[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210819183257.5dk35kvnuoipgcqa@linutronix.de>
Date:   Thu, 19 Aug 2021 20:32:57 +0200
From:   Sebastian Andrzej Siewior <bigeasy@...utronix.de>
To:     Peter Zijlstra <peterz@...radead.org>
Cc:     Guenter Roeck <linux@...ck-us.net>,
        Thomas Gleixner <tglx@...utronix.de>,
        LKML <linux-kernel@...r.kernel.org>,
        Ingo Molnar <mingo@...nel.org>,
        Juri Lelli <juri.lelli@...hat.com>,
        Steven Rostedt <rostedt@...dmis.org>,
        Daniel Bristot de Oliveira <bristot@...hat.com>,
        Will Deacon <will@...nel.org>,
        Waiman Long <longman@...hat.com>,
        Boqun Feng <boqun.feng@...il.com>,
        Davidlohr Bueso <dave@...olabs.net>,
        Mike Galbraith <efault@....de>
Subject: Re: [PATCH] locking/ww_mutex: Initialize waiter.ww_ctx properly
On 2021-08-19 20:22:38 [+0200], Peter Zijlstra wrote:
> > @@ -630,6 +628,7 @@ __mutex_lock_common(struct mutex *lock, unsigned int state, unsigned int subclas
> >  		ret = __ww_mutex_add_waiter(&waiter, lock, ww_ctx);
> >  		if (ret)
> >  			goto err_early_kill;
> > +		waiter.ww_ctx = ww_ctx;
> 
> Yeah, I suppose this works too, but I wanted to keep the waiter
> initialization together. Note how you've already called
> __ww_mutex_add_waiter() on it before you actually set part of the waiter
> state.
The wait_lock is held but yes, it ain't pretty.
Sebastian
Powered by blists - more mailing lists