提交 70ab81c2 编写于 作者: L Linus Torvalds

posix cpu timers: fix timer ordering

Pointed out by Oleg Nesterov, who has been walking over the code
forwards and backwards.
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 b0917bd9
...@@ -576,17 +576,15 @@ static void arm_timer(struct k_itimer *timer, union cpu_time_count now) ...@@ -576,17 +576,15 @@ static void arm_timer(struct k_itimer *timer, union cpu_time_count now)
listpos = head; listpos = head;
if (CPUCLOCK_WHICH(timer->it_clock) == CPUCLOCK_SCHED) { if (CPUCLOCK_WHICH(timer->it_clock) == CPUCLOCK_SCHED) {
list_for_each_entry(next, head, entry) { list_for_each_entry(next, head, entry) {
if (next->expires.sched > nt->expires.sched) { if (next->expires.sched > nt->expires.sched)
listpos = &next->entry;
break; break;
} listpos = &next->entry;
} }
} else { } else {
list_for_each_entry(next, head, entry) { list_for_each_entry(next, head, entry) {
if (cputime_gt(next->expires.cpu, nt->expires.cpu)) { if (cputime_gt(next->expires.cpu, nt->expires.cpu))
listpos = &next->entry;
break; break;
} listpos = &next->entry;
} }
} }
list_add(&nt->entry, listpos); list_add(&nt->entry, listpos);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册