Re: [PATCH 19/22] KVM: x86/mmu: Add infrastructure to allow walking rmaps outside of mmu_lock
From: Lai Jiangshan
Date: Tue Aug 13 2024 - 02:36:17 EST
On Mon, Aug 12, 2024 at 11:22 PM Sean Christopherson <seanjc@xxxxxxxxxx> wrote:
>
> Oh yeah, duh, re-read after PAUSE, not before.
>
> Definitely holler if you have any alternative ideas for walking rmaps
> without taking mmu_lock, I guarantee you've spent more time than me
> thinking about the shadow MMU :-)
We use the same bit and the same way for the rmap lock.
We just use bit_spin_lock() and the optimization for empty rmap_head is
handled out of kvm_rmap_lock().
bit_spin_lock() has the most-needed preempt_disable(). I'm not sure if the
new kvm_rmap_age_gfn_range_lockless() is called in a preempt disabled region.
Thanks
Lai