Re: [Bug 350] New: i386 context switch very slow compared to 2.4 due to wrmsr (performance)

Andi Kleen
2003-03-10T10:56:21Z

On Mon, Mar 10, 2003 at 04:07:36AM +0100, Linus Torvalds wrote:
> since you've been interested in the past, I thought I'd ask you to test
> the current context switch stuff. Andi cleaned up some FPU reload stuff
> (and I fixed a bug in it, tssk tssk Andi - you'd obviously not actually
> timed your cleanups), and I just committed and pushed out my "cache the

You mean the TIF->_TIF thing? Yes that was wrong in the first patch,
but fixed in the patches later. Unfortunately the patch still
has the problem pointed out by Manfred Spraul: if you're unlucky
it could destroy the _TIF_SIGPENDING set by another CPU with the
non atomic access. Really thread_info should have two flag words:
one that is truly local and can be accessed without LOCK and
one that can be changed at will by external users too.

After some discussion with him I think the right fix for now is to
move it it back to PF_USEDFPU into task_struct->flags.

Will submit a patch for that later after I was able to test it.

-Andi