lkml.org 
[lkml]   [2021]   [Sep]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 3/4] locking/rwbase: Fix rwbase_write_lock() vs __rwbase_read_lock()
Date
On Tue, Sep 14 2021 at 15:59, Peter Zijlstra wrote:
> On Tue, Sep 14, 2021 at 09:45:12AM +0200, Thomas Gleixner wrote:
>> The read/set is always in the same lock instance.
>
> I really did make a mess of things didn't I :-/ It was some intermediate
> state that was broken.

Thinking about memory ordering can reorder your memory :)

> How's this then?
>
> ---
> Subject: locking/rwbase: Extract __rwbase_write_trylock()
> From: Peter Zijlstra <peterz@infradead.org>
> Date: Thu, 09 Sep 2021 12:59:18 +0200
>
> The code in rwbase_write_lock() is a little non-obvious vs the
> read+set 'trylock', extract the sequence into a helper function to
> clarify the code.
>
> This also provides a single site to fix fast-path ordering.
>
> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>

Reviewed-by: Thomas Gleixner <tglx@linutronix.de>

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