Date: Fri, 04 Jul 2014 09:55:23 +0000 From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 188911] [libc] sysctl(KERN_PROC_VMMAP) takes too long Message-ID: <bug-188911-8-215HL9GmTB@https.bugs.freebsd.org/bugzilla/> In-Reply-To: <bug-188911-8@https.bugs.freebsd.org/bugzilla/> References: <bug-188911-8@https.bugs.freebsd.org/bugzilla/>
next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=188911 --- Comment #4 from Konstantin Belousov <kib@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 disable. 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 before 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.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-188911-8-215HL9GmTB>