Re: [PATCH] KVM: guest_memfd: fix NUMA interleave index double-counting

From: Sean Christopherson

Date: Tue Jun 09 2026 - 12:41:32 EST


On Wed, 03 Jun 2026 11:57:33 -0400, Michael S. Tsirkin wrote:
> kvm_gmem_get_policy() sets *ilx to the full page offset
> (vm_pgoff + vma offset). But get_vma_policy() adds the page
> offset on top of *ilx, so the offset is counted twice. This
> causes NUMA interleaving to skip nodes: for order-0 pages the
> effective index jumps by 2 for each consecutive page.
>
> The get_policy vm_op should return only a per-file bias in *ilx
> (like shmem_get_policy does with inode->i_ino), letting
> get_vma_policy() add the page-offset component.
>
> [...]

Applied to kvm-x86 gmem, with a heavily massaged changelog to explicitly spell
out that ilx == interleave index, and to try and explain the role of the index
(it wasn't at all obvious to me why using the inode number was "correct").

Thanks!

[1/1] KVM: guest_memfd: fix NUMA interleave index double-counting
https://github.com/kvm-x86/linux/commit/48dbe4732198

--
https://github.com/kvm-x86/linux/tree/next