lightnvm: pblk: allocate line map bitmaps using a mempool
Line map bitmap allocations are fairly large and can fail. Allocation failures are fatal to pblk, stopping the write pipeline. To avoid this, allocate the bitmaps using a mempool instead. Mempool allocations never fail if called from a process context, and pblk *should* only allocate map bitmaps in process context, but keep the failure handling for robustness sake. Signed-off-by: Hans Holmberg <hans.holmberg@cnexlabs.com> Signed-off-by: Matias Bjørling <mb@lightnvm.io> Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:

committed by
Jens Axboe

parent
d68a934404
commit
53d82db693
@@ -530,6 +530,10 @@ struct pblk_line_mgmt {
|
||||
struct pblk_emeta *eline_meta[PBLK_DATA_LINES];
|
||||
unsigned long meta_bitmap;
|
||||
|
||||
/* Cache and mempool for map/invalid bitmaps */
|
||||
struct kmem_cache *bitmap_cache;
|
||||
mempool_t *bitmap_pool;
|
||||
|
||||
/* Helpers for fast bitmap calculations */
|
||||
unsigned long *bb_template;
|
||||
unsigned long *bb_aux;
|
||||
|
Reference in New Issue
Block a user