From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Jan Beulich <JBeulich@suse.com>,
xen-devel <xen-devel@lists.xenproject.org>
Cc: Wei Liu <wei.liu2@citrix.com>,
Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
Ian Jackson <Ian.Jackson@eu.citrix.com>, Tim Deegan <tim@xen.org>,
Ian Campbell <Ian.Campbell@eu.citrix.com>,
Keir Fraser <keir@xen.org>
Subject: Re: [PATCH] domctl: do away with tool stack based retrying
Date: Wed, 11 Feb 2015 14:02:11 +0000 [thread overview]
Message-ID: <54DB60E3.1040402@citrix.com> (raw)
In-Reply-To: <54DB6B6D020000780005F100@mail.emea.novell.com>
[-- Attachment #1.1: Type: text/plain, Size: 2286 bytes --]
On 11/02/15 13:47, Jan Beulich wrote:
> XEN_DOMCTL_destroydomain so far is being special cased in libxc to
> reinvoke the operation when getting back EAGAIN. Quite a few other
> domctl-s have gained continuations, so I see no reason not to use them
> here too.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
In particular, it ought to be much more efficient as it avoids the
kernel/user context switches, and associated TLB flushes.
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
>
> --- a/tools/libxc/xc_domain.c
> +++ b/tools/libxc/xc_domain.c
> @@ -112,14 +112,10 @@ int xc_domain_unpause(xc_interface *xch,
> int xc_domain_destroy(xc_interface *xch,
> uint32_t domid)
> {
> - int ret;
> DECLARE_DOMCTL;
> domctl.cmd = XEN_DOMCTL_destroydomain;
> domctl.domain = (domid_t)domid;
> - do {
> - ret = do_domctl(xch, &domctl);
> - } while ( ret && (errno == EAGAIN) );
> - return ret;
> + return do_domctl(xch, &domctl);
> }
>
> int xc_domain_shutdown(xc_interface *xch,
> --- a/xen/common/domain.c
> +++ b/xen/common/domain.c
> @@ -617,13 +617,9 @@ int domain_kill(struct domain *d)
> case DOMDYING_dying:
> rc = domain_relinquish_resources(d);
> if ( rc != 0 )
> - {
> - if ( rc == -ERESTART )
> - rc = -EAGAIN;
> break;
> - }
> if ( cpupool_move_domain(d, cpupool0) )
> - return -EAGAIN;
> + return -ERESTART;
> for_each_vcpu ( d, v )
> unmap_vcpu_info(v);
> d->is_dying = DOMDYING_dead;
> --- a/xen/common/domctl.c
> +++ b/xen/common/domctl.c
> @@ -692,10 +692,11 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xe
> break;
>
> case XEN_DOMCTL_destroydomain:
> - {
> ret = domain_kill(d);
> - }
> - break;
> + if ( ret == -ERESTART )
> + ret = hypercall_create_continuation(
> + __HYPERVISOR_domctl, "h", u_domctl);
> + break;
>
> case XEN_DOMCTL_setnodeaffinity:
> {
>
>
>
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
[-- Attachment #1.2: Type: text/html, Size: 3057 bytes --]
[-- Attachment #2: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
next prev parent reply other threads:[~2015-02-11 14:02 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-11 13:47 [PATCH] domctl: do away with tool stack based retrying Jan Beulich
2015-02-11 14:02 ` Andrew Cooper [this message]
2015-02-13 14:34 ` Wei Liu
2015-02-18 13:31 ` Ian Campbell
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=54DB60E3.1040402@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=Ian.Campbell@eu.citrix.com \
--cc=Ian.Jackson@eu.citrix.com \
--cc=JBeulich@suse.com \
--cc=keir@xen.org \
--cc=stefano.stabellini@eu.citrix.com \
--cc=tim@xen.org \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xenproject.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.