Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3044359rdg; Tue, 17 Oct 2023 02:57:33 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE76cAjEilhCVVXcu4Wbet1R7WcufFG8gGsDYKa4whL6CL6oV58VuhmrtFLXRJWnLv1A3JS X-Received: by 2002:a17:903:110f:b0:1c1:fe97:bf34 with SMTP id n15-20020a170903110f00b001c1fe97bf34mr2229326plh.24.1697536652999; Tue, 17 Oct 2023 02:57:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697536652; cv=none; d=google.com; s=arc-20160816; b=ULSXqOeAxZGzowihinxBnUd3imIWaT/8EQIaeEqN9wl0xe1hYh+L+1sNHmYsdd89Pd /p2YVVSVKlG2nJi/c+BfZ/eqYfvz/S4DEqZwIrp/MXIAXCA7xkmKPZiFxv2vInsqlErH HtNhJTnmJ6AQPxU1Rto1etfibPjwqylak2HCSaJ72iF3AY+Qj2FIDKrQIr/0ulLGHeEm dIs6fF14YZo2cSpbXeqdZrtSbMylojNTFS9qFY2Q712gAhJQ8x92eFfJv6mvUsDqzSmO 4zvtRcuogQzLxZuzZtttPCUDhZNBFnQ/iBW0VAkoQsPJWclBB9ON5Z8UBEToVimEk5v5 zaMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=fCybuev8u2mLHJZo/DgPK9PSt1vqOPKFa1SF6X2U518=; fh=TED5NTHnCHuEC+Ck3/Ekdn54zP37mdJxDCTOt6F1+wA=; b=F9S8ofeCUz3I2DlsElx8NkcpJcvy1NM/8J2a6srOIOv+T8qSY+bng8eJJ93pwgy1Ow s3DtCcz1RPBgTzndG+21pKsbViePgfZ+f7exp0aGwkEruBcseA0klHYD0Q121Um3g2yB CRH3AN9tFYfidX/LJ8P468K8dAqjCXQzJCx/QmpNESga9ZOzSASkxN075zpNiXm2VvMe Zvtxskh3nKVF1TSmiuczu3K9m6lW8MxnJiUJVTJVADqHLFKgph0Z5tIvZ2KcGp0CvxSv 7OFrwseOFQEY8udgrIx2D2c+iIXqCLTQDJl0yqb+5OFZaWxn+IoAP1GZKisgmU7NkhIi +WbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CBgxSfB2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id g15-20020a1709029f8f00b001c58401354dsi1315163plq.565.2023.10.17.02.57.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 02:57:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=CBgxSfB2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 66EE6802A685; Tue, 17 Oct 2023 02:57:28 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234824AbjJQJ5W (ORCPT + 99 others); Tue, 17 Oct 2023 05:57:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53518 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234752AbjJQJ5V (ORCPT ); Tue, 17 Oct 2023 05:57:21 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3C66F8E; Tue, 17 Oct 2023 02:57:20 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D8CCCC433D9; Tue, 17 Oct 2023 09:57:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697536639; bh=sKwYVnqhSSrwqp7PC9H2TY6yCD+XS2CditWC5vXqB+4=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=CBgxSfB237rqRI9/lYgZglglsdpwEqcW7F0KqpbEKc15ZDg3CHRwqrxtl3WbD5ts4 LY0MgzE3g7ZTeyfPZD/4h4w/Rv4vAfcBvUDWw8saPVGVzAXrGHmIWfpz/EM3KWtgoZ HWLGHI6ZYI6GgwzdrxSHSjMgFxmiizLgfjvp5hatThd1AVR6zR/bzp/sQC9Qz7G8ci KWvhOx0NpS+F8kmwW13nNN2nzW3e26WHAHh8+CYvo4Kp2kY7D+4RQo0REXfuvCsYOW 6DT9gvrsG8IOFI5PoiLbbzs7hClUKkkCoOegLl8io3zB/EUSZoXTwuevn8Pqtwv4CN vIc7qpt0hH4aA== Received: by mail-lj1-f170.google.com with SMTP id 38308e7fff4ca-2c5071165d5so41305521fa.0; Tue, 17 Oct 2023 02:57:19 -0700 (PDT) X-Gm-Message-State: AOJu0YxIIXV7A2P7psga2B/hZnlfTzyFrBzhADaO1vbQ1Wens4pSsvl1 pZRGQttONfdIA+Tg1vxsOYwYmzXwIQDvlfExrh8= X-Received: by 2002:a2e:be12:0:b0:2bd:133c:2d71 with SMTP id z18-20020a2ebe12000000b002bd133c2d71mr1124282ljq.52.1697536638036; Tue, 17 Oct 2023 02:57:18 -0700 (PDT) MIME-Version: 1.0 References: <20231016163122.12855-1-kirill.shutemov@linux.intel.com> <20231016213932.6cscnn6tsnzsnvmf@box.shutemov.name> <20231017094403.g6laxp2c3vwzt2sw@box.shutemov.name> In-Reply-To: <20231017094403.g6laxp2c3vwzt2sw@box.shutemov.name> From: Ard Biesheuvel Date: Tue, 17 Oct 2023 11:57:06 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCHv2] efi/unaccepted: Fix soft lockups caused by parallel memory acceptance To: "Kirill A. Shutemov" Cc: Matthew Wilcox , Borislav Petkov , Andy Lutomirski , Dave Hansen , Sean Christopherson , Andrew Morton , Joerg Roedel , Andi Kleen , Kuppuswamy Sathyanarayanan , David Rientjes , Vlastimil Babka , Tom Lendacky , Thomas Gleixner , Peter Zijlstra , Paolo Bonzini , Ingo Molnar , Dario Faggioli , Mike Rapoport , David Hildenbrand , Mel Gorman , marcelo.cerri@canonical.com, tim.gardner@canonical.com, philip.cox@canonical.com, aarcange@redhat.com, peterx@redhat.com, x86@kernel.org, linux-mm@kvack.org, linux-coco@lists.linux.dev, linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org, stable@kernel.org, Nikolay Borisov Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 pete.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 (pete.vger.email [0.0.0.0]); Tue, 17 Oct 2023 02:57:28 -0700 (PDT) On Tue, 17 Oct 2023 at 11:44, Kirill A. Shutemov wrote: > > On Tue, Oct 17, 2023 at 09:42:13AM +0200, Ard Biesheuvel wrote: > > On Mon, 16 Oct 2023 at 23:39, Kirill A. Shutemov > > wrote: > > > > > > On Mon, Oct 16, 2023 at 06:55:41PM +0100, Matthew Wilcox wrote: > > > > On Mon, Oct 16, 2023 at 07:31:22PM +0300, Kirill A. Shutemov wrote: > > > > > v2: > > > > > - Fix deadlock (Vlastimil); > > > > > - Fix comments (Vlastimil); > > > > > - s/cond_resched()/cpu_relax()/ -- cond_resched() cannot be called > > > > > from atomic context; > > > > > > > > Isn't there an implicit cpu_relax() while we're spinning? Does this > > > > really accomplish anything? > > > > > > You are right. It is useless. I will drop it in v3. > > > > > > > I can drop that bit when applying the patch. > > > > One question I have is whether the sequence > > > > spin_lock_irqsave(&unaccepted_memory_lock, flags); > > ... > > spin_unlock(&unaccepted_memory_lock); > > arch_accept_memory(phys_start, phys_end); > > spin_lock(&unaccepted_memory_lock); > > ... > > spin_unlock_irqrestore(&unaccepted_memory_lock, flags); > > > > is considered sound and is supported by all architectures? > > I am not an locking expert and only tested it on x86. But what potential > issue do you see? > Not sure. It just looks slightly out of place, and I am curious whether all architectures tolerate this asymmetric use.