Messages in this thread | | | Date | Wed, 6 Feb 2013 10:46:38 -0800 | From | Tejun Heo <> | Subject | Re: [PATCH 1/3] stop_machine: check work->done while handling enqueued works |
| |
On Wed, Feb 06, 2013 at 08:36:01PM +0800, Hillf Danton wrote: > To advoid invalid reference, updating work result is moved to > cpu_stop_signal_done().
Can you please elaborate "why" in addition to "what"? Do we actually have a bug here, is it meant to be an independent cleanup, or is it something which is necessary for later patches in the series? What are we achieving here?
> /* signal completion unless @done is NULL */ > -static void cpu_stop_signal_done(struct cpu_stop_done *done, bool executed) > +static void cpu_stop_signal_done(struct cpu_stop_done *done, bool > executed, int ret)
Patch is corrupt.
> @@ -279,8 +281,6 @@ repeat: > preempt_disable(); > > ret = fn(arg); > - if (ret) > - done->ret = ret;
If this is meant as a pure cleanup, I'm not sure it's an improvement. You own your cpu_stop_done until you call cpu_stop_signal_done() on it, so I don't think there's anything wrong with the current code. The new code is different, not necessarily better.
Thanks.
-- tejun
| |