sched: fix update_stats_enqueue() reniced codepath
authorIngo Molnar <mingo@elte.hu>
Thu, 9 Aug 2007 09:16:52 +0000 (11:16 +0200)
committerIngo Molnar <mingo@elte.hu>
Thu, 9 Aug 2007 09:16:52 +0000 (11:16 +0200)
the key has to be rescaled to /weight even if it has a positive value.

(this change only affects the scheduling of reniced tasks)

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

index b885b3c85bbad4d1ebe6e4520c31b29d6c3358fc..7a632c534ce5d82287db0a2d9074363c4ec9e7f6 100644 (file)
@@ -405,7 +405,8 @@ static void update_stats_enqueue(struct cfs_rq *cfs_rq, struct sched_entity *se)
                                        (WMULT_SHIFT - NICE_0_SHIFT);
                } else {
                        tmp = se->wait_runtime;
-                       key -= (tmp * se->load.weight) >> NICE_0_SHIFT;
+                       key -= (tmp * se->load.inv_weight) >>
+                                       (WMULT_SHIFT - NICE_0_SHIFT);
                }
        }