diff options
author | Roman Gushchin <roman.gushchin@linux.dev> | 2024-07-26 20:31:09 +0000 |
---|---|---|
committer | Andrew Morton <akpm@linux-foundation.org> | 2024-09-01 20:25:51 -0700 |
commit | 941ce635234162c420c9185816c59f7d5dd1ad07 (patch) | |
tree | 1ea4103c14cfc0a75a82be650f7fc8a201a74dde /mm/page_counter.c | |
parent | f77bd4b14ccfd38dfcfe67eecad517b8ec1b7f37 (diff) | |
download | linux-stable-941ce635234162c420c9185816c59f7d5dd1ad07.tar.gz linux-stable-941ce635234162c420c9185816c59f7d5dd1ad07.tar.bz2 linux-stable-941ce635234162c420c9185816c59f7d5dd1ad07.zip |
mm: page_counters: put page_counter_calculate_protection() under CONFIG_MEMCG
Put page_counter_calculate_protection() under CONFIG_MEMCG.
The protection functionality (min/low limits) is not supported by any
other cgroup subsystem, so page_counter_calculate_protection() and related
static effective_protection() can be compiled out if CONFIG_MEMCG is not
enabled.
Link: https://lkml.kernel.org/r/20240726203110.1577216-3-roman.gushchin@linux.dev
Signed-off-by: Roman Gushchin <roman.gushchin@linux.dev>
Acked-by: Shakeel Butt <shakeel.butt@linux.dev>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Muchun Song <songmuchun@bytedance.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm/page_counter.c')
-rw-r--r-- | mm/page_counter.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/mm/page_counter.c b/mm/page_counter.c index dd242245bee2..3887bd152b75 100644 --- a/mm/page_counter.c +++ b/mm/page_counter.c @@ -275,6 +275,7 @@ int page_counter_memparse(const char *buf, const char *max, } +#ifdef CONFIG_MEMCG /* * This function calculates an individual page counter's effective * protection which is derived from its own memory.min/low, its @@ -446,3 +447,4 @@ void page_counter_calculate_protection(struct page_counter *root, atomic_long_read(&parent->children_low_usage), recursive_protection)); } +#endif /* CONFIG_MEMCG */ |