Skip to contentSkip to conversation

Bug in for-each-cpu-akpm from incrementals

uml-devel Blaisorblade 2 participants 3 messages Jan 11, 2005 User-mode Linux (UML)

lore
Share & tools
lore
#0 lore raw

You think that for_each_cpu() only iterates over online CPU, while you should use for_each_online_cpu() for this purpose.

http://user-mode-linux.sourceforge.net/work/current/2.6/2.6.10-mm2/patches/for-each-cpu-akpm

Bye

Signature · 13 lines
Paolo Giarrusso, aka Blaisorblade
Linux registered user n. 292729
http://www.user-mode-linux.org/~blaisorblade


-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
User-mode-linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
#1 lore raw
Quoted 2 lines · [email protected] said:

You think that for_each_cpu() only iterates over online CPU, while you should use for_each_online_cpu() for this purpose.

Oops, correct.

Jeff

-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

#2 lore raw
In reply to Blaisorblade
Quoted 2 lines · [email protected] said:

You think that for_each_cpu() only iterates over online CPU, while you should use for_each_online_cpu() for this purpose.

Fixed in my tree, but there was method to my madness. I spotted this while reading the 2.6.10 patch, which has this:

@@ -207,9 +212,8 @@ int show_interrupts(struct seq_file *p,

if (i == 0) {
seq_printf(p, " ");
- for (j=0; j<NR_CPUS; j++)
- if (cpu_online(j))
- seq_printf(p, "CPU%d ",j);
+ for_each_cpu(j)
+ seq_printf(p, "CPU%d ",j);
seq_putc(p, '\n');
}

which would appear to be wrong as well.

Jeff

-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel