On Thu, Sep 13, 2018 at 9:51 AM <liu.son...@zte.com.cn> wrote: > > >> From: Liu Song <liu.son...@zte.com.cn> > >> > >> Although the 'need_to_create_worker' has been determined to be > >> true before entering the function. However, adjusting the order > >> of judgment can combine two judgments in the loop. Also improve > >> the matching between logical operations and function naming. > >> > > >Signed-off-by: Liu Song <liu.son...@zte.com.cn> > > > >idk, this doesn't really improve anything. > > > >Thanks. > > > >-- > >tejun > > Hi, tejun > Indeed, the logic of the code has not changed.
The logic of the code is changed in the patch when create_worker() happened to be failed. Failed create_worker() doesn't always result to COOLDOWN due to the possible condition changes. if (!need_to_create_worker(pool)), it dosn't need to COOLDOWN. > The idea that I made this change is > that when reading the workqueue code, from 'maybe_create_worker' naming, it is > possible to create a worker, but the implementation will definitely create a > worker, > which makes me somewhat confused. After analysis, I found the determine > whether > to create a worker before the function call. So this patch seems to be able > to reduce > the confusion between the function naming and implementation. > > Thanks > Best regards