From nobody Thu Apr 2 03:24:27 2026 Received: from mail-dy1-f181.google.com (mail-dy1-f181.google.com [74.125.82.181]) (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 3287A3368BF for ; Wed, 25 Mar 2026 09:09:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774429799; cv=none; b=MSM/mhCXmPafPENHUetmzqLpLlCehJF290smQx20ndT/80vwljMf1lY3rUprJp2OQ9LY1SutMbBA0uTrLVqqFYQMy3sOOyJVQVQmgZE0Ds8MHvV+G8DtOaXbtst+3oNeL86DgvXy6Hl1RCA63LoZUjmTsjU24bo47zoBcpdYwrg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774429799; c=relaxed/simple; bh=0fAmdldKanTfynKcGbwbLRGSY5kHdMz+uttHRTgpIhY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=RRQz1R05zQCh5pSkfptGAJWNl0+8Xevt+A/8Urlt1FV/Meo/6eL4Icg9aVqmt9tlJ70iY/256+ypWks0Xes42J2bvbJ6M8aZUM3IZLhwHBsZc34Ujqx1qlyPFlqjqOeS8SG18pbJnK8mbRC1HSxpMspUePUggVlcpDFZXjBI9NE= 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=gp837kIh; arc=none smtp.client-ip=74.125.82.181 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="gp837kIh" Received: by mail-dy1-f181.google.com with SMTP id 5a478bee46e88-2bd9a485bd6so4096852eec.1 for ; Wed, 25 Mar 2026 02:09:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774429797; x=1775034597; 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=UVkhe/sbAiDJEUQYidI2AeK8GB4BwtQurPArQfvZeuc=; b=gp837kIhLNPhp9yBYtHdkUjG3fbpq7aJ3S7VRFx74GlqRiKToAFpQS4WP/hoQqkyW0 vPCW3S3TYcutpoP8l8D9cDvtr+I4AhvlStVMbkvU844ljJWUhpP13wBD8pNVPNJ89VZQ OgGuprhsgv9wZDdp6DPhYhcjgz5TXa/d9BpS/vT/ulCdxYS7Nm56yWn9jvGncqVuPYhQ /0rXQ9FkXE/OwZDqqoZQUh50GeA9LFfbdDxByX0N9NiaqP3lbt1odfPrEiFUYYW/MhEa Sk8j6q5RDGc3oco6OOnfPPhy0JU468vxhReox0o5gcgsfmHUUJB2fviSDUs6BUAVmhZM gOeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774429797; x=1775034597; 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=UVkhe/sbAiDJEUQYidI2AeK8GB4BwtQurPArQfvZeuc=; b=J/TnjTRXXvKeY/OzlctctFERPBdzxe+LgAbnalptJC670qGhBIqF3RBZWUhLYFgKB1 cfh4Md5lnJGOtcRWld+d7LzRZ4WKe5KZqBy5FwVyFihPcKzzJuCr9lOIvQPO2MMRK2qy 9dFfQWAHm35r1wYxiCY2cAiRGNn1jy3wgysrw+keazB7TNWr89dswnoMZdV43cvKG0Aa Lw2SYXvSRSgETK8aU+uR9pQa3gfcHm/JvrSe8SCwjbzeVk8ewhiFHY24ABV8UKON1R/O 01iGoDmiHYWtF+a2JA2syaGYhC1cXhXcoKPojQ+U+uYjqE7M1fzuQ8d6fMly4bHUnAut HnMg== X-Gm-Message-State: AOJu0Yw8ZjmSviX9tRSUYYb9fYJApp/n7chjW4LLJV4glQVvT1cS94SE an6wsvlgqvhv3UqPl36qGXKg438IueYv8ZWZECuZV5LliyE/nPS0BJuj X-Gm-Gg: ATEYQzxQc7/ZJNU9FEZe+18AP5ERYIThqh/cZ6x8UQYDZqfUr9PfHqj8cNmhi570OvN tuqiHL+uo1wazRL5r6/nfk5n+BMKlpC+mCVMDvi6D/ebpv7Uai2s7ZfBQs7khUdV69S8yrhdqwz LaSC+hvXVW5F2zJJEXDQ7nszhO/qKTjTQF448/bq3nlzI4Orj3vBX8G0wqSAgbKXg+VmjkJbhYw X6OcvbDtVZmuBn5ZYrsD3J1hCk0OM1HBFyIx9s356c5crAYc9KGvfIcJeDcMh6Dam/asNvmEyF3 1+WfV9yRkaFDTNq6+pLHoG3M1xm4KhNz5OsDFgm9yJmIr+1t7vh8sHQ3UnHZMT72f9Ny8xEzBbY nFZm9nqPh0UpjeUWgPCNbsxmRN/m/++rTAj7cDpFPZVZuiE0gJDYGhMF7tdkk7oL5OsILBP6aKb cLMVWuteCGXO2phCofQMwiuQHO9Ls= X-Received: by 2002:a05:7300:a584:b0:2b7:1e86:3604 with SMTP id 5a478bee46e88-2c15d2b7001mr1621331eec.6.1774429797296; Wed, 25 Mar 2026 02:09:57 -0700 (PDT) Received: from wujing. ([74.48.213.230]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-2c159e25dc7sm2786389eec.27.2026.03.25.02.09.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Mar 2026 02:09:57 -0700 (PDT) From: Qiliang Yuan Date: Wed, 25 Mar 2026 17:09:33 +0800 Subject: [PATCH 02/15] sched/isolation: Introduce housekeeping notifier infrastructure 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: <20260325-dhei-v12-final-v1-2-919cca23cadf@gmail.com> References: <20260325-dhei-v12-final-v1-0-919cca23cadf@gmail.com> In-Reply-To: <20260325-dhei-v12-final-v1-0-919cca23cadf@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 , Shuah Khan Cc: linux-kernel@vger.kernel.org, rcu@vger.kernel.org, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, Qiliang Yuan X-Mailer: b4 0.13.0 Subsystems currently rely on static housekeeping masks determined at boot. Supporting runtime reconfiguration (DHEI) requires a mechanism to broadcast mask changes to affected kernel components. Implement a blocking notifier chain for housekeeping mask updates. This infrastructure enables subsystems like genirq, workqueues, and RCU to react dynamically to isolation changes. Signed-off-by: Qiliang Yuan --- include/linux/sched/isolation.h | 21 +++++++++++++++++++++ kernel/sched/isolation.c | 24 ++++++++++++++++++++++++ 2 files changed, 45 insertions(+) diff --git a/include/linux/sched/isolation.h b/include/linux/sched/isolatio= n.h index d8501f4709b58..9df55237d3901 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); @@ -33,6 +41,9 @@ extern void housekeeping_affine(struct task_struct *t, en= um hk_type type); extern bool housekeeping_test_cpu(int cpu, enum hk_type type); extern void __init housekeeping_init(void); =20 +extern int housekeeping_register_notifier(struct notifier_block *nb); +extern int housekeeping_unregister_notifier(struct notifier_block *nb); + #else =20 static inline int housekeeping_any_cpu(enum hk_type type) @@ -59,6 +70,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 67a5ff273ea08..e7a21023726df 100644 --- a/kernel/sched/isolation.c +++ b/kernel/sched/isolation.c @@ -9,6 +9,7 @@ */ #include #include +#include #include "sched.h" =20 enum hk_flags { @@ -18,6 +19,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 +88,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 housekeeping_update_notify(enum hk_type type, const struct cpum= ask *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 __init housekeeping_init(void) { enum hk_type type; --=20 2.43.0