From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Williamson Subject: Re: [RFC PATCH 0/2] Expose available KVM free memory slot count to help avoid aborts Date: Tue, 25 Jan 2011 12:13:51 -0700 Message-ID: <1295982831.3230.90.camel@x201> References: <20110121233040.22262.68117.stgit@s20.home> <20110124093241.GA28654@amt.cnet> <4D3D89B1.30300@siemens.com> <1295883899.3230.9.camel@x201> <1295933876.3230.46.camel@x201> <4D3E7D74.1030100@web.de> <1295966492.3230.55.camel@x201> <4D3EE3F8.3020603@redhat.com> <4D3EFBDC.201@web.de> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Cc: Avi Kivity , Marcelo Tosatti , "kvm@vger.kernel.org" , "ddutile@redhat.com" , "mst@redhat.com" , "chrisw@redhat.com" To: Jan Kiszka Return-path: Received: from mx1.redhat.com ([209.132.183.28]:16211 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751251Ab1AYTNy (ORCPT ); Tue, 25 Jan 2011 14:13:54 -0500 In-Reply-To: <4D3EFBDC.201@web.de> Sender: kvm-owner@vger.kernel.org List-ID: On Tue, 2011-01-25 at 17:35 +0100, Jan Kiszka wrote: > On 2011-01-25 15:53, Avi Kivity wrote: > > On 01/25/2011 04:41 PM, Alex Williamson wrote: > >> > > > >> > > > >> > > kvm: Allow memory slot array to grow on demand > >> > > > >> > > Remove fixed KVM_MEMORY_SLOTS limit, allowing the slot array > >> > > to grow on demand. Private slots are now allocated at the > >> > > front instead of the end. Only x86 seems to use private slots, > >> > > >> > Hmm, doesn't current user space expect slots 8..11 to be the private > >> > ones and wouldn't it cause troubles if slots 0..3 are suddenly > >> reserved? > >> > >> The private slots aren't currently visible to userspace, they're > >> actually slots 32..35. The patch automatically increments user passed > >> slot ids so userspace has it's own zero-based view of the array. > >> Frankly, I don't understand why userspace reserves slots 8..11, is this > >> compatibility with older kernel implementations? > > > > I think so. I believe these kernel versions are too old now to matter, > > but of course I can't be sure. > > Will check and enable those 4 additional slots for user space if we no > longer need to exclude them. Appears that the history goes something like this... * Once upon a time we had 8 memory slots * v2.6.24-4949-ge0d62c7 added 4 reserved slots above those 8 * v2.6.24-4950-gcbc9402 made use of slot 8 for tss * v2.6.24-4962-gf78e0e2 made use of slot 9 for tpr * v2.6.25-5341-gef2979b bumped the 8 slots to 32 * v2.6.26-rc1-13-gb7ebfb0 made use of slot 10 for ept * v2.6.28-4952-g6fe6397 moved the previously hard coded slots 8,9,10 up to KVM_MEMORY_SLOTS + {0,1,2} So we haven't needed to reserve 8..11 for a while and we've never made use of all 4 private slots. I should reduce that to 3 in my patch. Maybe there's a test we could do in userspace to figure out we don't have to skip those anymore? Alex