[RFC 0/3] mm: vmevent: Stats accuracy improvements

From: Anton Vorontsov
Date: Fri Oct 12 2012 - 06:13:59 EST


Hi all,

Some time ago KOSAKI Motohiro noticed[1] that vmevent might be very
inaccurate (up to 2GB inaccuracy on a very large machines) since per CPU
stats synchronization happens either on time basis or when we hit stat
thresholds.

KOSAKI also told that perf API might be a good inspirations for further
improvements, but I must admit I didn't fully get the idea, although I'm
open to investigate this route too, but I guess it needs a bit more
explanations.

Also note that this is just an RFC, I just show some ideas and wonder how
you feel about it. Since we now use memory pressure factor bolted into the
reclaimer code path, we don't desperately need the accurate stats, but
it's still nice thing to have/fix.

Anyway, here we take two approaches:

- Asynchronously sum vm_stat diffs and global stats. This is very similar
to what we already have for per-zone stats, implemented in
zone_page_state_snapshot(). The values still could be inaccurate, but
overall this makes things better;

- Implement configurable per CPU vmstat thresholds. This is much more
powerful tool to get accurate statistics, but it comes with a price: it
might cause some performance penalty as we'd update global stats more
frequently (in a fast path), so users have to be careful.

The two items are independent, so we might implement one or another, or
both, or none, if desired. ;-)

Thanks,
Anton.

p.s. Note that the patches are against my vmevent tree, i.e.:

git://git.infradead.org/users/cbou/linux-vmevent.git

[1] http://lkml.indiana.edu/hypermail/linux/kernel/1205.1/00062.html
--
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/