Messages in this thread Patch in this message | | | From | hawkes@sgi ... | Date | Thu, 13 Apr 2006 16:11:35 -0700 | Subject | [PATCH] nfs_show_stats: for_each_possible_cpu(), not NR_CPUS |
| |
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); - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |