From: "Jan Beulich" Subject: [PATCH] x86: adjust available memory calculation for Dom0 construction Date: Thu, 11 Mar 2010 16:44:54 +0000 Message-ID: <4B992C16020000780003458A@vpn.id2.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__PartB2986D16.0__=" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__PartB2986D16.0__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline With a large number of CPUs, the amount of memory needed to construct the vCPU structures for Dom0 becomes significant and hence should be accounted for when calculating the amount of memory to pass to Dom0. Signed-off-by: Jan Beulich --- 2010-03-09.orig/xen/arch/x86/domain_build.c 2010-03-09 00:00:00.0000000= 00 +0100 +++ 2010-03-09/xen/arch/x86/domain_build.c 2010-03-10 16:49:52.0000000= 00 +0100 @@ -155,6 +155,13 @@ static unsigned long __init compute_dom0 unsigned long min_pages =3D dom0_min_nrpages; unsigned long max_pages =3D dom0_max_nrpages; =20 + avail -=3D (opt_dom0_max_vcpus - 1UL) + << get_order_from_bytes(sizeof(struct vcpu)); +#ifdef __x86_64__ + if ( sizeof_long =3D=3D sizeof(int) ) + avail -=3D opt_dom0_max_vcpus - 1; +#endif + /* * If domain 0 allocation isn't specified, reserve 1/16th of = available * memory for things like DMA buffers. This reservation is clamped = to=20 --=__PartB2986D16.0__= Content-Type: text/plain; name="x86-dom0-alloc-avail.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="x86-dom0-alloc-avail.patch" With a large number of CPUs, the amount of memory needed to construct=0Athe= vCPU structures for Dom0 becomes significant and hence should be=0Aaccount= ed for when calculating the amount of memory to pass to Dom0.=0A=0ASigned-o= ff-by: Jan Beulich =0A=0A--- 2010-03-09.orig/xen/arch/= x86/domain_build.c 2010-03-09 00:00:00.000000000 +0100=0A+++ = 2010-03-09/xen/arch/x86/domain_build.c 2010-03-10 16:49:52.000000000 = +0100=0A@@ -155,6 +155,13 @@ static unsigned long __init compute_dom0=0A = unsigned long min_pages =3D dom0_min_nrpages;=0A unsigned long = max_pages =3D dom0_max_nrpages;=0A =0A+ avail -=3D (opt_dom0_max_vcpus = - 1UL)=0A+ << get_order_from_bytes(sizeof(struct vcpu));=0A+#if= def __x86_64__=0A+ if ( sizeof_long =3D=3D sizeof(int) )=0A+ = avail -=3D opt_dom0_max_vcpus - 1;=0A+#endif=0A+=0A /*=0A * If = domain 0 allocation isn't specified, reserve 1/16th of available=0A * = memory for things like DMA buffers. This reservation is clamped to =0A --=__PartB2986D16.0__= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --=__PartB2986D16.0__=--