[Bug 188911] [libc] sysctl(KERN_PROC_VMMAP) takes too long

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Fri Jul 4 09:55:23 UTC 2014


--- Comment #4 from Konstantin Belousov <kib at FreeBSD.org> ---
Created attachment 144398
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=144398&action=edit
suggested change

The existing calculation of the resident page count in kern_proc_vmmap_out()
does not make sense.  It counts the number of installed pte's in the specified
range, which can be less than the number of resident pages, if the pages are
not faulted on yet (i.e. softfault case).

The patch does two things:
1. it adds a tunable to disable the calculation of the resident count at all.
sysctl kern.proc_vmmap_skip_resident_count;
2. it changes the algorithm for calculation to count the number of pages
which are resident for the read fault, the COW copy allocations are counted
as resident, while they are really not.

I am on the edge WRT disabling the calculation by default, the patch does

One interesting consequence of the new algorithm is that the provided test case
is executed in zero time even with the residency count calculation enabled. 
The reason is that there is no backing object for the mapping which was never
faulted on.  As result, the loop is not executed at all.

If I change the test case to access at least one page in the mmaped range
calling sysctl, I get around 30 sec runtime on my i7 2600K.

You are receiving this mail because:
You are the assignee for the bug.

More information about the freebsd-bugs mailing list