mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Zqiang <qiang1.zhang@intel.com>
To: tj@kernel.org, jiangshanlai@gmail.com
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] workqueue: Restrict kworker in the offline CPU pool running on housekeeping CPUs
Date: Tue, 29 Mar 2022 13:17:14 +0800	[thread overview]
Message-ID: <20220329051714.2184811-1-qiang1.zhang@intel.com> (raw)

When CPU going offline, all workers in this CPU pool will lose
affinity to this CPU, and may run to isolated CPU. like kworker
in unbound pool, set CPU affinity of these kworker is housekeeping
cpumask.

Signed-off-by: Zqiang <qiang1.zhang@intel.com>
---
 kernel/workqueue.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index abcc9a2ac319..c509ce73a783 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -5023,7 +5023,8 @@ static void unbind_workers(int cpu)
 
 		for_each_pool_worker(worker, pool) {
 			kthread_set_per_cpu(worker->task, -1);
-			WARN_ON_ONCE(set_cpus_allowed_ptr(worker->task, cpu_possible_mask) < 0);
+			WARN_ON_ONCE(set_cpus_allowed_ptr(worker->task,
+						housekeeping_cpumask(HK_TYPE_WQ)) < 0);
 		}
 
 		mutex_unlock(&wq_pool_attach_mutex);
-- 
2.25.1


             reply	other threads:[~2022-03-29  5:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-29  5:17 Zqiang [this message]
2022-03-31  4:22 ` Lai Jiangshan

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=20220329051714.2184811-1-qiang1.zhang@intel.com \
    --to=qiang1.zhang@intel.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

all inboxes | Powered by JetHome®