]> git.ipfire.org Git - thirdparty/linux.git/commit
cpuset: separate tmpmasks and cpuset allocation logic
authorChen Ridong <chenridong@huawei.com>
Mon, 25 Aug 2025 03:23:51 +0000 (03:23 +0000)
committerTejun Heo <tj@kernel.org>
Mon, 25 Aug 2025 18:19:57 +0000 (08:19 -1000)
commitada00d51622822b151e1b8cc2bc85a20d2191349
treedba0a8a0dfbd41ac5864a07aa214f27af49be89a
parent5806b3d05165568eee665399d3c04349c151a0b9
cpuset: separate tmpmasks and cpuset allocation logic

The original alloc_cpumasks() served dual purposes: allocating cpumasks
for both temporary masks (tmpmasks) and cpuset structures. This patch:

1. Decouples these allocation paths for better code clarity
2. Introduces dedicated alloc_tmpmasks() and dup_or_alloc_cpuset()
   functions
3. Maintains symmetric pairing:
   - alloc_tmpmasks() ↔ free_tmpmasks()
   - dup_or_alloc_cpuset() ↔ free_cpuset()

Signed-off-by: Chen Ridong <chenridong@huawei.com>
Reviewed-by: Waiman Long <longman@redhat.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
kernel/cgroup/cpuset.c