lkml.org 
[lkml]   [2018]   [Sep]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] workqueue: combine judgments in the loop ofmaybe_create_worker
On Thu, Sep 13, 2018 at 9:51 AM <liu.song11@zte.com.cn> wrote:
>
> >> From: Liu Song <liu.song11@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.song11@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

\
 
 \ /
  Last update: 2018-09-13 04:33    [W:0.033 / U:0.748 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site