You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
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>
This commit is contained in:
committed by
Linus Torvalds
parent
4101b62435
commit
cb731d6c62
+2
-9
@@ -242,15 +242,8 @@ void shake_page(struct page *p, int access)
|
||||
* Only call shrink_node_slabs here (which would also shrink
|
||||
* other caches) if access is not potentially fatal.
|
||||
*/
|
||||
if (access) {
|
||||
int nr;
|
||||
int nid = page_to_nid(p);
|
||||
do {
|
||||
nr = shrink_node_slabs(GFP_KERNEL, nid, 1000, 1000);
|
||||
if (page_count(p) == 1)
|
||||
break;
|
||||
} while (nr > 10);
|
||||
}
|
||||
if (access)
|
||||
drop_slab_node(page_to_nid(p));
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(shake_page);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user