From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34519) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZLEKU-0000NJ-Qp for qemu-devel@nongnu.org; Fri, 31 Jul 2015 13:42:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZLEKP-0002pl-6K for qemu-devel@nongnu.org; Fri, 31 Jul 2015 13:42:46 -0400 Received: from e18.ny.us.ibm.com ([129.33.205.208]:36898) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZLEKP-0002ph-1I for qemu-devel@nongnu.org; Fri, 31 Jul 2015 13:42:41 -0400 Received: from /spool/local by e18.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 31 Jul 2015 13:42:40 -0400 Received: from b01cxnp22033.gho.pok.ibm.com (b01cxnp22033.gho.pok.ibm.com [9.57.198.23]) by d01dlp01.pok.ibm.com (Postfix) with ESMTP id D1F3A38C803B for ; Fri, 31 Jul 2015 13:42:37 -0400 (EDT) Received: from d01av05.pok.ibm.com (d01av05.pok.ibm.com [9.56.224.195]) by b01cxnp22033.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t6VHgbih55836844 for ; Fri, 31 Jul 2015 17:42:37 GMT Received: from d01av05.pok.ibm.com (localhost [127.0.0.1]) by d01av05.pok.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t6VHgbDR016725 for ; Fri, 31 Jul 2015 13:42:37 -0400 Message-ID: <55BBB38A.4060807@linux.vnet.ibm.com> Date: Fri, 31 Jul 2015 13:42:34 -0400 From: "Jason J. Herne" MIME-Version: 1.0 References: <1435855010-30882-1-git-send-email-jjherne@linux.vnet.ibm.com> <1435855010-30882-2-git-send-email-jjherne@linux.vnet.ibm.com> <55956A2E.4020806@redhat.com> <55A3CEAF.6030504@linux.vnet.ibm.com> <55A3D5D8.7070902@redhat.com> <55A654D6.5000906@linux.vnet.ibm.com> <55A657ED.3070407@redhat.com> <55A7BDF4.4020509@linux.vnet.ibm.com> <55B0BAE6.3040504@redhat.com> <55BBAC8F.6030604@linux.vnet.ibm.com> <55BBAD5D.4090807@redhat.com> In-Reply-To: <55BBAD5D.4090807@redhat.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v4 1/5] 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: Paolo Bonzini , afaerber@suse.de, amit.shah@redhat.com, dgilbert@redhat.com, borntraeger@de.ibm.com, quintela@redhat.com, qemu-devel@nongnu.org On 07/31/2015 01:16 PM, Paolo Bonzini wrote: > > > On 31/07/2015 19:12, Jason J. Herne wrote: >>> >>> >> >> Throttle ratio is relative to CPU_THROTTLE_TIMESLICE. Take a look at how >> throttle_ratio is used in the calculation: >> >> long sleeptime_ms = (long)(throttle_ratio * CPU_THROTTLE_TIMESLICE); >> >> A value of 1 means we sleep the same amount of time that we execute. > > But that doesn't work if your timer runs every CPU_THROTTLE_TIMESLICE > milliseconds, and thus schedules async work every CPU_THROTTLE_TIMESLICE > milliseconds. > > The timer would have to be scheduled every (throttle_ratio + 1) * > CPU_THROTTLE_TIMESLICE milliseconds, i.e. CPU_THROTTLE_TIMESLICE / > (1-pct) milliseconds. > > Paolo Doh! Yep :). This problem is an artifact of moving the timer_mod from cpu_throttle_thread into cpu_throttle_timer_tick. I'll have to go back to the review comments and look at why that was done. -- -- Jason J. Herne (jjherne@linux.vnet.ibm.com)