Skip to content

Commit c1e16aa

Browse files
KAGA-KOKOLinus Torvalds
authored and
Linus Torvalds
committed
[PATCH] Fix posix-cpu-timer breakage caused by stale p->last_ran value
Problem description at: http://bugzilla.kernel.org/show_bug.cgi?id=8048 Commit b18ec80 [PATCH] sched: improve migration accuracy optimized the scheduler time calculations, but broke posix-cpu-timers. The problem is that the p->last_ran value is not updated after a context switch. So a subsequent call to current_sched_time() calculates with a stale p->last_ran value, i.e. accounts the full time, which the task was scheduled away. Signed-off-by: Thomas Gleixner <[email protected]> Acked-by: Ingo Molnar <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent ae73fc0 commit c1e16aa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/sched.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3566,7 +3566,7 @@ asmlinkage void __sched schedule(void)
35663566

35673567
sched_info_switch(prev, next);
35683568
if (likely(prev != next)) {
3569-
next->timestamp = now;
3569+
next->timestamp = next->last_ran = now;
35703570
rq->nr_switches++;
35713571
rq->curr = next;
35723572
++*switch_count;

0 commit comments

Comments
 (0)