Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752738Ab2JCO1F (ORCPT ); Wed, 3 Oct 2012 10:27:05 -0400 Received: from e5.ny.us.ibm.com ([32.97.182.145]:34207 "EHLO e5.ny.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751661Ab2JCO1C (ORCPT ); Wed, 3 Oct 2012 10:27:02 -0400 Date: Wed, 3 Oct 2012 19:47:40 +0530 From: Raghavendra K T To: Avi Kivity Cc: Gleb Natapov , Raghavendra K T , Jiannan Ouyang , Peter Zijlstra , Rik van Riel , "H. Peter Anvin" , Ingo Molnar , Marcelo Tosatti , Srikar , "Nikunj A. Dadhania" , KVM , chegu vinod , "Andrew M. Theurer" , LKML , Srivatsa Vaddagiri Subject: Re: [PATCH RFC 1/2] kvm: Handle undercommitted guest case in PLE handler Message-ID: <20121003141739.GA15253@linux.vnet.ibm.com> Reply-To: Raghavendra K T References: <5060851E.1030404@redhat.com> <506166B4.4010207@linux.vnet.ibm.com> <5061713D.5060406@redhat.com> <50641356.5070008@redhat.com> <506540C7.9070105@linux.vnet.ibm.com> <50680049.5020206@redhat.com> <20120930110755.GB1009@redhat.com> <50682945.3060309@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <50682945.3060309@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) x-cbid: 12100314-5930-0000-0000-00000CB5D172 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1201 Lines: 35 * Avi Kivity [2012-09-30 13:13:09]: > On 09/30/2012 01:07 PM, Gleb Natapov wrote: > > On Sun, Sep 30, 2012 at 10:18:17AM +0200, Avi Kivity wrote: > >> On 09/28/2012 08:16 AM, Raghavendra K T wrote: > >> > > >> >> > >> >> +struct pv_sched_info { > >> >> + unsigned long sched_bitmap; > >> > > >> > Thinking, whether we need something similar to cpumask here? > >> > Only thing is we are representing guest (v)cpumask. > >> > > >> > >> DECLARE_BITMAP(sched_bitmap, KVM_MAX_VCPUS) > >> > > vcpu_id can be greater than KVM_MAX_VCPUS. > > Use the index into the vcpu table as the bitmap index then. In fact > it's better because then the lookup to get the vcpu pointer is trivial. Did you mean, while setting the bitmap, we should do for (i = 1..n) if (kvm->vcpus[i] == vcpu) set ith position in bitmap? I just wanted to know whether there is any easy way to convert from vcpu pointer to index in kvm vcpu table. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/