All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>, Tim Deegan <tim@xen.org>,
	Xen-devel <xen-devel@lists.xen.org>,
	Jan Beulich <JBeulich@suse.com>, Keir Fraser <keir@xen.org>
Subject: Re: [PATCH for-4.5] tools/libxc: Avoid cacheflush toolstack hypercalls on x86
Date: Wed, 24 Sep 2014 15:24:41 +0100	[thread overview]
Message-ID: <5422D429.8000903@citrix.com> (raw)
In-Reply-To: <1411568558.28127.42.camel@kazak.uk.xensource.com>

On 24/09/14 15:22, Ian Campbell wrote:
> On Wed, 2014-09-24 at 14:47 +0100, Andrew Cooper wrote:
>> XEN_DOMCTL_cacheflush hypercalls are (and will always be) -ENOSYS on x86, but
>> xc_domain_cacheflush() is called often during domain build and migrate for
>> correct behaviour on ARM.
>>
>> Stub xc_domain_cacheflush() out on x86 to remove its pressure on the global
>> domctl lock, and the hypercall overhead (which applies further pressure to the
>> already heavily-contended TLB flush lock).
>>
>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
>> CC: Keir Fraser <keir@xen.org>
>> CC: Jan Beulich <JBeulich@suse.com>
>> CC: Tim Deegan <tim@xen.org>
>> CC: Ian Campbell <Ian.Campbell@citrix.com>
>> CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
>> CC: Wei Liu <wei.liu2@citrix.com>
> Acked-by: Ian Campbell <ian.campbell@citrix.com>
>
> Although IMHO only the first paragraph of the comment is useful, the
> rest belongs in the commit log (where it already mostly is already).

I am happy for that to be fixed while committing, or I could resubmit?

~Andrew

>
>> ---
>>  tools/libxc/xc_domain.c |   16 ++++++++++++++++
>>  1 file changed, 16 insertions(+)
>>
>> diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c
>> index 1a6f90a..a68127f 100644
>> --- a/tools/libxc/xc_domain.c
>> +++ b/tools/libxc/xc_domain.c
>> @@ -51,12 +51,28 @@ int xc_domain_create(xc_interface *xch,
>>  int xc_domain_cacheflush(xc_interface *xch, uint32_t domid,
>>                           xen_pfn_t start_pfn, xen_pfn_t nr_pfns)
>>  {
>> +#if defined (__i386__) || defined (__x86_64__)
>> +    /*
>> +     * The x86 architecture provides cache coherency guarantees which prevent
>> +     * the need for this hypercall.
>> +     *
>> +     * This call however is made frequently during domain build and migrate
>> +     * for the benefit of ARM, where cache flushes are needed.
>> +     *
>> +     * Stub it out here on x86 as domctls take the global domctl lock in Xen
>> +     * which is detrimental to concurrent toolstack operations on other
>> +     * domains.
>> +     */
>> +    errno = ENOSYS;
>> +    return -1;
>> +#else
>>      DECLARE_DOMCTL;
>>      domctl.cmd = XEN_DOMCTL_cacheflush;
>>      domctl.domain = (domid_t)domid;
>>      domctl.u.cacheflush.start_pfn = start_pfn;
>>      domctl.u.cacheflush.nr_pfns = nr_pfns;
>>      return do_domctl(xch, &domctl);
>> +#endif
>>  }
>>  
>>  int xc_domain_pause(xc_interface *xch,
>

  reply	other threads:[~2014-09-24 14:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-24 13:47 [PATCH for-4.5] tools/libxc: Avoid cacheflush toolstack hypercalls on x86 Andrew Cooper
2014-09-24 14:22 ` Ian Campbell
2014-09-24 14:24   ` Andrew Cooper [this message]
2014-09-24 14:29     ` 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=5422D429.8000903@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=JBeulich@suse.com \
    --cc=keir@xen.org \
    --cc=tim@xen.org \
    --cc=wei.liu2@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 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.