public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Mike Travis <travis@sgi.com>
Cc: 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 16:08:13 -0700	[thread overview]
Message-ID: <20081016160813.b7ee423f.akpm@linux-foundation.org> (raw)
In-Reply-To: <48F7C69E.3060509@sgi.com>

On Thu, 16 Oct 2008 15:56:30 -0700
Mike Travis <travis@sgi.com> wrote:

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

OK, thanks.  I was foggily looking for max_possible_cpus(), to match
num_online_cpus(), num_possible_cpus(), num_present_cpus().  Silly me.


      reply	other threads:[~2008-10-16 23:08 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
2008-10-16 23:08     ` Andrew Morton [this message]

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=20081016160813.b7ee423f.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=adobriyan@gmail.com \
    --cc=laijs@cn.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=menage@google.com \
    --cc=pj@sgi.com \
    --cc=travis@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