From: Glauber Costa <glommer@parallels.com>
To: Michael Wolf <mjw@linux.vnet.ibm.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>,
<linux-kernel@vger.kernel.org>, <riel@redhat.com>,
<kvm@vger.kernel.org>, <peterz@infradead.org>, <mingo@redhat.com>
Subject: Re: [PATCH 0/5] Alter steal time reporting in KVM
Date: Thu, 29 Nov 2012 00:55:39 +0400 [thread overview]
Message-ID: <50B67A4B.8060800@parallels.com> (raw)
In-Reply-To: <50B65B4A.50508@linux.vnet.ibm.com>
On 11/28/2012 10:43 PM, Michael Wolf wrote:
> On 11/27/2012 05:24 PM, Marcelo Tosatti wrote:
>> On Mon, Nov 26, 2012 at 02:36:24PM -0600, Michael Wolf wrote:
>>> In the case of where you have a system that is running in a
>>> capped or overcommitted environment the user may see steal time
>>> being reported in accounting tools such as top or vmstat.
>> The definition of stolen time is 'time during which the virtual CPU is
>> runnable to not running'. Overcommit is the main scenario which steal
>> time helps to detect.
>>
>> Can you describe the 'capped' case?
> In the capped case, the time that the guest spends waiting due to it
> having used its full allottment of time shows up as steal time. The way
> my patchset currently stands is that you would set up the
> bandwidth control and you would have to pass it a matching value from
> qemu. In the future, it would
> be possible to have something parse the bandwidth setting and
> automatically adjust the setting in the
> host used for steal time reporting.
Ok, so correct me if I am wrong, but I believe you would be using
something like the bandwidth capper in the cpu cgroup to set those
entitlements, right?
Some time has passed since I last looked into it, but IIRC, after you
get are out of your quota, you should be out of the runqueue. In the
lovely world of KVM, we approximate steal time as runqueue time:
arch/x86/kvm/x86.c:
delta = current->sched_info.run_delay - vcpu->arch.st.last_steal;
vcpu->arch.st.last_steal = current->sched_info.run_delay;
vcpu->arch.st.accum_steal = delta;
include/linux/sched.h:
unsigned long long run_delay; /* time spent waiting on a runqueue */
So if you are out of the runqueue, you won't get steal time accounted,
and then I truly fail to understand what you are doing.
In case I am wrong, and run_delay also includes the time you can't run
because you are out of capacity, then maybe what we should do, is to
just subtract it from run_delay in kvm/x86.c before we pass it on. In
summary:
>>> Alter the amount of steal time reported by the guest.
Maybe this should go away.
>>> Expand the steal time msr to also contain the consigned time.
Maybe this should go away
>>> Add the code to send the consigned time from the host to the
>>> guest
This definitely should be heavily modified
>>> Add a timer to allow the separation of consigned from steal time.
Maybe this should go away
>>> Add an ioctl to communicate the consign limit to the host.
This definitely should go away.
More specifically, *whatever* way we use to cap the processor, the host
system will have all the information at all times.
next prev parent reply other threads:[~2012-11-28 20:55 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-26 20:36 [PATCH 0/5] Alter steal time reporting in KVM Michael Wolf
2012-11-26 20:36 ` [PATCH 1/5] Alter the amount of steal time reported by the guest Michael Wolf
2012-11-26 20:36 ` [PATCH 2/5] Expand the steal time msr to also contain the consigned time Michael Wolf
2012-11-27 21:03 ` Konrad Rzeszutek Wilk
2012-11-28 15:23 ` Michael Wolf
2012-11-26 20:36 ` [PATCH 3/5] Add the code to send the consigned time from the host to the guest Michael Wolf
2012-11-26 20:37 ` [PATCH 4/5] Add a timer to allow the separation of consigned from steal time Michael Wolf
2012-11-26 20:37 ` [PATCH 5/5] Add an ioctl to communicate the consign limit to the host Michael Wolf
2012-11-27 8:48 ` [PATCH 0/5] Alter steal time reporting in KVM Glauber Costa
2012-11-27 15:10 ` Michael Wolf
2012-11-28 8:45 ` Glauber Costa
2012-11-28 18:44 ` Michael Wolf
2012-11-28 19:16 ` Anthony Liguori
2012-11-27 23:24 ` Marcelo Tosatti
2012-11-28 0:32 ` Marcelo Tosatti
2012-11-28 18:43 ` Michael Wolf
2012-11-28 20:55 ` Glauber Costa [this message]
2012-11-29 17:43 ` Michael Wolf
2012-12-05 12:46 ` Glauber Costa
2012-12-07 15:50 ` Michael Wolf
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=50B67A4B.8060800@parallels.com \
--to=glommer@parallels.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=mjw@linux.vnet.ibm.com \
--cc=mtosatti@redhat.com \
--cc=peterz@infradead.org \
--cc=riel@redhat.com \
/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.