Thread (12 messages) 12 messages, 5 authors, 2024-11-11

Re: [RFC PATCH 0/4] Add fbind() and NUMA mempolicy support for KVM guest_memfd

From: Shivank Garg <hidden>
Date: 2024-11-07 08:54:38
Also in: kvm, linux-arch, linux-coco, linux-fsdevel, linux-mm, lkml

Hi Matthew,

On 11/6/2024 12:25 AM, Matthew Wilcox wrote:
On Tue, Nov 05, 2024 at 04:45:45PM +0000, Shivank Garg wrote:
quoted
This patch series introduces fbind() syscall to support NUMA memory
policies for KVM guest_memfd, allowing VMMs to configure memory placement
for guest memory. This addresses the current limitation where guest_memfd
allocations ignore NUMA policies, potentially impacting performance of
memory-locality-sensitive workloads.
Why does guest_memfd ignore numa policies?  The pagecache doesn't,
eg in vma_alloc_folio_noprof().
guest_memfd doesn't have VMAs and hence can't store policy information in
VMA and use vma_alloc_folio_noprof() that fetches mpol from VMA.

The folio allocation path from guest_memfd typically looks like this...

kvm_gmem_get_folio
  filemap_grab_folio
    __filemap_get_folio
      filemap_alloc_folio
        __folio_alloc_node_noprof
          -> goes to the buddy allocator

Hence, I am trying to have a version of filemap_alloc_folio() that takes an mpol.


Thanks,
Shivank
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help