]> Git Repo - linux.git/commit
mm: workingset: tell cache transitions from workingset thrashing
authorJohannes Weiner <[email protected]>
Fri, 26 Oct 2018 22:06:04 +0000 (15:06 -0700)
committerLinus Torvalds <[email protected]>
Fri, 26 Oct 2018 23:26:32 +0000 (16:26 -0700)
commit1899ad18c6072d689896badafb81267b0a1092a4
treed960f2886025787cdbd5fa12fb64e7f52a6e4053
parent95f9ab2d596e8cbb388315e78c82b9a131bf2928
mm: workingset: tell cache transitions from workingset thrashing

Refaults happen during transitions between workingsets as well as in-place
thrashing.  Knowing the difference between the two has a range of
applications, including measuring the impact of memory shortage on the
system performance, as well as the ability to smarter balance pressure
between the filesystem cache and the swap-backed workingset.

During workingset transitions, inactive cache refaults and pushes out
established active cache.  When that active cache isn't stale, however,
and also ends up refaulting, that's bonafide thrashing.

Introduce a new page flag that tells on eviction whether the page has been
active or not in its lifetime.  This bit is then stored in the shadow
entry, to classify refaults as transitioning or thrashing.

How many page->flags does this leave us with on 32-bit?

20 bits are always page flags

21 if you have an MMU

23 with the zone bits for DMA, Normal, HighMem, Movable

29 with the sparsemem section bits

30 if PAE is enabled

31 with this patch.

So on 32-bit PAE, that leaves 1 bit for distinguishing two NUMA nodes.  If
that's not enough, the system can switch to discontigmem and re-gain the 6
or 7 sparsemem section bits.

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Johannes Weiner <[email protected]>
Acked-by: Peter Zijlstra (Intel) <[email protected]>
Tested-by: Daniel Drake <[email protected]>
Tested-by: Suren Baghdasaryan <[email protected]>
Cc: Christopher Lameter <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Johannes Weiner <[email protected]>
Cc: Mike Galbraith <[email protected]>
Cc: Peter Enderborg <[email protected]>
Cc: Randy Dunlap <[email protected]>
Cc: Shakeel Butt <[email protected]>
Cc: Tejun Heo <[email protected]>
Cc: Vinayak Menon <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
include/linux/mmzone.h
include/linux/page-flags.h
include/linux/swap.h
include/trace/events/mmflags.h
mm/filemap.c
mm/huge_memory.c
mm/migrate.c
mm/swap_state.c
mm/vmscan.c
mm/vmstat.c
mm/workingset.c
This page took 0.063549 seconds and 4 git commands to generate.