The patch titled Subject: mm-memcg-use-larger-batches-for-proactive-reclaim-v4 has been added to the -mm mm-unstable branch. Its filename is mm-memcg-use-larger-batches-for-proactive-reclaim-v4.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-memcg-use-larger-batches-for-proactive-reclaim-v4.patch This patch will later appear in the mm-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm 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 via the mm-everything branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there every 2-3 working days ------------------------------------------------------ From: "T.J. Mercier" <tjmercier@xxxxxxxxxx> Subject: mm-memcg-use-larger-batches-for-proactive-reclaim-v4 Date: Tue, 6 Feb 2024 17:52:50 +0000 Add additional info to commit message and move definition of batch_size per Michal Hocko. No functional changes. Link: https://lkml.kernel.org/r/20240206175251.3364296-1-tjmercier@xxxxxxxxxx Fixes: 0388536ac291 ("mm:vmscan: fix inaccurate reclaim during proactive re= claim") Signed-off-by: T.J. Mercier <tjmercier@xxxxxxxxxx> Reviewed-by: Yosry Ahmed <yosryahmed@xxxxxxxxxx> Acked-by: Johannes Weiner <hannes@xxxxxxxxxxx> Acked-by: Shakeel Butt <shakeelb@xxxxxxxxxx> Reviewed-by: Michal Koutny <mkoutny@xxxxxxxx> Cc: Efly Young <yangyifei03@xxxxxxxxxxxx> Cc: Michal Hocko <mhocko@xxxxxxxx> Cc: Muchun Song <songmuchun@xxxxxxxxxxxxx> Cc: Roman Gushchin <roman.gushchin@xxxxxxxxx> Cc: Yu Zhao <yuzhao@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/memcontrol.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) --- a/mm/memcontrol.c~mm-memcg-use-larger-batches-for-proactive-reclaim-v4 +++ a/mm/memcontrol.c @@ -6981,6 +6981,8 @@ static ssize_t memory_reclaim(struct ker reclaim_options = MEMCG_RECLAIM_MAY_SWAP | MEMCG_RECLAIM_PROACTIVE; while (nr_reclaimed < nr_to_reclaim) { + /* Will converge on zero, but reclaim enforces a minimum */ + unsigned long batch_size = (nr_to_reclaim - nr_reclaimed) / 4; unsigned long reclaimed; if (signal_pending(current)) @@ -6994,9 +6996,6 @@ static ssize_t memory_reclaim(struct ker if (!nr_retries) lru_add_drain_all(); - /* Will converge on zero, but reclaim enforces a minimum */ - unsigned long batch_size = (nr_to_reclaim - nr_reclaimed) / 4; - reclaimed = try_to_free_mem_cgroup_pages(memcg, batch_size, GFP_KERNEL, reclaim_options); _ Patches currently in -mm which might be from tjmercier@xxxxxxxxxx are mm-memcg-dont-periodically-flush-stats-when-memcg-is-disabled.patch mm-memcg-use-larger-batches-for-proactive-reclaim.patch mm-memcg-use-larger-batches-for-proactive-reclaim-v4.patch