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 D05C52BB1D; Thu, 4 Dec 2025 03:37:09 +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=1764819431; cv=none; b=Uxn/oW352lGeSmuxvZiLU21/yk7sv7bwH6JOAyffChFAdYnWXSl3FQFkCNdWAyuODWSyai7qDfPsxDO5MSoRML4uIlJnHttxaISKDA5oi87HWIY4HbyxA8LC8j7G3Ar+CqOCR5j0GTtXqvqMb6KrIn64Vb9ZO79KxxP8JNpaa+s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764819431; c=relaxed/simple; bh=rwl3csJ1un9FkM+EMLL+mG4TpdKpHd3EbdTJ8K28vQA=; h=Message-ID:Date:MIME-Version:From:Subject:To:Cc:References: In-Reply-To:Content-Type; b=iv+x1A0SvnX+k4NjSWbgxrA+y6V3GUpatpLLgRO+NMUScylZExf+uqkhzuJiw9x2/TtYmsL5vAFZ9/2V21JR+9N/uI3p7wZCYXVytaxlolw5frCRPBzaung5+opzn7SnUhXogrxqTj1zcrQNk1PEK6eTNHMd/ATSGeotmXCp8go= 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 63087339; Wed, 3 Dec 2025 19:37:01 -0800 (PST) Received: from [10.164.18.78] (unknown [10.164.18.78]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id EBB883F59E; Wed, 3 Dec 2025 19:36:58 -0800 (PST) Message-ID: <15cc652c-937b-4d5b-98f3-7cdcecf28e27@arm.com> Date: Thu, 4 Dec 2025 09:06:56 +0530 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Anshuman Khandual Subject: Re: [PATCH v5 02/12] x86/xen: simplify flush_lazy_mmu() 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 , "Ritesh Harjani (IBM)" , Ryan Roberts , Suren Baghdasaryan , Thomas Gleixner , Venkat Rao Bagalkote , 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: <20251124132228.622678-1-kevin.brodsky@arm.com> <20251124132228.622678-3-kevin.brodsky@arm.com> Content-Language: en-US In-Reply-To: <20251124132228.622678-3-kevin.brodsky@arm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 24/11/25 6:52 PM, Kevin Brodsky wrote: > arch_flush_lazy_mmu_mode() is called when outstanding batched > pgtable operations must be completed immediately. There should > however be no need to leave and re-enter lazy MMU completely. The > only part of that sequence that we really need is xen_mc_flush(); > call it directly. > > Reviewed-by: David Hildenbrand > Reviewed-by: Ryan Roberts > Reviewed-by: Juergen Gross > Signed-off-by: Kevin Brodsky > --- Reviewed-by: Anshuman Khandual > arch/x86/xen/mmu_pv.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/arch/x86/xen/mmu_pv.c b/arch/x86/xen/mmu_pv.c > index 2a4a8deaf612..7a35c3393df4 100644 > --- a/arch/x86/xen/mmu_pv.c > +++ b/arch/x86/xen/mmu_pv.c > @@ -2139,10 +2139,8 @@ static void xen_flush_lazy_mmu(void) > { > preempt_disable(); > > - if (xen_get_lazy_mode() == XEN_LAZY_MMU) { > - arch_leave_lazy_mmu_mode(); > - arch_enter_lazy_mmu_mode(); > - } > + if (xen_get_lazy_mode() == XEN_LAZY_MMU) > + xen_mc_flush(); > > preempt_enable(); > }