Re: [PATCH 1/5] 2.6.0 fix preempt ctx switch accounting

From: Nick Piggin
Date: Sat Dec 20 2003 - 18:18:59 EST




Linus Torvalds wrote:

On Sat, 20 Dec 2003, Ingo Molnar wrote:


i'd prefer the much simpler patch below. This also keeps the kernel
preemption logic isolated instead of mixing it into the normal path.



That patch still gets several cases wrong: we don't update any counters at
all for the case where we were TASK_INTERRUPTIBLE and we got made
TASK_RUNNING because of having a signal pending.

Also, we shouldn't update the context switch counter just because we entered the scheduler. If we don't actually end up switching to anything else, it shouldn't count as a context switch.

So how about something like this?

Totally untested. Comments?



Thats about as good as you'll get it, I think.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/