Page MenuHomeFreeBSD

libkvm: performance improvements for minidump read routines
AbandonedPublic

Authored by will on Jun 11 2016, 1:20 AM.

Details

Reviewers
jhb
Summary

libkvm: Move private kvm routines to kvm_private.c.

libkvm: Use mmap instead of pread.

libkvm: Bounds check (more) PTE indices.

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.

Sponsored by: Backtrace I/O

Diff Detail

Repository
rS FreeBSD src repository
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 4178
Build 4221: arc lint + arc unit

Event Timeline

will updated this revision to Diff 17501.Jun 11 2016, 1:20 AM
will retitled this revision from to libkvm: performance improvements for minidump read routines.
will updated this object.
will edited the test plan for this revision. (Show Details)
andrew added a reviewer: jhb.Jun 11 2016, 2:16 PM
will abandoned this revision.May 7 2017, 6:16 AM

Committed last summer in several parts.