smalloc: bump initial size to 8 pools
authorJens Axboe <axboe@fb.com>
Tue, 3 Mar 2015 22:13:17 +0000 (15:13 -0700)
committerJens Axboe <axboe@fb.com>
Tue, 3 Mar 2015 22:13:17 +0000 (15:13 -0700)
commit85492cb89e2421ae71d92b1c88e75efda3ee1f1b
treef02180c8220619a3bc2411a353e1df84be554605
parent2894a2d44cfa29c250276853e460b7fb5ea1ef7e
smalloc: bump initial size to 8 pools

Commit 23bd40f944b7 shrank our pool size from 128 pools at 8MB max,
to one static 16MB pool. Christian reports:

"For our tests with about 250k files we found the smalloc pool being
 depleted.  Now for us values of 3-4 would be enough, but since it is a
 compile time switch I'd like to make it safe for everybody and set 8."

Bump the pool alloc to 8 pools again, retaining the 16MB size. That's
still substantially less than before, but should be enough for most
cases. Allocate the pools at init time, to avoid the issue that the
original commit fixed.

Also fix a bug where we failed to iterate some pools when restarting
the allocation scan, resulting in less-than-optimal exhaustion of all
pools before smalloc() gave up and returned NULL.

Signed-off-by: Jens Axboe <axboe@fb.com>
smalloc.c