Skip to content

Commit baddaeb

Browse files
committed
cgroup/cpuset: remove fetch_xcpus
jira NONE_AUTOMATION Rebuild_History Non-Buildable kernel-5.14.0-570.17.1.el9_6 commit-author Chen Ridong <[email protected]> commit 9414f68 Both fetch_xcpus and user_xcpus functions are used to retrieve the value of exclusive_cpus. If exclusive_cpus is not set, cpus_allowed is the implicit value used as exclusive in a local partition. I can not imagine a scenario where effective_xcpus is not empty when exclusive_cpus is empty. Therefore, I suggest removing the fetch_xcpus function. Signed-off-by: Chen Ridong <[email protected]> Reviewed-by: Waiman Long <[email protected]> Signed-off-by: Tejun Heo <[email protected]> (cherry picked from commit 9414f68) Signed-off-by: Jonathan Maple <[email protected]>
1 parent 4930690 commit baddaeb

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

kernel/cgroup/cpuset.c

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -751,22 +751,15 @@ static inline bool xcpus_empty(struct cpuset *cs)
751751
cpumask_empty(cs->exclusive_cpus);
752752
}
753753

754-
static inline struct cpumask *fetch_xcpus(struct cpuset *cs)
755-
{
756-
return !cpumask_empty(cs->exclusive_cpus) ? cs->exclusive_cpus :
757-
cpumask_empty(cs->effective_xcpus) ? cs->cpus_allowed
758-
: cs->effective_xcpus;
759-
}
760-
761754
/*
762755
* cpusets_are_exclusive() - check if two cpusets are exclusive
763756
*
764757
* Return true if exclusive, false if not
765758
*/
766759
static inline bool cpusets_are_exclusive(struct cpuset *cs1, struct cpuset *cs2)
767760
{
768-
struct cpumask *xcpus1 = fetch_xcpus(cs1);
769-
struct cpumask *xcpus2 = fetch_xcpus(cs2);
761+
struct cpumask *xcpus1 = user_xcpus(cs1);
762+
struct cpumask *xcpus2 = user_xcpus(cs2);
770763

771764
if (cpumask_intersects(xcpus1, xcpus2))
772765
return false;
@@ -2563,7 +2556,7 @@ static int update_cpumask(struct cpuset *cs, struct cpuset *trialcs,
25632556
invalidate = true;
25642557
rcu_read_lock();
25652558
cpuset_for_each_child(cp, css, parent) {
2566-
struct cpumask *xcpus = fetch_xcpus(trialcs);
2559+
struct cpumask *xcpus = user_xcpus(trialcs);
25672560

25682561
if (is_partition_valid(cp) &&
25692562
cpumask_intersects(xcpus, cp->effective_xcpus)) {

0 commit comments

Comments
 (0)