]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
KVM: guest_memfd: Add slab-allocated inode cache
authorShivank Garg <shivankg@amd.com>
Thu, 16 Oct 2025 17:28:45 +0000 (10:28 -0700)
committerSean Christopherson <seanjc@google.com>
Mon, 20 Oct 2025 13:30:40 +0000 (06:30 -0700)
commitf609e89ae8936dbba8992ada83d27ece5cb8393a
tree7fb02145fabf684092de4e5796f3d4c3d0a28d8f
parenta63ca4236e6799cf4343f9aec9d92afdfa582446
KVM: guest_memfd: Add slab-allocated inode cache

Add a dedicated gmem_inode structure and a slab-allocated inode cache for
guest memory backing, similar to how shmem handles inodes.

This adds the necessary allocation/destruction functions and prepares
for upcoming guest_memfd NUMA policy support changes.  Using a dedicated
structure will also allow for additional cleanups, e.g. to track flags in
gmem_inode instead of i_private.

Signed-off-by: Shivank Garg <shivankg@amd.com>
Tested-by: Ashish Kalra <ashish.kalra@amd.com>
[sean: s/kvm_gmem_inode_info/gmem_inode, name init_once()]
Reviewed-by: Ackerley Tng <ackerleytng@google.com>
Tested-by: Ackerley Tng <ackerleytng@google.com>
Link: https://lore.kernel.org/r/20251016172853.52451-5-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
virt/kvm/guest_memfd.c