All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2.6.12-rc5-mm2] [sched] add allowed CPUs check into find_idlest_group()
@ 2005-06-05 17:36 M.Baris Demiray
  2005-06-06  1:44 ` Nick Piggin
  0 siblings, 1 reply; 5+ messages in thread
From: M.Baris Demiray @ 2005-06-05 17:36 UTC (permalink / raw)
  To: Nick Piggin; +Cc: linux-kernel, Andrew Morton

[-- Attachment #1: Type: text/plain, Size: 1744 bytes --]


Hello,
following patch adds check for allowed CPUs into
sched.c:find_idlest_group() -as told in comment line that had
removed-. But, I have several questions about that comment.

Firstly, I've understood it as "Check whether process p is allowed to
run on each CPU of to-be-found idlest group"; is that right?

If so, isn't it more appropriate to do check in find_idlest_cpu()?
Because, we're only interested in CPUs that are in idlest group
but doing a check in find_idlest_group() also checks for CPUs
that are not in idlest group (since we're traversing all the groups
in given domain). Checking this after finding the idlest group
(in find_idlest_cpu() with ordinary call order as in
sched_balance_self()) will save us from extra overhead.

Although I've questions in my mind, I'm sending a patch following
that comment. Any explanation and comment on patch will be
appreciated.

Regards.

Signed-off-by: M.Baris Demiray <baris@labristeknoloji.com>

--- linux-2.6.12-rc5-mm2/kernel/sched.c.orig	2005-06-05 
12:31:04.000000000 +0000
+++ linux-2.6.12-rc5-mm2/kernel/sched.c	2005-06-05 16:49:49.000000000 +0000
@@ -1040,7 +1040,12 @@
  		int i;

  		local_group = cpu_isset(this_cpu, group->cpumask);
-		/* XXX: put a cpus allowed check */
+
+		/* Check whether all CPUs in the group is allowed to run on */
+		for_each_cpu_mask(i, group->cpumask) {
+			if (!cpu_isset(i, p->cpus_allowed))
+				continue;
+		}

  		/* Tally up the load of all CPUs in the group */
  		avg_load = 0;


-- 
"You have to understand, most of these people are not ready to be
unplugged. And many of them are no inert, so hopelessly dependent
on the system, that they will fight to protect it."
                                                          Morpheus




[-- Attachment #2: baris.vcf --]
[-- Type: text/x-vcard, Size: 342 bytes --]

begin:vcard
fn:M.Baris Demiray
n:Demiray;M.Baris
org:Labris Teknoloji
adr:;;Teknokent Silikon Bina No:24 ODTU;Ankara;;06531;Turkey
email;internet:baris@labristeknoloji.com
title:Yazilim Gelistirme Uzmani
tel;work:+903122101490
tel;fax:+903122101492
x-mozilla-html:FALSE
url:http://www.labristeknoloji.com
version:2.1
end:vcard


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

end of thread, other threads:[~2005-06-06 10:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-06-05 17:36 [PATCH 2.6.12-rc5-mm2] [sched] add allowed CPUs check into find_idlest_group() M.Baris Demiray
2005-06-06  1:44 ` Nick Piggin
2005-06-06 11:13   ` M.Baris Demiray
2005-06-06 10:36     ` Nick Piggin
2005-06-06 13:59       ` M.Baris Demiray

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.