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 E4CAACDB474 for ; Mon, 16 Oct 2023 17:56:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232033AbjJPR41 (ORCPT ); Mon, 16 Oct 2023 13:56:27 -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> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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;