]> Git Repo - linux.git/commit
mm, memcg: decouple e{low,min} state mutations from protection checks
authorChris Down <[email protected]>
Fri, 7 Aug 2020 06:22:05 +0000 (23:22 -0700)
committerLinus Torvalds <[email protected]>
Fri, 7 Aug 2020 18:33:25 +0000 (11:33 -0700)
commit45c7f7e1ef17f09fe70bad4b705ce43772153fd7
tree9808b63a84333682b41c7545df99020621bc1481
parent22f7496f0b901249f23c5251eb8a10aae126b909
mm, memcg: decouple e{low,min} state mutations from protection checks

mem_cgroup_protected currently is both used to set effective low and min
and return a mem_cgroup_protection based on the result.  As a user, this
can be a little unexpected: it appears to be a simple predicate function,
if not for the big warning in the comment above about the order in which
it must be executed.

This change makes it so that we separate the state mutations from the
actual protection checks, which makes it more obvious where we need to be
careful mutating internal state, and where we are simply checking and
don't need to worry about that.

[[email protected] - don't check protection on root memcgs]

Suggested-by: Johannes Weiner <[email protected]>
Signed-off-by: Chris Down <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Acked-by: Johannes Weiner <[email protected]>
Acked-by: Michal Hocko <[email protected]>
Cc: Roman Gushchin <[email protected]>
Cc: Yafang Shao <[email protected]>
Link: http://lkml.kernel.org/r/ff3f915097fcee9f6d7041c084ef92d16aaeb56a.1594638158.git.chris@chrisdown.name
Signed-off-by: Linus Torvalds <[email protected]>
include/linux/memcontrol.h
mm/memcontrol.c
mm/vmscan.c
This page took 0.056383 seconds and 4 git commands to generate.