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] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 12 Sep 2008 14:33:22 +1000
From:	Rusty Russell <rusty@...tcorp.com.au>
To:	Mike Travis <travis@....com>
Cc:	Ingo Molnar <mingo@...e.hu>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Thomas Gleixner <tglx@...utronix.de>,
	"H. Peter Anvin" <hpa@...or.com>, Jack Steiner <steiner@....com>,
	Jes Sorensen <jes@....com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/3] cpumask: add for_each_online_cpu_mask_nr function

On Wednesday 10 September 2008 01:50:14 Mike Travis wrote:
>   * Add for_each_online_cpu_mask_nr() function to eliminate need for
>     a common use of a temporary cpumask_t variable.  When the following
>     procedure is being used:
>
>     funcproto(cpumask_t *mask, ...)
>     {
> 	cpumask_t temp;
>
> 	cpus_and(temp, *mask, cpu_online_map);
> 	for_each_cpu_mask_nr(cpu, temp)
> 		...
>
>     If then becomes:
>
>     funcproto(cpumask_t *mask, ...)
>     {
> 	for_each_online_cpu_mask_nr(cpu, *mask)
> 		...
>
>   * Note the generic __next_cpu_and (and __next_cpu_and_nr) functions
>     allowing AND'ing with any cpumask_t variable, not just the
> cpu_online_map.

Good idea!  But I really dislike the _nr versions (too many names!).  Do we 
really need them, since by definition cpus after nr_cpu_ids are never 
online...

(And we should initialize nr_cpu_ids to NR_CPUS so even early boot works, if 
we don't already...).

Cheers,
Rusty.
--
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