linux-hardened/arch
Mel Gorman 599d0c954f mm, vmscan: move LRU lists to node
This moves the LRU lists from the zone to the node and related data such
as counters, tracing, congestion tracking and writeback tracking.

Unfortunately, due to reclaim and compaction retry logic, it is
necessary to account for the number of LRU pages on both zone and node
logic.  Most reclaim logic is based on the node counters but the retry
logic uses the zone counters which do not distinguish inactive and
active sizes.  It would be possible to leave the LRU counters on a
per-zone basis but it's a heavier calculation across multiple cache
lines that is much more frequent than the retry checks.

Other than the LRU counters, this is mostly a mechanical patch but note
that it introduces a number of anomalies.  For example, the scans are
per-zone but using per-node counters.  We also mark a node as congested
when a zone is congested.  This causes weird problems that are fixed
later but is easier to review.

In the event that there is excessive overhead on 32-bit systems due to
the nodes being on LRU then there are two potential solutions

1. Long-term isolation of highmem pages when reclaim is lowmem

   When pages are skipped, they are immediately added back onto the LRU
   list. If lowmem reclaim persisted for long periods of time, the same
   highmem pages get continually scanned. The idea would be that lowmem
   keeps those pages on a separate list until a reclaim for highmem pages
   arrives that splices the highmem pages back onto the LRU. It potentially
   could be implemented similar to the UNEVICTABLE list.

   That would reduce the skip rate with the potential corner case is that
   highmem pages have to be scanned and reclaimed to free lowmem slab pages.

2. Linear scan lowmem pages if the initial LRU shrink fails

   This will break LRU ordering but may be preferable and faster during
   memory pressure than skipping LRU pages.

Link: http://lkml.kernel.org/r/1467970510-21195-4-git-send-email-mgorman@techsingularity.net
Signed-off-by: Mel Gorman <mgorman@techsingularity.net>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Cc: Hillf Danton <hillf.zj@alibaba-inc.com>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Rik van Riel <riel@surriel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2016-07-28 16:07:41 -07:00
..
alpha mm: do not pass mm_struct into handle_mm_fault 2016-07-26 16:19:19 -07:00
arc Disable "maybe-uninitialized" warning globally 2016-07-27 13:17:41 -07:00
arm New LED class driver: 2016-07-27 14:03:52 -07:00
arm64 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2016-07-27 12:03:20 -07:00
avr32 mm: do not pass mm_struct into handle_mm_fault 2016-07-26 16:19:19 -07:00
blackfin media updates for v4.8-rc1 2016-07-26 18:59:59 -07:00
c6x asm-generic patch for 4.7 2016-05-24 15:24:37 -07:00
cris mm: do not pass mm_struct into handle_mm_fault 2016-07-26 16:19:19 -07:00
frv mm: do not pass mm_struct into handle_mm_fault 2016-07-26 16:19:19 -07:00
h8300 locking/atomic: Remove linux/atomic.h:atomic_fetch_or() 2016-06-16 10:48:32 +02:00
hexagon Merge branch 'akpm' (patches from Andrew) 2016-07-26 19:55:54 -07:00
ia64 Merge branch 'akpm' (patches from Andrew) 2016-07-26 19:55:54 -07:00
m32r mm: do not pass mm_struct into handle_mm_fault 2016-07-26 16:19:19 -07:00
m68k mm: do not pass mm_struct into handle_mm_fault 2016-07-26 16:19:19 -07:00
metag mm: do not pass mm_struct into handle_mm_fault 2016-07-26 16:19:19 -07:00
microblaze Merge branch 'akpm' (patches from Andrew) 2016-07-26 19:55:54 -07:00
mips spi: Updates for v4.8 2016-07-27 14:11:43 -07:00
mn10300 mm: do not pass mm_struct into handle_mm_fault 2016-07-26 16:19:19 -07:00
nios2 mm: do not pass mm_struct into handle_mm_fault 2016-07-26 16:19:19 -07:00
openrisc Merge branch 'akpm' (patches from Andrew) 2016-07-26 19:55:54 -07:00
parisc New LED class driver: 2016-07-27 14:03:52 -07:00
powerpc New LED class driver: 2016-07-27 14:03:52 -07:00
s390 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2016-07-27 12:03:20 -07:00
score mm: do not pass mm_struct into handle_mm_fault 2016-07-26 16:19:19 -07:00
sh Merge branch 'akpm' (patches from Andrew) 2016-07-26 19:55:54 -07:00
sparc mm: do not pass mm_struct into handle_mm_fault 2016-07-26 16:19:19 -07:00
tile mm, vmscan: move LRU lists to node 2016-07-28 16:07:41 -07:00
um Merge branch 'akpm' (patches from Andrew) 2016-07-26 19:55:54 -07:00
unicore32 New LED class driver: 2016-07-27 14:03:52 -07:00
x86 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2016-07-27 12:03:20 -07:00
xtensa mm: do not pass mm_struct into handle_mm_fault 2016-07-26 16:19:19 -07:00
.gitignore
Kconfig Clarify naming of thread info/stack allocators 2016-06-24 15:09:37 -07:00