[PATCH v2 0/3] page stealing tweaks

From: Vlastimil Babka
Date: Fri Dec 12 2014 - 11:02:56 EST

Changes since v1:
o Reorder patch 2 and 3, Cc stable for patch 1
o Fix tracepoint in patch 1 (Joonsoo Kim)
o Cleanup in patch 2 (suggested by Minchan Kim)
o Improved comments and changelogs per Minchan and Mel.
o Considered /proc/pagetypeinfo in evaluation with 3.18 as baseline

When studying page stealing, I noticed some weird looking decisions in
try_to_steal_freepages(). The first I assume is a bug (Patch 1), the following
two patches were driven by evaluation.

Testing was done with stress-highalloc of mmtests, using the
mm_page_alloc_extfrag tracepoint and postprocessing to get counts of how often
page stealing occurs for individual migratetypes, and what migratetypes are
used for fallbacks. Arguably, the worst case of page stealing is when
UNMOVABLE allocation steals from MOVABLE pageblock. RECLAIMABLE allocation
stealing from MOVABLE allocation is also not ideal, so the goal is to minimize
these two cases.

For some reason, the first patch increased the number of page stealing events
for MOVABLE allocations in the former evaluation with 3.17-rc7 + compaction
patches. In theory these events are not as bad, and the second patch does more
than just to correct this. In v2 evaluation based on 3.18, the weird result
was gone completely.

In v2 I also checked if /proc/pagetypeinfo has shown an increase of the number
of unmovable/reclaimable pageblocks during and after the test, and it didn't.
The test was repeated 25 times with reboot only after each 5 to show
longer-term differences in the state of the system, which also wasn't the case.

Extfrag events summed over first iteration after reboot (5 repeats)
3.18 3.18 3.18 3.18
0-nothp-1 1-nothp-1 2-nothp-1 3-nothp-1
Page alloc extfrag event 4547160 4593415 2343438 2198189
Extfrag fragmenting 4546361 4592610 2342595 2196611
Extfrag fragmenting for unmovable 5725 9196 5720 1093
Extfrag fragmenting unmovable placed with movable 3877 4091 1330 859
Extfrag fragmenting for reclaimable 770 628 511 616
Extfrag fragmenting reclaimable placed with movable 679 520 407 492
Extfrag fragmenting for movable 4539866 4582786 2336364 2194902

Compared to v1 this looks like a regression for patch 1 wrt unmovable events,
but I blame noise and less repeats (it was 10 in v1). On the other hand, the
the mysterious increase in movable allocation events in v1 is gone (due to
different baseline?)

Sum for second iterations since reboot:
3.18 3.18 3.18 3.18
0-nothp-2 1-nothp-2 2-nothp-2 3-nothp-2
Page alloc extfrag event 1960806 1682705 868136 602097
Extfrag fragmenting 1960268 1682153 867624 601608
Extfrag fragmenting for unmovable 14373 13973 12275 2158
Extfrag fragmenting unmovable placed with movable 10465 7233 8814 1821
Extfrag fragmenting for reclaimable 2268 1244 1122 1284
Extfrag fragmenting reclaimable placed with movable 2092 1010 940 1033
Extfrag fragmenting for movable 1943627 1666936 854227 598166

Running stress-highalloc again without reboot is indeed different, and worse
wrt unmovable allocations (also worse wrt high-order allocation success rates)
but the patches improve it as well. Similar trend can be observed for further
iterations after reboot.

Vlastimil Babka (3):
mm: when stealing freepages, also take pages created by splitting
buddy page
mm: always steal split buddies in fallback allocations
mm: more aggressive page stealing for UNMOVABLE allocations

include/trace/events/kmem.h | 7 ++--
mm/page_alloc.c | 78 ++++++++++++++++++++++++---------------------
2 files changed, 45 insertions(+), 40 deletions(-)


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/