Skip to contentSkip to conversation

nfs_show_stats: for_each_possible_cpu(), not NR_CPUS

PATCH New [email protected] 1 participant 1 message Apr 13, 2006 NFS client

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

fs/nfs/inode.c +1 -4
Index: linux/fs/nfs/inode.c
===================================================================
@@ -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);