Re: [PATCH] lockdep: Let lock_is_held_type() detect recursive read as read

From: Sebastian Andrzej Siewior
Date: Fri Sep 03 2021 - 10:30:43 EST


On 2021-09-03 22:15:04 [+0800], Boqun Feng wrote:
> But the rwlock in PREEMPT_RT is writer unfair, isn't it? As per:
>
> https://lore.kernel.org/lkml/20210815211302.957920571@xxxxxxxxxxxxx/
>
> also in __rwbase_read_lock():
>
> /*
> * Allow readers, as long as the writer has not completely
> * acquired the semaphore for write.
> */
> if (atomic_read(&rwb->readers) != WRITER_BIAS) {
> atomic_inc(&rwb->readers);
> raw_spin_unlock_irq(&rtm->wait_lock);
> return 0;
> }
>
> that means the readers of rwlock in PREEMPT_RT are always recursive,
> right? Am I missing something subtle?

huch. You are right. I take everything backt then. I do remember it
differently but it has been like since this implementation has been
introduced…

> Regards,
> Boqun

Sebastian