This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: Read contents of (userland) physical pages not yet mapped?
- From: fche at redhat dot com (Frank Ch. Eigler)
- To: "Yichun Zhang (agentzh)" <agentzh at gmail dot com>
- Cc: systemtap at sourceware dot org, Shuxin Yang <shuxin at cloudflare dot com>, Jovi Zhangwei <jovi dot zhangwei at gmail dot com>, Dane Knecht <dane at cloudflare dot com>
- Date: Thu, 22 Jan 2015 22:14:40 -0500
- Subject: Re: Read contents of (userland) physical pages not yet mapped?
- Authentication-results: sourceware.org; auth=none
- References: <CAB4Tn6MtK7C0gfZaYoSTJFK+-WVcRs19PyPBwmZM=Yt0C41uEA at mail dot gmail dot com>
agentzh wrote:
> [...] I have run into an interesting problem while writing the
> systemtap tool [1] to inspect the shared memory regions of nginx.
> [...] But sometimes, due to "demand paging", some pages initialized
> by some workers are not loaded yet to the current worker's page
> tables, leading to systemtap runtime errors while reading the
> corresponding userspace addresses even though a (minor) page fault
> should [do the job]
Yeah, this is similar to the way stap tries to preclude causing page
faults in other contexts, like not-yet-paged-in strings out of user
syscall parameters.
> [...] But anyway I've decide to ask here for any potential
> workarounds to this problem because there are so many systemtap and
> kernel experts here :)
Any chance that mlockall() (or an explicit page-touching loop right
after mmap) could work for you?
- FChE