]> git.hungrycats.org Git - linux/commit
[PATCH] sched: fix scheduler for unsynched processor sched_clock
authorAndrew Morton <akpm@osdl.org>
Sat, 15 May 2004 03:12:56 +0000 (20:12 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Sat, 15 May 2004 03:12:56 +0000 (20:12 -0700)
commit44069c37b6e110092b1836fc50c64374b4f5129e
treef39430a4db0afce4d38ed106dcd7b836dc9c67f7
parentb75125deebc5ff5fe96aba64ba11dad7ed320b2e
[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?
kernel/sched.c