Re: [PATCH 2/3] fix utrace_control(DETACH) && utrace->death interaction

2010-08-26 Thread Oleg Nesterov
On 08/19, Roland McGrath wrote: > > > Wait. It doesn't break this. It only breaks -EALREADY contract. And > > I don't understand why this is bad. > > The -EALREADY contract lets you have a report_death callback that does all > your cleanup and then returns UTRACE_DETACH. I think this is possible w

Re: [PATCH 2/3] fix utrace_control(DETACH) && utrace->death interaction

2010-08-19 Thread Roland McGrath
> Wait. It doesn't break this. It only breaks -EALREADY contract. And > I don't understand why this is bad. The -EALREADY contract lets you have a report_death callback that does all your cleanup and then returns UTRACE_DETACH. To have that plan, you need a way for an asynchronous detach attempt

Re: [PATCH 2/3] fix utrace_control(DETACH) && utrace->death interaction

2010-08-18 Thread Oleg Nesterov
On 08/17, Oleg Nesterov wrote: > > On 08/16, Roland McGrath wrote: > > > > > The problem is, utrace_control(DETACH) does nothing and returns > > > -EALREADY if utrace->death is set, this is not right. We can and > > > should detach in this case, we only should skip utrace_reset() to > > > avoid the

Re: [PATCH 2/3] fix utrace_control(DETACH) && utrace->death interaction

2010-08-17 Thread Oleg Nesterov
On 08/16, Roland McGrath wrote: > > > The problem is, utrace_control(DETACH) does nothing and returns > > -EALREADY if utrace->death is set, this is not right. We can and > > should detach in this case, we only should skip utrace_reset() to > > avoid the race with utrace_report_death()->REPORT_CALL

Re: [PATCH 2/3] fix utrace_control(DETACH) && utrace->death interaction

2010-08-16 Thread Roland McGrath
> The problem is, utrace_control(DETACH) does nothing and returns > -EALREADY if utrace->death is set, this is not right. We can and > should detach in this case, we only should skip utrace_reset() to > avoid the race with utrace_report_death()->REPORT_CALLBACKS(). This behavior is the original (m

[PATCH 2/3] fix utrace_control(DETACH) && utrace->death interaction

2010-08-16 Thread Oleg Nesterov
Suppose that we want to detach the engine and free engine->data. To avoid the races with our calbacks which can use ->data we should do either err = utrace_set_events(0); if (err == ...) utrace_barrier(); utrace_control(DETACH); or err = utrace_con