]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
The change a few years ago of having contigmalloc start its scan at the top
authorScott Long <scottl@FreeBSD.org>
Sun, 29 Jan 2006 08:24:54 +0000 (08:24 +0000)
committerScott Long <scottl@FreeBSD.org>
Sun, 29 Jan 2006 08:24:54 +0000 (08:24 +0000)
commita5cbb43e43dce2458dc62a410bb81ed6d97f971c
tree946310afdd23d85e0d00033553135f53c0fc621c
parent410d3bd3ace8c1c4fcf2508c8f8aee75ce46c2fb
The change a few years ago of having contigmalloc start its scan at the top
of physical RAM instead of the bottom was a sound idea, but the implementation
left a lot to be desired.  Scans would spend considerable time looking at
pages that are above of the address range given by the caller, and multiple
calls (like what happens in busdma) would spend more time on top of that
rescanning the same pages over and over.

Solve this, at least for now, with two simple optimizations.  The first is
to not bother scanning high ordered pages that are outside of the provided
address range.  Second is to cache the page index from the last successful
operation so that subsequent scans don't have to restart from the top.  This
is conditional on the numpages argument being the same or greater between
calls.

MFC After: 2 weeks
sys/vm/vm_contig.c