# Re: \[External\] \[PATCH v3 1/3\] mm, memcg: add mem\_cgroup\_disabled checks in vmpressure and swap-related functions

- From: Muchun Song \<hidden\>
- Date: 2021-07-10 11:01:29 
- List: cgroups
- Page: https://ratatoskr.run/cgroups/2021/07/1438350
- Thread: https://ratatoskr.run/cgroups/2021/07/1437746/t.md

```text
On Sat, Jul 10, 2021 at 8:36 AM Suren Baghdasaryan [ref] wrote:
>
> Add mem_cgroup_disabled check in vmpressure, mem_cgroup_uncharge_swap and
> cgroup_throttle_swaprate functions. 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 ~2.1% overhead reduction when running PFT test
> comparing {CONFIG_MEMCG=n, CONFIG_MEMCG_SWAP=n} against {CONFIG_MEMCG=y,
> CONFIG_MEMCG_SWAP=y, cgroup_disable=memory} configuration on an 8-core
> ARM64 Android device.
>
> Signed-off-by: Suren Baghdasaryan <surenb@google.com>
> Reviewed-by: Shakeel Butt <redacted>
> Acked-by: Johannes Weiner <hannes@cmpxchg.org>

The changes are straightforward. LGTM.
Reviewed-by: Muchun Song <redacted>
```
