public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cpuset: a bit cleanup for scan_for_empty_cpusets()
@ 2008-07-28  2:47 Li Zefan
  2008-07-28  4:25 ` Paul Jackson
  0 siblings, 1 reply; 2+ messages in thread
From: Li Zefan @ 2008-07-28  2:47 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Paul Jackson, Paul Menage, LKML

clean up hierarchy traversal code

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
---
 kernel/cpuset.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/kernel/cpuset.c b/kernel/cpuset.c
index 91cf85b..3624dc0 100644
--- a/kernel/cpuset.c
+++ b/kernel/cpuset.c
@@ -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) &&
-- 
1.5.4.rc3

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] cpuset: a bit cleanup for scan_for_empty_cpusets()
  2008-07-28  2:47 [PATCH] cpuset: a bit cleanup for scan_for_empty_cpusets() Li Zefan
@ 2008-07-28  4:25 ` Paul Jackson
  0 siblings, 0 replies; 2+ messages in thread
From: Paul Jackson @ 2008-07-28  4:25 UTC (permalink / raw)
  To: akpm, Cliff Wickman; +Cc: menage, linux-kernel, Li Zefan

Andrew - could you add the following CC to this patch:

	Cc: Cliff Wickman <cpw@sgi.com>

Thanks.

-- 
                  I won't rest till it's the best ...
                  Programmer, Linux Scalability
                  Paul Jackson <pj@sgi.com> 1.940.382.4214

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-07-28  4:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-28  2:47 [PATCH] cpuset: a bit cleanup for scan_for_empty_cpusets() Li Zefan
2008-07-28  4:25 ` Paul Jackson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox