mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Alexandru Moise <00moses.alexander00@gmail.com>,
	Joseph Qi <joseph.qi@linux.alibaba.com>,
	Bart Van Assche <bart.vanassche@wdc.com>
Cc: axboe@kernel.dk, shli@fb.com, nborisov@suse.com, arnd@arndb.de,
	gregkh@linuxfoundation.org, linux-block@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] blk-cgroup: remove entries in blkg_tree before queue release
Date: Wed, 11 Apr 2018 07:56:32 -0700	[thread overview]
Message-ID: <20180411145632.GK793541@devbig577.frc2.facebook.com> (raw)
In-Reply-To: <20180411145123.GJ793541@devbig577.frc2.facebook.com>

Hello, again.

On Wed, Apr 11, 2018 at 07:51:23AM -0700, Tejun Heo wrote:
> Oh, it wasn't Joseph's change.  It was Bart's fix for a problem
> reported by Joseph.  Bart, a063057d7c73 ("block: Fix a race between
> request queue removal and the block cgroup controller") created a
> regression where a request_queue can be destroyed with blkgs still
> attached.  The original report is..
> 
>  http://lkml.kernel.org/r/20180407102148.GA9729@gmail.com

And looking at the change, it looks like the right thing we should
have done is caching @lock on the print_blkg side and when switching
locks make sure both locks are held.  IOW, do the following in
blk_cleanup_queue()

	spin_lock_irq(lock);
	if (q->queue_lock != &q->__queue_lock) {
		spin_lock(&q->__queue_lock);
		q->queue_lock = &q->__queue_lock;
		spin_unlock(&q->__queue_lock);
	}
	spin_unlock_irq(lock);

Otherwise, there can be two lock holders thinking they have exclusive
access to the request_queue.

Thanks.

-- 
tejun

  reply	other threads:[~2018-04-11 14:56 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-07 10:21 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 [this message]
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:15                     ` tj
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 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:02                   ` tj
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 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=20180411145632.GK793541@devbig577.frc2.facebook.com \
    --to=tj@kernel.org \
    --cc=00moses.alexander00@gmail.com \
    --cc=arnd@arndb.de \
    --cc=axboe@kernel.dk \
    --cc=bart.vanassche@wdc.com \
    --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 \
    /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

Powered by JetHome