qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v5 33/45] Page request: Process incoming page re


From: David Gibson
Subject: Re: [Qemu-devel] [PATCH v5 33/45] Page request: Process incoming page request
Date: Thu, 26 Mar 2015 12:31:13 +1100
User-agent: Mutt/1.5.23 (2014-03-12)

On Wed, Mar 25, 2015 at 05:37:34PM +0000, Dr. David Alan Gilbert wrote:
> * David Gibson (address@hidden) wrote:
> > On Wed, Feb 25, 2015 at 04:51:56PM +0000, Dr. David Alan Gilbert (git) 
> > wrote:
> > > From: "Dr. David Alan Gilbert" <address@hidden>
> > > 
> > > On receiving MIG_RPCOMM_REQ_PAGES look up the address and
> > > queue the page.
> > > 
> > > Signed-off-by: Dr. David Alan Gilbert <address@hidden>
> > > ---
> > >  arch_init.c                   | 55 
> > > +++++++++++++++++++++++++++++++++++++++++++
> > >  include/exec/cpu-all.h        |  2 --
> > >  include/migration/migration.h | 21 +++++++++++++++++
> > >  include/qemu/typedefs.h       |  1 +
> > >  migration/migration.c         | 33 +++++++++++++++++++++++++-
> > >  trace-events                  |  3 ++-
> > >  6 files changed, 111 insertions(+), 4 deletions(-)
> > > 
> > > diff --git a/arch_init.c b/arch_init.c
> > > index d2c4457..9d8fc6b 100644
> > > --- a/arch_init.c
> > > +++ b/arch_init.c
> 
> <snip>
> 
> > >  static void migrate_handle_rp_req_pages(MigrationState *ms, const char* 
> > > rbname,
> > >                                         ram_addr_t start, ram_addr_t len)
> > >  {
> > > -    trace_migrate_handle_rp_req_pages(start, len);
> > > +    trace_migrate_handle_rp_req_pages(rbname, start, len);
> > > +
> > > +    /* Round everything up to our host page size */
> > > +    long our_host_ps = getpagesize();
> > > +    if (start & (our_host_ps-1)) {
> > > +        long roundings = start & (our_host_ps-1);
> > > +        start -= roundings;
> > > +        len += roundings;
> > > +    }
> > > +    if (len & (our_host_ps-1)) {
> > > +        long roundings = len & (our_host_ps-1);
> > > +        len -= roundings;
> > > +        len += our_host_ps;
> > > +    }
> > 
> > Why is it necessary to round out to host page size on the source?  I
> > understand why the host page size is relevant on the destination, due
> > to the userfaultfd and atomic populate constraints, but not on the source.
> 
> In principal the request you get from the destination should already
> be nicely aligned; but of course you can't actually trust it, so you
> have to at least test for alignment.
> 
> Since the code has to send whole host pages to keep the
> destination happy, it expects the requests that come out of the queue
> to be host page aligned.

I don't follow.  It sounds like you'll only send non-aligned things if
the destination (incorrectly) requests them.  But in that case the
only thing that the destination will mess up is itself, so where's the
requirement to do anything on the source side?

> At the moment we're only supporting matching page sizes, if we wanted
> to support mismatches then it probably needs to round to the size of
> destination host page sizes.

And can't that effectively be done by just answering the requests
exactly as the destination makes them?

-- 
David Gibson                    | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au  | minimalist, thank you.  NOT _the_ _other_
                                | _way_ _around_!
http://www.ozlabs.org/~dgibson

Attachment: pgpDXpQzNWCcJ.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]