raid5-ppl: use a single mempool for ppl_io_unit and header_page
commitfcd403aff643a120dbb3f1851337df5353ac8970
authorArtur Paszkiewicz <artur.paszkiewicz@intel.com>
Tue, 11 Apr 2017 18:50:51 +0000 (11 20:50 +0200)
committerShaohua Li <shli@fb.com>
Tue, 11 Apr 2017 21:56:46 +0000 (11 14:56 -0700)
tree5da21eb9112d8dd9b6f22af1f478363580cf9c1b
parentf00d7c85be9e39752ef87047a019dfc4cefbd299
raid5-ppl: use a single mempool for ppl_io_unit and header_page

Allocate both struct ppl_io_unit and its header_page from a shared
mempool to avoid a possible deadlock. Implement allocate and free
functions for the mempool, remove the second pool for allocating
header_page. The header_pages are now freed with their io_units, not
when the ppl bio completes. Also, use GFP_NOWAIT instead of GFP_ATOMIC
for allocating ppl_io_unit because we can handle failed allocations and
there is no reason to utilize emergency reserves.

Suggested-by: NeilBrown <neilb@suse.com>
Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Signed-off-by: Shaohua Li <shli@fb.com>
drivers/md/raid5-ppl.c