cpuset: a bit cleanup for scan_for_empty_cpusets()
PATCH 1/1 cpuset: a bit cleanup for scan_for_empty_cpusets()
clean up hierarchy traversal code
Signed-off-by Li Zefan <[email protected]>
--- kernel/cpuset.c | 7 ++----- 1 files changed, 2 insertions(+), 5 deletions(-)
kernel/cpuset.c +2 -5
@@ -1833,24 +1833,21 @@ static void remove_tasks_in_empty_cpuset(struct cpuset *cs)*/ static void scan_for_empty_cpusets (const struct cpuset *root) { +LIST_HEAD (queue);struct cpuset *cp;/* scans cpusets being updated */ struct cpuset *child;/* scans child cpusets of cp */ -struct list_head queue;struct cgroup *cont;nodemask_t oldmems; -INIT_LIST_HEAD (&queue); -list_add_tail ((struct list_head *)&root->stack_list, &queue);while (!list_empty (&queue)) { - cp = container_of(queue.next, struct cpuset, stack_list); + cp = list_first_entry(&queue, struct cpuset, stack_list);list_del (queue.next);list_for_each_entry (cont, &cp->css.cgroup->children, sibling) { child =cgroup_cs (cont);list_add_tail (&child->stack_list, &queue); } - cont = cp->css.cgroup;/* Continue past cpusets with all cpus, mems online */ if (cpus_subset(cp->cpus_allowed, cpu_online_map) &&
Signature · 1 line
1.5.4.rc3
Andrew - could you add the following CC to this patch:
Cc Cliff Wickman <[email protected]>
Thanks.
Signature · 3 lines
I won't rest till it's the best ...
Programmer, Linux Scalability
Paul Jackson <[email protected]> 1.940.382.4214