From nobody Mon Feb 9 13:57:07 2026 Received: from mail-dl1-f46.google.com (mail-dl1-f46.google.com [74.125.82.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B862E30AD06 for ; Fri, 6 Feb 2026 07:05:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770361519; cv=none; b=KgLCmqjeLW5+hri/SI8Q2N5PWS/5DHTgokimYOz3GDZZIz1r5gT5NaA3YhApu2fji0LkHCIVz5T2yQGXDM4RVs9i0Pld5RaLuqyrowLU0JAiEBOChBeUOpkb6rvk8v13GovuCqY6VztL6pjqTo9CCECQV/H49AELSilCRfRdhIk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770361519; c=relaxed/simple; bh=n0omYtl0xIEte7JAbbG8OBLHZ+FrvgEEEjgJhdigEL8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=FKxzWShWFVNt0+JU6o9yYgrC+jIPm9z9shHhZ8svn/2KV1kIpBdHH8szCsAFhfIoyLMExr7rBURUs1nRWCad0i1tCujx1pQnufxQRD5ZFywvWICZaEhB04ZxtZrv8R+AchyUblt3qH5FHg+/2gNYQHGkvvcidHmwCdBpcgw/0sQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=OKcEwFIu; arc=none smtp.client-ip=74.125.82.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="OKcEwFIu" Received: by mail-dl1-f46.google.com with SMTP id a92af1059eb24-124566b6693so975113c88.0 for ; Thu, 05 Feb 2026 23:05:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1770361519; x=1770966319; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=pOd/UWGDzn8jr9iF17p1rTKmc8F1m4wqgpJ+mmp6cko=; b=OKcEwFIun//Ar3ia//9lf13140nKTqJFHEYCZRZlQVLMad4Nq/ql8BTBrDZuQqJa/8 Z9gE/rFSn4+9JSqVJLMNq7b+PPels43W01C6jCMgSR11X4cZBYluFqLPCFD9G1KRHTsT D3NM+ESJFo1DMlKg/Bzm3A64kSX+CwiwYQVt1oMQA4jRYsEcKDTQ/rdMq4OWn0oQCMUW VGev0tAtFw2tkG5Kjzu1HvL0B8AHKaFSdEcbBE17s9h+wFUh3V5h7gSzL8l1TGeOp8Wg hMBVT5lNPI9IQuHMtK2Dly80Kl4v8u75tuf1e73/rlt098fls0dsGfnO6OSN6UP5/uyx 0p1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770361519; x=1770966319; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=pOd/UWGDzn8jr9iF17p1rTKmc8F1m4wqgpJ+mmp6cko=; b=D7mSm3A61PnbfHat3Aq1E4uEeCYuU1B4Uq6GoZ1iVU3uEgiv7AJIXVDwm/nP3qXEpN 2l/idi1GhHaNjkAkUk1FCgPboeaM5NWAVNMkXAOKsTvyTvBEqOZb/rzPpb+9curDbX7P LUBtPz5Nhgr1rlnlFdrBGraVjf7opYTvVeL+IlidCPdmEnYvLSZoA0xcVZimItEMMGkc G3+e5QDxzn0pBqtx9Tx+YI24lu84ZojmDO24sUD5TeUs45XH7+trgLaxfYI+AeEFzkn/ wBEmGbLGFSTKUWuVjP/WRXzS4CDEtQ21mhY4layI9LOYsh8rAH/ZD6LaInj1yKi7ne9K AOlQ== X-Gm-Message-State: AOJu0Yy8E6b2VdLhB+Rs6F7Mu3V5AsjQ/ovRcHDBoHGnJvOvMZaaAXlb 6ENWNHibci4biQS/nrgWVj0jATIHqchbiw09ZabpKLvL1EZ/JOEPwUEh X-Gm-Gg: AZuq6aJN7bUX0a0nJC6xB+VzuuooAcWYVaQes4GLhK2WyW30sVny3hlcd/LyXXgHk6P GsZPFuIGNyzs/5igXwotDhL4Tkt+ZKS+Lim6QNzPANblySWQYi4VD8ZMhiGzCU8SNdeezVG7mEO 4yryV5bqnHVyK/xE3BreAT7akDCcU6k6XZeKMBNELDlvAodrhJcPth3PBXERmWppcHt3u3yWH0f x2CwCfHNrH0AgRzs0v8N1RWMPhGk7SdHJKnICEThSE6si7Yh0ZWM8cCyE/ljnr8lva1OfHawVTk f+izDnUCwIi3mEkRe5bAkB4QICRiOq7QyvXWlCz1YFXqvKL3YMvyPIHIM86gw1R0YMKGomx0ah7 VQ69nKG2Y1x1b9KGQk8IHiC3jWekdVvfXEiDPucW5y8nL+VabZjOSkQpARxlap0NYcwIqYkJt6h Q/YUtTmSTPN7Co2e5pqe/+ X-Received: by 2002:a05:7022:492:b0:119:e569:f262 with SMTP id a92af1059eb24-12703ff13cemr1009542c88.11.1770361518689; Thu, 05 Feb 2026 23:05:18 -0800 (PST) Received: from [127.0.1.1] ([74.48.213.230]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-127041e61b9sm1592601c88.8.2026.02.05.23.05.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Feb 2026 23:05:18 -0800 (PST) From: Qiliang Yuan Date: Fri, 06 Feb 2026 02:04:23 -0500 Subject: [PATCH RFC 02/12] sched/isolation: Introduce reconfiguration notifier chain Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260206-feature-dynamic_isolcpus_dhei-v1-2-00a711eb0c74@gmail.com> References: <20260206-feature-dynamic_isolcpus_dhei-v1-0-00a711eb0c74@gmail.com> In-Reply-To: <20260206-feature-dynamic_isolcpus_dhei-v1-0-00a711eb0c74@gmail.com> To: Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , Thomas Gleixner , "Paul E. McKenney" , Frederic Weisbecker , Neeraj Upadhyay , Joel Fernandes , Josh Triplett , Boqun Feng , Uladzislau Rezki , Mathieu Desnoyers , Lai Jiangshan , Zqiang , Tejun Heo , Andrew Morton , Vlastimil Babka , Suren Baghdasaryan , Michal Hocko , Brendan Jackman , Johannes Weiner , Zi Yan , Anna-Maria Behnsen , Ingo Molnar Cc: linux-kernel@vger.kernel.org, rcu@vger.kernel.org, linux-mm@kvack.org, Qiliang Yuan , Qiliang Yuan X-Mailer: b4 0.14.3 Introduce a blocking notifier chain for housekeeping to support dynamic reconfiguration of masks. Subsystems like RCU, Timers, and IRQ management need to be notified when the isolation state of a CPU changes at runtime. 1. Define 'struct housekeeping_update' and 'HK_UPDATE_MASK' in isolation.h to pass update event details (type of housekeeping and the new mask). 2. Implement housekeeping_register_notifier() and housekeeping_unregister_notifier() to allow subsystems to subscribe to updates. 3. Provide an internal housekeeping_update_notify() helper to trigger the chain. This signaling mechanism enables other kernel subsystems to adapt their internal state (e.g., migrating kthreads or timers) dynamically when housekeeping masks are modified via upcoming sysfs interfaces. Signed-off-by: Qiliang Yuan Signed-off-by: Qiliang Yuan --- include/linux/sched/isolation.h | 20 ++++++++++++++++++++ kernel/sched/isolation.c | 23 +++++++++++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/include/linux/sched/isolation.h b/include/linux/sched/isolatio= n.h index cecb80b09120..5c07e3e9b8d1 100644 --- a/include/linux/sched/isolation.h +++ b/include/linux/sched/isolation.h @@ -5,6 +5,7 @@ #include #include #include +#include =20 enum hk_type { HK_TYPE_DOMAIN, @@ -24,6 +25,13 @@ enum hk_type { HK_TYPE_KTHREAD =3D HK_TYPE_KERNEL_NOISE }; =20 +struct housekeeping_update { + enum hk_type type; + const struct cpumask *new_mask; +}; + +#define HK_UPDATE_MASK 0x01 + #ifdef CONFIG_CPU_ISOLATION DECLARE_STATIC_KEY_FALSE(housekeeping_overridden); extern int housekeeping_any_cpu(enum hk_type type); @@ -32,6 +40,8 @@ extern bool housekeeping_enabled(enum hk_type type); extern void housekeeping_affine(struct task_struct *t, enum hk_type type); extern bool housekeeping_test_cpu(int cpu, enum hk_type type); extern void housekeeping_init(void); +extern int housekeeping_register_notifier(struct notifier_block *nb); +extern int housekeeping_unregister_notifier(struct notifier_block *nb); =20 #else =20 @@ -59,6 +69,16 @@ static inline bool housekeeping_test_cpu(int cpu, enum h= k_type type) } =20 static inline void housekeeping_init(void) { } + +static inline int housekeeping_register_notifier(struct notifier_block *nb) +{ + return 0; +} + +static inline int housekeeping_unregister_notifier(struct notifier_block *= nb) +{ + return 0; +} #endif /* CONFIG_CPU_ISOLATION */ =20 static inline bool housekeeping_cpu(int cpu, enum hk_type type) diff --git a/kernel/sched/isolation.c b/kernel/sched/isolation.c index 811bf6cbe68d..97cc41626a33 100644 --- a/kernel/sched/isolation.c +++ b/kernel/sched/isolation.c @@ -18,6 +18,7 @@ enum hk_flags { }; =20 static DEFINE_MUTEX(housekeeping_mutex); +static BLOCKING_NOTIFIER_HEAD(housekeeping_notifier_list); DEFINE_STATIC_KEY_FALSE(housekeeping_overridden); EXPORT_SYMBOL_GPL(housekeeping_overridden); =20 @@ -86,6 +87,28 @@ bool housekeeping_test_cpu(int cpu, enum hk_type type) } EXPORT_SYMBOL_GPL(housekeeping_test_cpu); =20 +int housekeeping_register_notifier(struct notifier_block *nb) +{ + return blocking_notifier_chain_register(&housekeeping_notifier_list, nb); +} +EXPORT_SYMBOL_GPL(housekeeping_register_notifier); + +int housekeeping_unregister_notifier(struct notifier_block *nb) +{ + return blocking_notifier_chain_unregister(&housekeeping_notifier_list, nb= ); +} +EXPORT_SYMBOL_GPL(housekeeping_unregister_notifier); + +static int __maybe_unused housekeeping_update_notify(enum hk_type type, co= nst struct cpumask *new_mask) +{ + struct housekeeping_update update =3D { + .type =3D type, + .new_mask =3D new_mask, + }; + + return blocking_notifier_call_chain(&housekeeping_notifier_list, HK_UPDAT= E_MASK, &update); +} + void housekeeping_init(void) { enum hk_type type; --=20 2.51.0