Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp2665921rdg; Mon, 16 Oct 2023 10:56:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFN/TS38f1qDhY8nU3YR8rs6M6L5RXjBfTHONfWSVCzNjNZgMYDGFZ1UhhMJUa6o09hIQf6 X-Received: by 2002:a17:903:191:b0:1c7:495c:87e0 with SMTP id z17-20020a170903019100b001c7495c87e0mr32186plg.37.1697479000966; Mon, 16 Oct 2023 10:56:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697479000; cv=none; d=google.com; s=arc-20160816; b=o9c9VOEr6VeIpBqYn5YoAFFCEeCSOmq8ow0kzzjwDG1xxQxNlGK+tnaihhyIiqw9Bs eX2MIeyQi9l9e3+fvNpJ1j4580t1GDYik69EsP5BXOtAzYojsEfh0F7rplFSVDuB2w9H E8qgUb5v+KMiHAekHp7fNcE2baKowkdhZOJ7h8iug+ng/ITxsr59y4s/DCkVfgXesdLP Kcn6Kz5YMcV1C/3F2zKPFB52khZV3E6Y5BBQoAPUc6Z5WNZiSUAepX/OBcrqNUj2cegj UlH5hDmd5++tULhqhQrk+pqJBh9kLvzNkfbSMcBCi0keZzUKmEie2Clo7RNr8bC0BnfK 1mNA== 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=/SdjzNKC8llTqbzK5M4yd54rZVBEOFB52/z6QfMDo7U=; fh=aIL7rDhtv8GcwYb8Uibloxo25+D3d0Yp4r7A5V12IQs=; b=r2DALG2i6xkV5AbHhETbcAz3Yva6dj5YzrYKpfVaBev9mSGwzBYePgbKEKrNclEMr+ f+ZenBFxJxkarszFaqn6HUiyCeiYBA22rvb8+I/7URFWlnRk3rdW6X3ZMeCd0dB/oUg4 ufwu9KNaagWivtyUW2CsGDYD+jZoCelAAImGb5Qgu5k+9N5DupGz+eGN+Ns1CIS2hpd2 fYTojdDHE+7jubqI0qv4ymPw2TpZMkeWw2tLMRM0GIy5bcdBcvAv2fbJI1G6OSmdpQni ye7iKr1zYahg9g5jnKabZhjaSiJQGb+XhdgpI5cg8dnIGYLEiJdU/5ettDMNfaxNkJgK 9jUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=dGuZgk5g; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id b7-20020a170903228700b001c746b986e2si12066192plh.346.2023.10.16.10.56.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 10:56:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=dGuZgk5g; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 09C60805F5EB; Mon, 16 Oct 2023 10:56:38 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234042AbjJPR40 (ORCPT + 99 others); Mon, 16 Oct 2023 13:56:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42572 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233853AbjJPR4Y (ORCPT ); Mon, 16 Oct 2023 13:56:24 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2BC5DA7; Mon, 16 Oct 2023 10:56:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=/SdjzNKC8llTqbzK5M4yd54rZVBEOFB52/z6QfMDo7U=; b=dGuZgk5gVAdiUWyjNrLk9vr6D2 Hb5y6FVBXRUfRBvHyn+Soa4vyCFm/FodV4eLxDheai2PTmCSQLd394tBXQz3m3kgacb7+kZMAp602 gx4EvxUI56Rz7+typFCFgG0VRpIkDZppCfjGyv92LJEtGp98KsFiy0uJJ/UsyLdZ8G3TsI2pyHFLL ZE4z2j4IBfvuKiBdGwHl74ZG2Rbj9EUQpTBtepWwbMaUJDZWqlPZzdh3VNQJWPMJyKCw3rI9CIuJ9 Z6fosUBoYWdv7tNwO8hJJgwpPz/lx0wBPm0pi51uiwTnKESpsIH9AsDCiYnJes74nG3hVG3NLK0Lv kFQ3+GPA==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1qsRob-007TKi-E0; Mon, 16 Oct 2023 17:55:41 +0000 Date: Mon, 16 Oct 2023 18:55:41 +0100 From: Matthew Wilcox To: "Kirill A. Shutemov" Cc: Borislav Petkov , Andy Lutomirski , Dave Hansen , Sean Christopherson , Andrew Morton , Joerg Roedel , Ard Biesheuvel , 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: References: <20231016163122.12855-1-kirill.shutemov@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231016163122.12855-1-kirill.shutemov@linux.intel.com> X-Spam-Status: No, score=-0.8 required=5.0 tests=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 groat.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 (groat.vger.email [0.0.0.0]); Mon, 16 Oct 2023 10:56:38 -0700 (PDT) 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? > +retry: > spin_lock_irqsave(&unaccepted_memory_lock, flags); [...] > + spin_unlock_irqrestore(&unaccepted_memory_lock, flags); > + > + /* > + * The code is reachable from atomic context. > + * cond_resched() cannot be used. > + */ > + cpu_relax(); > + > + goto retry;