I continue to play the advocatus diaboli ;)
On 11/15, Mike Galbraith wrote:
Hmm, why? Perhaps PF_EXITING was needed in the previous version to
avoid the race with release_task(). But now it is always safe to
use signal->autogroup.
And the exiting task can do a lot before it disappears, probably
we shouldn't ignore ->autogroup.
Not sure I understand why do we need rq->lock...
It can't protect the change of signal->autogroup, multiple callers
can use different rq's.
However. Currently the only callers holds ->siglock, so we are safe.
Perhaps we should just document that autogroup_move_group() needs
->siglock.
This also mean the patch can be simplified even more, __sched_move_task()
is not needed.
Well, in theory this can race with another thread doing autogroup_move_group().
We can read the old ->autogroup, and then use it after it was already freed.
Probably this needs ->siglock too.
Oleg.
--