Re: Linux 2.4.19-rc3 (hyperthreading)

From: Andrea Arcangeli (andrea@suse.de)
Date: Mon Jul 29 2002 - 19:32:48 EST


On Tue, Jul 30, 2002 at 02:09:12AM +0200, J.A. Magallon wrote:
> How about this version (gcc-3.2 generates the same amount of assembler):
>
> int find(int this_cpu)
> {
> int i;
>
> for ( i = (this_cpu+1)%smp_num_cpus;
> i != this_cpu;
> i = (i+1)%smp_num_cpus )
> {
> int physical = cpu_logical_map(i);
> int sibling = cpu_sibling_map[physical];
>
> if (idle_cpu(physical) && idle_cpu(sibling))
> return physical;
> }
> return -1;
> }

I also find the above a bit more readable, I'll rediff once more time
then.

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



This archive was generated by hypermail 2b29 : Tue Jul 30 2002 - 14:00:34 EST