lkml.org 
[lkml]   [2012]   [Feb]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 2/2] [RFC] fadvise: Add _VOLATILE,_ISVOLATILE, and _NONVOLATILE flags
From
Date
On Thu, 2012-02-16 at 19:43 -0800, John Stultz wrote:
> On Sun, 2012-02-12 at 13:48 +0100, Dmitry Adamushko wrote:
> >
> > On 10 February 2012 01:16, John Stultz <john.stultz@linaro.org> wrote:
>
> > +static inline void volatile_range_shrink(struct
> > volatile_range *range,
> > + pgoff_t start_index, pgoff_t
> > end_index)
> > +{
> > + size_t pre = range_size(range);
> > +
> > + range->range_node.start = start_index;
> > + range->range_node.end = end_index;
> > +
> >
> > I guess, here we get a whole range of races with volatile_shrink(),
> > which may see inconsistent (in-the-middle-of-update) ranges
> > (e.g. .start and .end).
>
> We should be holding the vlist_mutex to avoid any such races. But you
> also make clear that volatile_range_shrink() should really be called
> volatile_range_resize(), since having two _shrink calls is terrible. My
> apologies.

And sure enough in the shrinker we're not holding the vlist_mutex.
Thanks for pointing that out.
-john



\
 
 \ /
  Last update: 2012-02-17 06:29    [W:0.109 / U:1.404 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site