BACKPORT: FROMLIST: mm, memcg: inline mem_cgroup_{charge/uncharge} to improve disabled memcg config
Inline mem_cgroup_{charge/uncharge} and mem_cgroup_uncharge_list functions
functions to perform mem_cgroup_disabled static key check inline before
calling the main body of the function. This minimizes the memcg overhead
in the pagefault and exit_mmap paths when memcgs are disabled using
cgroup_disable=memory command-line option.
This change results in ~0.4% overhead reduction when running PFT test [1]
comparing {CONFIG_MEMCG=n} against {CONFIG_MEMCG=y, cgroup_disable=memory}
configuration on an 8-core ARM64 Android device.
[1] https://lkml.org/lkml/2006/8/29/294
also used in mmtests suite
Signed-off-by:
Suren Baghdasaryan <surenb@google.com>
Reviewed-by:
Shakeel Butt <shakeelb@google.com>
Reviewed-by:
Muchun Song <songmuchun@bytedance.com>
Acked-by:
Michal Hocko <mhocko@suse.com>
Acked-by:
Johannes Weiner <hannes@cmpxchg.org>
Conflicts:
include/linux/memcontrol.h
mm/memcontrol.c
1. Trivial merge conflicts in memcontrol.h
2. Did not need to rename __mem_cgroup_charge into memcg_charge as in the
upstream version since in 5.10 __mem_cgroup_charge did not exist
Link: https://lore.kernel.org/patchwork/patch/1458907/
Bug: 191223209
Signed-off-by:
Suren Baghdasaryan <surenb@google.com>
Change-Id: I9aad72aeabec2fe01f7218d629ec545c47b5d2c3
Loading
Please sign in to comment