Re: [PATCH] 2.6.14-rc3: wider use of for_each_cpu_mask() in arch/ia64

From: Robin Holt <holt_at_sgi.com>
Date: 2005-10-10 21:37:19
On Sat, Oct 08, 2005 at 10:43:31AM -0700, hawkes@sgi.com wrote:
> In arch/ia64 change the explicit use of for-loops and NR_CPUS into the
> general for_each_cpu_mask() construct.  This widens the scope of
> potential future optimizations of for_each_cpu_mask().
> 
> Signed-off-by: John Hawkes <hawkes@sgi.com>
> 
> Index: linux/arch/ia64/mm/tlb.c
> ===================================================================
> --- linux.orig/arch/ia64/mm/tlb.c	2005-08-28 16:41:01.000000000 -0700
> +++ linux/arch/ia64/mm/tlb.c	2005-10-07 14:30:11.000000000 -0700
> @@ -77,9 +77,10 @@
>  	/* can't call flush_tlb_all() here because of race condition with O(1) scheduler [EF] */
>  	{
>  		int cpu = get_cpu(); /* prevent preemption/migration */
> -		for (i = 0; i < NR_CPUS; ++i)
> -			if (cpu_online(i) && (i != cpu))
> +		for_each_cpu_mask(i, cpu_online_map) {

What about for_each_online_cpu?  Reads a little more cleanly.  Accomplishes
the same thing.

Robin
-
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Received on Mon Oct 10 21:38:07 2005

This archive was generated by hypermail 2.1.8 : 2005-10-10 21:38:16 EST