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

next in thread | previous in thread | raw e-mail | index | archive | help
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.



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