From: Jens Axboe <axboe@kernel.dk>
To: Bart Van Assche <bvanassche@acm.org>, linux-block@vger.kernel.org
Subject: Re: [PATCH 1/2] block/mq-deadline: serialize request dispatching
Date: Thu, 18 Jan 2024 11:55:47 -0700 [thread overview]
Message-ID: <ba770235-7c2f-4886-9507-2fc2ff521e35@kernel.dk> (raw)
In-Reply-To: <5f1e2bd2-b376-4272-93ce-a77c9b0c81ca@acm.org>
On 1/18/24 11:51 AM, Bart Van Assche wrote:
> On 1/18/24 10:45, Jens Axboe wrote:
>> Do you read the replies to the emails, from the other thread?
>
> Yes.
Well it's been a bit frustrating to say the least, as you seem to either
not read them or just ignore what's in them.
> > And secondly, this avoids a RMW if it's already set.
> From the spinlock implementation (something I looked up before I wrote
> my previous reply):
>
> static __always_inline int queued_spin_trylock(struct qspinlock *lock)
> {
> int val = atomic_read(&lock->val);
>
> if (unlikely(val))
> return 0;
>
> return likely(atomic_try_cmpxchg_acquire(&lock->val, &val,
> _Q_LOCKED_VAL));
> }
>
> I think this implementation does not perform a RMW if the spinlock is
> already locked.
This looks like a generic trylock, is the same true for the arch
variants? Because your attempt either failed because of RMW or because
you are hammering it repeatedly, or both.
In any case, even if any trylock would avoid the initial atomic, it
doesn't give you anything that a bitop would not just do, and we use the
latter trick elsewhere in blk-mq.
--
Jens Axboe
next prev parent reply other threads:[~2024-01-18 18:55 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-18 18:04 [PATCHSET RFC 0/2] mq-deadline scalability improvements Jens Axboe
2024-01-18 18:04 ` [PATCH 1/2] block/mq-deadline: serialize request dispatching Jens Axboe
2024-01-18 18:24 ` Bart Van Assche
2024-01-18 18:45 ` Jens Axboe
2024-01-18 18:51 ` Bart Van Assche
2024-01-18 18:55 ` Jens Axboe [this message]
2024-01-19 2:40 ` Ming Lei
2024-01-19 15:49 ` Jens Axboe
2024-01-18 18:04 ` [PATCH 2/2] block/mq-deadline: fallback to per-cpu insertion buckets under contention Jens Axboe
2024-01-18 18:25 ` Keith Busch
2024-01-18 18:28 ` Jens Axboe
2024-01-18 18:31 ` Bart Van Assche
2024-01-18 18:33 ` Jens Axboe
2024-01-18 18:53 ` Bart Van Assche
2024-01-18 18:56 ` Jens Axboe
2024-01-18 20:46 ` Bart Van Assche
2024-01-18 20:52 ` Jens Axboe
2024-01-19 23:11 ` Bart Van Assche
2024-01-18 19:29 ` [PATCHSET RFC 0/2] mq-deadline scalability improvements Jens Axboe
2024-01-18 20:22 ` 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=ba770235-7c2f-4886-9507-2fc2ff521e35@kernel.dk \
--to=axboe@kernel.dk \
--cc=bvanassche@acm.org \
--cc=linux-block@vger.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox