public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: linmiaohe <linmiaohe@huawei.com>
To: "tj@kernel.org" <tj@kernel.org>,
	"jiangshanlai@gmail.com" <jiangshanlai@gmail.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] workqueue: Use wake_up_worker() to wake up first idle worker
Date: Mon, 24 Aug 2020 12:00:45 +0000	[thread overview]
Message-ID: <c2121f0611924681841799695bfbe50f@huawei.com> (raw)

friendly ping :)

>Miaohe Lin <linmiaohe@huawei.com> wrote:
>From: Miaohe Lin <linmiaohe@huawei.com>
>
>Use wrapper function wake_up_worker() to wake up first idle worker.
>
>Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
>---
> kernel/workqueue.c | 10 ++++------
> 1 file changed, 4 insertions(+), 6 deletions(-)
>
>diff --git a/kernel/workqueue.c b/kernel/workqueue.c index c41c3c17b86a..5302f227f38f 100644
>--- a/kernel/workqueue.c
>+++ b/kernel/workqueue.c
>@@ -864,7 +864,7 @@ void wq_worker_running(struct task_struct *task)
>  */
> void wq_worker_sleeping(struct task_struct *task)  {
>-	struct worker *next, *worker = kthread_data(task);
>+	struct worker *worker = kthread_data(task);
> 	struct worker_pool *pool;
> 
> 	/*
>@@ -896,11 +896,9 @@ void wq_worker_sleeping(struct task_struct *task)
> 	 * lock is safe.
> 	 */
> 	if (atomic_dec_and_test(&pool->nr_running) &&
>-	    !list_empty(&pool->worklist)) {
>-		next = first_idle_worker(pool);
>-		if (next)
>-			wake_up_process(next->task);
>-	}
>+	    !list_empty(&pool->worklist))
>+		wake_up_worker(pool);
>+
> 	raw_spin_unlock_irq(&pool->lock);
> }
> 
>--
>2.19.1
>

             reply	other threads:[~2020-08-24 12:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-24 12:00 linmiaohe [this message]
  -- strict thread matches above, loose matches on Subject: below --
2020-07-27 12:29 [PATCH] workqueue: Use wake_up_worker() to wake up first idle worker linmiaohe
2020-08-03  7:48 ` Lai Jiangshan
2020-09-04 17:11 ` Tejun Heo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c2121f0611924681841799695bfbe50f@huawei.com \
    --to=linmiaohe@huawei.com \
    --cc=jiangshanlai@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tj@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox