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 lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 95494CFD313 for ; Mon, 24 Nov 2025 14:37:17 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [127.0.0.1]) by lists.ozlabs.org (Postfix) with ESMTP id 4dFT1S0h1kz30Vb; Tue, 25 Nov 2025 01:37:16 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; arc=none smtp.remote-ip=217.140.110.172 ARC-Seal: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1763995036; cv=none; b=YrrEMuH81FVDz8wlz1VAVH/y5jMEF9Fxan6V+o0GkdQco6JywlQQh/CJUBkFCHeC1mUB8eH0Z6VTYp9UsAkNETLKN5r+YqXr/YdC6zBA76WjpIyQn9UWM00BxzJVhpzPQ6FVLY9Lk81YZRs0af/uZDTwuMOf3Vr/7pSp4DXrhfmaT7sO8Fk6p8CT2W3yIWynzqULYwBh8L7EJhwjgbUskjUaiD3XtKeJPaPpTOmTUFgdDm/bWEZA3PNLrgj9SvebeK5ncm7aTjZUbWostSluLouQsDdlX/w3j3wYB8klmQkVLdBSDpGebiTwSH0YZpDrak9D0FJXzOOtkQd8+vmzvg== ARC-Message-Signature: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1763995036; c=relaxed/relaxed; bh=YJ471huPf3AbbCsoCzRDaoFvk+dd/VjhisJknTSiicY=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=YprkUSk/FI88kiRn7tc8J1L+qbv8FvqP4p6PHc5kDREMXpKBGg2L3YkpBwfxWcREL8/dUfDrqEu6Zo2SCXxu3qFzuZ8kl2fw2C2xMaaBWcO28lCtkp1E6UHI1aX7UwOogtfoMNDTVT3vroSnJvKzyG13GopVA9BVLVxvl79p5E8n3T20jJlyg+h72W6dyhHIM1NKBIgaKlKai1m8R/8NS6CNdCCBQ6PDzj1hsIt8WD018D3TCq1hQI2NHDnf5KD1hK4Tszy912tsfusH4cQSnyTTP7+J4VeqePUqNTFyaTXAa4GvGeTJ68WwowrOJeg3cjb4zs/d5PHoFeI5KUoCTg== ARC-Authentication-Results: i=1; lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass (client-ip=217.140.110.172; helo=foss.arm.com; envelope-from=ryan.roberts@arm.com; receiver=lists.ozlabs.org) smtp.mailfrom=arm.com Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=arm.com (client-ip=217.140.110.172; helo=foss.arm.com; envelope-from=ryan.roberts@arm.com; receiver=lists.ozlabs.org) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lists.ozlabs.org (Postfix) with ESMTP id 4dFT1Q6mDpz302l for ; Tue, 25 Nov 2025 01:37:12 +1100 (AEDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 80775497; Mon, 24 Nov 2025 06:36:32 -0800 (PST) Received: from [10.57.88.238] (unknown [10.57.88.238]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 94CBA3F6A8; Mon, 24 Nov 2025 06:36:34 -0800 (PST) Message-ID: Date: Mon, 24 Nov 2025 14:36:32 +0000 X-Mailing-List: linuxppc-dev@lists.ozlabs.org List-Id: List-Help: List-Owner: List-Post: List-Archive: , List-Subscribe: , , List-Unsubscribe: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 06/12] mm: introduce generic lazy_mmu helpers Content-Language: en-GB To: Kevin Brodsky , linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org, Alexander Gordeev , Andreas Larsson , Andrew Morton , Boris Ostrovsky , Borislav Petkov , Catalin Marinas , Christophe Leroy , Dave Hansen , David Hildenbrand , "David S. Miller" , David Woodhouse , "H. Peter Anvin" , Ingo Molnar , Jann Horn , Juergen Gross , "Liam R. Howlett" , Lorenzo Stoakes , Madhavan Srinivasan , Michael Ellerman , Michal Hocko , Mike Rapoport , Nicholas Piggin , Peter Zijlstra , Suren Baghdasaryan , Thomas Gleixner , Vlastimil Babka , Will Deacon , Yeoreum Yun , linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, sparclinux@vger.kernel.org, xen-devel@lists.xenproject.org, x86@kernel.org References: <20251029100909.3381140-1-kevin.brodsky@arm.com> <20251029100909.3381140-7-kevin.brodsky@arm.com> <71418b31-aedb-4600-9558-842515dd6c44@arm.com> From: Ryan Roberts In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 24/11/2025 12:47, Kevin Brodsky wrote: > On 10/11/2025 11:45, Kevin Brodsky wrote: >>>> diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c >>>> index b8d37eb037fc..d9c8e94f140f 100644 >>>> --- a/arch/arm64/mm/mmu.c >>>> +++ b/arch/arm64/mm/mmu.c >>>> @@ -731,7 +731,7 @@ int split_kernel_leaf_mapping(unsigned long start, unsigned long end) >>>> return -EINVAL; >>>> >>>> mutex_lock(&pgtable_split_lock); >>>> - arch_enter_lazy_mmu_mode(); >>>> + lazy_mmu_mode_enable(); >>>> >>>> /* >>>> * The split_kernel_leaf_mapping_locked() may sleep, it is not a >>> This is a bit unfortunate, IMHO. The rest of this comment explains that although >>> you're not supposed to sleep inside lazy mmu mode, it's fine for arm64's >>> implementation. But we are no longer calling arm64's implementation; we are >>> calling a generic function, which does who knows what. >>> >>> I think it all still works, but we are no longer containing our assumptions in >>> arm64 code. We are relying on implementation details of generic code. >> I see your point. The change itself is still correct (and required >> considering patch 8), but maybe the documentation of the generic >> interface should be clarified to guarantee that the generic layer can >> itself cope with sleeping - without any guarantee regarding the >> behaviour of arch_*_lazy_mmu_mode. > > Re-reading the existing comment in , I think it already > makes clear that sleeping is not forbidden by design: > >>  * In the general case, no lock is guaranteed to be held between entry >> and exit >>  * of the lazy mode. So the implementation must assume preemption may >> be enabled >>  * and cpu migration is possible; it must take steps to be robust >> against this. > > The arch implementation may disable preemption, but arm64 code can rely > on the arm64 implementation allowing sleeping. Yeah ok, I buy that! > > - Kevin >