f2fs: introduce private bioset
authorChao Yu <yuchao0@huawei.com>
Wed, 4 Dec 2019 01:52:58 +0000 (09:52 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Wed, 15 Jan 2020 21:43:48 +0000 (13:43 -0800)
commitf543805fcd60f3f9a491cfa2f2dc9284d2569c28
tree76d4452e72d8a97cc005dc2610996cc7b537977b
parent0e6d01643c207fdcd77b9b40c29cbe1c63f03c15
f2fs: introduce private bioset

In low memory scenario, we can allocate multiple bios without
submitting any of them.

- f2fs_write_checkpoint()
 - block_operations()
  - f2fs_sync_node_pages()
   step 1) flush cold nodes, allocate new bio from mempool
   - bio_alloc()
    - mempool_alloc()
   step 2) flush hot nodes, allocate a bio from mempool
   - bio_alloc()
    - mempool_alloc()
   step 3) flush warm nodes, be stuck in below call path
   - bio_alloc()
    - mempool_alloc()
     - loop to wait mempool element release, as we only
       reserved memory for two bio allocation, however above
       allocated two bios may never be submitted.

So we need avoid using default bioset, in this patch we introduce a
private bioset, in where we enlarg mempool element count to total
number of log header, so that we can make sure we have enough
backuped memory pool in scenario of allocating/holding multiple
bios.

Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/data.c
fs/f2fs/f2fs.h
fs/f2fs/super.c