Thread (2 messages) 2 messages, 2 authors, 2007-09-28

Re: Optimize cpumask functions for SMPs with < BITS_PER_LONG processors

From: Andi Kleen <hidden>
Date: 2007-09-28 17:34:16

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help