From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38729) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dIeHZ-0001lc-NS for qemu-devel@nongnu.org; Wed, 07 Jun 2017 12:58:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dIeHU-0007XO-R3 for qemu-devel@nongnu.org; Wed, 07 Jun 2017 12:58:09 -0400 Received: from mail-wr0-x243.google.com ([2a00:1450:400c:c0c::243]:36301) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dIeHU-0007X2-KJ for qemu-devel@nongnu.org; Wed, 07 Jun 2017 12:58:04 -0400 Received: by mail-wr0-x243.google.com with SMTP id e23so1703709wre.3 for ; Wed, 07 Jun 2017 09:58:04 -0700 (PDT) Sender: Paolo Bonzini References: <1495229390-18909-1-git-send-email-felipe@nutanix.com> <871sqvepc0.fsf@secure.mitica> From: Paolo Bonzini Message-ID: Date: Wed, 7 Jun 2017 18:58:01 +0200 MIME-Version: 1.0 In-Reply-To: <871sqvepc0.fsf@secure.mitica> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] cpus: reset throttle_thread_scheduled after sleep List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: quintela@redhat.com, Felipe Franciosi Cc: "Jason J. Herne" , Malcolm Crossley , "qemu-devel@nongnu.org" On 07/06/2017 18:26, Juan Quintela wrote: > Felipe Franciosi wrote: >> Currently, the throttle_thread_scheduled flag is reset back to 0 before >> sleeping (as part of the throttling logic). Given that throttle_timer >> (well, any timer) may tick with a slight delay, it so happens that under >> heavy throttling (ie. close or on CPU_THROTTLE_PCT_MAX) the tick may >> schedule a further cpu_throttle_thread() work item after the flag reset, >> but before the previous sleep completed. This results on the vCPU thread >> sleeping continuously for potentially several seconds in a row. >> >> The chances of that happening can be drastically minimised by resetting >> the flag after the sleep. >> >> Signed-off-by: Felipe Franciosi >> Signed-off-by: Malcolm Crossley > > Reviewed-by: Juan Quintela > > Paolo, I think that the analisys makes sense. > > Should you pull this patch, or do you want me to pull it? I've already included in my jinxed (now at v6) pull request. Paolo