From nobody Sat Feb 7 16:26:54 2026 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 99E99149C6F for ; Fri, 2 Jan 2026 16:53:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.165.32 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767372828; cv=none; b=iyZJiFRwsoeRiut45lhcdwRtOmuWDMQyKsAC0/oT2Lh+nHaixHNCwd5CZXxqkOEeqJVQ5bW7BQ0DbBFIs7kMuZPJ4dtkcwoNqorbLSeoQQ+jwBFsDXhYITso5XIbbIjHvP0oSasj9c0noftdWPU1qz6S2eI5RTk1C4ra5ywPbz4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767372828; c=relaxed/simple; bh=rTXh0SSCmbQtkgx4Je4gILsPfAoIyS6BU3plszU+NgM=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=H8PqDGvxVLu5myWIw6X17ihUa4fxVvT2taRGa4mOp8wfhpalEQ28hjy8zT+V9SDL6Zv+gX6oheY9iWcruTXmo2AGaIhHc9bcvbpGkb9Yz4BFG9ivOL+w7aofoYhtctF2zTrTCtssDNzYr6hGdzclqyNr1ih/4WbbWbAygbKYsj4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=qIxKJmzs; arc=none smtp.client-ip=205.220.165.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="qIxKJmzs" Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 602BuqJm2742087; Fri, 2 Jan 2026 16:53:37 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=cc :content-transfer-encoding:date:from:message-id:mime-version :subject:to; s=corp-2025-04-25; bh=Ar0XLuCZ7xHzQaHki/t3ExB4fT6UF DFtgFdJy/QqPDQ=; b=qIxKJmzs8Zqwif334j+YP/0/CW+Mw99+5N/Ud8rj8o+R4 GFAhRcbC+3yNQ0pA9IhSX+yPZ+lY0lAoyX7X2/zTj/KbPZVuHWAqD7ycQ/LdEFNq XMwjRcPU3EUmPU/x1IUWHe4R64VxE3x56vrIuCjx4w7stMKrpcUghYWAGDV8cca6 Bu/X32WTGkQdXjvVy6UVEWbNJfpntFMbGAPTdUwx8v5j2DPy2UXep50SKMoqu/ZH o+adMfuM2NSMJLQ5d5w2rmx7//uoz1Tc5+Io/XXDr2jf79BqRyxOXT9wAhvrkB3F gNc22kgxw2v8W82Bmidld5WmGtZIhGYMEda73eJyQ== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 4ba80pw89h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 02 Jan 2026 16:53:37 +0000 (GMT) Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 602ErRS0038335; Fri, 2 Jan 2026 16:53:36 GMT Received: from imran-metabox.au.oracle.com (dhcp-10-191-119-136.vpn.oracle.com [10.191.119.136]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTP id 4ba5w9yvmq-1; Fri, 02 Jan 2026 16:53:36 +0000 From: Imran Khan To: tglx@linutronix.de Cc: linux-kernel@vger.kernel.org Subject: [RFC PATCH v2] genirq/cpuhotpug: notify of irq affinity change for offlined cpu. Date: Sat, 3 Jan 2026 00:53:08 +0800 Message-Id: <20260102165308.76290-1-imran.f.khan@oracle.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.100.49 definitions=2026-01-02_02,2025-12-31_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 mlxlogscore=981 malwarescore=0 suspectscore=0 spamscore=0 adultscore=0 phishscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2512120000 definitions=main-2601020151 X-Proofpoint-ORIG-GUID: 6Z-mgAZ-b2kuSEJsIWddOoJdLOGC33p7 X-Proofpoint-GUID: 6Z-mgAZ-b2kuSEJsIWddOoJdLOGC33p7 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMTAyMDE1MCBTYWx0ZWRfX6qnYCFt5Y+ez 1cK6N7pK4ctKsrFb74lGaSXLtWXbiMYG6im7PjA6/5rrtcGpEznL50bNZ/R73wpGmxKFxpSlbY5 sHZkf4kJaw0NTxTRuo/1f2NlZ87/Vbf4xwrLZZf36o85wwzM6Xba4PS3bKU9qGs7hckRkImQvKU MZqX5zOqIz7F8FQCXCYum3uuRyp17YEzQlAlGbNqLamkz2tA6w3AJhu1y6g1LL6YJpcyCv8lfEQ /rhwFzAoutGJ1y/TLRXk/bzqD7XzbZi6P8AQtqosckEqBMxHALkAc7+6TcLZ7FIJyEfkg6PgFoX ex8GhsLLi/AFk6w6tA3ItdHJorol4F/yroHZg0f0UcY2S8+oC8Xf1cGxVkx7bAA9Xbs1YZ0OucP PDkBuqaq9ARpItYKLaWBUNcteIXRIkeL81JX16dbXf9ywqSrXSBYn92/ZUZlf462zwqqwwYFKXh zS12u6JV72EJUQsVWpw== X-Authority-Analysis: v=2.4 cv=RY2dyltv c=1 sm=1 tr=0 ts=6957f811 cx=c_pps a=XiAAW1AwiKB2Y8Wsi+sD2Q==:117 a=XiAAW1AwiKB2Y8Wsi+sD2Q==:17 a=vUbySO9Y5rIA:10 a=VkNPw1HP01LnGYTKEx00:22 a=yPCof4ZbAAAA:8 a=OZUZPLp5RXmhioZ-uJ8A:9 Content-Type: text/plain; charset="utf-8" During cpu offlining the irqs with broken_affinity are affined to other CPU but this affinity change is not accounted for by desc::affinity_notify (if available). This can leave users of irq_set_affinity_notifier, with old affinity information. Signed-off-by: Imran Khan --- v1 -> v2: - Fix compilation error due to missed parenthesis around scoped_guard kernel/irq/cpuhotplug.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/kernel/irq/cpuhotplug.c b/kernel/irq/cpuhotplug.c index 755346ea98196..30153be1a4cca 100644 --- a/kernel/irq/cpuhotplug.c +++ b/kernel/irq/cpuhotplug.c @@ -177,9 +177,17 @@ void irq_migrate_all_off_this_cpu(void) bool affinity_broken; =20 desc =3D irq_to_desc(irq); - scoped_guard(raw_spinlock, &desc->lock) + scoped_guard(raw_spinlock_irqsave, &desc->lock) { affinity_broken =3D migrate_one_irq(desc); - + if (affinity_broken && desc->affinity_notify) { + kref_get(&desc->affinity_notify->kref); + if (!schedule_work(&desc->affinity_notify->work)) { + /* Work was already scheduled, drop our extra ref */ + kref_put(&desc->affinity_notify->kref, + desc->affinity_notify->release); + } + } + } if (affinity_broken) { pr_debug_ratelimited("IRQ %u: no longer affine to CPU%u\n", irq, smp_processor_id()); base-commit: f8f9c1f4d0c7a64600e2ca312dec824a0bc2f1da --=20 2.34.1