Page MenuHomeFreeBSD

break up vm_map_splay_merge
ClosedPublic

Authored by dougm on Thu, Nov 28, 6:03 AM.

Details

Summary

Functions that call vm_map_splay_merge sometimes set data fields (e.g. root->left = NULL) to affect the behavior of that function. This change stops that data manipulation, and instead calls a pair of functions, one for the left direction and the other for the right, with the function called depending whether or not we currently null the root child in that direction to control the behavior of vm_map_splay_merge.

Small running-time improvements are visible in my usual vm_map nano-benchmarks.

Before
Test1 sec dc-misses Test2 sec dc-misses
17.402387 696208819 16.695700 756675325
17.488991 702202446 16.695138 744614537
17.460239 734025345 16.569006 729289000
17.512725 743791615 16.580101 723884448
17.569991 763269763 16.628956 721604744

After
17.112856 702574892 16.159560 674984912
17.166679 706461437 16.136775 678707722
17.122392 707339253 16.148504 679940515
17.111229 701338010 16.162141 680050685
17.687890 701092368 16.152907 673210370

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

dougm created this revision.Thu, Nov 28, 6:03 AM
pho added a comment.Thu, Nov 28, 2:14 PM

I ran a preliminary 3 hours test with 400 test cases. No problems seen.

dougm updated this revision to Diff 65014.Thu, Nov 28, 5:45 PM

Incrementing the nupdates counter, which matters only when DIAGNOSTICS is #defined, fell out of the previous version. Add it back in, in a new and better place.

kib accepted this revision.Thu, Nov 28, 7:54 PM
kib added inline comments.
sys/vm/vm_map.c
999 ↗(On Diff #65014)

This should be written stylish as return (a > b ? a : b);. Note the closing brace location.

This revision is now accepted and ready to land.Thu, Nov 28, 7:54 PM
This revision was automatically updated to reflect the committed changes.