[lkml]   [2012]   [Apr]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH 2/3] fadvise: Add _VOLATILE,_ISVOLATILE, and _NONVOLATILE flags
On 04/24/2012 12:20 PM, Peter Zijlstra wrote:
> On Tue, 2012-04-24 at 10:49 -0700, John Stultz wrote:
>> +/*
>> + * Purges volatile ranges when under memory pressure
>> + */
>> +static int volatile_shrink(struct shrinker *ignored, struct shrink_control *sc)
>> +{
> Hmm, I would have expected regular page reclaim to know about this
> instead of using a shrinker interface. Is this done specifically to
> avoid growing small holes in all ranges and instead dump entire ranges
> thereby keeping other ranges usable?
So yes. We don't want to have single pages purged from the ranges. My
first attempt used the standard writeout method to do the purging.
However, since the ranges in their entirety should be purged at once
(since if any single page is purged, the entire range must be
reconstructed), keeping track of the least-recently-unpinned range is
more useful then the least-recently-used page.

Now, Dave Chinner suggested using tags to mark pages as part of a
volatile range, as well as tracking their purged status, then iterating
over adjacent pages on writeout to also purge the entire range, which
could be done, but seemed more costly to iterate over each page updating
the tags when marking or unmarking a range as volatile. This suggestion
was also (as I understood) mainly to address the memory overhead of
early implementation adding a pointer to each address_space structure.
That issue was resolved by using the hash table for address_space ->
range_tree mappings.


 \ /
  Last update: 2012-04-24 21:55    [W:0.097 / U:2.080 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site