linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: tiozhang <tiozhang@didiglobal.com>
To: <tj@kernel.org>, <mingo@redhat.com>, <peterz@infradead.org>,
	<juri.lelli@redhat.com>, <vincent.guittot@linaro.org>
Cc: <linux-kernel@vger.kernel.org>, <dietmar.eggemann@arm.com>,
	<rostedt@goodmis.org>, <bsegall@google.com>, <mgorman@suse.de>,
	<bristot@redhat.com>, <vschneid@redhat.com>,
	<fuyuanli@didiglobal.com>, <zwp10758@gmail.com>,
	<zyhtheonly@gmail.com>, <zyhtheonly@yeah.net>,
	<tiozhang@didiglobal.com>
Subject: [PATCH v3] sched/isolation: add a workqueue parameter onto isolcpus to constrain unbound CPUs
Date: Thu, 22 Jun 2023 11:22:17 +0800	[thread overview]
Message-ID: <20230622032133.GA29012@didi-ThinkCentre-M930t-N000> (raw)
In-Reply-To: <ZJNizvI-7A2hFDoM@slm.duckdns.org>

Motivation of doing this is to better improve boot times for devices when
we want to prevent our workqueue works from running on some specific CPUs,
i,e, some CPUs are busy with interrupts.

Also remove HK_FLAG_WQ from nohz_full to prevent nohz_full overriding
workqueue's cpu config.

Suggested-by: Tejun Heo <tj@kernel.org>
Signed-off-by: tiozhang <tiozhang@didiglobal.com>
---
 kernel/sched/isolation.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/kernel/sched/isolation.c b/kernel/sched/isolation.c
index 373d42c707bc..5cd67c51622e 100644
--- a/kernel/sched/isolation.c
+++ b/kernel/sched/isolation.c
@@ -181,8 +181,8 @@ static int __init housekeeping_nohz_full_setup(char *str)
 {
 	unsigned long flags;
 
-	flags = HK_FLAG_TICK | HK_FLAG_WQ | HK_FLAG_TIMER | HK_FLAG_RCU |
-		HK_FLAG_MISC | HK_FLAG_KTHREAD;
+	flags = HK_FLAG_TICK | HK_FLAG_TIMER | HK_FLAG_RCU | HK_FLAG_MISC
+		| HK_FLAG_KTHREAD;
 
 	return housekeeping_setup(str, flags);
 }
@@ -208,6 +208,12 @@ static int __init housekeeping_isolcpus_setup(char *str)
 			continue;
 		}
 
+		if (!strncmp(str, "workqueue,", 10)) {
+			str += 10;
+			flags |= HK_FLAG_WQ;
+			continue;
+		}
+
 		if (!strncmp(str, "managed_irq,", 12)) {
 			str += 12;
 			flags |= HK_FLAG_MANAGED_IRQ;
-- 
2.17.1


  reply	other threads:[~2023-06-22  3:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-13  9:28 [PATCH] sched/isolation: add a workqueue parameter to constrain unbound CPUs tiozhang
2023-06-14  9:19 ` [PATCH v2] " tiozhang
2023-06-21 20:51   ` Tejun Heo
2023-06-22  3:22     ` tiozhang [this message]
2023-06-26 20:54       ` [PATCH v3] sched/isolation: add a workqueue parameter onto isolcpus " Tejun Heo
2023-06-26 22:59       ` Frederic Weisbecker
2023-06-22  3:47     ` [PATCH v2] sched/isolation: add a workqueue parameter " Yuanhan Zhang

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=20230622032133.GA29012@didi-ThinkCentre-M930t-N000 \
    --to=tiozhang@didiglobal.com \
    --cc=bristot@redhat.com \
    --cc=bsegall@google.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=fuyuanli@didiglobal.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=tj@kernel.org \
    --cc=vincent.guittot@linaro.org \
    --cc=vschneid@redhat.com \
    --cc=zwp10758@gmail.com \
    --cc=zyhtheonly@gmail.com \
    --cc=zyhtheonly@yeah.net \
    /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;
as well as URLs for NNTP newsgroup(s).