|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH RFC 07/20] migration: defer precopy policy to libxl
On Thu, Mar 30, 2017 at 01:19:41AM -0400, Joshua Otto wrote:
> >
> > > +};
> > > +
> > > /* callbacks provided by xc_domain_save */
> > > struct save_callbacks {
> > > /* Called after expiration of checkpoint interval,
> > > @@ -46,6 +54,17 @@ struct save_callbacks {
> > > */
> > > int (*suspend)(void* data);
> > >
> > > + /* Called after every batch of page data sent during the precopy
> > > phase of a
> > > + * live migration to ask the caller what to do next based on the
> > > current
> > > + * state of the precopy migration.
> > > + */
> > > +#define XGS_POLICY_ABORT (-1) /* Abandon the migration entirely
> > > and
> > > + * tidy up. */
> > > +#define XGS_POLICY_CONTINUE_PRECOPY 0 /* Remain in the precopy phase. */
> > > +#define XGS_POLICY_STOP_AND_COPY 1 /* Immediately suspend and
> > > transmit the
> > > + * remaining dirty pages. */
> > > + int (*precopy_policy)(struct precopy_stats stats, void *data);
> >
> > Structures shouldn't be passed by value like this, as the compiler has
> > to do a lot of memcpy() work to make it happen. You should pass by
> > const pointer, as (as far as I can tell), they are strictly read-only to
> > the implementation of this hook?
>
> I chose to pass by value to make the IPC plumbing easier -
> libxl_save_msgs_gen.pl doesn't know what to do about pointers, and (not being
> the strongest Perl programmer...) I didn't want to volunteer to be the one to
> teach it.
>
> Is the memcpy() really significant here? If this were a tight loop, sure, but
> every invocation of the policy callback implies both a 4MB network transfer
> _and_ a synchronous RPC.
Ian, How can Joshua pass a pointer across RPC boundary to avoid excessive
copying?
Wei.
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |