]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/commit
MFC r319905
authoralc <alc@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Sat, 22 Jul 2017 17:49:18 +0000 (17:49 +0000)
committeralc <alc@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Sat, 22 Jul 2017 17:49:18 +0000 (17:49 +0000)
commit13ffe20663221e4f62ddbcdf74b52b2898bc06fb
treeb3b85cdfecffb1cbacfda68c8e89d0dc1ef8b9e3
parentd39efa22c0b7721b80bb8faba1b82e6ac958deef
MFC r319905

Reduce the frequency of hint updates on allocation without incurring
additional allocation overhead.  Previously, blst_meta_alloc() updated the
hint after every successful allocation.  However, these "eager" hint
updates are of no actual benefit if, instead, the "lazy" hint update at
the start of blst_meta_alloc() is generalized to handle all cases where
the number of available blocks is less than the requested allocation.
Previously, the lazy hint update at the start of blst_meta_alloc() only
handled the ALL-FULL case.  (I would also note that this change provides
consistency between blist_alloc() and blist_fill() in that their hint
maintenance is now entirely lazy.)

Eliminate unnecessary checks for terminators in blst_meta_alloc() and
blst_meta_fill() when handling ALL-FREE meta nodes.

Eliminate the field "bl_free" from struct blist.  It is redundant.  Unless
the entire radix tree is a single leaf, the count of free blocks is stored
in the root node.  Instead, provide a function blist_avail() for obtaining
the number of free blocks.

In blst_meta_alloc(), perform a sanity check on the allocation once rather
than repeating it in a loop over the meta node's children.

In blst_leaf_fill(), use the optimized bitcount*() function instead of a
loop to count the blocks being allocated.

Add or improve several comments.

Address some nearby style errors.

git-svn-id: svn://svn.freebsd.org/base/stable/10@321375 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
sys/kern/subr_blist.c
sys/sys/blist.h