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

From: Wu Fengguang
Date: Sun Aug 16 2009 - 01:51:18 EST


On Sun, Aug 16, 2009 at 01:09:03PM +0800, Balbir Singh wrote:
> * Wu Fengguang <fengguang.wu@xxxxxxxxx> [2009-08-15 13:45:24]:
>
> > On Fri, Aug 14, 2009 at 09:19:35PM +0800, Rik van Riel wrote:
> > > Wu Fengguang wrote:
> > > > On Fri, Aug 14, 2009 at 05:10:55PM +0800, Johannes Weiner wrote:
> > >
> > @@ -1541,11 +1542,11 @@ static void shrink_zone(int priority, st
> > scan = (scan * percent[file]) / 100;
> > }
> > if (scanning_global_lru(sc))
> > - nr[l] = nr_scan_try_batch(scan,
> > - &zone->lru[l].nr_saved_scan,
> > - swap_cluster_max);
> > + saved_scan = &zone->lru[l].nr_saved_scan;
> > else
> > - nr[l] = scan;
> > + saved_scan = mem_cgroup_get_saved_scan(sc->mem_cgroup,
> > + zone, l);
> > + nr[l] = nr_scan_try_batch(scan, saved_scan, swap_cluster_max);
> > }
> >
>
> This might be a concern (although not a big ATM), since we can't
> afford to miss limits by much. If a cgroup is near its limit and we
> drop scanning it. We'll have to work out what this means for the end
> user. May be more fundamental look through is required at the priority
> based logic of exposing how much to scan, I don't know.

I also had this worry at first. Then dismissed it because the page
reclaim should be driven by "pages reclaimed" rather than "pages
scanned". So when shrink_zone() decides to cancel one smallish scan,
it may well be called again and accumulate up nr_saved_scan.

So it should only be a problem for a very small mem_cgroup (which may
be _full_ scanned too much times in order to accumulate up nr_saved_scan).

Thanks,
Fengguang
--
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/