[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v5 11/17] migration: Really use multiple pages a
From: |
Peter Xu |
Subject: |
Re: [Qemu-devel] [PATCH v5 11/17] migration: Really use multiple pages at a time |
Date: |
Thu, 20 Jul 2017 18:09:17 +0800 |
User-agent: |
Mutt/1.5.24 (2015-08-30) |
On Thu, Jul 20, 2017 at 05:49:47PM +0800, Peter Xu wrote:
> On Mon, Jul 17, 2017 at 03:42:32PM +0200, Juan Quintela wrote:
>
> [...]
>
> > static int multifd_send_page(uint8_t *address)
> > {
> > - int i;
> > + int i, j;
> > MultiFDSendParams *p = NULL; /* make happy gcc */
> > + static multifd_pages_t pages;
> > + static bool once;
> > +
> > + if (!once) {
> > + multifd_init_group(&pages);
> > + once = true;
>
> Would it be good to put the "pages" into multifd_send_state? One is to
> stick globals together; another benefit is that we can remove the
> "once" here: we can then init the "pages" when init multifd_send_state
> struct (but maybe with a better name?...).
>
> (there are similar static variables in multifd_recv_page() as well, if
> this one applies, then we can possibly use multifd_recv_state for
> that one)
>
> > + }
> > +
> > + pages.iov[pages.num].iov_base = address;
> > + pages.iov[pages.num].iov_len = TARGET_PAGE_SIZE;
> > + pages.num++;
> > +
> > + if (pages.num < (pages.size - 1)) {
> > + return UINT16_MAX;
>
> Nit: shall we define something for readability? Like:
>
> #define MULTIFD_FD_INVALID UINT16_MAX
Sorry I misunderstood. INVALID may not suite here. Maybe
MULTIFD_FD_CONTINUE?
(afaiu we send this before we send the real fd_num for the chunk)
--
Peter Xu
- Re: [Qemu-devel] [PATCH v5 09/17] migration: Start of multiple fd work, (continued)
- [Qemu-devel] [PATCH v5 10/17] migration: Create ram_multifd_page, Juan Quintela, 2017/07/17
- [Qemu-devel] [PATCH v5 11/17] migration: Really use multiple pages at a time, Juan Quintela, 2017/07/17
- [Qemu-devel] [PATCH v5 12/17] migration: Send the fd number which we are going to use for this page, Juan Quintela, 2017/07/17
- [Qemu-devel] [PATCH v5 13/17] migration: Create thread infrastructure for multifd recv side, Juan Quintela, 2017/07/17
- [Qemu-devel] [PATCH v5 14/17] migration: Delay the start of reception on main channel, Juan Quintela, 2017/07/17
- [Qemu-devel] [PATCH v5 15/17] migration: Test new fd infrastructure, Juan Quintela, 2017/07/17