[dm-devel] [PATCH 0/4] dm: reduce memory overhead of DM devices
Junichi Nomura
j-nomura at ce.jp.nec.com
Fri Oct 3 11:48:08 UTC 2014
This series of patches reduce the memory overhead of device-mapper
device mainly by removing unused mempool for bio vecs.
DM creates per-device bioset to ensure forward progress under
low memory situation and bioset always includes mempool for bvec.
However, with the introduction of immutable bvec by Kent Overstreet,
dm core now uses bio_clone_fast for creating a clone bio, and no longer
needs bvecs for it.
For example, when you create 10,000 bio-based DM devices and 1,000
request-based DM devices, memory usage of biovec under no load is:
# grep biovec /proc/slabinfo
biovec-256 418068 418068 4096 ...
biovec-128 0 0 2048 ...
biovec-64 0 0 1024 ...
biovec-16 0 0 256 ...
With this patch series applied, the usage becomes:
# grep biovec /proc/slabinfo
biovec-256 116 116 4096 ...
biovec-128 0 0 2048 ...
biovec-64 0 0 1024 ...
biovec-16 0 0 256 ...
So 4096 * (418068 - 116) = 1.6GB of memory is saved in this example.
Jun'ichi Nomura (4):
dm: remove nr_iovecs parameter from alloc_tio()
block: use bio_clone_fast() in blk_rq_prep_clone()
block: add bioset_nobvec_create()
dm: use bioset_nobvec_create()
block/bio.c | 61 ++++++++++++++++++++++++++++++++++++++---------------
block/blk-core.c | 2 +-
drivers/md/dm.c | 15 +++++--------
include/linux/bio.h | 1 +
4 files changed, 51 insertions(+), 28 deletions(-)
--
1.9.3
--
Jun'ichi Nomura, NEC Corporation
More information about the dm-devel
mailing list