[PATCH] sched: fix scheduler for unsynched processor sched_clock
From: Nick Piggin <nickpiggin@yahoo.com.au>
Fine-tune the unsynched sched_clock handling.
Basically, you need to be careful about ensuring timestamps get correctly
adjusted when moving CPUs, and you *can't* look at your unadjusted
sched_clock() and a remote task's ->timestamp and try to come up with
anything meaningful.
I think this second problem will really hit hard in the activate_task path
on systems with unsynched sched_clock when you're waking up a remote task,
which happens very often. Andi, I thought some Opterons have unsynched
tscs? Maybe this is causing your unexplained bad interactivity?
Another problem is a fixup in pull_task. When adjusting ->timestamp from
one processor to another, you must use timestamp_last_tick for the local
processor too. Using sched_clock() will cause ->timestamp to creep
forward.
A final small fix is for sync wakeups. They were using __activate_task for
some reason, thus they don't get credited for sleeping at all AFAIKS.
And another thing, do we want to #ifdef timestamp_last_tick so it doesn't
show on UP?