On 08/20, Peter Zijlstra wrote: > > On Fri, 2012-08-17 at 17:14 +0200, Oleg Nesterov wrote: > > I still think that task_work_add() should synhronize with exit_task_work() > > itself and fail if necessary. But I wasn't able to convince Al ;) > > I'm not at all sure how that relates to needing task_lock() in the > keyctl stuff.
To serialize with exit_mm() which clears ->mm. We shouldn't do task_work_add(task) if the exiting task has already passed exit_task_work(). There is no way to do this after ed3e694d7 (and I think this is wrong), so keyctl relies on the fact that exit_task_work() is called after exit_mm(). > Also, can't task_work use llist stuff? That would also avoid using > ->pi_lock. Not sure.... task_work_add/run can use cmpxchg, but _cancel can't. Oleg. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

