Bug 10545 - sched_info_switch not being called according to documentation
Summary: sched_info_switch not being called according to documentation
Status: RESOLVED CODE_FIX
Alias: None
Product: Process Management
Classification: Unclassified
Component: Scheduler (show other bugs)
Hardware: All Linux
: P1 low
Assignee: Ingo Molnar
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-04-24 05:35 UTC by David Simner
Modified: 2008-05-06 14:21 UTC (History)
1 user (show)

See Also:
Kernel Version: 2.6.25
Subsystem:
Regression: ---
Bisected commit-id:


Attachments

Description David Simner 2008-04-24 05:35:30 UTC
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;
Comment 1 Ingo Molnar 2008-04-28 11:33:49 UTC
* 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
Comment 2 Ingo Molnar 2008-05-06 23:37:54 UTC
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

Note You need to log in before you can comment on or make changes to this bug.