kernel - Add minor VM shortcuts

Operating Systems / DragonFlyBSD - Matthew Dillon [] - 4 March 2020 17:17 UTC

- Adjust vm_page_hash_elm heuristic to save the full pindex field instead of just the lower 32 bits.

- Refactor the hash table and hash lookup to index directly to the potential hit rather than masking to the SET size (~3). This improves our chances of finding the requested page without having to iterate.

The hash table is now N + SET sized and the SET iteration runs from the potential direct-hit point forwards.

- Minor __predict* code optimizations.

- Shortcut vm_page_alloc() when PG_MAPPED|PG_WRITEABLE are clear to avoid unnecessary code paths.

3a8f824874 kernel - Add minor VM shortcuts
sys/vm/vm_page.c | 64 +++++++++++++++++++++++++++++++++++---------------------
1 file changed, 40 insertions(+), 24 deletions(-)


  • Share