[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20180220132254.GB25201@hirez.programming.kicks-ass.net>
Date: Tue, 20 Feb 2018 14:22:54 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Christian König <christian.koenig@....com>
Cc: dri-devel@...ts.freedesktop.org, amd-gfx@...ts.freedesktop.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/3] locking/ww_mutex: cleanup lock->ctx usage in amdgpu
On Tue, Feb 20, 2018 at 02:08:26PM +0100, Christian König wrote:
> Am 20.02.2018 um 13:35 schrieb Peter Zijlstra:
> > > +static inline bool ww_mutex_is_owned_by(struct ww_mutex *lock,
> > > + struct task_struct *task,
> > > + struct ww_acquire_ctx *ctx)
> > > +{
> > > + return likely(__mutex_owner(&lock->base) == task) &&
> > > + READ_ONCE(lock->ctx) == ctx;
> > > +}
> > Nak on that interface, that's racy and broken by design.
>
> Why?
If task != current you can race with a concurrent mutex_unlock().
Powered by blists - more mailing lists