Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp2952965rdh; Wed, 27 Sep 2023 19:43:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEu4PICTYAz3eCADncWGhoi9p8nl9i27mCdJDdgl0skPbAAN4Cq1Zsim7Pqh97pNVbCHFGh X-Received: by 2002:aa7:8892:0:b0:690:41a1:9b77 with SMTP id z18-20020aa78892000000b0069041a19b77mr4161996pfe.10.1695869035886; Wed, 27 Sep 2023 19:43:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1695869035; cv=pass; d=google.com; s=arc-20160816; b=YfTK0iNL+NSxc07NsAMbROkq0GF8/5A8+bx3Bh5ptQ46ohKHOLlgus07R0DNGZhK+H pmxLzc9CffhqlUGqYQLTXK7GvxflEB9sPO0bgkmHLv7NksClwaLPtSB5n+/SrmzeiQbl 0iqs46x9A7c0PH8mg/YqUEbOtmujqBEeyYbLYRSPSvjhQqznLOYQaMlIvmNA//MkRyYD X+7oo/amUwxQN3NZCqLhQnOg9t3/BmkZJuoq1PoGx8NUwNw8KCOly2OuPPTOUGSDhYmk W2DHZ2x0b0lqRnJMsBJcia+uYBiuJxdiVN79rU+7P/ok4NtpblKWHQs8BM3jnuAGi6Sn SrZQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:date:message-id:dkim-signature:dkim-signature; bh=3GsKUt5ndQlkwZEex0V3wPdDzGrr9hhL6sQ2S5sAPXA=; fh=ybMkmNp8gr/fiU7e6UUqYY9YPxPunWITxNfwo6O2zvs=; b=k7PCKF+X85pViJYmioQsNSpowzN9Jq3tHC99/VKfYKkqSQ7nmDl7VFodxobA42Bbs7 bcgmaCftzditrXJMkb2CEoes4DLx1m2oAhG1KAeOGy7Nm+AlKh4DVlpIlBzetoWQyl+z Zhlr5o5dCOQdGKEvkMxG7VhuIrNHDYIGHaUtIzc2cesFdMvQNcLwgT9C2lbDMcPyoRNz wYTXSX01X2xVJBi/5X3QsNxGLSUZSwb0SIvfwQWgeCok02+ZXES+elOe8EWKr8CDdZ2w KeBvuiMvr2FsxTWFnqWDG5dPm/Avw+rfVktIw3gITTalgmZkjRw0pFabfSpfE4D6iVgo k2og== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-03-30 header.b=sK1WAD7K; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=wy2W5zlz; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id z188-20020a6333c5000000b00564f4a7f70asi5861781pgz.412.2023.09.27.19.43.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Sep 2023 19:43:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-03-30 header.b=sK1WAD7K; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=wy2W5zlz; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id A1F0D81BB3DD; Mon, 25 Sep 2023 07:59:57 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232395AbjIYO7s (ORCPT + 99 others); Mon, 25 Sep 2023 10:59:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47964 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232413AbjIYO7j (ORCPT ); Mon, 25 Sep 2023 10:59:39 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 18469103 for ; Mon, 25 Sep 2023 07:59:33 -0700 (PDT) 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 38PECLaR027263; Mon, 25 Sep 2023 14:59:20 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-03-30; bh=3GsKUt5ndQlkwZEex0V3wPdDzGrr9hhL6sQ2S5sAPXA=; b=sK1WAD7KLdGdwJlUqbXvmsCimk6K1ILR0513mOrXJ4aEmfoH33S2pbty1i4QJj99z6eG orSaySAirdKuOq61cbqo/Emfg5jyW9LNxivdj2JLiF82ALJXQt8SNf8j219p1tdx6b5p ZV0DqeJZIefrqkHZJeW6n8QSmGwPHYx7Kh1bn0zQv82jG+z2zp0zQydWwOMyzFmXei2Z FhvyCerUtRyeZlPricGVOB7uUSEzBCtPbllNFhXATaisDLQN6KlIl599o9Qi988T6Odm hoBECVqcl7YLBSEhXH3XajAw5Vtk1pCiWURm5ROSAzJavecI+X+yPoVVHJUsFb5GFKKK Mw== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3t9pxbuyvk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 25 Sep 2023 14:59:19 +0000 Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 38PE1SdZ003231; Mon, 25 Sep 2023 14:59:19 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2101.outbound.protection.outlook.com [104.47.55.101]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3t9pf4t09h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 25 Sep 2023 14:59:19 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=euiYSPERIJ7tqr0gnI857/nrVbuDwNanI80iLoMXOlvFk2vH/RjFZgidYjr2+hBEIvVzEwcKqp4mofVi6FGXjgD6YJKjO3uycfZQGdTsoVMqII16mdJDa5ND9yro0Zilnr/DTYGDVqteyF+KLAYkQyh/mpUxBjNXpYift9rj3p5btmWbwIoXt68EYBbMu3ZOXSzeN+2dpxFPf6rO/vtBkbbEydFJ3Z0pdYGqYT6jxwphYvySe8xByGzstFuyyINnRzqB+rpjWfnLLCPWAszPCtmvGviTnNT05cR8WZJw2xUO+NE5mFcP1phSVGZaDSyHhzLcOD8rOJnHr7oB3BvGeg== 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=3GsKUt5ndQlkwZEex0V3wPdDzGrr9hhL6sQ2S5sAPXA=; b=QU11xOeEeyu8rl+tlwn0c5ZsoC0Jb52xjCOLtq/VjLtZVN4aAMLvZtRvgYtRpi6DoHVBo9Yg0URO/sdnQURRSDEupWEkxyso5vI4UzaXUjKHTIsQRK24NXpbbPBdithYHZR1xEq13nkwoCMDlJwvdmTpUX1htv9zMLCUVB+m8zWyZGHazNQ57gFihWuP2MIvn+fmjoguD8x9gyW/jHcV1leTEg0jgDAoBAEnn8O7xzs5xa5q0WqkW3ZKXvTJXeuLfQfFOd5ttuqEM3IQ6e1cL/sXFnqgf3a+XJ5cZZMjCDUxTsYJIn15UkgXgsqCV1KgEZLfIKltDfm6/brv2LgXXA== 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=3GsKUt5ndQlkwZEex0V3wPdDzGrr9hhL6sQ2S5sAPXA=; b=wy2W5zlzuEIXKyFpfDtBr9VKDbQCRI0qbflaUaEkdDBeHPsGJZKnBtU6uB0W8P6UmX1Tau4OkDxG1QauzPsGxwJnDa2Uajr0Ps0V0iqQREMhOYCxZdmQhjyh0gqKbn5RFtgRuXjvlmW22LBiAs88bwpWPts9FzT6gmSBDgYbi3I= Received: from CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) by IA0PR10MB7159.namprd10.prod.outlook.com (2603:10b6:208:401::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6813.28; Mon, 25 Sep 2023 14:59:17 +0000 Received: from CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::f083:4d6:5079:bf24]) by CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::f083:4d6:5079:bf24%4]) with mapi id 15.20.6813.017; Mon, 25 Sep 2023 14:59:16 +0000 Message-ID: Date: Mon, 25 Sep 2023 09:59:13 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCH v2] Crash: add lock to serialize crash hotplug handling Content-Language: en-US To: Baoquan He , linux-kernel@vger.kernel.org Cc: kexec@lists.infradead.org, akpm@linux-foundation.org, vschneid@redhat.com, dyoung@redhat.com, sourabhjain@linux.ibm.com References: <20230925030701.338672-1-bhe@redhat.com> From: Eric DeVolder In-Reply-To: <20230925030701.338672-1-bhe@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: SN7PR04CA0211.namprd04.prod.outlook.com (2603:10b6:806:127::6) To CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PR10MB4531:EE_|IA0PR10MB7159:EE_ X-MS-Office365-Filtering-Correlation-Id: 1968e3ce-3e43-41ec-5f26-08dbbdd7fd3d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ntYNkicr7DOAjtYADrQFCgoC4bS6WhSvNr1NWRvH8OXwLbFHxEzLW0uk+Ax9xoH7+SsH2+BZYOTXW0oSxu854+3NuUFCKMp2GSnU/TISiukX0k+N0CIJ41YeO0CryEz7Fvij971Eur0D3ibTSkDPU7gVtEytLWgs63Mn8qVHn+eJ8PO45GBTFzvMGS9mhHLJwrFtgOt2G0MvSwGb0fxnefiUpO4kJ8STmMqASX5DbvPKWtg4Jw4en6Gsa7tr9A8L1n16lZS/NEl385iAjdgjhXGGfynLtFfad4i/9BZqwfQDF2RBEAW3Cff5EELR0KZRP1yVwCR/N0DYtB3swayFsO4Lsv5He53U0eUeP/Zmc3iaZmYzG6CKv2TFDUwrYlSL4/fNmAt3CHn+SbIWGB4JgT8Pgdo96dbZc9DGGbB7EBDjON/XIFy9PZwKoDiFvkItTs/nTyejO2yst8ID/k4qfQehA0Q1itpsdWEFOgKlGzP5b4E0aCq/0v3kOhDi7X7sbXUxCCXXqGaGwkVfXX+DFcTR7IHvpUEltLK8ycSJcDTzDDoNrJDc/VFJSCMhhMhWuB0jURXgRWXQe/Z6vPbueRwLdNPCNTYoRiwI7iIVVjybn0YW62H5tOhAoESRU9mO4/N0JuBUBWAMQ8i/ZQ2Exw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CO1PR10MB4531.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376002)(366004)(136003)(396003)(346002)(39860400002)(230922051799003)(451199024)(1800799009)(186009)(66556008)(66476007)(66946007)(5660300002)(31686004)(41300700001)(8936002)(316002)(8676002)(4326008)(2906002)(38100700002)(83380400001)(478600001)(31696002)(26005)(2616005)(53546011)(86362001)(6506007)(6512007)(6666004)(6486002)(36756003)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?YjEyYmMxbDNTOEJQMndQOVN2ZXNGakJ4MW1QbU1ZNGMyZjlEMFZnN3UwWjhi?= =?utf-8?B?OWNSQ0RZL2l5VE1wQUFKNjViTmZWOERLVHRnT3M2OVBxZ1B1NE9CMkl3V1dL?= =?utf-8?B?UmN1WkJWNEpkVWN5OUpmb0tTU2I5Uk9IYkVGLzhOMGtMNFRySjNLcTRYL012?= =?utf-8?B?TU9Ha0JPSmFNeEJFck9sS0ZTRWE5SGlSeHU5T2xQNlpHckZ4Um5TcXdXUTJ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214TFJWVW1lU1piUks1?= =?utf-8?B?dURGSis5SldBYlFuTlZVano2anBaTm1pd1JsMXRjaHljbHRMTnBwWnEvNEhp?= =?utf-8?B?Qk1kL1VXc1ppL1p1V2R2WVF6MjY3Ly9SMEhqWkpKVVRLK3hoWGE3YXowZ214?= =?utf-8?B?NUl4K0VVdk5DZ09weGd2ay8rbUYvRitZRkIzbEZHMnNvcWo3QW1yclZocmxI?= =?utf-8?B?QVhMQ2ppSjNvSmlVaUJlVkQyamYzOC84anpVOXYxKzFjUXMvenhlWTcybEgw?= =?utf-8?B?bWlHdlUvVlpUVEE2SDN6MVRkVlJkMzdTa3pMNCtTV2kyemtKRjRIaytYWXRv?= =?utf-8?B?T3NGVUFHVWVVSlB6WDlDblNuWGMySmk0V2RwMXY4ZEZ3K29xTDd6Vk8xR1By?= =?utf-8?B?eWp3dStqS29rRGtqeS9yUXZHUTJrVy93ekVYek41L2tIS285NEZzaCtNWnR5?= =?utf-8?B?ZW01b1VXVFhGckJ3dysvYmVKNEkzRGFxcThCbnBWbGEvWkROdVpqMjZoSVIr?= =?utf-8?B?TVRTeWtPaFlCM3NQb2YrU2lkK1BHVWJhUERmMTJHczhmZjk2UnJUZ0ZEQ09X?= =?utf-8?B?UjRlbzMvcGpyUlVVRW45aXRKNlBPOFE3anVBWWEzZkhWZUFqbi9sc1I5RFUr?= =?utf-8?Q?DVZ3k2gmYnI43xo?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1968e3ce-3e43-41ec-5f26-08dbbdd7fd3d X-MS-Exchange-CrossTenant-AuthSource: CO1PR10MB4531.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Sep 2023 14:59:16.9564 (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: AcAuy8AM5WWvcRX5kJR2bLwqWrXMlfLq+T2FXZaSSAak8/EZFWNZ34tx7O9VZ5JU2/rOpY4eMUIQPvlrBVBvW2zWPMi6UlIoHWqdD+sG4eo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR10MB7159 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-09-25_12,2023-09-25_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 bulkscore=0 mlxscore=0 adultscore=0 mlxlogscore=999 suspectscore=0 malwarescore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2309180000 definitions=main-2309250115 X-Proofpoint-GUID: psTtsJrOr0f_nCYIZM34cRFgy9mwpc04 X-Proofpoint-ORIG-GUID: psTtsJrOr0f_nCYIZM34cRFgy9mwpc04 X-Spam-Status: No, score=-2.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Mon, 25 Sep 2023 07:59:57 -0700 (PDT) On 9/24/23 22:07, Baoquan He wrote: > Eric reported that handling corresponding crash hotplug event can be > failed easily when many memory hotplug event are notified in a short > period. They failed because failing to take __kexec_lock. > > ======= > [ 78.714569] Fallback order for Node 0: 0 > [ 78.714575] Built 1 zonelists, mobility grouping on. Total pages: 1817886 > [ 78.717133] Policy zone: Normal > [ 78.724423] crash hp: kexec_trylock() failed, elfcorehdr may be inaccurate > [ 78.727207] crash hp: kexec_trylock() failed, elfcorehdr may be inaccurate > [ 80.056643] PEFILE: Unsigned PE binary > ======= > > The memory hotplug events are notified very quickly and very many, > while the handling of crash hotplug is much slower relatively. So the > atomic variable __kexec_lock and kexec_trylock() can't guarantee the > serialization of crash hotplug handling. > > Here, add a new mutex lock __crash_hotplug_lock to serialize crash > hotplug handling specifically. This doesn't impact the usage of > __kexec_lock. > > Signed-off-by: Baoquan He > --- > v1->v2: > - Move mutex lock definition into CONFIG_CRASH_HOTPLUG ifdeffery > scope in kernel/crash_core.c because the lock is only needed and > used in that scope. Suggested by Eric. > > kernel/crash_core.c | 14 ++++++++++++++ > 1 file changed, 14 insertions(+) > > diff --git a/kernel/crash_core.c b/kernel/crash_core.c > index 03a7932cde0a..5951d6366b72 100644 > --- a/kernel/crash_core.c > +++ b/kernel/crash_core.c > @@ -739,6 +739,17 @@ subsys_initcall(crash_notes_memory_init); > #undef pr_fmt > #define pr_fmt(fmt) "crash hp: " fmt > > +/* > + * Different than kexec/kdump loading/unloading/jumping/shrinking which > + * usually rarely happen, there will be many crash hotplug events notified > + * during one short period, e.g one memory board is hot added and memory > + * regions are online. So mutex lock __crash_hotplug_lock is used to > + * serialize the crash hotplug handling specifically. > + */ > +DEFINE_MUTEX(__crash_hotplug_lock); > +#define crash_hotplug_lock() mutex_lock(&__crash_hotplug_lock) > +#define crash_hotplug_unlock() mutex_unlock(&__crash_hotplug_lock) > + > /* > * This routine utilized when the crash_hotplug sysfs node is read. > * It reflects the kernel's ability/permission to update the crash > @@ -783,9 +794,11 @@ static void crash_handle_hotplug_event(unsigned int hp_action, unsigned int cpu) > { > struct kimage *image; > > + crash_hotplug_lock(); > /* Obtain lock while changing crash information */ > if (!kexec_trylock()) { > pr_info("kexec_trylock() failed, elfcorehdr may be inaccurate\n"); > + crash_hotplug_unlock(); > return; > } > > @@ -852,6 +865,7 @@ static void crash_handle_hotplug_event(unsigned int hp_action, unsigned int cpu) > out: > /* Release lock now that update complete */ > kexec_unlock(); > + crash_hotplug_unlock(); > } > > static int crash_memhp_notifier(struct notifier_block *nb, unsigned long val, void *v) The crash_check_update_elfcorehdr() also has kexec_trylock() and needs similar treatment. Userspace (ie udev rule processing) and kernel (crash hotplug infrastrucutre) need to be protected/serialized from one another. Eric