Messages in this thread | | | From | Thomas Gleixner <> | Subject | Re: [PATCH 3/4] locking/rwbase: Fix rwbase_write_lock() vs __rwbase_read_lock() | Date | Tue, 14 Sep 2021 17:00:56 +0200 |
| |
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>
| |