lkml.org 
[lkml]   [2003]   [Mar]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: cpu-2.5.64-1
Date
On Sun, 16 Mar 2003 02:10:55 -0800, 
William Lee Irwin III <wli@holomorphy.com> wrote:
>On Sun, Mar 16, 2003 at 08:19:31PM +1100, Keith Owens wrote:
>> Good, it lets us optimize for 1/32/64/lots of cpus. NR_CPUS > 8 *
>> sizeof(unsigned long) is the interesting case, it needs arrays.
>
>Hmm. It shouldn't make a difference with respect to optimizing them.
>My API passes transparently by reference:
>#define cpu_isset(cpu, map) test_bit(cpu, (map).mask)

Some of the 64 bit archs implement test_bit() as taking int * instead
of long *. That generates unoptimized code for the case of NR_CPUS <
64.

#if NR_CPUS < 64
#define cpu_isset(cpu, map) (map.mask & (1UL << (cpu)))
...

generates better code on those architectures. Yet another special case :(

-
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:34    [W:0.052 / U:1.148 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site