[PATCH] nfs_show_stats: for_each_possible_cpu(), not NR_CPUS

From: hawkes
Date: Thu Apr 13 2006 - 19:13:54 EST


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@xxxxxxx>

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);

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/