On Tuesday 25 September 2007 17:52:00 Ralf Baechle wrote:
> When debugging a kernel using a logic analyzer (!) a colleague recently
> noticed that because the <linux/cpumasks.h> functions are based on the
> generic bitops which support arbitrary size bitfields we had a relativly
> high overhead resulting from this.  Here's the chainsaw edition of a patch
> to optimize this for CONFIG_NR_CPUS <= BITS_PER_LONG.  Comments?

The right thing to test is not CONFIG_NR_CPUS, but just
do __builtin_constant_p(x) && (x) <= BITS_PER_LONG ? fast case : external call
in find_*_bit()

x86-64 has done this already for some time. But one issue is that 
that the cpumask walk functions currently do (n = find_*_bit()) >= maxbit ? 
maxbit : n
which also creates more overhead because some architectures get this
wrong (including x86-64 I must admit) 

-Andi

-
To unsubscribe from this list: send the line "unsubscribe linux-arch" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to