@@ -186,34 +186,6 @@ static struct cpuset top_cpuset = {
186
186
.remote_sibling = LIST_HEAD_INIT (top_cpuset .remote_sibling ),
187
187
};
188
188
189
- /**
190
- * cpuset_for_each_child - traverse online children of a cpuset
191
- * @child_cs: loop cursor pointing to the current child
192
- * @pos_css: used for iteration
193
- * @parent_cs: target cpuset to walk children of
194
- *
195
- * Walk @child_cs through the online children of @parent_cs. Must be used
196
- * with RCU read locked.
197
- */
198
- #define cpuset_for_each_child (child_cs , pos_css , parent_cs ) \
199
- css_for_each_child((pos_css), &(parent_cs)->css) \
200
- if (is_cpuset_online(((child_cs) = css_cs((pos_css)))))
201
-
202
- /**
203
- * cpuset_for_each_descendant_pre - pre-order walk of a cpuset's descendants
204
- * @des_cs: loop cursor pointing to the current descendant
205
- * @pos_css: used for iteration
206
- * @root_cs: target cpuset to walk ancestor of
207
- *
208
- * Walk @des_cs through the online descendants of @root_cs. Must be used
209
- * with RCU read locked. The caller may modify @pos_css by calling
210
- * css_rightmost_descendant() to skip subtree. @root_cs is included in the
211
- * iteration and the first node to be visited.
212
- */
213
- #define cpuset_for_each_descendant_pre (des_cs , pos_css , root_cs ) \
214
- css_for_each_descendant_pre((pos_css), &(root_cs)->css) \
215
- if (is_cpuset_online(((des_cs) = css_cs((pos_css)))))
216
-
217
189
/*
218
190
* There are two global locks guarding cpuset structures - cpuset_mutex and
219
191
* callback_lock. We also require taking task_lock() when dereferencing a
@@ -409,22 +381,6 @@ static void guarantee_online_mems(struct cpuset *cs, nodemask_t *pmask)
409
381
nodes_and (* pmask , cs -> effective_mems , node_states [N_MEMORY ]);
410
382
}
411
383
412
- /*
413
- * is_cpuset_subset(p, q) - Is cpuset p a subset of cpuset q?
414
- *
415
- * One cpuset is a subset of another if all its allowed CPUs and
416
- * Memory Nodes are a subset of the other, and its exclusive flags
417
- * are only set if the other's are set. Call holding cpuset_mutex.
418
- */
419
-
420
- static int is_cpuset_subset (const struct cpuset * p , const struct cpuset * q )
421
- {
422
- return cpumask_subset (p -> cpus_allowed , q -> cpus_allowed ) &&
423
- nodes_subset (p -> mems_allowed , q -> mems_allowed ) &&
424
- is_cpu_exclusive (p ) <= is_cpu_exclusive (q ) &&
425
- is_mem_exclusive (p ) <= is_mem_exclusive (q );
426
- }
427
-
428
384
/**
429
385
* alloc_cpumasks - allocate three cpumasks for cpuset
430
386
* @cs: the cpuset that have cpumasks to be allocated.
@@ -555,35 +511,6 @@ static inline bool cpusets_are_exclusive(struct cpuset *cs1, struct cpuset *cs2)
555
511
return true;
556
512
}
557
513
558
- /*
559
- * validate_change_legacy() - Validate conditions specific to legacy (v1)
560
- * behavior.
561
- */
562
- static int validate_change_legacy (struct cpuset * cur , struct cpuset * trial )
563
- {
564
- struct cgroup_subsys_state * css ;
565
- struct cpuset * c , * par ;
566
- int ret ;
567
-
568
- WARN_ON_ONCE (!rcu_read_lock_held ());
569
-
570
- /* Each of our child cpusets must be a subset of us */
571
- ret = - EBUSY ;
572
- cpuset_for_each_child (c , css , cur )
573
- if (!is_cpuset_subset (c , trial ))
574
- goto out ;
575
-
576
- /* On legacy hierarchy, we must be a subset of our parent cpuset. */
577
- ret = - EACCES ;
578
- par = parent_cs (cur );
579
- if (par && !is_cpuset_subset (trial , par ))
580
- goto out ;
581
-
582
- ret = 0 ;
583
- out :
584
- return ret ;
585
- }
586
-
587
514
/*
588
515
* validate_change() - Used to validate that any proposed cpuset change
589
516
* follows the structural rules for cpusets.
0 commit comments