[PATCH] sched/isolation: add a workqueue parameter to constrain unbound CPUs

From: tiozhang
Date: Tue Jun 13 2023 - 05:28:47 EST


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.

Suggested-by: Tejun Heo <tj@xxxxxxxxxx>
Signed-off-by: tiozhang <tiozhang@xxxxxxxxxxxxxx>
---
kernel/sched/isolation.c | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/kernel/sched/isolation.c b/kernel/sched/isolation.c
index 373d42c707bc..85e744c1349a 100644
--- a/kernel/sched/isolation.c
+++ b/kernel/sched/isolation.c
@@ -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