From nobody Fri Jun 19 18:16:29 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BD31BC433F5 for ; Thu, 31 Mar 2022 05:57:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230288AbiCaF6v (ORCPT ); Thu, 31 Mar 2022 01:58:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54846 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230312AbiCaF6e (ORCPT ); Thu, 31 Mar 2022 01:58:34 -0400 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 80EA41AA056 for ; Wed, 30 Mar 2022 22:56:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1648706207; x=1680242207; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=FZyFixHTyqkYhNWGDpwi2BoO+1lQkoTiQ3VMdhC0QAg=; b=B7JkgfW4BpIzNcT2BJj36fgvUWVdn1UwlCnuvPih+u81PAKFC1hrfnCA r9yiWsT2qsdxagPDqjuObI4qu7Oxtnej889WqHkD0zXROyb770L20B4UA 9OYwQKBr5kU2ZeGsi6dGR3ZE41948f/lS478MRr1MSxgcNc40ARgogiG2 BwFNY1A7t7H+Wyi+WcMQ9U/h75KuEBvGIcC0En4f/tMqGq5ZN1XmAd4mJ WoQN3XjbpdqVn5EQSiHBaMAECFtb65sBHLA0PfEliHLBuDMe5BEXJJ1d7 D+78ExmgH0D6iErHk7CyKJ3Ch15/ob+k7OpaP1bhZDWfHic853sTLtGpI Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10302"; a="257307543" X-IronPort-AV: E=Sophos;i="5.90,224,1643702400"; d="scan'208";a="257307543" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Mar 2022 22:56:47 -0700 X-IronPort-AV: E=Sophos;i="5.90,224,1643702400"; d="scan'208";a="522196740" Received: from zq-optiplex-7090.bj.intel.com ([10.238.156.125]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Mar 2022 22:56:45 -0700 From: Zqiang To: jiangshanlai@gmail.com, tj@kernel.org Cc: linux-kernel@vger.kernel.org Subject: [PATCH v2] workqueue: Restrict kworker in the offline CPU pool running on housekeeping CPUs Date: Thu, 31 Mar 2022 13:57:17 +0800 Message-Id: <20220331055717.2659428-1-qiang1.zhang@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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 wq_unbound_cpumask. Signed-off-by: Zqiang --- v1->v2: Replace housekeeping_cpumask(HK_TYPE_WQ) with wq_unbound_cpumask. kernel/workqueue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/workqueue.c b/kernel/workqueue.c index abcc9a2ac319..b447012df177 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -5023,7 +5023,7 @@ static void unbind_workers(int cpu) =20 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, wq_unbound_cpumask) < 0= ); } =20 mutex_unlock(&wq_pool_attach_mutex); --=20 2.25.1