How to access user process memory/pages from swap_pager.c
Yoshihiro Ota
ota at j.email.ne.jp
Thu Sep 19 21:24:56 UTC 2019
On Thu, 19 Sep 2019 09:12:16 +0300
Konstantin Belousov <kostikbel at gmail.com> wrote:
> 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.
I'm trying before pageout I/O are scheduled at https://svnweb.freebsd.org/base/head/sys/vm/swap_pager.c?revision=352407&view=markup#l1373
This is where it is about to start looking for available swap spaces in swap devices.
Hiro
More information about the freebsd-hackers
mailing list