On Thu, Aug 02, 2012 at 05:50:25PM +0400, Andrey Zonov wrote: > Hi, > > It would be useful to have system wide major and minor page faults > counters. Attached patch makes this possible. > > Are there any objections to have it? I thought that struct vmmeter was engraved into our ABI much deeper, but inspection shows that at least base system successfully avoids dragging the structure into ABI at all. So what follows is only some comments and not objections.
The description of v_majflt as 'page faults' and v_minflt as 'page reclaim' is very confusing, IMO. First, the v_majflt is not inclusive in regard of v_minflt. Second, reclaim usually has a connotation of thing being repurposed (I am probably wrong there), which is not case for minor page faults. As an additional twist, please note that not all page faults reach vm_fault_hold() at all. See for instance x86 handling of the spurious page faults, I believe that other architectures like MIPS also completely consume some page faults in MD code. The minfault counter probably should be incremented there too. And, not all calls to vm_fault_hold() are caused by hardware page faults. See the use of vm_fault_hold() and vm_fault_quick_hold_pages() scattered around the sys/.
pgp53qNfxSORm.pgp
Description: PGP signature