Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp3360429rdh; Thu, 28 Sep 2023 09:22:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHwHXuHJbZzGJe88/8F984FuEOsu3hbusbTPR5lXvYwhE8riRtiTqtEH0cUdk6CwcWsDuRn X-Received: by 2002:a05:6a21:a58c:b0:135:1af6:9a01 with SMTP id gd12-20020a056a21a58c00b001351af69a01mr2171460pzc.8.1695918121824; Thu, 28 Sep 2023 09:22:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695918121; cv=none; d=google.com; s=arc-20160816; b=wdAmMHR8uycf5ImLbi/Nl2t9sle855eM0n4J2GMZFaknp2yhnmpiy2WhlwVW/IrtYC YE202Wd1NnplAZDJ5FUATx1xz5J59Vmzj9d/R+9e3MTXqRm1pkN6g2wY6DZD/noobeOS Vc4Mv+93o6PsTmbTNe1eBCC7dYpMsCEbV5mFXRKYZOVCNzbZe9RpLtHKtqDsRjoQT7+P Qb67gkuI2ka2ii2+7rLXh+pp0JY0zwiJdvHemxEbCPooIyPwGqwn8rKnASBMLzEIX8D8 6DPPNskPokB21YSFW75OJ3xpDTSZY4mXscM9sGEkmLcenTCCyJoF8WS6koc28VWoTgMw no2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:dkim-signature; bh=NkWcflk7o2IhAoW5ugdA3P4TxFldRrvEEsOTDIfjw5E=; fh=xwyE1enUxtTb+bvqe/UqiggSYTPHHv0I5DSelBjNW6k=; b=jiiRJxYuHkY0tDZtYISfLDL7GZOCkD594h3ueaV92rs/FsUloSGr6QwYBJbk6jrRcX ednJ0XJ3fBnGRbZWVsALT2JvEg8H2n3IJvkOpQZhgfG0HED4nP701WSvP1qY6VR/v0Ux 8MP920yKw7FPLG8JeG0FAR6IJ8DA3RyqRIsM1bsJ8OIKl58eDH6zcljuYxiFKWgxAFbi 25eSGvVZLlw/Wz8Nc5Uy03UtcbQ7t8mo5NazCAno2bGefNi4CBntERd/GJJ83C/LMjZc G/OGQKvOA4uTy3q2gen0H1wPvPNitlBdjg65VLgmyfsK297d6hyF3RJsfvbQCkJ0EWJx M+Pg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=LlGrtTwe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id bo13-20020a17090b090d00b00273e2f407casi20639090pjb.76.2023.09.28.09.21.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 09:22:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=LlGrtTwe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id DF0B180DA8C0; Thu, 28 Sep 2023 01:53:10 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231384AbjI1Iwo (ORCPT + 99 others); Thu, 28 Sep 2023 04:52:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49382 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231359AbjI1Iwj (ORCPT ); Thu, 28 Sep 2023 04:52:39 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 84EFFAC for ; Thu, 28 Sep 2023 01:51:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695891111; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=NkWcflk7o2IhAoW5ugdA3P4TxFldRrvEEsOTDIfjw5E=; b=LlGrtTweUgG0Mw1ZuDKwRx8D7xFVIg6oVj3O+e95APmwxe6xcv1w9hg214uuzQL5SQdVBN zRicWYE675AhbXkHfWzwNFX9YBFwBSdpHeEPGD7hjqhZYN/vqlhPalvfm+Enadsjzci+2A 3XvrpccJqYtfjFlLVg3i6HWHZCNmMe4= Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-135-DVnNAnAyNjWsMZ0yidM2EQ-1; Thu, 28 Sep 2023 04:51:49 -0400 X-MC-Unique: DVnNAnAyNjWsMZ0yidM2EQ-1 Received: by mail-qt1-f200.google.com with SMTP id d75a77b69052e-418225fb5d6so113969841cf.3 for ; Thu, 28 Sep 2023 01:51:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695891109; x=1696495909; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=NkWcflk7o2IhAoW5ugdA3P4TxFldRrvEEsOTDIfjw5E=; b=Dj2H67SbKMmjXNrISt6xz7v2IBgDnT2JN/SnpZ2EZA+4LwIHw7n+5sgbkS+doq8iLp 8fgcgaH7UJjqyZAeVpOg9Xt+wRMMFGkcsg2+LDi0NwgakD1HfmLEF6GU6JMZ62OcyAtM 5kCKHx6FkfKLNBmK5hs5GcGOF9lVMKVTipztbsHA2wABgLWWis7ASHJPYomYrSiTwPPD tqV4yiejDX5cNh2ZkyXkbtrcGPfjlXyy1rdK99agqgzYpSt/HAYcJbMh28//jvsq88Gu uPR7PFXsJmBcvNDTYueKReJoYv5HCI3eXKNH5cVl5Yc8pVNKU3cyuLvQ7sqGkwfw31ua o9nA== X-Gm-Message-State: AOJu0Yzv6H78ncB6wgNLQmMwCVw+c5bKz1KQqzL6Sb+cqQgxkruaXWz6 y4gN/lBgw2fRG+ctkKeUbBlsOhQOUAnf/YVbZ7MPYhUhe5EQXY21T+kRksTwOU6BwTtuiy38znW 8tkBSON9J3iRKPUWqcT9f328l X-Received: by 2002:a05:622a:138b:b0:412:191c:ffa with SMTP id o11-20020a05622a138b00b00412191c0ffamr637754qtk.26.1695891109113; Thu, 28 Sep 2023 01:51:49 -0700 (PDT) X-Received: by 2002:a05:622a:138b:b0:412:191c:ffa with SMTP id o11-20020a05622a138b00b00412191c0ffamr637746qtk.26.1695891108882; Thu, 28 Sep 2023 01:51:48 -0700 (PDT) Received: from vschneid.remote.csb ([80.215.217.124]) by smtp.gmail.com with ESMTPSA id ig8-20020a05622a6a4800b004181127a230sm3614173qtb.76.2023.09.28.01.51.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 01:51:48 -0700 (PDT) From: Valentin Schneider To: Baoquan He , linux-kernel@vger.kernel.org Cc: kexec@lists.infradead.org, akpm@linux-foundation.org, eric.devolder@oracle.com, sourabhjain@linux.ibm.com, Baoquan He Subject: Re: [PATCH v3] Crash: add lock to serialize crash hotplug handling In-Reply-To: <20230926120905.392903-1-bhe@redhat.com> References: <20230926120905.392903-1-bhe@redhat.com> Date: Thu, 28 Sep 2023 10:51:45 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,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 morse.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 (morse.vger.email [0.0.0.0]); Thu, 28 Sep 2023 01:53:11 -0700 (PDT) On 26/09/23 20:09, 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 Reviewed-by: Valentin Schneider