From: Mike Snitzer <snitzer@redhat.com>
To: Tejun Heo <tj@kernel.org>
Cc: Mikulas Patocka <mpatocka@redhat.com>,
Jens Axboe <axboe@kernel.dk>,
dm-crypt@saout.de, Christian Schmidt <schmidt@digadd.de>,
linux-kernel@vger.kernel.org,
Christoph Hellwig <hch@infradead.org>,
dm-devel@redhat.com, Andi Kleen <andi@firstfloor.org>,
"Alasdair G. Kergon" <agk@redhat.com>,
Milan Broz <gmazyland@gmail.com>, Vivek Goyal <vgoyal@redhat.com>
Subject: Re: [PATCH v2] make dm and dm-crypt forward cgroup context (was: dm-crypt parallelization patches)
Date: Thu, 18 Apr 2013 12:47:42 -0400 [thread overview]
Message-ID: <20130418164742.GA8254@redhat.com> (raw)
In-Reply-To: <20130416172418.GB2874@mtj.dyndns.org>
On Tue, Apr 16 2013 at 1:24pm -0400,
Tejun Heo <tj@kernel.org> wrote:
> Hey,
>
> On Mon, Apr 15, 2013 at 09:02:06AM -0400, Mikulas Patocka wrote:
> > The patch is not bug-prone, because we already must make sure that the
> > cloned bio has shorter lifetime than the master bio - so the patch doesn't
> > introduce any new possibilities to make bugs.
>
> The whole world isn't composed of only your code. As I said
> repeatedly, you're introducing an API which is misleading and can
> easily cause subtle bugs which are very difficult to reproduce.
>
> Imagine it being used to tag a metatdata or checksum update bio being
> sent down while processing another bio and used to "clone" the context
> of the original bio. It'll work most of the time even if the original
> bio gets completed first but it'll break when it gets really unlucky -
> e.g. racing with other operations which can put the base css ref, and
> it'll be hellish to reproduce and everyone would have to pay for your
> silly hack.
>
> > > Do the two really look the same to you? The page refs are much more
> > > expensive, mostly contained in and the main focus of dm. ioc/css refs
> > > aren't that expensive to begin with, css refcnting is widely scattered
> >
> > ioc is per-task, so it is likely to be cached (but there are processors
> > that have slow atomic operations even on cached data - on Pentium 4 it
> > takes about 100 cycles). But css is shared between tasks and produces the
> > cache ping-pong effect.
>
> For $DIETY's sake, how many times do I have to tell you to use per-cpu
> reference count? Why do I have to repeat the same story over and over
> again? What part of "make the reference count per-cpu" don't you get?
> It's not a complicated message.
>
> At this point, I can't even understand why or what the hell you're
> arguing. There's a clearly better way to do it and you're just
> repeating yourself like a broken record that your hack in itself isn't
> broken.
>
> So, if you wanna continue that way for whatever reason, you have my
> firm nack and I'm outta this thread.
>
> Bye bye.
Hey Tejun,
I see you nack and raise you with: please reconsider in the near term.
Your point about not wanting to introduce a generic block interface that
isn't "safe" for all users noted. But as Mikulas has repeatedly said DM
does _not_ ever need to do the refcounting. So it seems a bit absurd to
introduce the requirement that DM should stand up an interface that uses
percpu. That is a fair amount of churn that DM will never have a need
to take advantage of.
So why not introduce __bio_copy_association(bio1, bio2) and add a BUG_ON
in it if bio2 isn't a clone of bio1?
When there is a need for async IO to have more scalable refcounting that
would be the time to introduce bio_copy_association that uses per-cpu
refcounting (and yes we could then even nuke __bio_copy_association).
It just seems to me a bit burdensome to ask Mikulas to add this
infrastructure when DM really doesn't need it at all. But again I do
understand your desire for others to be stearing the kernel where it
needs to be to benefit future use-cases. But I think in general it best
to introduce complexity when there is an actual need.
Your insights are amazingly helpful and I think it is unfortunate that
this refcounting issue overshadowed the positive advancements of
dm-crypt scaling. I'm just looking to see if we can carry on with a
temporary intermediate step with __bio_copy_association.
Thanks,
Mike
next prev parent reply other threads:[~2013-04-18 16:48 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <Pine.LNX.4.64.1303252051520.9745@file.rdu.redhat.com>
2013-03-26 12:27 ` [dm-devel] dm-crypt performance Alasdair G Kergon
2013-03-26 20:05 ` Milan Broz
2013-03-26 20:28 ` Mike Snitzer
2013-03-26 20:58 ` Milan Broz
2013-03-28 18:53 ` Tejun Heo
2013-03-28 19:33 ` Vivek Goyal
2013-03-28 19:44 ` Tejun Heo
2013-03-28 20:38 ` Vivek Goyal
2013-03-28 20:45 ` Tejun Heo
2013-04-09 17:51 ` dm-crypt parallelization patches Mikulas Patocka
2013-04-09 17:57 ` Tejun Heo
2013-04-09 18:08 ` Mikulas Patocka
2013-04-09 18:10 ` Tejun Heo
2013-04-09 18:42 ` Vivek Goyal
2013-04-09 18:57 ` Tejun Heo
2013-04-09 19:13 ` Vivek Goyal
2013-04-09 19:42 ` Mikulas Patocka
2013-04-09 19:52 ` Tejun Heo
2013-04-09 20:32 ` Mikulas Patocka
2013-04-09 21:02 ` Tejun Heo
2013-04-09 21:03 ` Tejun Heo
2013-04-09 21:07 ` Vivek Goyal
2013-04-09 21:18 ` Mikulas Patocka
2013-04-10 19:24 ` Vivek Goyal
2013-04-10 23:42 ` [PATCH] make dm and dm-crypt forward cgroup context (was: dm-crypt parallelization patches) Mikulas Patocka
2013-04-10 23:50 ` Tejun Heo
2013-04-11 19:49 ` [PATCH v2] " Mikulas Patocka
2013-04-11 19:52 ` Tejun Heo
2013-04-11 20:00 ` Tejun Heo
2013-04-12 0:06 ` Mikulas Patocka
2013-04-12 0:22 ` Tejun Heo
2013-04-12 5:59 ` [PATCH v2] make dm and dm-crypt forward cgroup context Milan Broz
2013-04-12 18:17 ` [PATCH v2] make dm and dm-crypt forward cgroup context (was: dm-crypt parallelization patches) Mikulas Patocka
2013-04-12 18:01 ` Mikulas Patocka
2013-04-12 18:29 ` Tejun Heo
2013-04-15 13:02 ` Mikulas Patocka
2013-04-16 17:24 ` Tejun Heo
2013-04-16 19:41 ` Mikulas Patocka
2013-04-18 16:47 ` Mike Snitzer [this message]
2013-04-18 17:03 ` Tejun Heo
2013-05-22 18:50 ` Mike Snitzer
2013-05-22 19:48 ` Tejun Heo
2013-04-09 18:36 ` dm-crypt parallelization patches Vivek Goyal
2013-04-09 18:08 ` [dm-devel] dm-crypt performance Mikulas Patocka
2013-04-09 18:59 ` [dm-crypt] " Milan Broz
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=20130418164742.GA8254@redhat.com \
--to=snitzer@redhat.com \
--cc=agk@redhat.com \
--cc=andi@firstfloor.org \
--cc=axboe@kernel.dk \
--cc=dm-crypt@saout.de \
--cc=dm-devel@redhat.com \
--cc=gmazyland@gmail.com \
--cc=hch@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mpatocka@redhat.com \
--cc=schmidt@digadd.de \
--cc=tj@kernel.org \
--cc=vgoyal@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).