All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bart Van Assche <Bart.VanAssche@wdc.com>
To: "tj@kernel.org" <tj@kernel.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
	"nborisov@suse.com" <nborisov@suse.com>,
	"axboe@kernel.dk" <axboe@kernel.dk>, "shli@fb.com" <shli@fb.com>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"00moses.alexander00@gmail.com" <00moses.alexander00@gmail.com>,
	"joseph.qi@linux.alibaba.com" <joseph.qi@linux.alibaba.com>,
	"arnd@arndb.de" <arnd@arndb.de>
Subject: Re: [PATCH v2] blk-cgroup: remove entries in blkg_tree before queue release
Date: Wed, 11 Apr 2018 20:23:05 +0000	[thread overview]
Message-ID: <f9527dc23ae63e4a58e3fabda0320c8bce7714ae.camel@wdc.com> (raw)
In-Reply-To: <20180411200245.GQ793541@devbig577.frc2.facebook.com>

T24gV2VkLCAyMDE4LTA0LTExIGF0IDEzOjAyIC0wNzAwLCB0akBrZXJuZWwub3JnIHdyb3RlOg0K
PiBPbiBXZWQsIEFwciAxMSwgMjAxOCBhdCAwODowMDoyOVBNICswMDAwLCBCYXJ0IFZhbiBBc3Nj
aGUgd3JvdGU6DQo+ID4gT24gV2VkLCAyMDE4LTA0LTExIGF0IDEyOjU3IC0wNzAwLCB0akBrZXJu
ZWwub3JnIHdyb3RlOg0KPiA+ID4gT24gV2VkLCBBcHIgMTEsIDIwMTggYXQgMDE6NTU6MjVQTSAt
MDYwMCwgQmFydCBWYW4gQXNzY2hlIHdyb3RlOg0KPiA+ID4gPiBPbiAwNC8xMS8xOCAxMzowMCwg
QWxleGFuZHJ1IE1vaXNlIHdyb3RlOg0KPiA+ID4gPiA+IEJ1dCB0aGUgcm9vdCBjYXVzZSBvZiBp
dCBpcyBpbiBibGtjZ19pbml0X3F1ZXVlKCkgd2hlbiBibGtnX2NyZWF0ZSgpIH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cyB0aHJlYWQgc28gSSB3YXMgbm90IGF3YXJlIG9mIHdoaWNo
IHByb2JsZW0gQWxleA0Kd2FzIHRyeWluZyB0byBzb2x2ZS4gSW4gdGhlIGRlc2NyaXB0aW9uIG9m
IHYxIG9mIHRoaXMgcGF0Y2ggSSByZWFkIHRoYXQgQWxleA0KdGhpbmtzIHRoYXQgaGUgcmFuIGlu
dG8gYSBzY2VuYXJpbyBpbiB3aGljaCBibGtfcXVldWVfYWxsb2Nfbm9kZSgpIGFzc2lnbnMgYQ0K
cS0+aWQgdGhhdCBpcyBzdGlsbCBpbiB1c2UgYnkgYW5vdGhlciByZXF1ZXN0IHF1ZXVlPyBUaGF0
J3Mgd2VpcmQuIFRoZSBmb2xsb3dpbmcNCmNvZGUgc3RpbGwgb2NjdXJzIGluIF9fYmxrX3JlbGVh
c2VfcXVldWUoKToNCg0KCWlkYV9zaW1wbGVfcmVtb3ZlKCZibGtfcXVldWVfaWRhLCBxLT5pZCk7
DQoNCkl0J3Mgbm90IGNsZWFyIHRvIG1lIGhvdyB0aGF0IHJlbW92ZSBjYWxsIGNvdWxkIGhhcHBl
biAqYmVmb3JlKiBxLT5pZCBpcyByZW1vdmVkDQpmcm9tIHRoZSBibGtjZyByYWRpeCB0cmVlLg0K
DQpCYXJ0Lg0KDQoNCg0K

WARNING: multiple messages have this Message-ID (diff)
From: Bart Van Assche <Bart.VanAssche@wdc.com>
To: "tj@kernel.org" <tj@kernel.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
	"nborisov@suse.com" <nborisov@suse.com>,
	"axboe@kernel.dk" <axboe@kernel.dk>, "shli@fb.com" <shli@fb.com>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"00moses.alexander00@gmail.com" <00moses.alexander00@gmail.com>,
	"joseph.qi@linux.alibaba.com" <joseph.qi@linux.alibaba.com>,
	"arnd@arndb.de" <arnd@arndb.de>
