From nobody Mon Feb 9 17:23:27 2026 Received: from mail-dl1-f54.google.com (mail-dl1-f54.google.com [74.125.82.54]) (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 DA688302756 for ; Fri, 6 Feb 2026 07:05:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770361528; cv=none; b=F3m12jgGqzWR3MhRvAhNzugTf+v1y3xqcL1CCrY63aQNxPBB6d13F6PFjzlOLGoIY+4glvakKQ75HsQpdvydMlRKs433UyCZd5W+RRsGrlaFc/miaXbnb12qLF9HyLU/Q2E3+zc3GXD4DvpBzgnJ7+cG1GOH+hUYyl0qmLdYfQQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770361528; c=relaxed/simple; bh=jQlgM95JazGPee4Uxm5VsMs1dWBVBeceOIcoQGdsSOo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=iLa6AS64awHznPBZS5XF1iTOEd/8Nfs2Q+PAGOe7Q/0f+lWMEQCFisUT5o/RBRgMzz2Bd4AMouWC99aIrYtzgZlvV9GgqcuVoM7J5uA4C+ke+h7IsWYHSEsI+0WfpKnmCZHBvP56yL1t+d33o325mPIXd56mVuayZs1o6OkvwM0= 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=H+YHvZZ+; arc=none smtp.client-ip=74.125.82.54 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="H+YHvZZ+" Received: by mail-dl1-f54.google.com with SMTP id a92af1059eb24-126ea4e9694so2636698c88.1 for ; Thu, 05 Feb 2026 23:05:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1770361527; x=1770966327; 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=5YEyu0s9ArePSjQ+ivxTOHvq670EsiUwyYwwidqduHM=; b=H+YHvZZ+kjA0FqfemVYPcHFHGxGaoA+zs7ULeKkfe4V5gCGu35Trnz5OVnRo68V2Hv hVMB9RzqLX02PvgAlIKu4QpmNwLJh452HTFlRAnnY5NIaxOFx6OMDrSfz21MbF2yQnTj qIMenKih62LfgEc6chQJeZKxwwY3ov16Q801tnkxw/Z5b9RaKDwwvR5zEPAah5OZN1os a9MJivXtUvmkw8dtFTkuKLBKp3xPF5HDpEjD+HoZR0nb79CXN4qQq5geWh69se8mJylk yDDticJ+CmHkEsYULIgeC/K2dFufKxEDvvnPqaJWk4BFyP2fG0tkS2Qb2xSiK7e2S3F1 p7mA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770361527; x=1770966327; 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=5YEyu0s9ArePSjQ+ivxTOHvq670EsiUwyYwwidqduHM=; b=SJxnK6d9N/3nER03Hg6M7cwgJIEvoaA4/+lU80dkXCA14SgpGRpzb3P7I2AJtthXWR dxZxjfK1yNBmIe+o6hxeVF2cc3QBMqWPZK7jKtJF0HvNrtNkspYjdE4KEbNpzVNoEVWb y7XMsv6cA9LxyI44qe9tvsQyVhhG7hUyIATN3ikG3A4c3vNLEtuKB62bqtHg53UAWInz /7Skrt2PSWzp6Dr+1sZdt7o9GnUOO7narhi57echY/DokPq036qgRLyJj5qR5SQ8KNSJ VVpq3Fl4e6deVRhLK6SL3LNbB2QOc/4BqcYKMDefnvTro8vmXMJWAh4xvNiCYZs7f1NQ JbEw== X-Gm-Message-State: AOJu0Ywax8bnTSmqEM2nciH6L94Dc8L1ai0vKSNDvMv7BO0SIQjK+yGQ 4M2dRlJWavXzdN4S+fwcOcWgf0fpAvWVIeJDqp/ebEXavp0qsyR3+qJN X-Gm-Gg: AZuq6aIoeJeG6oL5hOQl8vwXj1ru7MMcwtkNldCuIDDzGEL08dJsoTa/BrDYUxYgjhC VlzJymAVSoc21dmWvaMuq3OD9A3b0AO7yrSfh6wh1oW7yvFI4o+wZQLErWJtw7BduI7LW80x2Dj EgQl0fwnP8OXwF3hms1NqoIZH1bz3ndvr4pvWyxo4+o9/LKgq9Hcu3fKZR5DtaHWNcSsFCTI3Ym PP9qp6kOhszOZ43ygzMZxgYczyQnXCVV2luqtHACjcDsxPfdrgnE+oO+9h/lN5Xwm4Js0JZSjSK VA+1lWwXlm3En6Bz0c9+L+59znh5h475XLxkYDMEvoM2tbcgmWvkVzC7YpCHCGr3TaITl5g751C 16kZWMPEvJzjf/zwEw3UbdDBnAONi48C61X9Xe3GuFEX39Ak2hdWmhq02FioJ+9bCRF49D2Kdu/ pdWutzXGe6aQ== X-Received: by 2002:a05:7022:222a:b0:11b:9386:825c with SMTP id a92af1059eb24-1270402ea16mr1071439c88.41.1770361526887; Thu, 05 Feb 2026 23:05:26 -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.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Feb 2026 23:05:26 -0800 (PST) From: Qiliang Yuan Date: Fri, 06 Feb 2026 02:04:24 -0500 Subject: [PATCH RFC 03/12] genirq: Implement dynamic migration for Managed IRQs 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-3-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 Support dynamic reconfiguration of CPU isolation by making the managed interrupts responsive to housekeeping mask changes at runtime. 1. Register a housekeeping notifier in the genirq subsystem to listen for HK_TYPE_MANAGED_IRQ updates. 2. Iterate through all active interrupts when a mask update occurs. 3. Re-apply affinity for managed interrupts to ensure they honor the newly configured housekeeping mask. 4. Use irq_set_affinity_locked() to trigger migration away from newly isolated CPUs or towards newly designated housekeeping CPUs. Signed-off-by: Qiliang Yuan Signed-off-by: Qiliang Yuan --- kernel/irq/manage.c | 52 +++++++++++++++++++++++++++++++++++++++++++++++++= +++ 1 file changed, 52 insertions(+) diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c index 349ae7979da0..9523f0655b12 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c @@ -21,6 +21,7 @@ #include #include #include +#include =20 #include "internals.h" =20 @@ -2811,3 +2812,54 @@ bool irq_check_status_bit(unsigned int irq, unsigned= int bitmask) return res; } EXPORT_SYMBOL_GPL(irq_check_status_bit); + +#ifdef CONFIG_SMP +static int irq_housekeeping_reconfigure(struct notifier_block *nb, + unsigned long action, void *data) +{ + struct housekeeping_update *upd =3D data; + struct irq_desc *desc; + unsigned int irq; + + if (action !=3D HK_UPDATE_MASK || upd->type !=3D HK_TYPE_MANAGED_IRQ) + return NOTIFY_OK; + + irq_lock_sparse(); + for_each_active_irq(irq) { + struct irq_data *id; + + desc =3D irq_to_desc(irq); + if (!desc) + continue; + + scoped_guard(raw_spinlock_irqsave, &desc->lock) { + id =3D irq_desc_get_irq_data(desc); + if (!irqd_affinity_is_managed(id) || !desc->action || + !irq_data_get_irq_chip(id)) + continue; + + /* + * Re-apply existing affinity to honor the new + * housekeeping mask via __irq_set_affinity() logic. + */ + irq_set_affinity_locked(id, irq_data_get_affinity_mask(id), false); + } + } + irq_unlock_sparse(); + + return NOTIFY_OK; +} + +static struct notifier_block irq_housekeeping_nb =3D { + .notifier_call =3D irq_housekeeping_reconfigure, +}; + +static int __init irq_init_housekeeping_notifier(void) +{ + housekeeping_register_notifier(&irq_housekeeping_nb); + return 0; +} +core_initcall(irq_init_housekeeping_notifier); +#endif + + --=20 2.51.0