Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp2937834rdb; Fri, 22 Sep 2023 12:37:27 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFTa8OtfukvhQgeosYnz34WqDZAMNApxIGW9zmqmoQT3Vz9Wc7ibANIPZ0sO41VWNbHIGVr X-Received: by 2002:a05:6358:2496:b0:143:7a89:a8e8 with SMTP id m22-20020a056358249600b001437a89a8e8mr644250rwc.10.1695411447553; Fri, 22 Sep 2023 12:37:27 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1695411447; cv=pass; d=google.com; s=arc-20160816; b=0ow9WbTUoRf+puaFyNrL6CjhMSzfCldBW4Olvfn4uyxNvL5tJu8mdJzIy14+vc267Y 9lS2zmmmu5SG/5MUP6Wq7CKHvi1EJa3end8GdIK6gs/IGlrjqouiHvuE4huODK4ajz+V /n+8leJ9Nekg7whzr8mKSvnQ+gctS329MpmJldWDjsCLUxyF7rmW7bEPeMijDDdjcJeO iP7CIQfcVlakpVebm9OeR8hCkeAg2TTdeJ75cj//KKH7LmwUekg/zhvVaV3Ju90a1oIG qgJ/kPL6/cHe807w6ESGie/ieB43myP5gZS4GCu9QbHywWI2Z+b5Qg/ajSznGbrSuarn ngtg== 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=u13VGdXcP6WCdOy6i1WsWxAvdw09MaCsHikSyJXHPI8=; fh=4gRXZw6pOfpwumQTVYeTwdetdD1hskC6UFcukyYdcJg=; b=lYkDr9zWVkJz/eoriMDVSnLJpimKubGqhalmdt8N8EbwbP6wX0jlHIyloVv6drQ89z jV9jG2T7AztKMgNG+YKYsnyh0WQr88FFz3qvq8GKcuZxcKwK5uTLOT4jcyrbLZ9D3UGl pGFclRqPie02p0ZUut8mce9xVnnzwXQdtzh/CBayGMWIWN2YRzpTALT4d4vByBaZ9bDc xD0ERbm29lWy8Si9V9stM82h70jC6BnDlim0/VIMutsnQbpuqaRF+dV7XSoeJA+uoD3k E9FX9VQ6+kGtX34PZV5WNlUiOitiqAd3ZxlpHqEv+PnFvVrKsPkXEJrSGmMWG+ajE3vO H6Ig== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-03-30 header.b="PkkciLw/"; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=v6nqYlHK; 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 2620:137:e000::3:3 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. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id v186-20020a6389c3000000b0054fdb18c877si4254817pgd.607.2023.09.22.12.37.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Sep 2023 12:37:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-03-30 header.b="PkkciLw/"; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=v6nqYlHK; 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 2620:137:e000::3:3 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 D0A8A82C1309; Fri, 22 Sep 2023 06:39:28 -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 S232618AbjIVNj3 (ORCPT + 99 others); Fri, 22 Sep 2023 09:39:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47362 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229989AbjIVNj1 (ORCPT ); Fri, 22 Sep 2023 09:39:27 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 79AA2CE for ; Fri, 22 Sep 2023 06:39:21 -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 38MD08mp009333; Fri, 22 Sep 2023 13:39:11 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=u13VGdXcP6WCdOy6i1WsWxAvdw09MaCsHikSyJXHPI8=; b=PkkciLw/pP11S1OBHkhezWYzuOKeE4h6570RUA7J8NhfiuZb2/CJAChTCEYh/p4dflzB TVhgZ/bTgTx32JGi9go4+A2ifFtGZKEG1vxKDb4cUHWDjStDI0L7zzWBzrIWG8UDkUiM bf7ox033b7H23vR8/LkaThWxKG7LP6QrUdxJKnz8OJ7YiMzlo2OlPqXnre1SHl+LYnDt 5bM0+wBRAku8l8dbCX7SfQq6IfPOnCQvumZRO8CzIAUvVhosxQXa3rGz/bM20JU4Q2If 1FaHiY6fSMB80z1N//VRHgLxgfx9j3ilCqMcJiSg3istcAJVEVGG9vEDQZMOpLIPHY8O CQ== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3t8tsxstx4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 22 Sep 2023 13:39:10 +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 38MDXxID021327; Fri, 22 Sep 2023 13:39:10 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2105.outbound.protection.outlook.com [104.47.55.105]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3t92vxcnb4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 22 Sep 2023 13:39:10 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SZZs1MavlL1js11V3wxsOsiwKEuNasMm8Mnf6USx07ZlGy9N/7yzM5CZFVe16t9x39/XwoYtksORXwJc0zbtjRJnEvCc9xclkT1HcAx7bF+REgQSx7HIepuGVIRMkWfewbOmlSVHR0tv5JhryjGato0bmylfNCML8zMN0R3fZAFe8ZrBmWFjDJOrJLJ3rvVIbrLuphmRTDOoLWeXWqbXfYOP5L/BXJ08Zt+7ZAIrRW9JUAF6s12tPE/IxT0rkCZLdC5bBDhzmoQlQdFFZNhcnBH6vk+jIUBs2l17piyU/QuMqUVI+FRpyfCYaZbWToGdDL6YZIRDiG0L9RQMkVN2OA== 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=u13VGdXcP6WCdOy6i1WsWxAvdw09MaCsHikSyJXHPI8=; b=D2ecHi/ZMKcu2vh++kmKt8SAzmVXMtmkdxSowfceXSdBFnLudKAHAokz8VB/CNRnDNwuj57zWBGQcdoJEl+cvVn2xKOt7xdumG1OisBciTndM5+WQJ8uU91f5lzz7rjw+i08rHIVWyLXLTI90JiZy+1mpYqk5fLLyykybDaITwWxg6HdW6uKbIPTat9fvZF3/aQnho7xizrIwDxSumhs97Rxa/M2JE9Qa4wWEdTPIqwp1a6mjLSO9kMQrzXZA1u9s7P04yiz5D4SSDXowE1NCUuVFHIwmNiLtNnic4G2Jhz4KFRl6RD4FD8cKasy8XqHUzX5wJjc4wLBzmtDj5hBsA== 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=u13VGdXcP6WCdOy6i1WsWxAvdw09MaCsHikSyJXHPI8=; b=v6nqYlHK+ELx5TfTTupbwpgLFcddunTprVBQiuVlzquNsw/0l26iOPAnllOS4TG9JKwVG+kbP4qyQgG4xKzDxCDJr9efe8RKqqluVhoyWVTVJ6reF2605cdnbQTMvVMZTk6t/PcQFdaJNZsTFRAxIaAd/AadBU8AwhNWOziCjCA= Received: from CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) by MN0PR10MB5912.namprd10.prod.outlook.com (2603:10b6:208:3cc::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6813.21; Fri, 22 Sep 2023 13:39:07 +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; Fri, 22 Sep 2023 13:39:07 +0000 Message-ID: Date: Fri, 22 Sep 2023 08:39:03 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCH] kexec: change locking mechanism to a mutex Content-Language: en-US To: Baoquan He Cc: linux-kernel@vger.kernel.org, Dave Young , vgoyal@redhat.com, ebiederm@xmission.com, kexec@lists.infradead.org, sourabhjain@linux.ibm.com, konrad.wilk@oracle.com, boris.ostrovsky@oracle.com, Valentin Schneider References: <20230921215938.2192-1-eric.devolder@oracle.com> From: Eric DeVolder In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: BYAPR03CA0017.namprd03.prod.outlook.com (2603:10b6:a02:a8::30) To CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PR10MB4531:EE_|MN0PR10MB5912:EE_ X-MS-Office365-Filtering-Correlation-Id: 7a2776e2-66bb-4a33-3bec-08dbbb714b73 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: fwW9jJWBusxumUtnDbPhvoGFTfkuuySwwIz1KmDO3la4j0j7RlMgxuACUE+jYdlF/fqN4V8yQkwKmNl4YdNTrIsMGfIu1ynddwEuM2/xjxaGyE74npFWMxoGVaybDGgJi9wvgV6FUESzolrSbWHNNyhfGQxCsB7Xxug68gaj9ENoItEHf2w6OWLp7wwc9ui33dx87cpkaFmr7u6mWUgC0HpKVoLnWfLSLbrmievZqrfihykJGkVt99Vo39BbQAh8DsOU58r3F4z2GkhiEk1woOVI364Q9hdIsuhg03BuU2OFAYlkeWn/DKVAkNmIMXt/U1JyxhbQznRU7gcnKzgGZ+VrxXy7+KjarVI+gLGV/hrpDV7mtRM3GcH5NOunTweXxwcqvFytY+Ga0uyd5YLsT6CyM4BQss577FC14conibVn05q8skApMvDUtx3J6O1CSn6GXetbXdaBWqMoDYaKZVb+qMqb+zBJQu3tfeJlEoe2Gdrd23XUe03kWeo51+o/p2nrm2QquosBrFgV9+I7YPQ0wafT26wBXK+/QHVmZuakCqOio7POqU2PbDjJrU6GPqGBlD0h+7ZKzCfmJUjVN1iyxfTC14F7phBgq2iELmMmql03+zNJBXG7dC5cud3eBS/Lpoo4TvcL1UGpExuS4g== 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)(396003)(136003)(39860400002)(346002)(376002)(366004)(186009)(1800799009)(451199024)(478600001)(38100700002)(31696002)(83380400001)(6512007)(6506007)(36756003)(2616005)(2906002)(6666004)(53546011)(6486002)(26005)(86362001)(4326008)(66556008)(66946007)(66476007)(6916009)(54906003)(316002)(8676002)(31686004)(8936002)(5660300002)(41300700001)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?OWN2cW9UdzRZQkpRbnFibGpZQ3pTeWtOOE5rV3lQWG8zejAyVnN4VnZIM2My?= =?utf-8?B?VDBVV3ZYVTVDQVpxYmxXMDNEMjVtazhhUDRiRHZlYWxncUR3WnduMzJESVl3?= =?utf-8?B?VXRTQ2FTR3BtT290MnphWUN5WUlwVkwyNlIxdnRldTR3Q2RWUDJwUWwwdEo1?= =?utf-8?B?Ti92YVdpd0pDeWplZFB4MThEejRjMDJUczh0d0JhMTlIcDN6Njg1NGI0RzZS?= =?utf-8?B?WFo1NlFxN3NSQzZZamxs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smjzIzy4n9XK/A/8kk05C/coGV6x+aOimQwITNHAFFJa0qo1JPOvcOZPD88utVGasDvXU4y6CFjF/8WtsINZ+lacV4vsLj9esNjg1n3M39k= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7a2776e2-66bb-4a33-3bec-08dbbb714b73 X-MS-Exchange-CrossTenant-AuthSource: CO1PR10MB4531.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Sep 2023 13:39:07.6654 (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: EOMpg+33MgF7Z+94NpM1dIBtz/9tSFzPZ9U/17qqO5hsAcfzSWmqUrg6UjPqUJtnABhPgv66ppu7+jKkq5gIbyPSjwCBdmXgjGjZD3Qz4Lo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR10MB5912 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-22_11,2023-09-21_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 mlxlogscore=999 mlxscore=0 suspectscore=0 adultscore=0 phishscore=0 bulkscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2309180000 definitions=main-2309220117 X-Proofpoint-ORIG-GUID: jYElliTmN_CCQ_TDqBzH8UlC6WodW-o1 X-Proofpoint-GUID: jYElliTmN_CCQ_TDqBzH8UlC6WodW-o1 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]); Fri, 22 Sep 2023 06:39:29 -0700 (PDT) On 9/22/23 03:06, Baoquan He wrote: > On 09/22/23 at 11:36am, Dave Young wrote: >> [Cced Valentin Schneider as he added the trylocks] >> >> On Fri, 22 Sept 2023 at 06:04, Eric DeVolder wrote: >>> >>> Scaled up testing has revealed that the kexec_trylock() >>> implementation leads to failures within the crash hotplug >>> infrastructure due to the inability to acquire the lock, >>> specifically the message: >>> >>> crash hp: kexec_trylock() failed, elfcorehdr may be inaccurate >>> >>> When hotplug events occur, the crash hotplug infrastructure first >>> attempts to obtain the lock via the kexec_trylock(). However, the >>> implementation either acquires the lock, or fails and returns; there >>> is no waiting on the lock. Here is the comment/explanation from >>> kernel/kexec_internal.h:kexec_trylock(): >>> >>> * Whatever is used to serialize accesses to the kexec_crash_image needs to be >>> * NMI safe, as __crash_kexec() can happen during nmi_panic(), so here we use a >>> * "simple" atomic variable that is acquired with a cmpxchg(). >>> >>> While this in theory can happen for either CPU or memory hoptlug, >>> this problem is most prone to occur for memory hotplug. >>> >>> When memory is hot plugged, the memory is converted into smaller >>> 128MiB memblocks (typically). As each memblock is processed, a >>> kernel thread and a udev event thread are created. The udev thread >>> tries for the lock via the reading of the sysfs node >>> /sys/devices/system/memory/crash_hotplug node, and the kernel >>> worker thread tries for the lock upon entering the crash hotplug >>> infrastructure. >>> >>> These threads then compete for the kexec lock. >>> >>> For example, a 1GiB DIMM is converted into 8 memblocks, each >>> spawning two threads for a total of 16 threads that create a small >>> "swarm" all trying to acquire the lock. The larger the DIMM, the >>> more the memblocks and the larger the swarm. >>> >>> At the root of the problem is the atomic lock behind kexec_trylock(); >>> it works well for low lock traffic; ie loading/unloading a capture >>> kernel, things that happen basically once. But with the introduction >>> of crash hotplug, the traffic through the lock increases significantly, >>> and more importantly in bursts occurring at roughly the same time. Thus >>> there is a need to wait on the lock. > > Yeah, the atomic __kexec_lock is used to lock the door of operation on > kimage. Among kexec/kdump kernel load/unload/shrink/jumping, once any one > is in progress, the later attempt doesn't make sense. And these events are > rare. > > Crash hotplug event is different, there will be many during one period. > The main problem you are encountering is the cocurrent handling of hotplug > event, right? Wondering if we can define another mutex lock to serialize > the handling of hotplug event like below. Just a sterotype to state my > thought. I've tried this patch (with slight change) against my regression setup and it works as well. Eric > > diff --git a/kernel/crash_core.c b/kernel/crash_core.c > index 03a7932cde0a..39b9a57a4177 100644 > --- a/kernel/crash_core.c > +++ b/kernel/crash_core.c > @@ -783,6 +783,7 @@ 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"); > @@ -852,6 +853,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) > diff --git a/kernel/kexec_core.c b/kernel/kexec_core.c > index 9dc728982d79..b95a73f35d9a 100644 > --- a/kernel/kexec_core.c > +++ b/kernel/kexec_core.c > @@ -48,6 +48,7 @@ > #include "kexec_internal.h" > > atomic_t __kexec_lock = ATOMIC_INIT(0); > +DEFINE_MUTEX(__crash_hotplug_lock); > > /* Flag to indicate we are going to kexec a new kernel */ > bool kexec_in_progress = false; > diff --git a/kernel/kexec_internal.h b/kernel/kexec_internal.h > index 74da1409cd14..32cb890bb059 100644 > --- a/kernel/kexec_internal.h > +++ b/kernel/kexec_internal.h > @@ -28,6 +28,10 @@ static inline void kexec_unlock(void) > atomic_set_release(&__kexec_lock, 0); > } > > +extern struct mutex __crash_hotplug_lock; > +#define crash_hotplug_lock() mutex_lock(&__crash_hotplug_lock) > +#define crash_hotplug_unlock() mutex_unlock(&__crash_hotplug_lock) > + > #ifdef CONFIG_KEXEC_FILE > #include > void kimage_file_post_load_cleanup(struct kimage *image); >