Re: [RFC] respect the referenced bit of KVM guest pages?

From: Johannes Weiner
Date: Fri Aug 14 2009 - 05:12:09 EST


On Fri, Aug 14, 2009 at 10:16:26AM +0300, Avi Kivity wrote:
> On 08/14/2009 12:16 AM, Johannes Weiner wrote:
> >
> >>- do not ignore the referenced bit
> >>- if you see a run of N pages which all have the referenced bit set, do
> >>swap one
> >>
> >>
> >
> >But it also means destroying the LRU order.
> >
> >
>
> True, it would, but if we ignore the referenced bit, LRU order is really
> FIFO.

For the active list, yes. But it's not that we degrade to First Fault
First Out in a global scope, we still update the order from
mark_page_accessed() and by activating referenced pages in
shrink_page_list() etc.

So even with the active list being a FIFO, we keep usage information
gathered from the inactive list. If we deactivate pages in arbitrary
list intervals, we throw this away.

And while global FIFO-based reclaim does not work too well, initial
fault order is a valuable hint in the aspect of referential locality
as the pages get used in groups and thus move around the lists in
groups.

Our granularity for regrouping decisions is pretty coarse, for
non-filecache pages it's basically 'referenced or not refrenced in the
last list round-trip', so it will take quite some time to regroup
pages that are used in truly similar intervals.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/