lkml.org 
[lkml]   [2002]   [Jul]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Linux 2.4.19-rc3 (hyperthreading)
On 20020730 Rik van Riel wrote:
> On Tue, 30 Jul 2002, Andrea Arcangeli wrote:
>
> > and the new one had a bug too :). Please merge the fix I posted to l-k
> > too thanks.
>
> Judging from the patch the code seems incredibly subtle and
> I'd be amazed if it doesn't break again every few weeks...
>

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;
}

-
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/

\
 
 \ /
  Last update: 2005-03-22 13:27    [W:0.262 / U:0.584 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site