sched: fix sched_info_switch not being called according to documentation
authorDavid Simner <djs203@srcf.ucam.org>
Tue, 29 Apr 2008 09:08:59 +0000 (10:08 +0100)
committerIngo Molnar <mingo@elte.hu>
Mon, 5 May 2008 21:56:18 +0000 (23:56 +0200)
http://bugzilla.kernel.org/show_bug.cgi?id=10545

sched_stats.h says that __sched_info_switch is "called when prev !=
next" in the comment.  sched.c should therefore do that.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
kernel/sched.c

index bee9cbe13c1548aec429b298f41f448d3f3266c6..3ac3d7af04a186990bf3f849c51863e26fbb6cac 100644 (file)
@@ -4662,9 +4662,9 @@ need_resched_nonpreemptible:
        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;