[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v8 41/54] postcopy_ram.c: place_page and helpers
From: |
Dr. David Alan Gilbert |
Subject: |
Re: [Qemu-devel] [PATCH v8 41/54] postcopy_ram.c: place_page and helpers |
Date: |
Wed, 28 Oct 2015 13:11:11 +0000 |
User-agent: |
Mutt/1.5.24 (2015-08-30) |
* Juan Quintela (address@hidden) wrote:
> "Dr. David Alan Gilbert (git)" <address@hidden> wrote:
> > From: "Dr. David Alan Gilbert" <address@hidden>
> >
> > postcopy_place_page (etc) provide a way for postcopy to place a page
> > into guests memory atomically (using the copy ioctl on the ufd).
> >
> > Signed-off-by: Dr. David Alan Gilbert <address@hidden>
> > Reviewed-by: Amit Shah <address@hidden>
>
>
> Reviewed-by: Juan Quintela <address@hidden>
>
> > +int postcopy_place_page_zero(MigrationIncomingState *mis, void *host)
> > +{
> > + struct uffdio_zeropage zero_struct;
> > +
> > + zero_struct.range.start = (uint64_t)(uintptr_t)host;
> > + zero_struct.range.len = getpagesize();
> > + zero_struct.mode = 0;
> > +
> > + if (ioctl(mis->userfault_fd, UFFDIO_ZEROPAGE, &zero_struct)) {
> > + int e = errno;
> > + error_report("%s: %s zero host: %p",
> > + __func__, strerror(e), host);
> > +
> > + return -e;
> > + }
> > +
> > + trace_postcopy_place_page_zero(host);
> > + return 0;
> > +}
>
> Would this be faster than normal precopy way of just copying a zero page?
For postcopy we have to do an ioctl anyway (to release any paused tasks
waiting on the page), and we can't just write to the page because it's not
mapped yet. We could do a UFFDIO_COPY of a zero page but that would
take a copy; here the kernel maps the zero page and releases the paused task
without needing a zero page to copy from.
Dave
--
Dr. David Alan Gilbert / address@hidden / Manchester, UK
- Re: [Qemu-devel] [PATCH v8 38/54] Page request: Add MIG_RP_MSG_REQ_PAGES reverse command, (continued)
- [Qemu-devel] [PATCH v8 39/54] Page request: Process incoming page request, Dr. David Alan Gilbert (git), 2015/10/01
- [Qemu-devel] [PATCH v8 40/54] Page request: Consume pages off the post-copy queue, Dr. David Alan Gilbert (git), 2015/10/01
- [Qemu-devel] [PATCH v8 42/54] Postcopy: Use helpers to map pages during migration, Dr. David Alan Gilbert (git), 2015/10/01
- [Qemu-devel] [PATCH v8 43/54] Don't sync dirty bitmaps in postcopy, Dr. David Alan Gilbert (git), 2015/10/01
- [Qemu-devel] [PATCH v8 41/54] postcopy_ram.c: place_page and helpers, Dr. David Alan Gilbert (git), 2015/10/01
- [Qemu-devel] [PATCH v8 44/54] Don't iterate on precopy-only devices during postcopy, Dr. David Alan Gilbert (git), 2015/10/01
- [Qemu-devel] [PATCH v8 45/54] Host page!=target page: Cleanup bitmaps, Dr. David Alan Gilbert (git), 2015/10/01
- [Qemu-devel] [PATCH v8 46/54] postcopy: Check order of received target pages, Dr. David Alan Gilbert (git), 2015/10/01
- [Qemu-devel] [PATCH v8 47/54] Round up RAMBlock sizes to host page sizes, Dr. David Alan Gilbert (git), 2015/10/01
- [Qemu-devel] [PATCH v8 48/54] Postcopy; Handle userfault requests, Dr. David Alan Gilbert (git), 2015/10/01
- [Qemu-devel] [PATCH v8 50/54] postcopy: Wire up loadvm_postcopy_handle_ commands, Dr. David Alan Gilbert (git), 2015/10/01