[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20260206-feature-dynamic_isolcpus_dhei-v1-12-00a711eb0c74@gmail.com>
Date: Fri, 06 Feb 2026 02:04:33 -0500
From: Qiliang Yuan <realwujing@...il.com>
To: Ingo Molnar <mingo@...hat.com>, Peter Zijlstra <peterz@...radead.org>,
Juri Lelli <juri.lelli@...hat.com>,
Vincent Guittot <vincent.guittot@...aro.org>,
Dietmar Eggemann <dietmar.eggemann@....com>,
Steven Rostedt <rostedt@...dmis.org>, Ben Segall <bsegall@...gle.com>,
Mel Gorman <mgorman@...e.de>, Valentin Schneider <vschneid@...hat.com>,
Thomas Gleixner <tglx@...nel.org>, "Paul E. McKenney" <paulmck@...nel.org>,
Frederic Weisbecker <frederic@...nel.org>,
Neeraj Upadhyay <neeraj.upadhyay@...nel.org>,
Joel Fernandes <joelagnelf@...dia.com>,
Josh Triplett <josh@...htriplett.org>, Boqun Feng <boqun.feng@...il.com>,
Uladzislau Rezki <urezki@...il.com>,
Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
Lai Jiangshan <jiangshanlai@...il.com>, Zqiang <qiang.zhang@...ux.dev>,
Tejun Heo <tj@...nel.org>, Andrew Morton <akpm@...ux-foundation.org>,
Vlastimil Babka <vbabka@...e.cz>, Suren Baghdasaryan <surenb@...gle.com>,
Michal Hocko <mhocko@...e.com>, Brendan Jackman <jackmanb@...gle.com>,
Johannes Weiner <hannes@...xchg.org>, Zi Yan <ziy@...dia.com>,
Anna-Maria Behnsen <anna-maria@...utronix.de>,
Ingo Molnar <mingo@...nel.org>
Cc: linux-kernel@...r.kernel.org, rcu@...r.kernel.org, linux-mm@...ck.org,
Qiliang Yuan <realwujing@...il.com>, Qiliang Yuan <yuanql9@...natelecom.cn>
Subject: [PATCH RFC 12/12] sched/isolation: Bridge isolcpus and support
runtime tick offload init
Bridge the boot-time 'isolcpus' and 'nohz_full' parameters with the
DHEI sysfs interface. Ensure that housekeeping_init() correctly
initializes the isolation state and that subsequent sysfs updates
can take over management even if no isolation was configured at boot.
Remove __init from sched_tick_offload_init() and update it to be
safe for multiple calls. This allows DHEI to initialize tick offload
infrastructure at runtime when the first tick-isolated core is
configured.
Signed-off-by: Qiliang Yuan <realwujing@...il.com>
Signed-off-by: Qiliang Yuan <yuanql9@...natelecom.cn>
---
kernel/sched/core.c | 5 ++++-
kernel/sched/isolation.c | 3 +++
kernel/sched/sched.h | 2 +-
3 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 045f83ad261e..d155e1132d6b 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -5685,8 +5685,11 @@ static void sched_tick_stop(int cpu)
}
#endif /* CONFIG_HOTPLUG_CPU */
-int __init sched_tick_offload_init(void)
+int sched_tick_offload_init(void)
{
+ if (tick_work_cpu)
+ return 0;
+
tick_work_cpu = alloc_percpu(struct tick_work);
BUG_ON(!tick_work_cpu);
return 0;
diff --git a/kernel/sched/isolation.c b/kernel/sched/isolation.c
index 30798e790b9f..76c039a01fb0 100644
--- a/kernel/sched/isolation.c
+++ b/kernel/sched/isolation.c
@@ -241,6 +241,9 @@ static ssize_t housekeeping_store(struct kobject *kobject,
housekeeping.flags |= BIT(type);
static_branch_enable(&housekeeping_overridden);
+ if (type == HK_TYPE_TICK || type == HK_TYPE_TIMER || type == HK_TYPE_RCU)
+ sched_tick_offload_init();
+
housekeeping_update_notify(type, new_mask);
err = count;
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
index 93fce4bbff5e..0079e7210c38 100644
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -2867,7 +2867,7 @@ extern void post_init_entity_util_avg(struct task_struct *p);
#ifdef CONFIG_NO_HZ_FULL
extern bool sched_can_stop_tick(struct rq *rq);
-extern int __init sched_tick_offload_init(void);
+extern int sched_tick_offload_init(void);
/*
* Tick may be needed by tasks in the runqueue depending on their policy and
--
2.51.0
Powered by blists - more mailing lists