All of lore.kernel.org
 help / color / mirror / Atom feed
From: George Dunlap <George.Dunlap@eu.citrix.com>
To: Massimo Canonico <mex@di.unipmn.it>
Cc: "xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: CAP and performance problem
Date: Tue, 21 May 2013 11:48:41 +0100	[thread overview]
Message-ID: <CAFLBxZaDbUgVfVT-AXQS+JOxoaVPCC7bv-_1tm=SwUnzBUqD=A@mail.gmail.com> (raw)
In-Reply-To: <CAFLBxZbGNoyzuX-jCCzQ1F3Gh7b6rjXR3mCVP=-2HwEqwop5_Q@mail.gmail.com>

On Tue, May 21, 2013 at 11:41 AM, George Dunlap
<George.Dunlap@eu.citrix.com> wrote:
> On Tue, May 21, 2013 at 10:02 AM, Massimo Canonico <mex@di.unipmn.it> wrote:
>> Hi,
>> I sent the following problem on xen-user ML without an answer. I hope I'll
>> get one in this ML.
>>
>> My application is written in std C++ and it makes a matrix multiplication:
>> so it uses only CPU and memory (no I/O, no network).
>>
>>
>> I'm quite surprise that with CAP = 100% I got my results in about 600
>> seconds and with CAP = 50% I got my results in about 1800 seconds (around 3
>> times longer).
>>
>> For this kind of application I was expecting to get results in about 1200
>> seconds (2 times longer) for the second scenario with respect to the first
>> one.
>>
>> Of course, the HW and SW are exactly the same for the 2 experiments.
>>
>> Am I wrong or the CAP mechanism is not working well?
>
> How many vcpus do you have?
>
> I'm not sure the CAP stuff actually does anything sensible with
> multiple cpus -- e.g., a VM with 2 vcpus maxed out will typically
> actually get 200%, so will a CAP force both of them to get only 25%
> each?
>
> The other possibility if you've got multiple vcpus is that you're
> running into something I call "concurrency hazard": if one vcpu grabs
> a spinlock and then is paused in order to enforce the cap, and another
> vcpu tries to grab that spinlock, it will just spin until the first
> vcpu manages to wake up and release it again.

Sorry, meant to add: if you have more than one vcpu and you want to
limit the cpu footprint, you're much better off halving the number of
vcpus rather than giving each vcpu only 50% of a cpu.

I gave a presentation on why here, if you're interested:

http://www.citrix.com/tv/#videos/2930

 -George

  reply	other threads:[~2013-05-21 10:48 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-21  9:02 CAP and performance problem Massimo Canonico
2013-05-21 10:41 ` George Dunlap
2013-05-21 10:48   ` George Dunlap [this message]
2013-05-21 11:54     ` Massimo Canonico
2013-05-21 13:06       ` Dario Faggioli
2013-05-21 14:28         ` Massimo Canonico
2013-05-21 14:47           ` Dario Faggioli
2013-05-21 15:26             ` Massimo Canonico
2013-05-22 14:42             ` Massimo Canonico
2013-05-22 15:39               ` Dario Faggioli
2013-05-24  7:48                 ` Massimo Canonico
2013-06-04 14:03                   ` Massimo Canonico
2013-06-04 14:25                     ` Dario Faggioli
2013-06-05 16:50 ` Dario Faggioli
2013-06-05 17:11   ` Dario Faggioli
2013-06-05 17:05     ` Massimo Canonico
2013-06-06  8:37       ` Dario Faggioli
2013-06-06  8:57         ` Massimo Canonico
2013-06-06  9:52           ` Dario Faggioli
2013-06-06 10:39           ` Juergen Gross
2013-06-06 10:44             ` George Dunlap
2013-06-06 12:52               ` Massimo Canonico
2013-06-06 12:58                 ` George Dunlap
2013-06-06 13:02                 ` Juergen Gross
2013-06-06 13:55                   ` Massimo Canonico
2013-06-06 14:12                     ` George Dunlap
2013-06-06 14:12                     ` Dario Faggioli
2013-06-06 15:27                       ` Massimo Canonico
2013-06-06 15:42                         ` Dario Faggioli
2013-06-06 15:54                           ` Dario Faggioli
2013-06-06 16:27                             ` George Dunlap
2013-06-07  7:40                               ` Massimo Canonico
2013-06-07  4:45                       ` Juergen Gross
2013-06-06 13:03                 ` Dario Faggioli
2013-06-06 13:09                   ` Massimo Canonico
2013-06-06  9:02   ` George Dunlap
2013-06-06  9:48     ` Dario Faggioli

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='CAFLBxZaDbUgVfVT-AXQS+JOxoaVPCC7bv-_1tm=SwUnzBUqD=A@mail.gmail.com' \
    --to=george.dunlap@eu.citrix.com \
    --cc=mex@di.unipmn.it \
    --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.