mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH -next] workqueue: use LIST_HEAD to initialize cull_list
@ 2023-08-03  7:51 Yang Yingliang
  2023-08-03  9:50 ` Lai Jiangshan
  0 siblings, 1 reply; 4+ messages in thread
From: Yang Yingliang @ 2023-08-03  7:51 UTC (permalink / raw)
  To: linux-kernel; +Cc: tj, jiangshanlai, yangyingliang

Use LIST_HEAD() to initialize cull_list instead of open-coding it.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
 kernel/workqueue.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 3ddd0d599dab..ae975a7c9f69 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -2307,9 +2307,8 @@ static void idle_worker_timeout(struct timer_list *t)
 static void idle_cull_fn(struct work_struct *work)
 {
 	struct worker_pool *pool = container_of(work, struct worker_pool, idle_cull_work);
-	struct list_head cull_list;
+	LIST_HEAD(cull_list);
 
-	INIT_LIST_HEAD(&cull_list);
 	/*
 	 * Grabbing wq_pool_attach_mutex here ensures an already-running worker
 	 * cannot proceed beyong worker_detach_from_pool() in its self-destruct
@@ -3875,10 +3874,8 @@ static void rcu_free_pool(struct rcu_head *rcu)
 static void put_unbound_pool(struct worker_pool *pool)
 {
 	DECLARE_COMPLETION_ONSTACK(detach_completion);
-	struct list_head cull_list;
 	struct worker *worker;
-
-	INIT_LIST_HEAD(&cull_list);
+	LIST_HEAD(cull_list);
 
 	lockdep_assert_held(&wq_pool_mutex);
 
-- 
2.25.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH -next] workqueue: use LIST_HEAD to initialize cull_list
  2023-08-03  7:51 [PATCH -next] workqueue: use LIST_HEAD to initialize cull_list Yang Yingliang
@ 2023-08-03  9:50 ` Lai Jiangshan
  2023-08-04  0:11   ` Tejun Heo
  0 siblings, 1 reply; 4+ messages in thread
From: Lai Jiangshan @ 2023-08-03  9:50 UTC (permalink / raw)
  To: Yang Yingliang; +Cc: linux-kernel, tj

On Thu, Aug 3, 2023 at 3:54 PM Yang Yingliang <yangyingliang@huawei.com> wrote:
>
> Use LIST_HEAD() to initialize cull_list instead of open-coding it.
>
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>

Reviewed-by: Lai Jiangshan <jiangshanlai@gmail.com>

> ---
>  kernel/workqueue.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/kernel/workqueue.c b/kernel/workqueue.c
> index 3ddd0d599dab..ae975a7c9f69 100644
> --- a/kernel/workqueue.c
> +++ b/kernel/workqueue.c
> @@ -2307,9 +2307,8 @@ static void idle_worker_timeout(struct timer_list *t)
>  static void idle_cull_fn(struct work_struct *work)
>  {
>         struct worker_pool *pool = container_of(work, struct worker_pool, idle_cull_work);
> -       struct list_head cull_list;
> +       LIST_HEAD(cull_list);
>
> -       INIT_LIST_HEAD(&cull_list);
>         /*
>          * Grabbing wq_pool_attach_mutex here ensures an already-running worker
>          * cannot proceed beyong worker_detach_from_pool() in its self-destruct
> @@ -3875,10 +3874,8 @@ static void rcu_free_pool(struct rcu_head *rcu)
>  static void put_unbound_pool(struct worker_pool *pool)
>  {
>         DECLARE_COMPLETION_ONSTACK(detach_completion);
> -       struct list_head cull_list;
>         struct worker *worker;
> -
> -       INIT_LIST_HEAD(&cull_list);
> +       LIST_HEAD(cull_list);
>
>         lockdep_assert_held(&wq_pool_mutex);
>
> --
> 2.25.1
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH -next] workqueue: use LIST_HEAD to initialize cull_list
  2023-08-03  9:50 ` Lai Jiangshan
@ 2023-08-04  0:11   ` Tejun Heo
  2023-08-04  1:59     ` Yang Yingliang
  0 siblings, 1 reply; 4+ messages in thread
From: Tejun Heo @ 2023-08-04  0:11 UTC (permalink / raw)
  To: Lai Jiangshan; +Cc: Yang Yingliang, linux-kernel

On Thu, Aug 03, 2023 at 05:50:42PM +0800, Lai Jiangshan wrote:
> On Thu, Aug 3, 2023 at 3:54 PM Yang Yingliang <yangyingliang@huawei.com> wrote:
> >
> > Use LIST_HEAD() to initialize cull_list instead of open-coding it.
> >
> > Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
> 
> Reviewed-by: Lai Jiangshan <jiangshanlai@gmail.com>

I don't have this patch in my inbox. Yang, can you pelase resend?

Thanks.

-- 
tejun

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH -next] workqueue: use LIST_HEAD to initialize cull_list
  2023-08-04  0:11   ` Tejun Heo
@ 2023-08-04  1:59     ` Yang Yingliang
  0 siblings, 0 replies; 4+ messages in thread
From: Yang Yingliang @ 2023-08-04  1:59 UTC (permalink / raw)
  To: Tejun Heo, Lai Jiangshan; +Cc: linux-kernel


On 2023/8/4 8:11, Tejun Heo wrote:
> On Thu, Aug 03, 2023 at 05:50:42PM +0800, Lai Jiangshan wrote:
>> On Thu, Aug 3, 2023 at 3:54 PM Yang Yingliang <yangyingliang@huawei.com> wrote:
>>> Use LIST_HEAD() to initialize cull_list instead of open-coding it.
>>>
>>> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
>> Reviewed-by: Lai Jiangshan <jiangshanlai@gmail.com>
> I don't have this patch in my inbox. Yang, can you pelase resend?
OK. I will resend it.
>
> Thanks.
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-08-04  1:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-03  7:51 [PATCH -next] workqueue: use LIST_HEAD to initialize cull_list Yang Yingliang
2023-08-03  9:50 ` Lai Jiangshan
2023-08-04  0:11   ` Tejun Heo
2023-08-04  1:59     ` Yang Yingliang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®