The patch titled Subject: memcg: replace memcg ID idr with xarray has been added to the -mm mm-unstable branch. Its filename is memcg-replace-memcg-id-idr-with-xarray-v2.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/memcg-replace-memcg-id-idr-with-xarray-v2.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: Shakeel Butt <shakeel.butt@xxxxxxxxx> Subject: memcg: replace memcg ID idr with xarray Date: Thu, 15 Aug 2024 08:54:02 -0700 fix error path in mem_cgroup_alloc(), per Dan Link: https://lkml.kernel.org/r/20240815155402.3630804-1-shakeel.butt@xxxxxxxxx Signed-off-by: Shakeel Butt <shakeel.butt@xxxxxxxxx> Suggested-by: Matthew Wilcox <willy@xxxxxxxxxxxxx> Reviewed-by: Roman Gushchin <roman.gushchin@xxxxxxxxx> Reviewed-by: Matthew Wilcox (Oracle) <willy@xxxxxxxxxxxxx> Acked-by: Johannes Weiner <hannes@xxxxxxxxxxx> Reviewed-by: Muchun Song <muchun.song@xxxxxxxxx> Acked-by: Michal Hocko <mhocko@xxxxxxxx> Cc: Dan Carpenter <dan.carpenter@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/memcontrol.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) --- a/mm/memcontrol.c~memcg-replace-memcg-id-idr-with-xarray-v2 +++ a/mm/memcontrol.c @@ -3496,16 +3496,17 @@ static struct mem_cgroup *mem_cgroup_all struct mem_cgroup *memcg; int node, cpu; int __maybe_unused i; - long error = -ENOMEM; + long error; memcg = kzalloc(struct_size(memcg, nodeinfo, nr_node_ids), GFP_KERNEL); if (!memcg) - return ERR_PTR(error); + return ERR_PTR(-ENOMEM); error = xa_alloc(&mem_cgroup_ids, &memcg->id.id, NULL, XA_LIMIT(1, MEM_CGROUP_ID_MAX), GFP_KERNEL); if (error) goto fail; + error = -ENOMEM; memcg->vmstats = kzalloc(sizeof(struct memcg_vmstats), GFP_KERNEL_ACCOUNT); _ Patches currently in -mm which might be from shakeel.butt@xxxxxxxxx are memcg-increase-the-valid-index-range-for-memcg-stats.patch memcg-replace-memcg-id-idr-with-xarray.patch memcg-replace-memcg-id-idr-with-xarray-v2.patch memcg-use-ratelimited-stats-flush-in-the-reclaim.patch