aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2006-03-25 06:08:10 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-25 11:23:00 -0500
commit96a9b4d31eba4722ba7aad2cc15118a7799f499f (patch)
treef96739e328e3e50b43122e551a36415f6e26a1e8 /lib
parent8630282070b4a52b12cfa514ba8558e2f3d56360 (diff)
[PATCH] cpumask: uninline any_online_cpu()
text data bss dec hex filename before: 3605597 1363528 363328 5332453 515de5 vmlinux after: 3605295 1363612 363200 5332107 515c8b vmlinux 218 bytes saved. Also, optimise any_online_cpu() out of existence on CONFIG_SMP=n. This function seems inefficient. Can't we simply AND the two masks, then use find_first_bit()? Cc: Paul Jackson <pj@sgi.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/cpumask.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/cpumask.c b/lib/cpumask.c
index ea25a034276..3a67dc5ada7 100644
--- a/lib/cpumask.c
+++ b/lib/cpumask.c
@@ -31,3 +31,15 @@ int highest_possible_processor_id(void)
31 return highest; 31 return highest;
32} 32}
33EXPORT_SYMBOL(highest_possible_processor_id); 33EXPORT_SYMBOL(highest_possible_processor_id);
34
35int __any_online_cpu(const cpumask_t *mask)
36{
37 int cpu;
38
39 for_each_cpu_mask(cpu, *mask) {
40 if (cpu_online(cpu))
41 break;
42 }
43 return cpu;
44}
45EXPORT_SYMBOL(__any_online_cpu);