From: hawkes@sgi.com
To: Andrew Morton <akpm@osdl.org>
Cc: hawkes@sgi.com, linux-kernel@vger.kernel.org
Subject: [PATCH] nfs_show_stats: for_each_possible_cpu(), not NR_CPUS
Date: Thu, 13 Apr 2006 16:11:35 -0700 [thread overview]
Message-ID: <20060413231135.3397.56412.sendpatchset@tomahawk.engr.sgi.com> (raw)
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);
reply other threads:[~2006-04-13 23:12 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20060413231135.3397.56412.sendpatchset@tomahawk.engr.sgi.com \
--to=hawkes@sgi.com \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®