Thread (80 messages) 80 messages, 8 authors, 2025-11-24

Re: [PATCH v4 02/12] x86/xen: simplify flush_lazy_mmu()

From: Ryan Roberts <ryan.roberts@arm.com>
Date: 2025-11-11 10:08:20
Also in: linux-arm-kernel, linux-mm, lkml, sparclinux, xen-devel

On 10/11/2025 10:36, Kevin Brodsky wrote:
On 07/11/2025 12:31, Ryan Roberts wrote:
quoted
On 29/10/2025 10:08, Kevin Brodsky wrote:
quoted
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.

Signed-off-by: Kevin Brodsky <redacted>
This looks functionally equivalent to me, so:

Reviewed-by: Ryan Roberts <ryan.roberts@arm.com>

But I don't think this tidy up is strictly necessary for your series to work?
(perhaps I'll change my mind on that as I go through it).
I initially thought it might be, but in the end I think you're right -
it should still work fine without this patch.

Still, I'd rather avoid unnecessary calls to arch_enter() and
arch_leave() as it makes it harder to reason about what is called where.
Namely, keeping them here means that a nested call to
lazy_mmu_mode_disable() would cause arch_leave() then arch_enter() to be
called - rather unexpected.

The only calls to arch_enter() and arch_leave() that are left after this
series are the ones in <linux/pgtable.h> and the Xen context-switching
logic (the one case where calling arch hooks directly is justified, see
discussion on v3 [1]).
OK yeah, sounds reasonable.
- Kevin

[1]
https://lore.kernel.org/all/390e41ae-4b66-40c1-935f-7a1794ba0b71@arm.com/ (local)
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help