|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v12 1/3] xen/mem_sharing: VM forking
On Thu, Mar 26, 2020 at 6:33 AM Jan Beulich <jbeulich@xxxxxxxx> wrote:
>
> On 23.03.2020 18:04, Tamas K Lengyel wrote:
> > --- a/xen/arch/x86/domain.c
> > +++ b/xen/arch/x86/domain.c
> > @@ -2202,6 +2202,17 @@ int domain_relinquish_resources(struct domain *d)
> > ret = relinquish_shared_pages(d);
> > if ( ret )
> > return ret;
> > +
> > + /*
> > + * If the domain is forked, decrement the parent's pause count
> > + * and release the domain.
> > + */
> > + if ( mem_sharing_is_fork(d) )
> > + {
> > + domain_unpause(d->parent);
> > + put_domain(d->parent);
> > + d->parent = NULL;
>
> I think you want to clear the field before putting the reference,
> to make sure possible readers of it won't see it non-NULL when
> the domain is already being cleaned up, or even gone.
Sure.
>
> With this, applicable parts of the change
> Acked-by: Jan Beulich <jbeulich@xxxxxxxx>
>
> I'll try to keep an eye on when you and Roger have settled on the
> remaining aspects, to determine when this (probably v13) can be
> committed.
Thanks!
>
> > --- a/xen/include/asm-x86/mem_sharing.h
> > +++ b/xen/include/asm-x86/mem_sharing.h
> > @@ -77,6 +77,14 @@ static inline int mem_sharing_unshare_page(struct domain
> > *d,
> > return rc;
> > }
> >
> > +static inline bool mem_sharing_is_fork(struct domain *d)
>
> const? (then also in the stub further down)
Sure.
Tamas
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |