Skip to contentSkip to conversation

signal_struct->count must die, initial changes

PATCH In review Oleg Nesterov 3 participants 3 messages Mar 17, 2010 – Mar 18, 2010

lore
Share & tools
lore
#0 lore raw

cover signal_struct->count must die, initial changes

signal_struct->count in its current form must die.

- it has no reasons to be atomic_t

- it looks like a reference counter, but it is not

- otoh, we really need to make task->signal refcountable, just look at the extremely ugly task_rq_unlock_wait() called from __exit_signals().

- we should change the lifetime rules for task->signal, it should be pinned to task_struct. We have a lot of code which can be simplified after that.

- it is not needed! while the code is correct, any usage of this counter is artificial, except fs/proc uses it correctly to show the number of threads.

This series removes the usage of sig->count from exit pathes.

Oleg.

Acked-by on the v1 series
#1 lore raw
Quoted 1 line

signal_struct->count in its current form must die.

Agreed. This series

Quoted 3 lines

- otoh, we really need to make task->signal refcountable, just look at the extremely ugly task_rq_unlock_wait() called from __exit_signals().

Another of many good reasons for...

Quoted 3 lines

- we should change the lifetime rules for task->signal, it should be pinned to task_struct. We have a lot of code which can be simplified after that.

Yes, and sighand too. I think there will be quite a torrent of cleanup we can do after that.

Remember too that we should really change de_thread() altogether. It has long-standing signal-losing races that we should fix. Changing the lifetime rules may complicate that, or not. But they'll tie in together, and when we do that we'll replace the notify_count again with something else entirely.

Thanks,
Roland