From: Jens Axboe <axboe@kernel.dk>
To: Mike Snitzer <snitzer@redhat.com>,
Junichi Nomura <j-nomura@ce.jp.nec.com>
Cc: device-mapper development <dm-devel@redhat.com>,
Kent Overstreet <kmo@daterainc.com>
Subject: Re: [PATCH 0/4] dm: reduce memory overhead of DM devices
Date: Fri, 03 Oct 2014 14:57:29 -0600 [thread overview]
Message-ID: <542F0DB9.4020805@kernel.dk> (raw)
In-Reply-To: <20141003204852.GA14135@redhat.com>
On 2014-10-03 14:48, Mike Snitzer wrote:
> On Fri, Oct 03 2014 at 9:23am -0400,
> Mike Snitzer <snitzer@redhat.com> wrote:
>
>> On Fri, Oct 03 2014 at 7:48am -0400,
>> Junichi Nomura <j-nomura@ce.jp.nec.com> wrote:
>>
>>> 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.
>>
>> Very nice Junichi!
>>
>> Kent definitely left us some low hanging fruit that offers a huge win
>> (and fixes the really long-standing problem of excessive memory reserves
>> for each request-based DM device!)
>>
>> Jens, this is obviously an awkward patchset given it touches both block
>> and DM (block more so than DM). I'd be fine with you pulling it into
>> block (or vice-versa if you're OK with me staging it for 3.18 via
>> linux-dm.git with your Acked-by).
>
> I picked up this patchset, refactored the patches based on my earlier
> suggested s/bioset_nobvec_create/bioset_create_nobvec/ rename and
> tweaked headers a bit. I've staged the result in the for-next branch of
> linux-dm.git for v3.18 inclusion, see:
> https://git.kernel.org/cgit/linux/kernel/git/device-mapper/linux-dm.git/log/?h=for-next
>
> b83bb63 dm: remove nr_iovecs parameter from alloc_tio()
> b875215 block: use bio_clone_fast() in blk_rq_prep_clone()
> cd595c9 block: add bioset_create_nobvec()
> 3611594 dm: use bioset_create_nobvec()
>
> Jens, I can easily yield this patchset to you if you care. Or I can
> backfill your Acked-by in the above 2 block commits (I obviously won't
> just send block changes upstream without your OK!).
My only worry is the switch to fast clones, apart from that, it's pretty
basic. But we are pretty close to the 3.18 merge window, and as such,
I'd prefer to let it simmer for a release.
--
Jens Axboe
next prev parent reply other threads:[~2014-10-03 20:57 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-03 11:48 [PATCH 0/4] dm: reduce memory overhead of DM devices Junichi Nomura
2014-10-03 11:55 ` [PATCH 1/4] dm: remove nr_iovecs parameter from alloc_tio() Junichi Nomura
2014-10-03 20:01 ` Mike Snitzer
2014-10-03 11:55 ` [PATCH 2/4] block: use bio_clone_fast() in blk_rq_prep_clone() Junichi Nomura
2014-10-03 11:55 ` [PATCH 3/4] block: add bioset_nobvec_create() Junichi Nomura
2014-10-03 13:16 ` Mike Snitzer
2014-10-03 11:55 ` [PATCH 4/4] dm: use bioset_nobvec_create() Junichi Nomura
2014-10-03 13:23 ` [PATCH 0/4] dm: reduce memory overhead of DM devices Mike Snitzer
2014-10-03 20:48 ` Mike Snitzer
2014-10-03 20:57 ` Jens Axboe [this message]
2014-10-03 21:04 ` Mike Snitzer
2014-10-03 21:27 ` [PATCH v2 1/4] dm: remove nr_iovecs parameter from alloc_tio() Mike Snitzer
2014-10-03 21:27 ` [PATCH v2 2/4] block: use bio_clone_fast() in blk_rq_prep_clone() Mike Snitzer
2014-10-03 21:27 ` [PATCH v2 3/4] block: add bioset_create_nobvec() Mike Snitzer
2014-10-03 21:27 ` [PATCH v2 4/4] dm: use bioset_create_nobvec() Mike Snitzer
2014-10-05 23:06 ` Junichi Nomura
2014-10-06 0:24 ` Mike Snitzer
2014-10-04 17:01 ` [PATCH 0/4] dm: reduce memory overhead of DM devices Christoph Hellwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=542F0DB9.4020805@kernel.dk \
--to=axboe@kernel.dk \
--cc=dm-devel@redhat.com \
--cc=j-nomura@ce.jp.nec.com \
--cc=kmo@daterainc.com \
--cc=snitzer@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.