Subject: Re: [PATCH v2] blk-cgroup: remove entries in blkg_tree before queue release
Date: Wed, 11 Apr 2018 20:23:05 +0000	[thread overview]
Message-ID: <f9527dc23ae63e4a58e3fabda0320c8bce7714ae.camel@wdc.com> (raw)
In-Reply-To: <20180411200245.GQ793541@devbig577.frc2.facebook.com>

On Wed, 2018-04-11 at 13:02 -0700, tj@kernel.org wrote:
> On Wed, Apr 11, 2018 at 08:00:29PM +0000, Bart Van Assche wrote:
> > On Wed, 2018-04-11 at 12:57 -0700, tj@kernel.org wrote:
> > > On Wed, Apr 11, 2018 at 01:55:25PM -0600, Bart Van Assche wrote:
> > > > On 04/11/18 13:00, Alexandru Moise wrote:
> > > > > But the root cause of it is in blkcg_init_queue() when blkg_create() returns
> > > > > an ERR ptr, because it tries to insert into a populated index into blkcg->blkg_tree,
> > > > > the entry that we fail to remove at __blk_release_queue().
> > > > 
> > > > Hello Alex,
> > > > 
> > > > Had you considered something like the untested patch below?
> > > 
> > > But queue init shouldn't fail here, right?
> > 
> > Hello Tejun,
> > 
> > Your question is not entirely clear to me. Are you referring to the atomic
> > allocations in blkg_create() or are you perhaps referring to something else?
> 
> Hmm.. maybe I'm confused but I thought that the fact that
> blkcg_init_queue() fails itself is already a bug, which happens
> because a previously destroyed queue left behind blkgs.

Hello Tejun,

I had missed the start of this thread so I was not aware of which problem Alex
was trying to solve. In the description of v1 of this patch I read that Alex
thinks that he ran into a scenario in which blk_queue_alloc_node() assigns a
q->id that is still in use by another request queue? That's weird. The following
code still occurs in __blk_release_queue():

	ida_simple_remove(&blk_queue_ida, q->id);

It's not clear to me how that remove call could happen *before* q->id is removed
from the blkcg radix tree.

Bart.




  reply	other threads:[~2018-04-11 20:23 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-07 10:21 [PATCH v2] blk-cgroup: remove entries in blkg_tree before queue release Alexandru Moise
2018-04-09 22:09 ` Tejun Heo
2018-04-11 10:12   ` Alexandru Moise
2018-04-11 14:20     ` Tejun Heo
2018-04-11 14:28       ` Alexandru Moise
2018-04-11 14:46         ` Tejun Heo
2018-04-11 14:51           ` Tejun Heo
2018-04-11 14:56             ` Tejun Heo
2018-04-11 16:42               ` Bart Van Assche
2018-04-11 16:42                 ` Bart Van Assche
2018-04-11 17:00                 ` tj
2018-04-11 17:06                   ` Bart Van Assche
2018-04-11 17:06                     ` Bart Van Assche
2018-04-11 17:15                     ` tj
2018-04-11 17:26                       ` Bart Van Assche
2018-04-11 17:26                         ` Bart Van Assche
2018-04-11 17:30                         ` tj
2018-04-11 15:54         ` Bart Van Assche
2018-04-11 15:54           ` Bart Van Assche
2018-04-11 19:00           ` Alexandru Moise
2018-04-11 19:55             ` Bart Van Assche
2018-04-11 19:57               ` tj
2018-04-11 20:00                 ` Bart Van Assche
2018-04-11 20:00                   ` Bart Van Assche
2018-04-11 20:02                   ` tj
2018-04-11 20:23                     ` Bart Van Assche [this message]
2018-04-11 20:23                       ` Bart Van Assche
2018-04-11 21:23               ` Alexandru Moise
2018-04-11 21:28                 ` Bart Van Assche
2018-04-11 21:28                   ` Bart Van Assche
2018-04-11 22:58                   ` Alexandru Moise

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=f9527dc23ae63e4a58e3fabda0320c8bce7714ae.camel@wdc.com \
    --to=bart.vanassche@wdc.com \
    --cc=00moses.alexander00@gmail.com \
    --cc=arnd@arndb.de \
    --cc=axboe@kernel.dk \
    --cc=gregkh@linuxfoundation.org \
    --cc=joseph.qi@linux.alibaba.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nborisov@suse.com \
    --cc=shli@fb.com \
    --cc=tj@kernel.org \
    /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.