smalloc: allocate struct pool array from shared memory
authorVincent Fu <vincent.fu@wdc.com>
Tue, 3 Sep 2019 17:44:44 +0000 (13:44 -0400)
committerJens Axboe <axboe@kernel.dk>
Tue, 3 Sep 2019 18:32:00 +0000 (12:32 -0600)
commit247aa73ad08ff4c2202878e7e4f0485403c7e97e
treef1961373fc384f29fd8b9708185cf4dd0e595b35
parent971d6a22bad5942234496683d89a2f8deed57172
smalloc: allocate struct pool array from shared memory

If one process is making smalloc calls and another process is making
sfree calls, pool->free_blocks and pool->next_non_full will not be
synchronized because the two processes each have independent, local
copies of the variables.

This patch allocates space for the array of struct pool instances from
shared storage so that separate processes will be modifying quantities
stored at the same locations.

This issue was discovered on the server side running a client/server job
with --status-interval=1. Such a job encountered an OOM error when only
~50 objects were allocated from the smalloc pool.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
smalloc.c