mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nilay Shroff <nilay@linux.ibm.com>
To: Christoph Hellwig <hch@lst.de>, mt4022@columbia.edu
Cc: Jens Axboe <axboe@kernel.dk>,
	Mohamed Khalfella <mkhalfella@purestorage.com>,
	Keith Busch <kbusch@kernel.org>, Ming Lei <tom.leiming@gmail.com>,
	Bart Van Assche <bvanassche@acm.org>,
	Josef Bacik <josef@toxicpanda.com>,
	linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
	tz2294@columbia.edu, stable@vger.kernel.org
Subject: Re: [PATCH] blk-mq: take quiesce_lock when removing a queue from the tag set
Date: Wed, 4 Nov 2026 18:56:07 +0530	[thread overview]
Message-ID: <c172b7a8-bea1-4004-83be-af6dfe921df0@linux.ibm.com> (raw)
In-Reply-To: <20261104071926.GA29136@lst.de>

On 11/4/26 12:49 PM, Christoph Hellwig wrote:
> Looks good, but the note from Mohamed should be taken into account.
> 
> Or even better add a guarded_by so that clang catches this (requires
> actualy compile testing with clang, though).
> 
Yeah agreed! I also recommend adding __guarded_by() annotation around
set->tag_list and set->quiesce_depth.

With this change, I have sorted following locking pattern:

1. Every set->tag_list mutation holds both set->tag_list_lock and set->quiesce_lock.
2. Every set->tag_list traversal holds at least one of set->tag_list_lock or set->quiesce_lock.
3. The set->tag_list_lock and set->quiesce_lock order is preserved.

So the above scheme fits really well in the context annotations.

We can define context annotation as follows:

struct blk_mq_tag_set {
     ...
     struct list_head    tag_list __guarded_by(&tag_list_lock, &quiesce_lock);
     unsigned int        quiesce_depth __guarded_by(&quiesce_lock);
     ...
}

Thanks,
--Nilay

  reply	other threads:[~2026-11-04 13:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-03 19:04 Mani Tofigh via B4 Relay
2026-11-03 19:51 ` Mohamed Khalfella
2026-11-04  7:19 ` Christoph Hellwig
2026-11-04 13:26   ` Nilay Shroff [this message]
2026-11-04 13:19 ` Nilay Shroff

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=c172b7a8-bea1-4004-83be-af6dfe921df0@linux.ibm.com \
    --to=nilay@linux.ibm.com \
    --cc=axboe@kernel.dk \
    --cc=bvanassche@acm.org \
    --cc=hch@lst.de \
    --cc=josef@toxicpanda.com \
    --cc=kbusch@kernel.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mkhalfella@purestorage.com \
    --cc=mt4022@columbia.edu \
    --cc=stable@vger.kernel.org \
    --cc=tom.leiming@gmail.com \
    --cc=tz2294@columbia.edu \
    /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

all inboxes | Powered by JetHome®