[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v7 37/42] Postcopy; Handle userfault requests
From: |
Dr. David Alan Gilbert |
Subject: |
Re: [Qemu-devel] [PATCH v7 37/42] Postcopy; Handle userfault requests |
Date: |
Tue, 14 Jul 2015 16:15:39 +0100 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
* Juan Quintela (address@hidden) wrote:
> "Dr. David Alan Gilbert (git)" <address@hidden> wrote:
> > From: "Dr. David Alan Gilbert" <address@hidden>
> >
> > userfaultfd is a Linux syscall that gives an fd that receives a stream
> > of notifications of accesses to pages registered with it and allows
> > the program to acknowledge those stalls and tell the accessing
> > thread to carry on.
> >
> > We convert the requests from the kernel into messages back to the
> > source asking for the pages.
> >
> > Signed-off-by: Dr. David Alan Gilbert <address@hidden>
>
>
> > @@ -274,15 +276,41 @@ int postcopy_ram_incoming_init(MigrationIncomingState
> > *mis, size_t ram_pages)
> > */
> > int postcopy_ram_incoming_cleanup(MigrationIncomingState *mis)
> > {
> > - /* TODO: Join the fault thread once we're sure it will exit */
> > - if (qemu_ram_foreach_block(cleanup_area, mis)) {
> > - return -1;
> > + trace_postcopy_ram_incoming_cleanup_entry();
> > +
> > + if (mis->have_fault_thread) {
> > + uint64_t tmp64;
> > +
> > + if (qemu_ram_foreach_block(cleanup_area, mis)) {
> > + return -1;
> > + }
> > + /*
> > + * Tell the fault_thread to exit, it's an eventfd that should
> > + * currently be at 0, we're going to inc it to 1
> > + */
> > + tmp64 = 1;
> > + if (write(mis->userfault_quit_fd, &tmp64, 8) == 8) {
> > + trace_postcopy_ram_incoming_cleanup_join();
> > + qemu_thread_join(&mis->fault_thread);
> > + } else {
> > + /* Not much we can do here, but may as well report it */
> > + error_report("%s: incing userfault_quit_fd: %s", __func__,
> > + strerror(errno));
>
> "incing"???
Oh, incrementing :-)
Changed.
Dave
--
Dr. David Alan Gilbert / address@hidden / Manchester, UK