Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 19 Sep 2019 17:23:53 -0400
From:      Yoshihiro Ota <ota@j.email.ne.jp>
To:        Konstantin Belousov <kostikbel@gmail.com>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: How to access user process memory/pages from swap_pager.c
Message-ID:  <20190919172353.2da06fc2aec3a332e2462ada@j.email.ne.jp>
In-Reply-To: <20190919061216.GG2559@kib.kiev.ua>
References:  <20190919003419.007b6de7f9887617f254e334@j.email.ne.jp> <20190919061216.GG2559@kib.kiev.ua>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 19 Sep 2019 09:12:16 +0300
Konstantin Belousov <kostikbel@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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20190919172353.2da06fc2aec3a332e2462ada>