From: Mike Travis <travis@sgi.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Lai Jiangshan <laijs@cn.fujitsu.com>,
adobriyan@gmail.com, menage@google.com, pj@sgi.com,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/4] seq_file: Add seq_cpumask_list(), seq_nodemask_list()
Date: Thu, 16 Oct 2008 15:56:30 -0700 [thread overview]
Message-ID: <48F7C69E.3060509@sgi.com> (raw)
In-Reply-To: <20081016125827.d72c52c8.akpm@linux-foundation.org>
Andrew Morton wrote:
> On Sun, 12 Oct 2008 17:29:25 +0800
> Lai Jiangshan <laijs@cn.fujitsu.com> wrote:
>
>> +static inline int seq_cpumask_list(struct seq_file *m, cpumask_t *mask)
>> +{
>> + return seq_bitmap_list(m, mask->bits, NR_CPUS);
>> +}
>
> Is it possible to avoid using NR_CPUS? In some situations it'd be much
> more efficient to use the runtime-determined max possible cpu index.
>
> But I don't immediately recall how to get at that number.
> num_possible_cpus() assumes that there are no holes in the CPU
> identifier list.
>
nr_cpu_ids represents the max index +1 of the possible cpus. (Usually the
same as num_possible_cpus() except a.) it doesn't need to do the cpus_weight()
op, and b.) *if* (a big if) the cpu indices are sparse, then they wouldn't
be the same values.)
Thanks,
Mike
next prev parent reply other threads:[~2008-10-16 22:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-12 9:29 [PATCH 2/4] seq_file: Add seq_cpumask_list(), seq_nodemask_list() Lai Jiangshan
2008-10-16 19:58 ` Andrew Morton
2008-10-16 22:56 ` Mike Travis [this message]
2008-10-16 23:08 ` Andrew Morton
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=48F7C69E.3060509@sgi.com \
--to=travis@sgi.com \
--cc=adobriyan@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=laijs@cn.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=menage@google.com \
--cc=pj@sgi.com \
/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