The patch titled Subject: mm: memcontrol: drain memcg stock on force_empty has been added to the -mm tree. Its filename is mm-memcontrol-drain-memcg-stock-on-force_empty.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/mm-memcontrol-drain-memcg-stock-on-force_empty.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/mm-memcontrol-drain-memcg-stock-on-force_empty.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: Junaid Shahid <junaids@xxxxxxxxxx> Subject: mm: memcontrol: drain memcg stock on force_empty The per-cpu memcg stock can retain a charge of upto 32 pages. On a machine with large number of cpus, this can amount to a decent amount of memory. Additionally force_empty interface might be triggering unneeded memcg reclaims. Link: http://lkml.kernel.org/r/20180507201651.165879-1-shakeelb@xxxxxxxxxx Signed-off-by: Junaid Shahid <junaids@xxxxxxxxxx> Signed-off-by: Shakeel Butt <shakeelb@xxxxxxxxxx> Cc: Michal Hocko <mhocko@xxxxxxxxxx> Cc: Greg Thelen <gthelen@xxxxxxxxxx> Cc: Johannes Weiner <hannes@xxxxxxxxxxx> Cc: Vladimir Davydov <vdavydov.dev@xxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/memcontrol.c | 3 +++ 1 file changed, 3 insertions(+) diff -puN mm/memcontrol.c~mm-memcontrol-drain-memcg-stock-on-force_empty mm/memcontrol.c --- a/mm/memcontrol.c~mm-memcontrol-drain-memcg-stock-on-force_empty +++ a/mm/memcontrol.c @@ -2615,6 +2615,9 @@ static int mem_cgroup_force_empty(struct /* we call try-to-free pages for make this cgroup empty */ lru_add_drain_all(); + + drain_all_stock(memcg); + /* try to free all pages in this cgroup */ while (nr_retries && page_counter_read(&memcg->memory)) { int progress; _ Patches currently in -mm which might be from junaids@xxxxxxxxxx are mm-memcontrol-drain-memcg-stock-on-force_empty.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html