Received: by 2002:ab2:7a09:0:b0:1f8:46dc:890e with SMTP id k9csp238493lqo; Wed, 15 May 2024 12:51:57 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXpDwe2dLBdp75Za6JSJqyQdq74LSaoF5/PZO1wuprNZWCmm4F72hembYka/RWZJGZ4mUlvXDCbLFy6x3PcTmNZSiCK7ktcK+/YN1CGqQ== X-Google-Smtp-Source: AGHT+IHuUj+L8aXKN1F4DqlOIEBFMzLutgo0x2xYWmGgyKh+vBEy8ZBBioNAiAlNaJAeCNEnAeFy X-Received: by 2002:a17:907:a4a:b0:a5a:580f:8e64 with SMTP id a640c23a62f3a-a5a580f8fcbmr899508066b.15.1715802717673; Wed, 15 May 2024 12:51:57 -0700 (PDT) Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a5cdb953406si48611966b.655.2024.05.15.12.51.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 May 2024 12:51:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-180331-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@oracle.com header.s=corp-2023-11-20 header.b=HYqfx8du; dkim=neutral (body hash did not verify) header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=Tj5qaruO; arc=fail (body hash mismatch); spf=pass (google.com: domain of linux-kernel+bounces-180331-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-180331-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=oracle.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 3E8C51F22270 for ; Wed, 15 May 2024 19:51:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 06D9415ADB0; Wed, 15 May 2024 19:51:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="HYqfx8du"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="Tj5qaruO" 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 C00461591E8 for ; Wed, 15 May 2024 19:51:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.165.32 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715802712; cv=fail; b=VnddnMGhgT47s4L6E1VTGLDS3eL9Blv4BuovSgeEJnTBQQ4Laj8N8KQbYxPROmSdIS7BNIv5vP2gTmS25/qFFRuxTzdnvCIPhekLFLP11Ca5VP63Utb/t1MPJdnQswzzWKTa+PKWffUNLJ/QrjJDf3IwswUfc/qsAtr7lVIopHo= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715802712; c=relaxed/simple; bh=aVQVLGqFdNw6cyl+jxSkzXm3ok22FRGFGpzGJ0404dY=; h=Message-ID:Date:Subject:To:Cc:References:From:In-Reply-To: Content-Type:MIME-Version; b=jVSOLrBgKVSud4s22CCBo1Jot2ADXj/Kg61hlE4sf167ETaSF0HoFUE7N66EMO49x02UJiiclKlKp4bt2zO4qWKB8yKfNhZcnc3kHIgdf1Xh0qqnWSIxLVdiMAc1rYg6NsAdp/G+aEH8NEVWY1iQrccmte9DxH+44IEoDyANsfs= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine 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=HYqfx8du; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=Tj5qaruO; arc=fail smtp.client-ip=205.220.165.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Received: from pps.filterd (m0333521.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 44FHx5BH029697; Wed, 15 May 2024 19:51:23 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=message-id : date : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding : mime-version; s=corp-2023-11-20; bh=OPjW8VFCCc6AKuH4dM3LsnPAEzwKfffEpYEtcWNVjyg=; b=HYqfx8dunPHBL9Xy9XqiPqfCkxd9WPXW7eqiGaX3qLHSBwnLOOHn1cwpHdJvR+zj7mmr hwbDHvyV1gtdShsgGRmo8SwXwWLUgME0/v4LJNN1O9zCgKw0/ydPZz61vf7E8zUzdFCO 1lBug59A5qC90+1yO32cnVcUdZPGQff442wujF7qV5xdSwyDjKGUY5AsmRkkbwqeeuzb c32QeVbcMrXFoAVXq7iMSqacDOefI1CeQMmACJ6Yw3X/OLM1Dio7E+muKMy14ZWLVIwi X/o5pio3V/D9n+LHbyRqau4sAroQgQyPdxQ7/pWpYc/v2kp3tTMIMyAOYZ4naWXvR0Sk 6w== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3y3txc3xs4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 15 May 2024 19:51:22 +0000 Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 44FIi1df019166; Wed, 15 May 2024 19:51:21 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2101.outbound.protection.outlook.com [104.47.58.101]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3y3r86thsu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 15 May 2024 19:51:21 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Y4JtQlPjQDCwWbrNYw12cI9dWoasbb1iSunzxUSxMx9zFOQeTTnglvUANHlwJ3lEoyMKpB1E8Sr4D7a/BcGA5EjxGljkH5qqrInPvXQqdMZfmxdf8xYJ2vgj426jmUWbJL122o6Utw0rQRO8MiMNoh/v/PVZAhQ3QicG/Yhw//SP8oGJT7GQvlgVcXcXq+BfxTPVZaL9xZJYA2lVigDsI3+zJrPkBnN66Ez3uxKOlI4h3hf1oNAnz//1u67/j+EH6LHDJMVWfM4L2F2il3Yhzzlprvtx1s0TP8YvcR0lfmvOUcM0pxenKRrocLKoDU/J68LF14o1l5yMfAkugrujwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=OPjW8VFCCc6AKuH4dM3LsnPAEzwKfffEpYEtcWNVjyg=; b=g3cMErMmdTBme521EkXISa83oT8wPavyhJG0kfhZWh63G1jdBXZXPRgpbtXfueJSB4nnCid30m/SJSJrMc9VlWhqGoVEpMo0Ewoj2UW+6R1dztAtkTVXdTEB3Xfqz9Ie5Q6FayPARstDGy7Ue+HxHrs3k8vHL0+ZLNvYrYmCNM44u2j8zWRDQ5FOWa9bJYj0PHh9i0DLXM61U5RcyrbPzxVVkPh2sUXKzikMfKsLOrh5Z5cmvLOW2TgiQLVbgZNUkP5HyQ0hu4Ltb6casLcXUlXh3I/kjpZLfLUWTUufbsdaQsdZ4AWg0mZ6ObWytydcfDJyrcRIogNTUf52hKcdEw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OPjW8VFCCc6AKuH4dM3LsnPAEzwKfffEpYEtcWNVjyg=; b=Tj5qaruORNvxdCuvzgKVkMr76J/nc/zE6GsC6/yBi5OlbfKZ0BHXglFGrG9f7qZTgReyEiUeL+rkGUhJelP6nmkEr86Y4pOurbUH+4cQexhts6YkiTYPobnmFcjqTdXiBbxtVIt1Bo5aCg5RxJTlw73y7etFTEBfKWcD+A4/4KY= Received: from SA0PR10MB6425.namprd10.prod.outlook.com (2603:10b6:806:2c0::8) by CO1PR10MB4803.namprd10.prod.outlook.com (2603:10b6:303:92::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7587.27; Wed, 15 May 2024 19:51:19 +0000 Received: from SA0PR10MB6425.namprd10.prod.outlook.com ([fe80::447b:4d38:1f8b:28f1]) by SA0PR10MB6425.namprd10.prod.outlook.com ([fe80::447b:4d38:1f8b:28f1%5]) with mapi id 15.20.7587.028; Wed, 15 May 2024 19:51:19 +0000 Message-ID: <954040a2-435d-48d9-b5de-9ce46ffba238@oracle.com> Date: Wed, 15 May 2024 12:51:17 -0700 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/1] x86/vector: Fix vector leak during CPU offline To: Thomas Gleixner , x86@kernel.org Cc: mingo@redhat.com, dave.hansen@linux.intel.com, hpa@zytor.com, joe.jin@oracle.com, linux-kernel@vger.kernel.org, virtualization@lists.linux.dev, Borislav Petkov References: <20240510190623.117031-1-dongli.zhang@oracle.com> <87msotnaow.ffs@tglx> <2b8e02cd-2f2e-4bf1-9332-6dde502c22b1@oracle.com> <87eda5mitw.ffs@tglx> Content-Language: en-US From: Dongli Zhang In-Reply-To: <87eda5mitw.ffs@tglx> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: BYAPR08CA0038.namprd08.prod.outlook.com (2603:10b6:a03:117::15) To SA0PR10MB6425.namprd10.prod.outlook.com (2603:10b6:806:2c0::8) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SA0PR10MB6425:EE_|CO1PR10MB4803:EE_ X-MS-Office365-Filtering-Correlation-Id: 4d013df4-f128-4986-4d6b-08dc751863a4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|1800799015|376005|366007; X-Microsoft-Antispam-Message-Info: =?utf-8?B?RGtDQkd1dGN6am8rdjJWOHA2MnZ2dW8yYVQ5eDh2ZXAyVHZuSlN1b2VmN3Bm?= =?utf-8?B?RWdKTUNoaDg3c3FzV2dKdmxibjhuNUJVTEVSR0ZIbWs2YlhoaCtWaUpiaTJH?= =?utf-8?B?Q0hwU1FXN3MrcnFrUVYra3ZTb3hVNyszMTBQemVmd0U4MWRLMnV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Fd1MUZVNHlZcUZmK09oTFE2MUJz?= =?utf-8?B?NUR2UGtBN3h4NXp4ejFaTUNvK2tCU0l2ZE04M0M1NHdlM01yTlhBOXhJcHNF?= =?utf-8?B?eittR3BWbzBqM284WWlhRmlqUndDU1RiYk91bk5qWDYzR1MzcVMrQ1F3aE5I?= =?utf-8?B?dXdrUStlUjEvbWU1d3JOVXdVRVRDaVc1elBFY1VKL2duYTF4SFVlZVJlVnNx?= =?utf-8?B?M1JtSno2VUtlVEk4aER5Zi9lbzZzY25udFdWcWc1amw2bTI3TW9zNGM3bGZY?= =?utf-8?B?cUtEaXdZaUN1QXFuc2RaUFpLMUNQVlE2K2ViZzhtVXhTTFZNWFlaUHQvVThl?= =?utf-8?B?MXdjN3NMV0s2U0FlL0dkN2xsU0tKc2pmOTlndXNHRjNNL005RkdWYmUrNGI2?= =?utf-8?B?OVdCRkpJMUFzcGhTRExoTXZoczdzWU5HWC9pamNyN0xuQ3lrRExFSGg2RHE3?= =?utf-8?B?Vk9oMEpmT21YSFBneTI3L2NEVWE3eHpWNVMralFaUE16dlE5eHRIdnlDQlU2?= =?utf-8?B?ZUpTdkxGMjd0MS95NGRwWU5EckdWbmxJejlGdXg5aWFyV25VdjJLV0ZuM0h5?= =?utf-8?B?czF0aDcrU0J0YkgrNlRubUtaM3dib3BSVmdDdjRTZHNPZnQ0R0YvWmplZUIx?= =?utf-8?B?R1pSR1lhSDNvcUxjclY2a3l2bjBQL1BPS1gwcnhyanhrRTBRMk5Rd3VnPT0=?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SA0PR10MB6425.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(1800799015)(376005)(366007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?NVRMaUcyNkh2K0hydXowVGpTa0tJNW1xTmxIV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5OudcCSVg+yHb7bbEolmeBZ8o= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4d013df4-f128-4986-4d6b-08dc751863a4 X-MS-Exchange-CrossTenant-AuthSource: SA0PR10MB6425.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 May 2024 19:51:19.2208 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: AXL7WWzIINOrZlncIpzLVh0eLA56CycVF9Gj1AyTLEu+bnBnuyRVAR5DZpvXrmGjQ1WlypuVCLWgVkump8hSyg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR10MB4803 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.650,FMLib:17.11.176.26 definitions=2024-05-15_12,2024-05-15_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 bulkscore=0 mlxlogscore=999 spamscore=0 suspectscore=0 mlxscore=0 malwarescore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2405010000 definitions=main-2405150142 X-Proofpoint-GUID: kn-b0itJfs_3HES53Rvi-n7HTzyqyPdz X-Proofpoint-ORIG-GUID: kn-b0itJfs_3HES53Rvi-n7HTzyqyPdz On 5/13/24 3:46 PM, Thomas Gleixner wrote: > On Mon, May 13 2024 at 10:43, Dongli Zhang wrote: >> On 5/13/24 5:44 AM, Thomas Gleixner wrote: >>> On Fri, May 10 2024 at 12:06, Dongli Zhang wrote: >>> Any interrupt which is affine to an outgoing CPU is migrated and >>> eventually pending moves are enforced: >>> >>> cpu_down() >>> ... >>> cpu_disable_common() >>> fixup_irqs() >>> irq_migrate_all_off_this_cpu() >>> migrate_one_irq() >>> irq_force_complete_move() >>> free_moved_vector(); >>> >>> No? >> >> I noticed this and finally abandoned the solution to fix at migrate_one_irq(), >> because: >> >> 1. The objective of migrate_one_irq()-->irq_force_complete_move() looks to >> cleanup before irq_do_set_affinity(). >> >> 2. The irq_needs_fixup() may return false so that irq_force_complete_move() does >> not get the chance to trigger. >> >> 3. Even irq_force_complete_move() is triggered, it exits early if >> apicd->prev_vector==0. > > But that's not the case, really. > >> The apicd->prev_vector can be cleared by __vector_schedule_cleanup() because >> cpu_disable_common() releases the vector_lock after CPU is flagged offline. > > Nothing can schedule vector cleanup at that point because _all_ other > CPUs spin in stop_machine() with interrupts disabled and therefore > cannot handle interrupts which might invoke it. Thank you very much for the explanation! Now I see why to drop the vector_lock is not an issue. [snip] > >> diff --git a/kernel/irq/cpuhotplug.c b/kernel/irq/cpuhotplug.c >> index 1ed2b1739363..5ecd072a34fe 100644 >> --- a/kernel/irq/cpuhotplug.c >> +++ b/kernel/irq/cpuhotplug.c >> @@ -69,6 +69,14 @@ static bool migrate_one_irq(struct irq_desc *desc) >> return false; >> } >> >> + /* >> + * Complete an eventually pending irq move cleanup. If this >> + * interrupt was moved in hard irq context, then the vectors need >> + * to be cleaned up. It can't wait until this interrupt actually >> + * happens and this CPU was involved. >> + */ >> + irq_force_complete_move(desc); > > You cannot do that here because it is only valid when the interrupt is > affine to the outgoing CPU. > > In the problem case the interrupt was affine to the outgoing CPU, but > the core code does not know that it has not been cleaned up yet. It does > not even know that the interrupt was affine to the outgoing CPU before. > > So in principle we could just go and do: > > } else { > - apicd->prev_vector = 0; > + free_moved_vector(apicd); > } > raw_spin_unlock(&vector_lock); > > but that would not give enough information and would depend on the > interrupt to actually arrive. > > irq_force_complete_move() already describes this case, but obviously it > does not work because the core code does not invoke it in that > situation. > > So yes, moving the invocation of irq_force_complete_move() before the > irq_needs_fixup() call makes sense, but it wants this to actually work > correctly: > > --- a/arch/x86/kernel/apic/vector.c > +++ b/arch/x86/kernel/apic/vector.c > @@ -1036,7 +1036,8 @@ static void __vector_schedule_cleanup(st > add_timer_on(&cl->timer, cpu); > } > } else { > - apicd->prev_vector = 0; > + pr_warn("IRQ %u schedule cleanup for offline CPU %u\n", apicd->irq, cpu); > + free_moved_vector(apicd); > } > raw_spin_unlock(&vector_lock); > } > @@ -1097,10 +1098,11 @@ void irq_force_complete_move(struct irq_ > goto unlock; > > /* > - * If prev_vector is empty, no action required. > + * If prev_vector is empty or the descriptor was previously > + * not on the outgoing CPU no action required. > */ > vector = apicd->prev_vector; > - if (!vector) > + if (!vector || apicd->prev_cpu != smp_processor_id()) > goto unlock; > The above may not work. migrate_one_irq() relies on irq_force_complete_move() to always reclaim the apicd->prev_vector. Otherwise, the call of irq_do_set_affinity() later may return -EBUSY. 801 /* 802 * Careful here. @apicd might either have move_in_progress set or 803 * be enqueued for cleanup. Assigning a new vector would either 804 * leave a stale vector on some CPU around or in case of a pending 805 * cleanup corrupt the hlist. 806 */ 807 if (apicd->move_in_progress || !hlist_unhashed(&apicd->clist)) 808 return -EBUSY; Or maybe add a flag to control whether to enforce a cleanup in any conditions? -void irq_force_complete_move(struct irq_desc *desc) +void irq_force_complete_move(struct irq_desc *desc, bool always_force) { struct apic_chip_data *apicd; struct irq_data *irqd; @@ -1102,6 +1103,9 @@ void irq_force_complete_move(struct irq_desc *desc) if (!vector) goto unlock; + if (!always_force && apicd->prev_cpu != smp_processor_id()) + goto unlock; + /* * This is tricky. If the cleanup of the old vector has not been * done yet, then the following setaffinity call will fail with .. and call irq_force_complete_move() at different places? @@ -79,6 +79,11 @@ static bool migrate_one_irq(struct irq_desc *desc) * interrupt. */ if (irqd_is_per_cpu(d) || !irqd_is_started(d) || !irq_needs_fixup(d)) { + /* + * Complete an eventually pending irq move cleanup if this + * interrupt was affine to the outgoing CPU. + */ + irq_force_complete_move(desc, false); /* * If an irq move is pending, abort it if the dying CPU is * the sole target. @@ -93,7 +98,7 @@ static bool migrate_one_irq(struct irq_desc *desc) * to be cleaned up. It can't wait until this interrupt actually * happens and this CPU was involved. */ - irq_force_complete_move(desc); + irq_force_complete_move(desc, true); /* * If there is a setaffinity pending, then try to reuse the pending Thank you very much! Dongli Zhang