From nobody Sun Feb 8 05:28:27 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 069A9264619 for ; Fri, 2 Jan 2026 15:26:58 +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=1767367621; cv=none; b=p2GbnWAdXvjituy+WV5J0i39rL21NZBiep4EXTKFWzJD3OplXLo9KT6BA2nV86l8FR3HDu4Gi2cfErEp8FQ7szB+CQvhDFSMTMAhWHjj0NyZWBd0Kvbe2znBfanLOoRYVvnOf5FgGj9GWfyzzesOyEyzXcAz9vlle3SJ0eifXYA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767367621; c=relaxed/simple; bh=j5CSN9z2O3mHBJl8KVHdZo9IKXiALwSBxUbRZ/HLRZg=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=NdaJtv4SRYbgw9r8tVzz+p7Y1PmqlXep9Em8yQ9WNX8SRKa6B/00OBn0ELoPsrF6qcpV1R6RxjgzkVuHxQjVPh7cOqJZ75Akvk5n1lSbr8PB1G6GjiW89TVgOtm4DfcgnqoGQpt8wpSRnlg11iP7bxroH3AODdjdLYGWNmywqKA= 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=O/CvPtRo; 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="O/CvPtRo" Received: from pps.filterd (m0333521.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 602BusWc2923663; Fri, 2 Jan 2026 15:26:43 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=uo/i45IurQ2Zdp0m82hVzZ0+s6aB+ vLyxiqDMCRqFqc=; b=O/CvPtRo1BrEGVstB31wwY1D2r5iYEybWWijH9SCitxSU t5yb4FE4uwGoA+GjyRsVdGvoiWV/xilCrTL/fzZ5mT3g4xSk2WtkYJ4jqhQmxaOL afm+jEz6iZkaDA4lZ4I9vAGUn8lFxZ60uf307UkGB5Ig0cC61k0gjB4iFL712vMN Xg15+4U7nF1moO/csWl+Qdc1y/0nG5Oa+anNvtcsc+xDW3YOwor2nNSWSXwkXNBI YEoHREY1+CxB0u0hsDCACawbeC3YbF4uOxwO/wAzizBw3XUDkUmnwA07RyeLu5ch skvnG2a43w9JPxw76EjswbCM3WCpUh77dXcqCBJNw== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 4ba6c8w8dm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 02 Jan 2026 15:26:42 +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 602FLCTw038976; Fri, 2 Jan 2026 15:26:40 GMT Received: from imran-metabox.au.oracle.com (dhcp-10-191-119-125.vpn.oracle.com [10.191.119.125]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTP id 4ba5w9wpw1-1; Fri, 02 Jan 2026 15:26:39 +0000 From: Imran Khan To: tglx@linutronix.de Cc: linux-kernel@vger.kernel.org Subject: [RFC PATCH] genirq/cpuhotpug: notify of irq affinity change for offlined cpu. Date: Fri, 2 Jan 2026 23:26:37 +0800 Message-Id: <20260102152637.25377-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=999 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-2601020138 X-Authority-Analysis: v=2.4 cv=a4E9NESF c=1 sm=1 tr=0 ts=6957e3b2 cx=c_pps a=XiAAW1AwiKB2Y8Wsi+sD2Q==:117 a=XiAAW1AwiKB2Y8Wsi+sD2Q==:17 a=vUbySO9Y5rIA:10 a=VkNPw1HP01LnGYTKEx00:22 a=yPCof4ZbAAAA:8 a=XkPG0Lh8YZ3AMRgiu5QA:9 X-Proofpoint-GUID: jjLSV1c2kO8LPiOFdhYhXOHYzhBi018V X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMTAyMDEzOCBTYWx0ZWRfX239sUFE+nWu7 ABIwIPK54lgoN05csoE201cbsKWepDApCC1mRRVoIRoiRo6BCeYyYaWzwaaubMadFcgpM4AjKi6 tWU33FlBBKfPSA2p55O8gPG2n9xCfF3iLJaTJG3xJ4ZB0iJQGlTah/IpBltHWnMelWPf0tnmHNL JXwuoNx/UischMZsb1qrWS/G+iduCCdnRmxyO3wxJIcI/OxmOnryFPe8AuOU1BVBy/JF4uAKOlP 2nyXABe9WJjvRbMWbsnKkcMLjOjt2D0adcZeALFhXMcCvm7Xn3MRLUpOvfbHiQdvrychJ/HTcA7 Xc8yOO8WFxhzH67i5/fzLqifkwyH1FaYwwxguGG2RdyxukCM7+FT9i3RRI+97/QnjGUCzdlPBEM 7BYwkl5dWvTdgNV8RCgGCf7y8Sr+I4A92ncYbqjqjlBw1aYV0MbOah1+gz6y4uvayGlGOmSBqOL 5yr3QhY9n614YqNF8bQ== X-Proofpoint-ORIG-GUID: jjLSV1c2kO8LPiOFdhYhXOHYzhBi018V 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 --- I have kept the patch as RFC because I am not sure, if there is=20 some specific reason (and I have missed that) behind not getting affinity change notification for cpus being offlined. kernel/irq/cpuhotplug.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/kernel/irq/cpuhotplug.c b/kernel/irq/cpuhotplug.c index 755346ea98196..0ab0919f2cb57 100644 --- a/kernel/irq/cpuhotplug.c +++ b/kernel/irq/cpuhotplug.c @@ -177,8 +177,16 @@ 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); + } + } =20 if (affinity_broken) { pr_debug_ratelimited("IRQ %u: no longer affine to CPU%u\n", base-commit: f8f9c1f4d0c7a64600e2ca312dec824a0bc2f1da --=20 2.34.1