[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1329456251.2373.44.camel@js-netbook>
Date: Thu, 16 Feb 2012 21:24:11 -0800
From: John Stultz <johnstul@...ibm.com>
To: Dmitry Adamushko <dmitry.adamushko@...il.com>
Cc: linux-kernel@...r.kernel.org,
Andrew Morton <akpm@...ux-foundation.org>,
Android Kernel Team <kernel-team@...roid.com>,
Robert Love <rlove@...gle.com>, Mel Gorman <mel@....ul.ie>,
Hugh Dickins <hughd@...gle.com>,
Dave Hansen <dave@...ux.vnet.ibm.com>,
Rik van Riel <riel@...hat.com>
Subject: Re: [PATCH 2/2] [RFC] fadvise: Add _VOLATILE,_ISVOLATILE, and
_NONVOLATILE flags
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@...aro.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists