lkml.org 
[lkml]   [2018]   [Nov]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 2/4] fscache: Fix race in fscache_op_complete() due to split atomic_sub & read
Date
Andrea Parri <andrea.parri@amarulasolutions.com> wrote:

> > > > > > Fix this by using atomic_sub_return() instead of two calls.
> > > > >
> > > > > Seems a case for atomic_sub_return_relaxed()... why not?
> > > >
> > > > Ummm... In that case, should it be atomic_sub_return_release()?
> > >
> > > Hard to tell for me: your diff./changelog is all I know about fs-cache
> > > ... (and this suggests -no-, given that atomic_sub() and atomic_read()
> > > provide no ordering...); good question though. ;-)
> >
> > Yeah, that doesn't mean that it shouldn't be stricter than 'relaxed'.
> > It's kind of like an unlock/release operation, so I think 'release' is
> > probably the minimum requirement.
>
> Sure. My point was: those operations are currently not atomic _and_
> they provide no ordering; I think that the above commit message does
> a good work in explaining *why* we need atomicity, but can't say the
> same for the memory-ordering requirement.

Having discussed it with Paul McKenney and thought about it some more, I think
relaxed is probably okay since there isn't a pair of variables that need
ordering.

David

\
 
 \ /
  Last update: 2018-11-28 15:44    [W:0.096 / U:0.316 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site