From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: Bart Van Assche <bvanassche@acm.org>
Cc: "Ionut Nechita (Wind River)" <ionut.nechita@windriver.com>,
axboe@kernel.dk, linux-block@vger.kernel.org,
clrkwllms@kernel.org, rostedt@goodmis.org, ming.lei@redhat.com,
muchun.song@linux.dev, mkhalfella@purestorage.com,
chris.friesen@windriver.com, linux-kernel@vger.kernel.org,
linux-rt-devel@lists.linux.dev, linux-rt-users@vger.kernel.org,
stable@vger.kernel.org, ionut_n2001@yahoo.com,
sunlightlinux@gmail.com
Subject: Re: [PATCH v6 1/1] block/blk-mq: use atomic_t for quiesce_depth to avoid lock contention on RT
Date: Thu, 7 May 2026 09:45:02 +0200 [thread overview]
Message-ID: <20260507074502.cFMtH9BB@linutronix.de> (raw)
In-Reply-To: <713ba2ae-e322-4e56-b0b8-89766f7f65c1@acm.org>
On 2026-05-06 11:43:32 [+0200], Bart Van Assche wrote:
> On 5/6/26 9:47 AM, Sebastian Andrzej Siewior wrote:
> > On 2026-05-06 09:14:33 [+0200], Bart Van Assche wrote:
> > > If the atomic_inc() in blk_mq_quiesce_queue_nowait() is protected by
> > > hctx->queue->queue_lock then the above code doesn't have to be modified.
> >
> > But wouldn't the atomic_inc + barrier avoid the need to have the lock?
> > Isn't this a normal pattern? If the lock is kept, we could use
> > non-atomic ops here then. But this avoids having the lock.
>
> I strongly prefer a spinlock + non-atomic variables rather than using an
> atomic variable and barriers because algorithms that use a spinlock are
> easier to verify.
Hmmm. If we keep the lock, then there is no need for the atomic and we
keep int counter. Then we are where we are right now with the lock
synchronizing everything.
Isn't this also improving the performance for the !RT case or is it
simply not that visible here?
> Thanks,
>
> Bart.
Sebastian
next prev parent reply other threads:[~2026-05-07 7:45 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-06 6:56 [PATCH v6 0/1] block/blk-mq: use atomic_t for quiesce_depth to avoid lock contention on RT Ionut Nechita (Wind River)
2026-05-06 6:56 ` [PATCH v6 1/1] " Ionut Nechita (Wind River)
2026-05-06 7:14 ` Bart Van Assche
2026-05-06 7:47 ` Sebastian Andrzej Siewior
2026-05-06 9:43 ` Bart Van Assche
2026-05-07 7:45 ` Sebastian Andrzej Siewior [this message]
2026-05-07 10:41 ` Bart Van Assche
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=20260507074502.cFMtH9BB@linutronix.de \
--to=bigeasy@linutronix.de \
--cc=axboe@kernel.dk \
--cc=bvanassche@acm.org \
--cc=chris.friesen@windriver.com \
--cc=clrkwllms@kernel.org \
--cc=ionut.nechita@windriver.com \
--cc=ionut_n2001@yahoo.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rt-devel@lists.linux.dev \
--cc=linux-rt-users@vger.kernel.org \
--cc=ming.lei@redhat.com \
--cc=mkhalfella@purestorage.com \
--cc=muchun.song@linux.dev \
--cc=rostedt@goodmis.org \
--cc=stable@vger.kernel.org \
--cc=sunlightlinux@gmail.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