sched_stats.h says that __sched_info_switch is "called when prev != next" in the comment. sched.c should therefore do that, see the patch below: --- sched.c 2008-04-17 03:49:44.000000000 +0100 +++ sched.c 2008-04-24 14:39:36.000000000 +0100 @@ -3944,9 +3944,9 @@ prev->sched_class->put_prev_task(rq, prev); next = pick_next_task(rq, prev); - sched_info_switch(prev, next); - if (likely(prev != next)) { + sched_info_switch(prev, next); + rq->nr_switches++; rq->curr = next; ++*switch_count;
* bugme-daemon@bugzilla.kernel.org <bugme-daemon@bugzilla.kernel.org> wrote: > --- sched.c 2008-04-17 03:49:44.000000000 +0100 > +++ sched.c 2008-04-24 14:39:36.000000000 +0100 fair enough - please send the patch to lkml.org (and Cc: me if possible), thanks. Ingo
fixed upstream by: | commit 673a90a1e05c8127886f7659d1a457169378371f | Author: David Simner <djs203@srcf.ucam.org> | Date: Tue Apr 29 10:08:59 2008 +0100 | | sched: fix sched_info_switch not being called according to documentation