* [PATCH] nfs_show_stats: for_each_possible_cpu(), not NR_CPUS
@ 2006-04-13 23:11 hawkes
0 siblings, 0 replies; only message in thread
From: hawkes @ 2006-04-13 23:11 UTC (permalink / raw)
To: Andrew Morton; +Cc: hawkes, linux-kernel
Convert a for-loop that explicitly references "NR_CPUS" into the potentially
more efficient for_each_possible_cpu() construct.
Signed-off-by: John Hawkes <hawkes@sgi.com>
Index: linux/fs/nfs/inode.c
===================================================================
--- linux.orig/fs/nfs/inode.c 2006-04-13 12:48:18.000000000 -0700
+++ linux/fs/nfs/inode.c 2006-04-13 15:49:23.000000000 -0700
@@ -700,12 +700,9 @@ static int nfs_show_stats(struct seq_fil
/*
* Display superblock I/O counters
*/
- for (cpu = 0; cpu < NR_CPUS; cpu++) {
+ for_each_possible_cpu(cpu) {
struct nfs_iostats *stats;
- if (!cpu_possible(cpu))
- continue;
-
preempt_disable();
stats = per_cpu_ptr(nfss->io_stats, cpu);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2006-04-13 23:12 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-04-13 23:11 [PATCH] nfs_show_stats: for_each_possible_cpu(), not NR_CPUS hawkes
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®