Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

[PATCH] Yet more posix-cpu-timer fixes

This just makes sure that a thread's expiry times can't get reset after
it clears them in do_exit.

This is what allowed us to re-introduce the stricter BUG_ON() check in
a362f463a6d316d14daed0f817e151835ce97ff7.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Roland McGrath and committed by
Linus Torvalds
72ab373a a362f463

+7 -4
+7 -4
kernel/posix-cpu-timers.c
··· 497 497 left = cputime_div(cputime_sub(expires.cpu, val.cpu), 498 498 nthreads); 499 499 do { 500 - if (!unlikely(t->exit_state)) { 500 + if (!unlikely(t->flags & PF_EXITING)) { 501 501 ticks = cputime_add(prof_ticks(t), left); 502 502 if (cputime_eq(t->it_prof_expires, 503 503 cputime_zero) || ··· 512 512 left = cputime_div(cputime_sub(expires.cpu, val.cpu), 513 513 nthreads); 514 514 do { 515 - if (!unlikely(t->exit_state)) { 515 + if (!unlikely(t->flags & PF_EXITING)) { 516 516 ticks = cputime_add(virt_ticks(t), left); 517 517 if (cputime_eq(t->it_virt_expires, 518 518 cputime_zero) || ··· 527 527 nsleft = expires.sched - val.sched; 528 528 do_div(nsleft, nthreads); 529 529 do { 530 - if (!unlikely(t->exit_state)) { 530 + if (!unlikely(t->flags & PF_EXITING)) { 531 531 ns = t->sched_time + nsleft; 532 532 if (t->it_sched_expires == 0 || 533 533 t->it_sched_expires > ns) { ··· 565 565 struct cpu_timer_list *const nt = &timer->it.cpu; 566 566 struct cpu_timer_list *next; 567 567 unsigned long i; 568 + 569 + if (CPUCLOCK_PERTHREAD(timer->it_clock) && (p->flags & PF_EXITING)) 570 + return; 568 571 569 572 head = (CPUCLOCK_PERTHREAD(timer->it_clock) ? 570 573 p->cpu_timers : p->signal->cpu_timers); ··· 1207 1204 1208 1205 do { 1209 1206 t = next_thread(t); 1210 - } while (unlikely(t->exit_state)); 1207 + } while (unlikely(t->flags & PF_EXITING)); 1211 1208 } while (t != tsk); 1212 1209 } 1213 1210 }