]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
cpuset: remove redundant CS_ONLINE flag
authorChen Ridong <chenridong@huawei.com>
Wed, 13 Aug 2025 08:29:01 +0000 (08:29 +0000)
committerTejun Heo <tj@kernel.org>
Wed, 13 Aug 2025 18:14:20 +0000 (08:14 -1000)
commit4c70fb2624ab1588faa58dcd407d4c61d64b288d
tree8e7f07a5ee8568d13ee5bfa15b1d4e72ffe0fb8c
parent8a013ec9cb7af9921656c0e78c73510c9e4a0cc1
cpuset: remove redundant CS_ONLINE flag

The CS_ONLINE flag was introduced prior to the CSS_ONLINE flag in the
cpuset subsystem. Currently, the flag setting sequence is as follows:

1. cpuset_css_online() sets CS_ONLINE
2. css->flags gets CSS_ONLINE set
...
3. cgroup->kill_css sets CSS_DYING
4. cpuset_css_offline() clears CS_ONLINE
5. css->flags clears CSS_ONLINE

The is_cpuset_online() check currently occurs between steps 1 and 3.
However, it would be equally safe to perform this check between steps 2
and 3, as CSS_ONLINE provides the same synchronization guarantee as
CS_ONLINE.

Since CS_ONLINE is redundant with CSS_ONLINE and provides no additional
synchronization benefits, we can safely remove it to simplify the code.

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