[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20180628120742.GB4065@kroah.com>
Date: Thu, 28 Jun 2018 21:07:42 +0900
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: Mark Rutland <mark.rutland@....com>
Cc: Peter Zijlstra <peterz@...radead.org>,
linux-kernel@...r.kernel.org, Boqun Feng <boqun.feng@...il.com>,
Will Deacon <will.deacon@....com>,
Jiri Slaby <jslaby@...e.com>,
Peter Hurley <peter@...leysoftware.com>
Subject: Re: [PATCH 1/7] atomics/tty: add missing atomic_long_t * cast
On Fri, Jun 22, 2018 at 05:55:59PM +0100, Mark Rutland wrote:
> Hi,
>
> On Wed, Jun 06, 2018 at 04:00:42PM +0200, Greg Kroah-Hartman wrote:
> > On Tue, Jun 05, 2018 at 04:53:34PM +0200, Peter Zijlstra wrote:
> > > On Tue, Jun 05, 2018 at 04:43:04PM +0200, Peter Zijlstra wrote:
> > >
> > > > I can make a proper patch, hold on.
> > >
> > > ---
> > > Subject: atomic/tty: Fix up atomic abuse in ldsem
> > >
> > > Mark found ldsem_cmpxchg() needed an (atomic_long_t *) cast to keep
> > > working after making the atomic_long interface type safe.
> > >
> > > Needing casts is bad form, which made me look at the code. There are no
> > > ld_semaphore::count users outside of these functions so there is no
> > > reason why it can not be an atomic_long_t in the first place, obviating
> > > the need for this cast.
> > >
> > > That also ensures the loads use atomic_long_read(), which implies (at
> > > least) READ_ONCE() in order to guarantee single-copy-atomic loads.
> > >
> > > When using atomic_long_try_cmpxchg() the ldsem_cmpxchg() wrapper gets
> > > very thin (the only difference is not changing *old on success, which
> > > most callers don't seem to care about).
> > >
> > > So rework the whole thing to use atomic_long_t and its accessors
> > > directly.
> > >
> > > While there, fixup all the horrible comment styles.
> > >
> > > Cc: Peter Hurley <peter@...leysoftware.com>
> > > Reported-by: Mark Rutland <mark.rutland@....com>
> > > Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
> >
> > Looks good, I'll queue this up after 4.18-rc1 is out, thanks.
>
> Now that v4.18-rc1 is out, I thought I'd ping so that this doesn't get
> forgotten.
Not forgotten, sorry, now queued up.
greg k-h
Powered by blists - more mailing lists