Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3039678rdg; Tue, 17 Oct 2023 02:44:54 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG+x8X1DCWoGRX780VVRhKJZtsgdsSkzT2GLAgwcPOYJAKYENN6Dc0z5GrfrWrl1+Jea0I+ X-Received: by 2002:a17:903:32c9:b0:1ca:7909:6ee6 with SMTP id i9-20020a17090332c900b001ca79096ee6mr2075490plr.61.1697535894478; Tue, 17 Oct 2023 02:44:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697535894; cv=none; d=google.com; s=arc-20160816; b=XPhiZOAso0RfEobHuRLClvk5j7Pjo41WdiyewcLouQjPSVrn5HadD4nGdbPi6gXVuZ 0LauAkUNhOd/PezXRzHC6r9yZGeDTFJX0GDK3d5tTQV5gFdbB29pT37Gufn9eRBbpjOF wwqYZfLDuwVLdMQDxW5dMSgjyO6/FJFecLaG/7WW1WC+SIB3aaND429IZywNqHYVioWf vkc4136GCFptKyeDhuUfLAt06i0SVP41cttq74vhZS9mAezCyvRbUNYGzq54vfdADqlT oGFvq1/ikeOaHBP2BbKxWfHAMJMPkOGpWM7bwJdekICW993IDxjX2s6P+01TEZJIhcTE qZyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=l5KEdFAiR4hJeFQXnYQPISFUbQpuPDY1makiCGkzsHc=; fh=GQDv+S/7U9R1CsWcCwQ3deZrDLUABauxdaA6HEz56Mg=; b=Um0sfGkQoquzTDZGSTCgzo7dmg/sDBmUY6Ltq9Ac2/6nq0K4w09p9bHrKfu2M/1qGI pRZuWMONbHPWf0+RMcwycSx0VHdDpTX9ZCdvolXDa6kiQpgdkLoOblp8v8Bz6FIhKv/0 VTGWFPBZGvkSrTjoHv0rRTdGQba28oAmhJ7gTzofosa3KSs5Gs/i2Po0edfiEpRD42e2 y302bmop4chrGKJL/91cS/ZysebvWu7URhne8HRaqqK2gAZQQsFM/aPIRNHClSbdzPlD Q0clZIIK6kvw9pYumUFaHR5O7Nv83GPfF6syqxlIll9O77aPU5TdRfUCfZT5Hqy3uvKF 6VFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=hramDdnE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id i9-20020a170902eb4900b001ca176b7974si1291618pli.103.2023.10.17.02.44.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 02:44:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=hramDdnE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id ED34C80398C2; Tue, 17 Oct 2023 02:44:51 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234933AbjJQJoh (ORCPT + 99 others); Tue, 17 Oct 2023 05:44:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48858 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234985AbjJQJo3 (ORCPT ); Tue, 17 Oct 2023 05:44:29 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D963F9; Tue, 17 Oct 2023 02:44:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1697535867; x=1729071867; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=8OYWLx8EkOVmmzc/6gfhqaqtgdn7djCvrNPSlhU23rE=; b=hramDdnEcNtVy6AKWvv745sFso+Ug60hLVdaHTioWHE8FyFNj/zPRi9D dosJ2IaMOQKLdipv6UDoawOhJ4c2QPyFd1VLt1WY1rw1+TfJFj2R9nFs7 uS5unxQ+ASC4QXYqb6cfBxJaQD5kG2Fi8o75LZsWR1m3MQq4X4PjkVq5w jSgAVDxqUnef2QbQi4UECU/u2hyFGPtN/fNxEC/Y+Iy4CLejliZQ8pq/j BUHTIeBXpW9Os8QPbZiQeYzAkRmyqufMQsqZTvkNBrHyF+ShKZHjeMfBK os8YmTPJJzpB0WkiH6yLHcUev/XThgp5zRGy15ilCSh3N6zJS//skvnZB w==; X-IronPort-AV: E=McAfee;i="6600,9927,10865"; a="365097234" X-IronPort-AV: E=Sophos;i="6.03,231,1694761200"; d="scan'208";a="365097234" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Oct 2023 02:44:26 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10865"; a="826375189" X-IronPort-AV: E=Sophos;i="6.03,231,1694761200"; d="scan'208";a="826375189" Received: from mstanila-mobl1.ger.corp.intel.com (HELO box.shutemov.name) ([10.252.61.109]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Oct 2023 02:44:05 -0700 Received: by box.shutemov.name (Postfix, from userid 1000) id 2B4B510A1F3; Tue, 17 Oct 2023 12:44:03 +0300 (+03) Date: Tue, 17 Oct 2023 12:44:03 +0300 From: "Kirill A. Shutemov" To: Ard Biesheuvel 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 Subject: Re: [PATCHv2] efi/unaccepted: Fix soft lockups caused by parallel memory acceptance Message-ID: <20231017094403.g6laxp2c3vwzt2sw@box.shutemov.name> References: <20231016163122.12855-1-kirill.shutemov@linux.intel.com> <20231016213932.6cscnn6tsnzsnvmf@box.shutemov.name> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,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 howler.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 (howler.vger.email [0.0.0.0]); Tue, 17 Oct 2023 02:44:52 -0700 (PDT) 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? -- Kiryl Shutsemau / Kirill A. Shutemov