]> xenbits.xensource.com Git - pvdrivers/win/xenbus.git/commit
Improve the performance of the slab allocator
authorPaul Durrant <paul.durrant@citrix.com>
Wed, 4 Sep 2019 16:36:25 +0000 (17:36 +0100)
committerPaul Durrant <paul.durrant@citrix.com>
Thu, 5 Sep 2019 15:18:23 +0000 (16:18 +0100)
commit7f8b622668fbd8f42c94c5dcb1d7361959f58735
treee185474999501d355209b464dc2fa86119ed8aff
parent82a3f070a5cc4762b1a4ecf8b7ebca661caa989d
Improve the performance of the slab allocator

This patch makes a couple of changes which testing shows to improve
performance.

Firstly the slabs are now sorted such that the most occupied slab is on
the head of the list. This should lead to a smaller number of slabs, each
with a higher occupancy, which reduces the overall amount of memory
consumed and the number of 'Ctor' invocations (NB: a Ctor may also
allocate other memory).

Secondly, rather than destroying a slab as soon as its occupancy falls to
zero, defer freeing to the re-introduced monitor thread. This takes freeing
(and associated invocations of Dtor) off the performance critical paths
 and also allows an empty slab to be re-used, avoiding calls to
CacheCreateSlab() (and hence more Ctor invocations).

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
src/xenbus/cache.c