How to access user process memory/pages from swap_pager.c
Konstantin Belousov
kostikbel at gmail.com
Thu Sep 19 06:12:27 UTC 2019
On Thu, Sep 19, 2019 at 12:34:19AM -0400, Yoshihiro Ota wrote:
> Hi,
>
> I'm trying to get some data / statistics for pages being swapped out.
>
> I'm trying to access pages being swapped out in swp_pager_putpages.
> Given I have access to vm_page_t, it looked like I would be able to use VM_PAGE_TO_PHYS() to access user pages.
>
> However, I get page-fault panics like:
> panic: vm_fault_hold: fault on nofault entry, addr: 0
>
> Which functions/setup do I need to access/copy user data being swapped?
I am not sure what you are trying to do, but whatever is it, it is
unreasonable.
When a page is swapped out, its physical memory frame, described by
vm_page_t, is reused for something else. The only resource consumed by
swapped out page is the index in the vm_object page queue, swap space
which holds the actual content, and pointer from swap pager data to the
swap location.
More information about the freebsd-hackers
mailing list