lkml.org 
[lkml]   [2022]   [May]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 2/2] locking/qrwlock: Reduce cacheline contention for rwlocks used in interrupt context
From
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

\
 
 \ /
  Last update: 2022-05-11 14:02    [W:0.094 / U:2.484 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site