login
Header Space

 
 

Re: [PATCH] x86: Change x86 to use generic find_next_bit

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Ingo Molnar <mingo@...>
Cc: Alexander van Heukelum <heukelum@...>, Thomas Gleixner <tglx@...>, H. Peter Anvin <hpa@...>, LKML <linux-kernel@...>, <heukelum@...>
Date: Sunday, March 9, 2008 - 5:03 pm

Ingo Molnar <mingo@elte.hu> writes:

~14 cycles on K8 for memory, but if you stay in a register it is 8 cycles


I had a patchkit some time ago to special case the max_bit <= 63 case
and always use directly inlined stream lined single instruction
assembler for that. There was still some issue and I dropped it then,
but doing something like that makes still sense. Even if the BSF 
is slightly slower than the open coded version just getting rid
of the CALL will make it a win and it could be also kept in a register
so you get the 8 cycle variant (for which I doubt you can do 
it faster open coded) 

The result would be that a standard for_each_cpu () in a NR_CPUS <= 64
kernel wouldn't have any unnecessary calls.

In general the problem of walking cpu masks is quite different
from seaching ext2 bitmaps, so they likely should be special cased
and optimized for each.

-Andi

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] x86: Change x86 to use generic find_next_bit, Alexander van Heukelum, (Sun Mar 9, 4:01 pm)
Re: [PATCH] x86: Change x86 to use generic find_next_bit, Aneesh Kumar K.V, (Thu Mar 13, 8:44 am)
Re: [PATCH] x86: Change x86 to use generic find_next_bit, Alexander van Heukelum, (Thu Mar 13, 10:27 am)
Re: [PATCH] x86: Change x86 to use generic find_next_bit, Alexander van Heukelum, (Sun Mar 9, 4:31 pm)
[RFC/PATCH] x86: Optimize find_next_(zero_)bit for small con..., Alexander van Heukelum, (Mon Mar 10, 7:17 pm)
[PATCH] x86: Optimize find_next_(zero_)bit for small constan..., Alexander van Heukelum, (Tue Mar 11, 11:17 am)
[RFC] non-x86: Optimize find_next_(zero_)bit for small const..., Alexander van Heukelum, (Tue Mar 11, 11:22 am)
Re: [PATCH] x86: Change x86 to use generic find_next_bit, Alexander van Heukelum, (Sun Mar 9, 5:13 pm)
Re: [PATCH] x86: Change x86 to use generic find_next_bit, Andi Kleen, (Sun Mar 9, 5:03 pm)
speck-geostationary