freebsd-nq/lib/libkvm
Will Andrews ffdeef3234 libkvm: Improve physical address lookup scaling.
Instead of using a hash table to convert physical page addresses to offsets
in the sparse page array, cache the number of bits set for each 4MB chunk of
physical pages.  Upon lookup, find the nearest cached population count, then
add/subtract the number of bits from that point to the page's PTE bit.
Then multiply by page size and add to the sparse page map's base offset.

This replaces O(n) worst-case lookup with O(1) (plus a small number of bits
to scan in the bitmap).  Also, for a 128GB system, a typical kernel core of
about 8GB will now only require ~4.5MB of RAM for this approach instead of
~48MB as with the hash table.

More concretely, /usr/sbin/crashinfo against the same core improves from a
max RSS of 188MB and wall time of 43.72s (33.25 user 2.94 sys) to 135MB and
9.43s (2.58 user 1.47 sys).  Running "thread apply all bt" in kgdb has a
similar RSS improvement, and wall time drops from 4.44s to 1.93s.

Reviewed by:	jhb
Sponsored by:	Backtrace I/O
2016-07-18 01:55:25 +00:00
..
kvm_aarch64.h
kvm_amd64.c Don't leak PML4 in _amd64_initvtop(..) if kvm_read2(..) fails 2016-04-30 09:32:19 +00:00
kvm_amd64.h
kvm_arm.c Fix up pointer issues with lib/libkvm 2016-04-22 18:05:34 +00:00
kvm_arm.h
kvm_cptime.c
kvm_getcptime.3
kvm_geterr.3
kvm_getloadavg.3
kvm_getloadavg.c
kvm_getpcpu.3
kvm_getprocs.3
kvm_getswapinfo.3
kvm_getswapinfo.c
kvm_i386.c Fix up pointer issues with lib/libkvm 2016-04-22 18:05:34 +00:00
kvm_i386.h
kvm_minidump_aarch64.c libkvm: Improve physical address lookup scaling. 2016-07-18 01:55:25 +00:00
kvm_minidump_amd64.c libkvm: Improve physical address lookup scaling. 2016-07-18 01:55:25 +00:00
kvm_minidump_arm.c libkvm: Improve physical address lookup scaling. 2016-07-18 01:55:25 +00:00
kvm_minidump_i386.c libkvm: Improve physical address lookup scaling. 2016-07-18 01:55:25 +00:00
kvm_minidump_mips.c libkvm: Improve physical address lookup scaling. 2016-07-18 01:55:25 +00:00
kvm_mips.h
kvm_native.3
kvm_nlist.3
kvm_open.3
kvm_pcpu.c lib: minor spelling fixes in comments. 2016-05-01 19:37:33 +00:00
kvm_powerpc64.c
kvm_powerpc.c
kvm_private.c libkvm: Improve physical address lookup scaling. 2016-07-18 01:55:25 +00:00
kvm_private.h libkvm: Improve physical address lookup scaling. 2016-07-18 01:55:25 +00:00
kvm_proc.c Fix memory allocation edgecases in kvm_argv(..) 2016-04-30 09:13:26 +00:00
kvm_read.3
kvm_sparc64.c Remove a -Wunused-but-set-variable variable -- pa 2016-04-30 09:31:01 +00:00
kvm_sparc64.h
kvm_vnet.c lib: minor spelling fixes in comments. 2016-05-01 19:37:33 +00:00
kvm.3 Remove kvm_getfiles(3) 2016-04-30 09:21:13 +00:00
kvm.c libkvm: Improve physical address lookup scaling. 2016-07-18 01:55:25 +00:00
kvm.h Remove kvm_getfiles(3) 2016-04-30 09:21:13 +00:00
Makefile libkvm: Put private kvm routines in kvm_private.c. 2016-07-18 01:02:52 +00:00
Makefile.depend