summaryrefslogtreecommitdiffstats
path: root/mm/mempool.c
diff options
context:
space:
mode:
authorJohannes Weiner <hannes@cmpxchg.org>2020-08-06 23:22:15 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2020-08-07 11:33:26 -0700
commite22c6ed90aa91abc08f107344428ebb8c2629e98 (patch)
treef8fee7a0c44f9124184f3c2da9cd3e60344875de /mm/mempool.c
parent19ce33acbbd03c371f2d4b533879c4755686f95f (diff)
downloadlinux-e22c6ed90aa91abc08f107344428ebb8c2629e98.tar.gz
linux-e22c6ed90aa91abc08f107344428ebb8c2629e98.tar.bz2
linux-e22c6ed90aa91abc08f107344428ebb8c2629e98.zip
mm: memcontrol: don't count limit-setting reclaim as memory pressure
When an outside process lowers one of the memory limits of a cgroup (or uses the force_empty knob in cgroup1), direct reclaim is performed in the context of the write(), in order to directly enforce the new limit and have it being met by the time the write() returns. Currently, this reclaim activity is accounted as memory pressure in the cgroup that the writer(!) belongs to. This is unexpected. It specifically causes problems for senpai (https://github.com/facebookincubator/senpai), which is an agent that routinely adjusts the memory limits and performs associated reclaim work in tens or even hundreds of cgroups running on the host. The cgroup that senpai is running in itself will report elevated levels of memory pressure, even though it itself is under no memory shortage or any sort of distress. Move the psi annotation from the central cgroup reclaim function to callsites in the allocation context, and thereby no longer count any limit-setting reclaim as memory pressure. If the newly set limit causes the workload inside the cgroup into direct reclaim, that of course will continue to count as memory pressure. Signed-off-by: Johannes Weiner <hannes@cmpxchg.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Reviewed-by: Shakeel Butt <shakeelb@google.com> Reviewed-by: Roman Gushchin <guro@fb.com> Acked-by: Chris Down <chris@chrisdown.name> Acked-by: Michal Hocko <mhocko@suse.com> Link: http://lkml.kernel.org/r/20200728135210.379885-2-hannes@cmpxchg.org Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/mempool.c')
0 files changed, 0 insertions, 0 deletions