aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorWill Andrews <will@FreeBSD.org>2016-07-18 01:55:25 +0000
committerWill Andrews <will@FreeBSD.org>2016-07-18 01:55:25 +0000
commitffdeef3234496b79624f4ba34e3d0a6893f41404 (patch)
treef3433c72f62be02adf456241724fa38f416ac461 /tools
parent8fb15a24ceb2fa5cfd4849466dd9ca2a27ce2bff (diff)
downloadsrc-ffdeef3234496b79624f4ba34e3d0a6893f41404.tar.gz
src-ffdeef3234496b79624f4ba34e3d0a6893f41404.zip
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
Notes
Notes: svn path=/head/; revision=302976
Diffstat (limited to 'tools')
0 files changed, 0 insertions, 0 deletions