OSDN Git Service

cgroup/cpuset: Improve temporary cpumasks handling
authorWaiman Long <longman@redhat.com>
Tue, 27 Jun 2023 14:35:02 +0000 (10:35 -0400)
committerTejun Heo <tj@kernel.org>
Mon, 10 Jul 2023 21:01:03 +0000 (11:01 -1000)
commit99fe36ba6fc16aa0962bc1f41ebcdec696203889
tree1812ad65554d3291c9399c87c0674cb009e83c70
parenta86ce68078b200a5dcc263da01154ee926c25188
cgroup/cpuset: Improve temporary cpumasks handling

The limitation that update_parent_subparts_cpumask() can only use
addmask & delmask in the given tmp cpumasks is fragile and may lead to
unexpected error.

Fix this problem by allocating/freeing a struct tmpmasks in
update_cpumask() to avoid reusing the cpumasks in trial_cs.

With this change, we can move the update_tasks_cpumask() for the
parent and update_sibling_cpumasks() for the sibling to inside
update_parent_subparts_cpumask().

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