Skip to content

Commit fc9cfd4

Browse files
committed
cgroup/cpuset: Remove the unnecessary css_get/put() in cpuset_partition_write()
JIRA: https://issues.redhat.com/browse/RHEL-107751 commit 87eba5b Author: Waiman Long <longman@redhat.com> Date: Wed, 6 Aug 2025 13:24:30 -0400 cgroup/cpuset: Remove the unnecessary css_get/put() in cpuset_partition_write() The css_get/put() calls in cpuset_partition_write() are unnecessary as an active reference of the kernfs node will be taken which will prevent its removal and guarantee the existence of the css. Only the online check is needed. Signed-off-by: Waiman Long <longman@redhat.com> Reviewed-by: Michal Koutný <mkoutny@suse.com> Signed-off-by: Tejun Heo <tj@kernel.org> Signed-off-by: Waiman Long <longman@redhat.com>
1 parent a465753 commit fc9cfd4

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

kernel/cgroup/cpuset.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3358,14 +3358,12 @@ static ssize_t cpuset_partition_write(struct kernfs_open_file *of, char *buf,
33583358
else
33593359
return -EINVAL;
33603360

3361-
css_get(&cs->css);
33623361
cpus_read_lock();
33633362
mutex_lock(&cpuset_mutex);
33643363
if (is_cpuset_online(cs))
33653364
retval = update_prstate(cs, val);
33663365
mutex_unlock(&cpuset_mutex);
33673366
cpus_read_unlock();
3368-
css_put(&cs->css);
33693367
return retval ?: nbytes;
33703368
}
33713369

0 commit comments

Comments
 (0)