xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Shriram Rajagopalan <rshriram@cs.ubc.ca>
To: Ian Jackson <Ian.Jackson@eu.citrix.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
	Ian Campbell <ian.campbell@citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [PATCH 4 of 5 V3] tools/libxl: Control network buffering in remus callbacks
Date: Fri, 1 Nov 2013 13:04:16 -0700	[thread overview]
Message-ID: <CAP8mzPOMbzd0jiimV9uhqnBGi=hEfbpRQOJSLbuX0ZMLNuT1Qw@mail.gmail.com> (raw)
In-Reply-To: <21107.62159.140005.466786@mariner.uk.xensource.com>


[-- Attachment #1.1: Type: text/plain, Size: 2860 bytes --]

On Fri, Nov 1, 2013 at 11:28 AM, Ian Jackson <Ian.Jackson@eu.citrix.com>wrote:

> Shriram Rajagopalan writes ("[PATCH 4 of 5 V3] tools/libxl: Control
> network buffering in remus callbacks"):
> > tools/libxl: Control network buffering in remus callbacks
> ...
> >  static int libxl__remus_domain_suspend_callback(void *data)
> >  {
> > -    /* REMUS TODO: Issue disk and network checkpoint reqs. */
> > -    return libxl__domain_suspend_common_callback(data);
> > +    /* REMUS TODO: Issue disk checkpoint reqs. */
> > +    libxl__save_helper_state *shs = data;
> > +    libxl__domain_suspend_state *dss = CONTAINER_OF(shs, *dss, shs);
> > +    libxl__remus_ctx *remus_ctx = dss->remus_ctx;
> > +    bool is_suspended;
> > +    STATE_AO_GC(dss->ao);
> > +
> > +    is_suspended = !!libxl__domain_suspend_common_callback(data);
>
> I think this function would be less confusing if the return value
> variable was called "ok" or something similar.  It's really just an
> error flag.
>
> Also AFAICT the !! has no function here.  The return value is
> essentially a boolean.
>
> > +    if (!remus_ctx->netbuf_ctx) return is_suspended;
> > +
> > +    if (is_suspended) {
> > +        if (libxl__remus_netbuf_start_new_epoch(gc, dss->domid,
> > +                                                remus_ctx))
> > +            return !is_suspended;
>
> This construction is rather odd.  Why return !is_suspended when you
> know that !!is_suspended ?
>
>
If a new network buffer cannot be created (for the next epoch), then
return an error. This ends up terminating the checkpointing process.



> > @@ -1300,11 +1316,42 @@ static void libxl__remus_domain_checkpoi
> >  static void remus_checkpoint_dm_saved(libxl__egc *egc,
> >                                        libxl__domain_suspend_state *dss,
> int rc)
> >  {
> > -    /* REMUS TODO: Wait for disk and memory ack, release network buffer
> */
> > -    /* REMUS TODO: make this asynchronous */
> > -    assert(!rc); /* REMUS TODO handle this error properly */
> > -    usleep(dss->remus_ctx->interval * 1000);
> > -    libxl__xc_domain_saverestore_async_callback_done(egc, &dss->shs, 1);
> > +    /*
> > +     * REMUS TODO: Wait for disk and explicit memory ack (through
> restore
> > +     * callback from remote) before releasing network buffer.
> > +     */
> > +    libxl__remus_ctx *remus_ctx = dss->remus_ctx;
> > +    struct timespec epoch;
> > +    int do_next_iter = 0;
>
> Again, this variable is probably best called "ok".
>
> > +    epoch.tv_sec = remus_ctx->interval / 1000; /* interval is in ms */
> > +    epoch.tv_nsec = remus_ctx->interval * 1000L * 1000L;
> > +    nanosleep(&epoch, 0);
>
> This is no good, I'm afraid.  You should be using a libxl event loop
> timer.  (Also why are you changing your existing usleep to this new
> nanosleep which seems functionally very similar?)
>
> Ian.
>
>

[-- Attachment #1.2: Type: text/html, Size: 3908 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

  parent reply	other threads:[~2013-11-01 20:04 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-21  5:58 [PATCH 0 of 5 V3] Remus/Libxl: Network buffering support Shriram Rajagopalan
2013-10-21  5:58 ` [PATCH 1 of 5 V3] remus: add libnl3 dependency to autoconf scripts Shriram Rajagopalan
2013-10-31 20:13   ` Ian Campbell
2013-10-21  5:58 ` [PATCH 2 of 5 V3] tools/hotplug: Remus network buffering setup scripts Shriram Rajagopalan
2013-10-31 20:21   ` Ian Campbell
2013-10-31 21:06     ` Shriram Rajagopalan
2013-10-31 22:25       ` Ian Campbell
2013-11-14  3:55         ` Shriram Rajagopalan
2013-10-21  5:58 ` [PATCH 3 of 5 V3] tools/libxl: setup/teardown Remus network buffering Shriram Rajagopalan
2013-10-31 20:28   ` Ian Campbell
2013-10-21  5:58 ` [PATCH 4 of 5 V3] tools/libxl: Control network buffering in remus callbacks Shriram Rajagopalan
2013-10-31 20:31   ` Ian Campbell
2013-11-01 18:28   ` Ian Jackson
2013-11-01 19:57     ` Shriram Rajagopalan
2013-11-04 12:12       ` [PATCH 4 of 5 V3] tools/libxl: Control network buffering in remus callbacks [and 1 more messages] Ian Jackson
2013-11-04 15:17         ` Shriram Rajagopalan
2013-11-04 15:32           ` Ian Campbell
2013-11-04 16:06             ` Ian Jackson
2013-11-04 16:40               ` [PATCH 4 of 5 V3] tools/libxl: Control network buffering in remus callbacks [and 1 more messages] " Ian Jackson
2013-11-11 17:56                 ` Shriram Rajagopalan
2013-11-12  9:48                   ` Ian Campbell
2013-11-12 15:38                   ` Ian Jackson
2013-11-12 16:24                     ` Shriram Rajagopalan
2013-11-12 16:38                       ` Ian Jackson
2013-11-12 16:43                         ` Shriram Rajagopalan
2013-11-12 17:00                           ` Ian Jackson
2013-11-04 16:45               ` [PATCH 4 of 5 V3] tools/libxl: Control network buffering in remus callbacks " Ian Campbell
2013-11-04 16:47               ` Shriram Rajagopalan
2013-11-04 17:01                 ` Ian Jackson
2013-11-04 17:23                   ` Shriram Rajagopalan
2013-11-04 17:33                     ` Ian Jackson
2013-11-01 20:04     ` Shriram Rajagopalan [this message]
2013-10-21  5:58 ` [PATCH 5 of 5 V3] tools/xl: Remus - Network buffering cmdline switch Shriram Rajagopalan
2013-10-31 20:38   ` Ian Campbell
2013-10-31 21:47     ` Shriram Rajagopalan
2013-10-31 22:29       ` Ian Campbell
2013-10-30 23:05 ` [PATCH 0 of 5 V3] Remus/Libxl: Network buffering support Shriram Rajagopalan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAP8mzPOMbzd0jiimV9uhqnBGi=hEfbpRQOJSLbuX0ZMLNuT1Qw@mail.gmail.com' \
    --to=rshriram@cs.ubc.ca \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=ian.campbell@citrix.com \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).