Messages in this thread | | | Date | Sun, 06 Nov 2005 17:32:33 +0300 | From | Oleg Nesterov <> | Subject | Posix timers vs exec problems |
| |
Roland, George, I think posix timers have problems with de_thread().
First, when non-leader thread does exec it calls release_task(->group_leader) before calling exit_itimers(). This means that send_group_sigqueue() can oops after taking tasklist_lock while doing spin_lock_irqsave(->sighand->siglock). This is easy to fix.
cpu-timers have another problem. In !CPUCLOCK_PERTHREAD() case we attach the timer to ->signal->cpu_timers, so these timers (when created by another process) will survive after exec. However they will continue to profile execed process only if it was group_leader who did exec, otherwise posix_cpu_timer_schedule() will notice that timer->it.cpu.task has ->signal == NULL and stop this timer.
So, should de_thread() call posix_cpu_timers_exit_group() after exit_itimers() thus stoping cpu-timers after exec? Another option is to change ->it.cpu.task for each timer in ->signal->cpu_timers, this way cpu-timers will continue to work. But this is not trivial.
Oleg. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |