From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: Re: [PATCH] kvm: handle last_boosted_vcpu = 0 case Date: Fri, 6 Jul 2012 14:11:28 -0300 Message-ID: <20120706171128.GA8835@amt.cnet> References: <20120619202047.26191.40429.sendpatchset@codeblue> <20120619165104.2a4574f8@annuminas.surriel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Raghavendra K T , Avi Kivity , Srikar , Srivatsa Vaddagiri , Peter Zijlstra , "Nikunj A. Dadhania" , KVM , Ingo Molnar , LKML To: Rik van Riel Return-path: Received: from mx1.redhat.com ([209.132.183.28]:9383 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932610Ab2GFSMq (ORCPT ); Fri, 6 Jul 2012 14:12:46 -0400 Content-Disposition: inline In-Reply-To: <20120619165104.2a4574f8@annuminas.surriel.com> Sender: kvm-owner@vger.kernel.org List-ID: On Tue, Jun 19, 2012 at 04:51:04PM -0400, Rik van Riel wrote: > On Wed, 20 Jun 2012 01:50:50 +0530 > Raghavendra K T wrote: > > > > > In ple handler code, last_boosted_vcpu (lbv) variable is > > serving as reference point to start when we enter. > > > Also statistical analysis (below) is showing lbv is not very well > > distributed with current approach. > > You are the second person to spot this bug today (yes, today). > > Due to time zones, the first person has not had a chance yet to > test the patch below, which might fix the issue... > > Please let me know how it goes. > > ====8<==== > > If last_boosted_vcpu == 0, then we fall through all test cases and > may end up with all VCPUs pouncing on vcpu 0. With a large enough > guest, this can result in enormous runqueue lock contention, which > can prevent vcpu0 from running, leading to a livelock. > > Changing < to <= makes sure we properly handle that case. > > Signed-off-by: Rik van Riel Applied, thanks.