mm: list_lru: disable memcg_aware when cgroup.memory is set to "nokmem"
authorHaifeng Xu <haifeng.xu@shopee.com>
Thu, 28 Dec 2023 06:27:14 +0000 (06:27 +0000)
committerAndrew Morton <akpm@linux-foundation.org>
Thu, 22 Feb 2024 00:00:02 +0000 (16:00 -0800)
commit0057db47f8785d1017a04ec1c9590e0af10eb220
tree4ff66294fddffd4337c54080a95a28b4982450c2
parent21fff064a26dc93d7ff24e36f35197fec809beee
mm: list_lru: disable memcg_aware when cgroup.memory is set to "nokmem"

Actually, when using a boot time kernel option "cgroup.memory=nokmem", all
lru items are inserted to list_lru_node.  But for those users who invoke
list_lru_init_memcg() to initialize list_lru, list_lru_memcg_aware()
returns true.  And this brings unneeded operations related to memcg.

To make things more convenient, let's disable memcg_aware when
cgroup.memory is set to "nokmem".

Link: https://lkml.kernel.org/r/20231228062715.338672-1-haifeng.xu@shopee.com
Signed-off-by: Haifeng Xu <haifeng.xu@shopee.com>
Acked-by: Roman Gushchin <roman.gushchin@linux.dev>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Shakeel Butt <shakeelb@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/list_lru.c