Skip to content

Candidate fixes for premature OOM kills with node-lru v2

Mel Gorman linux-mm lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 15 repliesIn review 3 of 5 applied

Patches in v1 3 of 5 applied

#Subject and filesSizeRepliesApplied
1/5mm: add per-zone lru list statinclude/linux/mm_inline.h include/linux/mmzone.h mm/page_alloc.c +2 more+23 -91 replyApplied
2/5mm, vmscan: Remove highmem_file_pagesinclude/linux/mm_inline.h mm/page-writeback.c+4 -253 replies
3/5mm: Remove reclaim and compaction retry approximationsinclude/linux/mmzone.h include/linux/swap.h mm/compaction.c +5 more+39 -582 repliesApplied
4/5mm: consider per-zone inactive ratio to deactivatemm/vmscan.c+32 -51 reply
5/5mm, vmscan: Account for skipped pages as a partial scanmm/vmscan.c+18 -25 repliesApplied

Reviews trailers per patch

4 of 5 patches have a Reviewed-by or Acked-by.

PatchJohannes WeinerMinchan Kim
1/5A-b
2/5A-b
3/5A-b A-b
4/5
5/5A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/5] Candidate fixes for premature OOM kills with node-lru v2

Both Joonsoo Kim and Minchan Kim have reported premature OOM kills. The common element is a zone-constrained allocation failings. Two factors appear to be at fault -- pgdat being considered unreclaimable prematurely and insufficient rotation of the active list.

The series is in three basic parts;

Patches 1-3 add per-zone stats back in. The actual stats patch is different
to Minchan's as the original patch did not account for unevictable LRU which would corrupt counters. The second two patches remove approximations based on pgdat statistics. It's effectively a revert of "mm, vmstat: remove zone and node double accounting by approximating retries" but different LRU stats are used. This is better than a full revert or a reworking of the series as it preserves history of why the zone stats are necessary.

If this work out, we may have to leave the double accounting in place for now until an alternative cheap solution presents itself.

Patch 4 rotates inactive/active lists for lowmem allocations. This is also
quite different to Minchan's patch as the original patch did not account for memcg and would rotate if *any* eligible zone needed rotation which may rotate excessively. The new patch considers the ratio for all eligible zones which is more in line with node-lru in general.

Patch 5 accounts for skipped pages as partial scanned. This avoids the pgdat
being prematurely marked unreclaimable while still allowing it to be marked unreclaimable if there are no reclaimable pages.

These patches did not OOM for me on a 2G 32-bit KVM instance while running a stress test for an hour. Preliminary tests on a 64-bit system using a parallel dd workload did not show anything alarming.

If an OOM is detected then please post the full OOM message.

Optionally please test without patch 5 if an OOM occurs.

 include/linux/mm_inline.h | 19 ++---------
 include/linux/mmzone.h    |  7 ++++
 include/linux/swap.h      |  1 +
 mm/compaction.c           | 20 +----------
 mm/migrate.c              |  2 ++
 mm/page-writeback.c       | 17 +++++-----
 mm/page_alloc.c           | 59 +++++++++++----------------------
 mm/vmscan.c               | 84 ++++++++++++++++++++++++++++++++++++++---------
 mm/vmstat.c               |  6 ++++
 9 files changed, 116 insertions(+), 99 deletions(-)
Signature · 7 lines
2.6.4

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>