]> git.baikalelectronics.ru Git - kernel.git/commit
mm: workingset: per-cgroup cache thrash detection
authorJohannes Weiner <hannes@cmpxchg.org>
Tue, 15 Mar 2016 21:57:16 +0000 (14:57 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 15 Mar 2016 23:55:16 +0000 (16:55 -0700)
commit3c2367b96e6bcfb92a244c056e8ada1d328c089e
tree3c90e27cc6dcb6a386a54c503bbb0860e828509b
parent307e0161109b36d0188aee654a222102e87b96cd
mm: workingset: per-cgroup cache thrash detection

Cache thrash detection (see 4fbf2b0e4af7 "mm: thrash detection-based
file cache sizing" for details) currently only works on the system
level, not inside cgroups.  Worse, as the refaults are compared to the
global number of active cache, cgroups might wrongfully get all their
refaults activated when their pages are hotter than those of others.

Move the refault machinery from the zone to the lruvec, and then tag
eviction entries with the memcg ID.  This makes the thrash detection
work correctly inside cgroups.

[sergey.senozhatsky@gmail.com: do not return from workingset_activation() with locked rcu and page]
Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Reviewed-by: Vladimir Davydov <vdavydov@virtuozzo.com>
Cc: Michal Hocko <mhocko@suse.cz>
Cc: David Rientjes <rientjes@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/linux/memcontrol.h
include/linux/mmzone.h
mm/memcontrol.c
mm/vmscan.c
mm/workingset.c