diff options
author | Vladimir Davydov <vdavydov@parallels.com> | 2015-02-12 17:58:54 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-02-12 21:54:09 -0500 |
commit | cb731d6c62bbc2f890b08ea3d0386d5dad887326 (patch) | |
tree | 1c597a1018d8258585aa65b3c4872a9c5d177d46 /mm/memory-failure.c | |
parent | 4101b624352fddb5ed72e7a1b6f8be8cffaa20fa (diff) |
vmscan: per memory cgroup slab shrinkers
This patch adds SHRINKER_MEMCG_AWARE flag. If a shrinker has this flag
set, it will be called per memory cgroup. The memory cgroup to scan
objects from is passed in shrink_control->memcg. If the memory cgroup
is NULL, a memcg aware shrinker is supposed to scan objects from the
global list. Unaware shrinkers are only called on global pressure with
memcg=NULL.
Signed-off-by: Vladimir Davydov <vdavydov@parallels.com>
Cc: Dave Chinner <david@fromorbit.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@suse.cz>
Cc: Greg Thelen <gthelen@google.com>
Cc: Glauber Costa <glommer@gmail.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Christoph Lameter <cl@linux.com>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: David Rientjes <rientjes@google.com>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Tejun Heo <tj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/memory-failure.c')
-rw-r--r-- | mm/memory-failure.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/mm/memory-failure.c b/mm/memory-failure.c index feb803bf3443..1a735fad2a13 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c | |||
@@ -242,15 +242,8 @@ void shake_page(struct page *p, int access) | |||
242 | * Only call shrink_node_slabs here (which would also shrink | 242 | * Only call shrink_node_slabs here (which would also shrink |
243 | * other caches) if access is not potentially fatal. | 243 | * other caches) if access is not potentially fatal. |
244 | */ | 244 | */ |
245 | if (access) { | 245 | if (access) |
246 | int nr; | 246 | drop_slab_node(page_to_nid(p)); |
247 | int nid = page_to_nid(p); | ||
248 | do { | ||
249 | nr = shrink_node_slabs(GFP_KERNEL, nid, 1000, 1000); | ||
250 | if (page_count(p) == 1) | ||
251 | break; | ||
252 | } while (nr > 10); | ||
253 | } | ||
254 | } | 247 | } |
255 | EXPORT_SYMBOL_GPL(shake_page); | 248 | EXPORT_SYMBOL_GPL(shake_page); |
256 | 249 | ||