mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nilay Shroff <nilay@linux.ibm.com>
To: Laveesh Bansal <laveeshb@laveeshbansal.com>,
	Jens Axboe <axboe@kernel.dk>
Cc: "Shin'ichiro Kawasaki" <shinichiro.kawasaki@wdc.com>,
	Ming Lei <tom.leiming@gmail.com>, Christoph Hellwig <hch@lst.de>,
	Yu Kuai <yukuai@fygo.io>, Reindl Harald <h.reindl@thelounge.net>,
	regressions@lists.linux.dev, linux-block@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] block: only serialize elevator switches of the same queue
Date: Tue, 3 Nov 2026 10:57:58 +0530	[thread overview]
Message-ID: <0d071b1f-82c2-41a5-8b0a-7ea67706b4eb@linux.ibm.com> (raw)
In-Reply-To: <20261031044141.5569-1-laveeshb@laveeshbansal.com>

On 10/31/26 10:11 AM, Laveesh Bansal wrote:
> Since commit 4ff58d6bc9dd ("block: serialize elevator changes for the
> same queue using a writer lock"), a write to queue/scheduler fails with
> -EBUSY whenever something else holds set->update_nr_hwq_lock. That
> commit takes the lock for write, and it has to be a trylock because of
> commit ce8ee8583ed8 ("block: use trylock to avoid lockdep circular
> dependency in sysfs").
> 
> The lock covers the whole tag set, so it is easy to hit. A scheduler
> write fails while another queue of the set is switching, or while a
> sibling disk of the same SCSI host or NVMe controller is added or
> removed. This matches the udev failures reported on 7.2.
> 
> Go back to taking the lock for read. The write lock was there to keep
> two switches of one queue from overlapping in elevator_change_done(),
> which touches the elevator sysfs and debugfs entries outside of
> q->elevator_lock. Use QUEUE_FLAG_NO_ELV_SWITCH for that instead: a
> write sets it before elevator_change() and clears it afterwards, and a
> write that finds it set returns -EBUSY. Disk removal already sets the
> flag under the write lock, so no switch can start once it has run.
> 
> Writes to the same queue, and writes that race with an nr_hw_queues
> update, an nr_requests write or disk removal, can still get -EBUSY, as
> with 4ff58d6bc9dd. A write to a disk that is being removed now gets
> -EBUSY instead of -ENOENT.
> 
> Fixes: 4ff58d6bc9dd ("block: serialize elevator changes for the same queue using a writer lock")
> Cc:stable@vger.kernel.org # v7.2+
> Reported-by: Reindl Harald<h.reindl@thelounge.net>
> Closes:https://lore.kernel.org/r/077dd42e-cbc9-4c23-a5ef-3d20e4fc7757@thelounge.net
> Suggested-by: Nilay Shroff<nilay@linux.ibm.com>
> Assisted-by: LLM
> Signed-off-by: Laveesh Bansal<laveeshb@laveeshbansal.com>

Looks good to me:
Reviewed-by: Nilay Shroff <nilay@linux.ibm.com>

  reply	other threads:[~2026-11-03  5:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-31  4:41 Laveesh Bansal
2026-11-03  5:27 ` Nilay Shroff [this message]
2026-11-03 14:31 ` Jens Axboe

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=0d071b1f-82c2-41a5-8b0a-7ea67706b4eb@linux.ibm.com \
    --to=nilay@linux.ibm.com \
    --cc=axboe@kernel.dk \
    --cc=h.reindl@thelounge.net \
    --cc=hch@lst.de \
    --cc=laveeshb@laveeshbansal.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=regressions@lists.linux.dev \
    --cc=shinichiro.kawasaki@wdc.com \
    --cc=tom.leiming@gmail.com \
    --cc=yukuai@fygo.io \
    /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®