From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753806Ab2IYINP (ORCPT ); Tue, 25 Sep 2012 04:13:15 -0400 Received: from e23smtp06.au.ibm.com ([202.81.31.148]:35300 "EHLO e23smtp06.au.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753657Ab2IYINL (ORCPT ); Tue, 25 Sep 2012 04:13:11 -0400 Message-ID: <506166B4.4010207@linux.vnet.ibm.com> Date: Tue, 25 Sep 2012 13:39:24 +0530 From: Raghavendra K T Organization: IBM User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.1) Gecko/20120216 Thunderbird/10.0.1 MIME-Version: 1.0 To: Avi Kivity CC: Peter Zijlstra , Rik van Riel , "H. Peter Anvin" , Ingo Molnar , Marcelo Tosatti , Srikar , "Nikunj A. Dadhania" , KVM , Jiannan Ouyang , chegu vinod , "Andrew M. Theurer" , LKML , Srivatsa Vaddagiri , Gleb Natapov Subject: Re: [PATCH RFC 1/2] kvm: Handle undercommitted guest case in PLE handler References: <20120921115942.27611.67488.sendpatchset@codeblue> <20120921120000.27611.71321.sendpatchset@codeblue> <505C654B.2050106@redhat.com> <505CA2EB.7050403@linux.vnet.ibm.com> <50607F1F.2040704@redhat.com> <5060851E.1030404@redhat.com> In-Reply-To: <5060851E.1030404@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit x-cbid: 12092508-7014-0000-0000-000001F12ECF Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/24/2012 09:36 PM, Avi Kivity wrote: > On 09/24/2012 05:41 PM, Avi Kivity wrote: >> >>> >>> case 2) >>> rq1 : vcpu1->wait(lockA) (spinning) >>> rq2 : vcpu3 (running) , vcpu2->holding(lockA) [scheduled out] >>> >>> I agree that checking rq1 length is not proper in this case, and as you >>> rightly pointed out, we are in trouble here. >>> nr_running()/num_online_cpus() would give more accurate picture here, >>> but it seemed costly. May be load balancer save us a bit here in not >>> running to such sort of cases. ( I agree load balancer is far too >>> complex). >> >> In theory preempt notifier can tell us whether a vcpu is preempted or >> not (except for exits to userspace), so we can keep track of whether >> it's we're overcommitted in kvm itself. It also avoids false positives >> from other guests and/or processes being overcommitted while our vm is fine. > > It also allows us to cheaply skip running vcpus. Hi Avi, Could you please elaborate on how preempt notifiers can be used here to keep track of overcommit or skip running vcpus? Are we planning set some flag in sched_out() handler etc?