From: Waiman Long <longman@redhat.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>, Will Deacon <will@kernel.org>,
Boqun Feng <boqun.feng@gmail.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/2] locking/qrwlock: Reduce cacheline contention for rwlocks used in interrupt context
Date: Wed, 11 May 2022 08:01:24 -0400 [thread overview]
Message-ID: <8f047351-c53e-ae9a-2d5e-f7c37f6bbdff@redhat.com> (raw)
In-Reply-To: <CAK8P3a3APecwzfS24Cc2f7rPdZXKU0Y9FB3RZNFTnRYnVXVQzg@mail.gmail.com>
On 5/11/22 03:20, Arnd Bergmann wrote:
> On Tue, May 10, 2022 at 9:21 PM Waiman Long <longman@redhat.com> wrote:
>> Even though qrwlock is supposed to be a fair lock, it does allow readers
>> from interrupt context to spin on the lock until it can acquire it making
>> it not as fair. This exception was added due to the requirement to allow
>> recursive read lock in interrupt context. This can also be achieved by
>> just ignoring the writer waiting bit without spinning on the lock.
>>
>> By making this change, we make qrwlock a bit more fair and eliminating
>> the problem of cacheline bouncing for rwlocks that are used heavily in
>> interrupt context, like the networking stack. This should also reduce
>> the chance of lock starvation for those interrupt context rwlocks.
>>
>> Signed-off-by: Waiman Long <longman@redhat.com>
>> ---
>> include/asm-generic/qrwlock.h | 6 +++---
>> kernel/locking/qrwlock.c | 17 ++++++-----------
>> 2 files changed, 9 insertions(+), 14 deletions(-)
> I have no opinion on the change itself, but I made sure this does
> not conflict with the generic ticket spinlock changes that I merged
> in the asm-generic tree, since those also touch the comments in
> qrwlock.h [1]
>
> I assume you are merging both patches through the tip tree, so
Yes, it is based on the latest tip tree.
Cheers,
Longman
next prev parent reply other threads:[~2022-05-11 12:01 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-10 19:21 [PATCH 1/2] locking/qrwlock: Change "queue rwlock" to "queued rwlock" Waiman Long
2022-05-10 19:21 ` [PATCH 2/2] locking/qrwlock: Reduce cacheline contention for rwlocks used in interrupt context Waiman Long
2022-05-11 7:20 ` Arnd Bergmann
2022-05-11 12:01 ` Waiman Long [this message]
2022-05-11 8:30 ` Peter Zijlstra
2022-05-11 12:44 ` Waiman Long
2022-05-11 13:34 ` Peter Zijlstra
2022-05-11 16:00 ` Waiman Long
2022-05-11 19:39 ` [tip: locking/core] locking/qrwlock: Change "queue rwlock" to "queued rwlock" tip-bot2 for Waiman Long
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=8f047351-c53e-ae9a-2d5e-f7c37f6bbdff@redhat.com \
--to=longman@redhat.com \
--cc=arnd@arndb.de \
--cc=boqun.feng@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=will@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;
as well as URLs for NNTP newsgroup(s).