Re: [PATCH RT 00/02] SLOB optimizations

Eric Dumazet
2005-12-22T22:00:20Z

George Anzinger a écrit :
>
>
>> that's just the profiling interrupt hitting them. You should not
>> analyze irq-safe code with a non-NMI profiling interrupt.
>>
>> CLI/STI is extremely fast. (In fact in the -rt tree i'm using them
>> within mutexes instead of preempt_enable()/preempt_disable(), because
>> they are faster and generate less register side-effect.)
>>
> Hm... I rather thought that the cli would cause a rather large hit on
> the pipeline and certainly on OOE. Is your observation based on any
> particular instruction stream? Sti, on the otherhand should be fast...

Just to be exact, the 'cli' is coded as 3 instruction :

pushfq
popq (%rsp)
cli

and the 'sti' is coded as 2 instructions :
pushq (%rsp)
popfq

And 'popfq' seems to be expensive, at least on Opteron machines and if
oprofile is not completely wrong...

Eric