Hi Vishal, On Wed, 5 Feb 2025 at 00:51, Vishal Annapurve <vannapurve@xxxxxxxxxx> wrote: > > On Fri, Jan 17, 2025 at 8:30 AM Fuad Tabba <tabba@xxxxxxxxxx> wrote: > > > <snip> > > > > static const char *page_type_name(unsigned int page_type) > > diff --git a/mm/swap.c b/mm/swap.c > > index 6f01b56bce13..15220eaabc86 100644 > > --- a/mm/swap.c > > +++ b/mm/swap.c > > @@ -37,6 +37,7 @@ > > #include <linux/page_idle.h> > > #include <linux/local_lock.h> > > #include <linux/buffer_head.h> > > +#include <linux/kvm_host.h> > > > > #include "internal.h" > > > > @@ -103,6 +104,9 @@ static void free_typed_folio(struct folio *folio) > > case PGTY_offline: > > /* Nothing to do, it's offline. */ > > return; > > + case PGTY_guestmem: > > + kvm_gmem_handle_folio_put(folio); > > + return; > > Unless it's discussed before, kvm_gmem_handle_folio_put() needs to be > implemented outside KVM code which could be unloaded at runtime. > Eliott's plan [1] to implement a guest_memfd library can handle this > scenario in future. > > [1] https://patches.linaro.org/project/linux-arm-msm/patch/20240829-guest-memfd-lib-v2-1-b9afc1ff3656@xxxxxxxxxxx/ Yes, not just that, but there's a lot of KVM code in guest_memdf in general. Cheers, /fuad