The patch titled Subject: mm/memcg: bail early from swap accounting if memcg disabled has been added to the -mm tree. Its filename is mm-memcg-bail-early-from-swap-accounting-if-memcg-disabled.patch This patch should soon appear at https://ozlabs.org/~akpm/mmots/broken-out/mm-memcg-bail-early-from-swap-accounting-if-memcg-disabled.patch and later at https://ozlabs.org/~akpm/mmotm/broken-out/mm-memcg-bail-early-from-swap-accounting-if-memcg-disabled.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Alex Shi <alex.shi@xxxxxxxxxxxxxxxxx> Subject: mm/memcg: bail early from swap accounting if memcg disabled Patch series "bail out early for memcg disable". These 2 patches are indepenedent from per memcg lru lock, and may encounter unexpected warning, so let's move out them from per memcg lru locking patchset. This patch (of 2): We could bail out early when memcg wasn't enabled. Link: https://lkml.kernel.org/r/1604283436-18880-1-git-send-email-alex.shi@xxxxxxxxxxxxxxxxx Link: https://lkml.kernel.org/r/1604283436-18880-2-git-send-email-alex.shi@xxxxxxxxxxxxxxxxx Signed-off-by: Alex Shi <alex.shi@xxxxxxxxxxxxxxxxx> Reviewed-by: Roman Gushchin <guro@xxxxxx> Acked-by: Michal Hocko <mhocko@xxxxxxxx> Acked-by: Hugh Dickins <hughd@xxxxxxxxxx> Acked-by: Johannes Weiner <hannes@xxxxxxxxxxx> Cc: Vladimir Davydov <vdavydov.dev@xxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/memcontrol.c | 6 ++++++ 1 file changed, 6 insertions(+) --- a/mm/memcontrol.c~mm-memcg-bail-early-from-swap-accounting-if-memcg-disabled +++ a/mm/memcontrol.c @@ -7157,6 +7157,9 @@ void mem_cgroup_swapout(struct page *pag VM_BUG_ON_PAGE(PageLRU(page), page); VM_BUG_ON_PAGE(page_count(page), page); + if (mem_cgroup_disabled()) + return; + if (cgroup_subsys_on_dfl(memory_cgrp_subsys)) return; @@ -7221,6 +7224,9 @@ int mem_cgroup_try_charge_swap(struct pa struct mem_cgroup *memcg; unsigned short oldid; + if (mem_cgroup_disabled()) + return 0; + if (!cgroup_subsys_on_dfl(memory_cgrp_subsys)) return 0; _ Patches currently in -mm which might be from alex.shi@xxxxxxxxxxxxxxxxx are mm-memcg-bail-early-from-swap-accounting-if-memcg-disabled.patch mm-memcg-warning-on-memcg-after-readahead-page-charged.patch