The patch titled Subject: mm-memcg-charge-memcg-percpu-memory-to-the-parent-cgroup-fix has been added to the -mm tree. Its filename is mm-memcg-charge-memcg-percpu-memory-to-the-parent-cgroup-fix.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/mm-memcg-charge-memcg-percpu-memory-to-the-parent-cgroup-fix.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/mm-memcg-charge-memcg-percpu-memory-to-the-parent-cgroup-fix.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: Roman Gushchin <guro@xxxxxx> Subject: mm-memcg-charge-memcg-percpu-memory-to-the-parent-cgroup-fix add WARN_ON_ONCE()s, per Johannes Link: http://lkml.kernel.org/r/20200811170611.GB1507044@xxxxxxxxxxxxxxxxxxxxxxxxxxx Cc: Dennis Zhou <dennis@xxxxxxxxxx> Cc: Shakeel Butt <shakeelb@xxxxxxxxxx> Cc: Johannes Weiner <hannes@xxxxxxxxxxx> Cc: Michal Hocko <mhocko@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/memcontrol.c | 6 ++++++ 1 file changed, 6 insertions(+) --- a/mm/memcontrol.c~mm-memcg-charge-memcg-percpu-memory-to-the-parent-cgroup-fix +++ a/mm/memcontrol.c @@ -5131,6 +5131,9 @@ static int alloc_mem_cgroup_per_node_inf if (!pn) return 1; + /* We charge the parent cgroup, never the current task */ + WARN_ON_ONCE(!current->active_memcg); + pn->lruvec_stat_local = alloc_percpu_gfp(struct lruvec_stat, GFP_KERNEL_ACCOUNT); if (!pn->lruvec_stat_local) { @@ -5213,6 +5216,9 @@ static struct mem_cgroup *mem_cgroup_all goto fail; } + /* We charge the parent cgroup, never the current task */ + WARN_ON_ONCE(!current->active_memcg); + memcg->vmstats_local = alloc_percpu_gfp(struct memcg_vmstats_percpu, GFP_KERNEL_ACCOUNT); if (!memcg->vmstats_local) _ Patches currently in -mm which might be from guro@xxxxxx are percpu-return-number-of-released-bytes-from-pcpu_free_area.patch mm-memcg-percpu-account-percpu-memory-to-memory-cgroups.patch mm-memcg-percpu-per-memcg-percpu-memory-statistics.patch mm-memcg-percpu-per-memcg-percpu-memory-statistics-v3.patch mm-memcg-charge-memcg-percpu-memory-to-the-parent-cgroup.patch mm-memcg-charge-memcg-percpu-memory-to-the-parent-cgroup-fix.patch kselftests-cgroup-add-perpcu-memory-accounting-test.patch mm-vmstat-fix-proc-sys-vm-stat_refresh-generating-false-warnings.patch mm-vmstat-fix-proc-sys-vm-stat_refresh-generating-false-warnings-fix.patch