Skip to content

Commit 93db2ae

Browse files
committed
cgroup/cpuset: drop useless cpumask_empty() in compute_effective_exclusive_cpumask()
JIRA: https://issues.redhat.com/browse/RHEL-107751 commit 225c036 Author: Yury Norov <yury.norov@gmail.com> Date: Thu, 8 May 2025 15:32:06 -0400 cgroup/cpuset: drop useless cpumask_empty() in compute_effective_exclusive_cpumask() Empty cpumasks can't intersect with any others. Therefore, testing for non-emptyness is useless. Signed-off-by: Yury Norov <yury.norov@gmail.com> Reviewed-by: Waiman Long <longman@redhat.com> Signed-off-by: Tejun Heo <tj@kernel.org> Signed-off-by: Waiman Long <longman@redhat.com>
1 parent afd05be commit 93db2ae

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

kernel/cgroup/cpuset.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1404,14 +1404,12 @@ static int compute_effective_exclusive_cpumask(struct cpuset *cs,
14041404
if (sibling == cs)
14051405
continue;
14061406

1407-
if (!cpumask_empty(sibling->exclusive_cpus) &&
1408-
cpumask_intersects(xcpus, sibling->exclusive_cpus)) {
1407+
if (cpumask_intersects(xcpus, sibling->exclusive_cpus)) {
14091408
cpumask_andnot(xcpus, xcpus, sibling->exclusive_cpus);
14101409
retval++;
14111410
continue;
14121411
}
1413-
if (!cpumask_empty(sibling->effective_xcpus) &&
1414-
cpumask_intersects(xcpus, sibling->effective_xcpus)) {
1412+
if (cpumask_intersects(xcpus, sibling->effective_xcpus)) {
14151413
cpumask_andnot(xcpus, xcpus, sibling->effective_xcpus);
14161414
retval++;
14171415
}

0 commit comments

Comments
 (0)