Re: cpu-2.5.64-1

Keith Owens (kaos@ocs.com.au)
Sun, 16 Mar 2003 22:12:24 +1100


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/