From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A0D472773DF; Tue, 9 Sep 2025 13:59:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757426394; cv=none; b=Xc2T76Ey6yYxpjEH2XN+dgU+rK7XwXY5Es0mHO3s0omXs5jeF+rZebBaRSjnf34wiIsR3ApCTqQgJt8hsOMXWaeWWt6VAQoaP6BdHc0KkkhdoDIQ9pnZQRxlBQlJbh1YLte77Z24pcOVKMfOlsuVgwGr4ePnWje2QC0qFv4XDPA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757426394; c=relaxed/simple; bh=me/PYrVLsmNCRPmt3YLLhQOu31Dt2HxN8RzThRmkvck=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=lJmEvct0867dFjwbKBBUWdPFDT1488jtwiCEWwgV5xpcUAtg9YVs0Gk3FduNLUYFHoR7v0A+MY6E355hVpuOuGQoW0l62nW5Cqb0ZbxAQkTUcowSjE1pLbwmCJfPvXCu+efqc8uCF7u3x1fmo1rGMWTxOY+jYXlWqtWesrQDm34= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com 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 5E9261424; Tue, 9 Sep 2025 06:59:43 -0700 (PDT) Received: from [10.44.160.77] (e126510-lin.lund.arm.com [10.44.160.77]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 4CF773F66E; Tue, 9 Sep 2025 06:59:44 -0700 (PDT) Message-ID: <203c84db-1a58-42f0-a79b-35104d79e964@arm.com> Date: Tue, 9 Sep 2025 15:59:41 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 0/7] Nesting support for lazy MMU mode To: David Hildenbrand , Andrew Morton Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Alexander Gordeev , Andreas Larsson , Boris Ostrovsky , Borislav Petkov , Catalin Marinas , Christophe Leroy , Dave Hansen , "David S. Miller" , "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 , Ryan Roberts , 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 References: <20250908073931.4159362-1-kevin.brodsky@arm.com> <20250908191602.61160a7990b9ea418de758c7@linux-foundation.org> Content-Language: en-GB From: Kevin Brodsky In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 09/09/2025 11:21, David Hildenbrand wrote: > On 09.09.25 04:16, Andrew Morton wrote: >> On Mon,  8 Sep 2025 08:39:24 +0100 Kevin Brodsky >> wrote: >> >>> The main change enabling nesting is patch 2, following the approach >>> suggested by Catalin Marinas [4]: have enter() return some state and >>> the matching leave() take that state. >> >> This is so totally the correct way.  Thanks. > > Staring at this, I wonder if we could alternatively handle it like > pagefault_disable()/pagefault_enable(), having something like > current->lazy_mmu_enabled. > > We wouldn't have to worry about preemption in that case I guess > (unless the arch has special requirements). > > Not sure if that was already discussed, just a thought.  That's an interesting point, I think I've addressed it in reply to patch 2 [1]. - Kevin [1] https://lore.kernel.org/all/47ee1df7-1602-4200-af94-475f84ca8d80@arm.com/