lkml.org 
[lkml]   [2022]   [Jun]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] locking/rwlocks: do not starve writers
On Fri, Jun 17, 2022 at 02:10:39AM -0700, Eric Dumazet wrote:
> --- a/kernel/locking/qrwlock.c
> +++ b/kernel/locking/qrwlock.c
> @@ -23,16 +23,6 @@ void queued_read_lock_slowpath(struct qrwlock *lock)
> /*
> * Readers come here when they cannot get the lock without waiting
> */
> - if (unlikely(in_interrupt())) {
> - /*
> - * Readers in interrupt context will get the lock immediately
> - * if the writer is just waiting (not holding the lock yet),
> - * so spin with ACQUIRE semantics until the lock is available
> - * without waiting in the queue.
> - */
> - atomic_cond_read_acquire(&lock->cnts, !(VAL & _QW_LOCKED));
> - return;
> - }
> atomic_sub(_QR_BIAS, &lock->cnts);
>
> trace_contention_begin(lock, LCB_F_SPIN | LCB_F_READ);

This is known to break tasklist_lock.

\
 
 \ /
  Last update: 2022-06-17 14:09    [W:1.223 / U:0.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site