From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34813) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z09lj-0004ex-HK for qemu-devel@nongnu.org; Wed, 03 Jun 2015 10:35:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z09le-0002tV-TG for qemu-devel@nongnu.org; Wed, 03 Jun 2015 10:35:47 -0400 Received: from e37.co.us.ibm.com ([32.97.110.158]:41028) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z09le-0002tD-Le for qemu-devel@nongnu.org; Wed, 03 Jun 2015 10:35:42 -0400 Received: from /spool/local by e37.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 3 Jun 2015 08:35:42 -0600 Received: from b03cxnp08027.gho.boulder.ibm.com (b03cxnp08027.gho.boulder.ibm.com [9.17.130.19]) by d03dlp02.boulder.ibm.com (Postfix) with ESMTP id E5CDD3E40044 for ; Wed, 3 Jun 2015 08:35:38 -0600 (MDT) Received: from d03av04.boulder.ibm.com (d03av04.boulder.ibm.com [9.17.195.170]) by b03cxnp08027.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t53EZcah32833572 for ; Wed, 3 Jun 2015 07:35:38 -0700 Received: from d03av04.boulder.ibm.com (loopback [127.0.0.1]) by d03av04.boulder.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t53EZbP0030109 for ; Wed, 3 Jun 2015 08:35:37 -0600 Message-ID: <556F10B8.9080703@linux.vnet.ibm.com> Date: Wed, 03 Jun 2015 10:35:36 -0400 From: "Jason J. Herne" MIME-Version: 1.0 References: <1433171851-18507-1-git-send-email-jjherne@linux.vnet.ibm.com> <1433171851-18507-2-git-send-email-jjherne@linux.vnet.ibm.com> <878uc29mwz.fsf@neno.neno> In-Reply-To: <878uc29mwz.fsf@neno.neno> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/2] cpu: Provide vcpu throttling interface Reply-To: jjherne@linux.vnet.ibm.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: quintela@redhat.com Cc: amit.shah@redhat.com, borntraeger@de.ibm.com, qemu-devel@nongnu.org, dgilbert@redhat.com, afaerber@suse.de On 06/03/2015 03:12 AM, Juan Quintela wrote: >> diff --git a/include/qom/cpu.h b/include/qom/cpu.h >> >index 39f0f19..9d16e6a 100644 >> >--- a/include/qom/cpu.h >> >+++ b/include/qom/cpu.h >> >@@ -310,6 +310,11 @@ struct CPUState { >> > uint32_t can_do_io; >> > int32_t exception_index; /* used by m68k TCG */ >> > >> >+ /* vcpu throttling controls */ >> >+ QEMUTimer *throttle_timer; >> >+ bool throttle_timer_stop; >> >+ float throttle_ratio; >> >+ > I think that if we go this way, we can have a single throotling thread > that do a for loop for each vcpu. As a bonus, we got a single timer, > and single bool and a single throotle_ratio (i.e. it don't need to be on > the cpu struct). Being a global will don't matter because we are > requiring the iothread anyways. > Juan, I like this idea. I'll work up another patch set :). -- -- Jason J. Herne (jjherne@linux.vnet.ibm.com)