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.

Revert "remove false BUG_ON() from run_posix_cpu_timers()"

This reverts commit 3de463c7d9d58f8cf3395268230cb20a4c15bffa.

Roland has another patch that allows us to leave the BUG_ON() in place
by just making sure that the condition it tests for really is always
true.

That goes in next.

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

+26 -18
+8
kernel/exit.c
··· 825 825 826 826 tsk->flags |= PF_EXITING; 827 827 828 + /* 829 + * Make sure we don't try to process any timer firings 830 + * while we are already exiting. 831 + */ 832 + tsk->it_virt_expires = cputime_zero; 833 + tsk->it_prof_expires = cputime_zero; 834 + tsk->it_sched_expires = 0; 835 + 828 836 if (unlikely(in_atomic())) 829 837 printk(KERN_INFO "note: %s[%d] exited with preempt_count %d\n", 830 838 current->comm, current->pid,
+18 -18
kernel/posix-cpu-timers.c
··· 1293 1293 1294 1294 #undef UNEXPIRED 1295 1295 1296 + BUG_ON(tsk->exit_state); 1297 + 1296 1298 /* 1297 1299 * Double-check with locks held. 1298 1300 */ 1299 1301 read_lock(&tasklist_lock); 1300 - if (likely(tsk->signal != NULL)) { 1301 - spin_lock(&tsk->sighand->siglock); 1302 + spin_lock(&tsk->sighand->siglock); 1302 1303 1303 - /* 1304 - * Here we take off tsk->cpu_timers[N] and tsk->signal->cpu_timers[N] 1305 - * all the timers that are firing, and put them on the firing list. 1306 - */ 1307 - check_thread_timers(tsk, &firing); 1308 - check_process_timers(tsk, &firing); 1304 + /* 1305 + * Here we take off tsk->cpu_timers[N] and tsk->signal->cpu_timers[N] 1306 + * all the timers that are firing, and put them on the firing list. 1307 + */ 1308 + check_thread_timers(tsk, &firing); 1309 + check_process_timers(tsk, &firing); 1309 1310 1310 - /* 1311 - * We must release these locks before taking any timer's lock. 1312 - * There is a potential race with timer deletion here, as the 1313 - * siglock now protects our private firing list. We have set 1314 - * the firing flag in each timer, so that a deletion attempt 1315 - * that gets the timer lock before we do will give it up and 1316 - * spin until we've taken care of that timer below. 1317 - */ 1318 - spin_unlock(&tsk->sighand->siglock); 1319 - } 1311 + /* 1312 + * We must release these locks before taking any timer's lock. 1313 + * There is a potential race with timer deletion here, as the 1314 + * siglock now protects our private firing list. We have set 1315 + * the firing flag in each timer, so that a deletion attempt 1316 + * that gets the timer lock before we do will give it up and 1317 + * spin until we've taken care of that timer below. 1318 + */ 1319 + spin_unlock(&tsk->sighand->siglock); 1320 1320 read_unlock(&tasklist_lock); 1321 1321 1322 1322 /*