memcg: replace memcg ID idr with xarray
authorShakeel Butt <shakeel.butt@linux.dev>
Fri, 9 Aug 2024 17:26:18 +0000 (10:26 -0700)
committerAndrew Morton <akpm@linux-foundation.org>
Mon, 2 Sep 2024 03:26:05 +0000 (20:26 -0700)
commit07222371912c835d12b3541791d0516f50c7b45b
tree2ab6ff8611dde8eb72ffd9a8cf7d984c98a2b606
parent072cd213b75eb01fcf40eff898f8d5c008ce1457
memcg: replace memcg ID idr with xarray

At the moment memcg IDs are managed through IDR which requires external
synchronization mechanisms and makes the allocation code a bit awkward.
Let's switch to xarray and make the code simpler.

[shakeel.butt@linux.dev: fix error path in mem_cgroup_alloc(), per Dan]
Link: https://lkml.kernel.org/r/20240815155402.3630804-1-shakeel.butt@linux.dev
Link: https://lkml.kernel.org/r/20240809172618.2946790-1-shakeel.butt@linux.dev
Signed-off-by: Shakeel Butt <shakeel.butt@linux.dev>
Suggested-by: Matthew Wilcox <willy@infradead.org>
Reviewed-by: Roman Gushchin <roman.gushchin@linux.dev>
Reviewed-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Reviewed-by: Muchun Song <muchun.song@linux.dev>
Acked-by: Michal Hocko <mhocko@suse.com>
Cc: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/memcontrol.c