From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 605D4CE7B0C for ; Thu, 28 Sep 2023 08:52:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231395AbjI1Iwq (ORCPT ); Thu, 28 Sep 2023 04:52:46 -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-Google-Smtp-Source: AGHT+IE+H2XpyC6g5cXAzUKMgVxYhAIA1uZrXD5jkN2vZZOVsLgR0f4SYCEkiNop7wfk3UqIpQAm2g== 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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