Skip to contentSkip to conversation

Fast path context switch - microoptimize FPU reload

PATCH Manfred Spraul 2 participants 2 messages Mar 9, 2003

lore
Share & tools
lore
#0 lore raw
Quoted 6 lines · Andi

We don't need the lock prefix to test our local thread flags state. Unfortunately test_thread_flag currently always uses test_bit which has a LOCK on SMP, but that's unnecessary. LOCK is costly on P4, so it's a good idea to avoid it.

No, LOCK is required: the TIF_ flags word is also used for signal delivery - writing without lock could corrupt state.

What about moving TIF_USEDFPU from the thread_info into task_struct->flags? This flag word is only accessed by "current", no special atomicity requirements.

--
Manfred

#1 lore raw
Quoted 3 lines · Manfred Spraul

What about moving TIF_USEDFPU from the thread_info into task_struct->flags? This flag word is only accessed by "current", no special atomicity requirements.

There is still a PF_USEDFPU defined there that can be used. I'll change it to using that.

But it would be a good idea to completely split the flags that are changed externally like signals from only process local bits.

Then we could avoid the wasteful LOCK prefixes for everything local.

-Andi