From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony Liguori Subject: Re: [Qemu-devel] [PATCH] qemu-kvm: introduce cpu_start/cpu_stop commands Date: Tue, 23 Nov 2010 07:57:14 -0600 Message-ID: <4CEBC83A.2070204@codemonkey.ws> References: <1290466818-5230-1-git-send-email-aliguori@us.ibm.com> <4CEB6222.5050203@redhat.com> <4CEB7845.4050104@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Avi Kivity , Chris Wright , qemu-devel@nongnu.org, kvm@vger.kernel.org To: dlaor@redhat.com Return-path: Received: from mail-yw0-f46.google.com ([209.85.213.46]:39886 "EHLO mail-yw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754111Ab0KWN5b (ORCPT ); Tue, 23 Nov 2010 08:57:31 -0500 Received: by ywl5 with SMTP id 5so354907ywl.19 for ; Tue, 23 Nov 2010 05:57:30 -0800 (PST) In-Reply-To: <4CEB7845.4050104@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 11/23/2010 02:16 AM, Dor Laor wrote: > On 11/23/2010 08:41 AM, Avi Kivity wrote: >> On 11/23/2010 01:00 AM, Anthony Liguori wrote: >>> qemu-kvm vcpu threads don't response to SIGSTOP/SIGCONT. Instead of >>> teaching >>> them to respond to these signals, introduce monitor commands that stop >>> and start >>> individual vcpus. >>> >>> The purpose of these commands are to implement CPU hard limits using >>> an external >>> tool that watches the CPU consumption and stops the CPU as appropriate. > > Why not use cgroup for that? This is a stop-gap. The cgroup solution isn't perfect. It doesn't know anything about guest time verses hypervisor time so it can't account just the guest time like we do with this implementation. Also, since it may deschedule the vcpu thread while it's holding the qemu_mutex, it may unfairly tax other vcpu threads by creating additional lock contention. This is all solvable but if there's an alternative that just requires a small change to qemu, it's worth doing in the short term. Regards, Anthony Liguori