lkml.org 
[lkml]   [2023]   [Feb]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v10 12/26] gunyah: vm_mgr: Add/remove user memory regions
* Srinivas Kandagatla <srinivas.kandagatla@linaro.org> [2023-02-21 12:28:53]:

> > +void gh_vm_mem_reclaim(struct gh_vm *ghvm, struct gh_vm_mem *mapping)
> > + __must_hold(&ghvm->mm_lock)
> > +{
> > + int i, ret = 0;
> > +
> > + if (mapping->parcel.mem_handle != GH_MEM_HANDLE_INVAL) {
> > + ret = gh_rm_mem_reclaim(ghvm->rm, &mapping->parcel);
> > + if (ret)
> > + pr_warn("Failed to reclaim memory parcel for label %d: %d\n",
> > + mapping->parcel.label, ret);
>
> what the behavoir of hypervisor if we failed to reclaim the pages?
>
> > + }
> > +
> > + if (!ret)
> So we will leave the user pages pinned if hypervisor call fails, but further
> down we free the mapping all together.

I think we should cleanup and bail out here, rather than try continuing past the
error. For ex: imagine userspace were to reclaim with VM still running. We would
leave the pages pinned AFAICS (even after VM terminates later) and also not
return any error to userspace indicating failure to reclaim.

\
 
 \ /
  Last update: 2023-03-27 00:30    [W:0.696 / U:0.216 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site