Use a bitmap in extents_t to speed up search.

Rather than iteratively checking all sufficiently large heaps during
search, maintain and use a bitmap in order to skip empty heaps.
This commit is contained in:
Jason Evans
2017-03-23 23:45:11 -07:00
parent 57e353163f
commit 5d33233a5e
3 changed files with 44 additions and 12 deletions

View File

@@ -102,6 +102,13 @@ struct extents_s {
*/
extent_heap_t heaps[NPSIZES+1];
/*
* Bitmap for which set bits correspond to non-empty heaps.
*
* Synchronization: mtx.
*/
bitmap_t bitmap[BITMAP_GROUPS(NPSIZES+1)];
/*
* LRU of all extents in heaps.
*