lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Thu, 16 Oct 2008 16:08:13 -0700
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Mike Travis <travis@....com>
Cc:	laijs@...fujitsu.com, adobriyan@...il.com, menage@...gle.com,
	pj@....com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/4] seq_file: Add seq_cpumask_list(),
 seq_nodemask_list()

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

> Andrew Morton wrote:
> > On Sun, 12 Oct 2008 17:29:25 +0800
> > Lai Jiangshan <laijs@...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.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