From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=38061 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PKo2s-0002k2-NK for qemu-devel@nongnu.org; Tue, 23 Nov 2010 03:16:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PKo2r-0004zx-KU for qemu-devel@nongnu.org; Tue, 23 Nov 2010 03:16:10 -0500 Received: from mx1.redhat.com ([209.132.183.28]:51750) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PKo2r-0004zP-Dk for qemu-devel@nongnu.org; Tue, 23 Nov 2010 03:16:09 -0500 Message-ID: <4CEB7845.4050104@redhat.com> Date: Tue, 23 Nov 2010 10:16:05 +0200 From: Dor Laor MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] qemu-kvm: introduce cpu_start/cpu_stop commands References: <1290466818-5230-1-git-send-email-aliguori@us.ibm.com> <4CEB6222.5050203@redhat.com> In-Reply-To: <4CEB6222.5050203@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Reply-To: dlaor@redhat.com List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Avi Kivity Cc: Chris Wright , Anthony Liguori , qemu-devel@nongnu.org, kvm@vger.kernel.org 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? >> >> The monitor commands provide a more elegant solution that signals >> because it >> ensures that a stopped vcpu isn't holding the qemu_mutex. >> > > From signal(7): > > The signals SIGKILL and SIGSTOP cannot be caught, blocked, or ignored. > > Perhaps this is a bug in kvm? > > If we could catch SIGSTOP, then it would be easy to unblock it only > while running in guest context. It would then stop on exit to userspace. > > Using monitor commands is fairly heavyweight for something as high > frequency as this. What control period do you see people using? Maybe we > should define USR1 for vcpu start/stop. > > What happens if one vcpu is stopped while another is running? Spin > loops, synchronous IPIs will take forever. Maybe we need to stop the > entire process. >