Kouya Shimura
2007-Oct-16 06:21 UTC
[Xen-devel] [PATCH][IA64] configure VHPT size per HVM domain
Hi Keir and Alex, A Virtual Hash Page Table(VHPT) is a special feature of IA64. It''s an extension of TLB that resides in memory and can be automatically searched by the processor. This patch allows user to configure VHPT size per HVM domain. We have an interesting result. We tried some large transaction benchmark, for VHPT size in 512K, 2M, 4M, 8M: - Linux is getting a better score (totally 20% up) - Windows is getting a worse score (totally 10% down) The reason of windows degradation is, windows OS flushes TLB more frequently. Xen hypervisor must clear the memory of VHPT with TLB flushing, that becomes an overhead. This patch is significant for IA64 to support both linux guest and windows guest simultaneously. Thanks, Kouya Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com> _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Isaku Yamahata
2007-Oct-16 08:00 UTC
[Xen-devel] Re: [Xen-ia64-devel] [PATCH][IA64] configure VHPT size per HVM domain
Hi Kouya. I guess Linux PV domains (especially dom0) possibly can gain similar performance improvement by increasing VHPT size too. So would it be easy to make vhpt parameter non hvm specific? I know your concern is hvm domain, though. On Tue, Oct 16, 2007 at 03:21:39PM +0900, Kouya Shimura wrote: Content-Description: message body text> Hi Keir and Alex, > > A Virtual Hash Page Table(VHPT) is a special feature of IA64. > It''s an extension of TLB that resides in memory and can be > automatically searched by the processor. > > This patch allows user to configure VHPT size per HVM domain. > > We have an interesting result. > We tried some large transaction benchmark, > for VHPT size in 512K, 2M, 4M, 8M: > - Linux is getting a better score (totally 20% up) > - Windows is getting a worse score (totally 10% down) > > The reason of windows degradation is, windows OS flushes > TLB more frequently. Xen hypervisor must clear the memory of VHPT > with TLB flushing, that becomes an overhead. > > This patch is significant for IA64 to support both linux guest > and windows guest simultaneously. > > Thanks, > Kouya > > Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com> >> diff -r 2863852e02f6 tools/examples/xmexample.vti > --- a/tools/examples/xmexample.vti Mon Oct 15 11:41:28 2007 -0600 > +++ b/tools/examples/xmexample.vti Tue Oct 16 11:31:53 2007 +0900 > @@ -34,6 +34,10 @@ name = "ExampleVTIDomain" > #cpus = "" # leave to Xen to pick > #cpus = "0" # all vcpus run on CPU0 > #cpus = "0-3,5,^1" # run on cpus 0,2,3,5 > + > +# VHPT size(2**n), default=23 (8MB), minimum=15 (32KB). > +# In Windows OS, smaller size shows better performance. > +#vhpt = 23 > > # Optionally define mac and/or bridge for the network interfaces. > # Random MACs are assigned if not given. > diff -r 2863852e02f6 tools/python/xen/lowlevel/xc/xc.c > --- a/tools/python/xen/lowlevel/xc/xc.c Mon Oct 15 11:41:28 2007 -0600 > +++ b/tools/python/xen/lowlevel/xc/xc.c Tue Oct 16 10:03:46 2007 +0900 > @@ -538,15 +538,20 @@ static PyObject *pyxc_hvm_build(XcObject > #endif > char *image; > int store_evtchn, memsize, vcpus = 1, pae = 0, acpi = 0, apic = 1; > + int vhpt = 0; > unsigned long store_mfn; > > static char *kwd_list[] = { "domid", "store_evtchn", > "memsize", "image", "vcpus", "pae", "acpi", > - "apic", NULL }; > - if ( !PyArg_ParseTupleAndKeywords(args, kwds, "iiis|iiii", kwd_list, > - &dom, &store_evtchn, &memsize, > - &image, &vcpus, &pae, &acpi, &apic) ) > - return NULL; > + "apic", "vhpt", NULL }; > + if ( !PyArg_ParseTupleAndKeywords(args, kwds, "iiis|iiiii", kwd_list, > + &dom, &store_evtchn, &memsize, &image, > + &vcpus, &pae, &acpi, &apic, &vhpt) ) > + return NULL; > + > +#ifdef __ia64__ > + xc_set_hvm_param(self->xc_handle, dom, HVM_PARAM_VHPT_SIZE, vhpt); > +#endif > > if ( xc_hvm_build(self->xc_handle, dom, memsize, image) != 0 ) > return pyxc_error_to_exception(); > diff -r 2863852e02f6 tools/python/xen/xend/XendConfig.py > --- a/tools/python/xen/xend/XendConfig.py Mon Oct 15 11:41:28 2007 -0600 > +++ b/tools/python/xen/xend/XendConfig.py Tue Oct 16 10:21:25 2007 +0900 > @@ -127,7 +127,7 @@ XENAPI_PLATFORM_CFG = [ ''acpi'', ''apic'', > ''nographic'', ''pae'', ''rtc_timeoffset'', ''serial'', ''sdl'', > ''soundhw'',''stdvga'', ''usb'', ''usbdevice'', ''vnc'', > ''vncconsole'', ''vncdisplay'', ''vnclisten'', > - ''vncpasswd'', ''vncunused'', ''xauthority'', ''pci''] > + ''vncpasswd'', ''vncunused'', ''xauthority'', ''pci'', ''vhpt''] > > # Xen API console ''other_config'' keys. > XENAPI_CONSOLE_OTHER_CFG = [''vncunused'', ''vncdisplay'', ''vnclisten'', > diff -r 2863852e02f6 tools/python/xen/xend/image.py > --- a/tools/python/xen/xend/image.py Mon Oct 15 11:41:28 2007 -0600 > +++ b/tools/python/xen/xend/image.py Tue Oct 16 10:03:46 2007 +0900 > @@ -277,6 +277,7 @@ class HVMImageHandler(ImageHandler): > self.pae = int(vmConfig[''platform''].get(''pae'', 0)) > self.apic = int(vmConfig[''platform''].get(''apic'', 0)) > self.acpi = int(vmConfig[''platform''].get(''acpi'', 0)) > + self.vhpt = int(vmConfig[''platform''].get(''vhpt'', 0)) > > > def buildDomain(self): > @@ -292,6 +293,7 @@ class HVMImageHandler(ImageHandler): > log.debug("pae = %d", self.pae) > log.debug("acpi = %d", self.acpi) > log.debug("apic = %d", self.apic) > + log.debug("vhpt = %d", self.vhpt) > > rc = xc.hvm_build(domid = self.vm.getDomid(), > image = self.kernel, > @@ -300,7 +302,8 @@ class HVMImageHandler(ImageHandler): > vcpus = self.vm.getVCpuCount(), > pae = self.pae, > acpi = self.acpi, > - apic = self.apic) > + apic = self.apic, > + vhpt = self.vhpt) > rc[''notes''] = { ''SUSPEND_CANCEL'': 1 } > return rc > > diff -r 2863852e02f6 tools/python/xen/xm/create.py > --- a/tools/python/xen/xm/create.py Mon Oct 15 11:41:28 2007 -0600 > +++ b/tools/python/xen/xm/create.py Tue Oct 16 11:22:10 2007 +0900 > @@ -209,6 +209,10 @@ gopts.var(''vcpu_avail'', val=''VCPUS'', > gopts.var(''vcpu_avail'', val=''VCPUS'', > fn=set_long, default=None, > use="Bitmask for virtual CPUs to make available immediately.") > + > +gopts.var(''vhpt'', val=''VHPT'', > + fn=set_int, default=0, > + use="VHPT Size(2**n) of IA64 HVM domain.") > > gopts.var(''cpu_cap'', val=''CAP'', > fn=set_int, default=None, > @@ -721,7 +725,7 @@ def configure_hvm(config_image, vals): > ''localtime'', ''serial'', ''stdvga'', ''isa'', ''nographic'', ''soundhw'', > ''vnc'', ''vncdisplay'', ''vncunused'', ''vncconsole'', ''vnclisten'', > ''sdl'', ''display'', ''xauthority'', ''rtc_timeoffset'', ''monitor'', > - ''acpi'', ''apic'', ''usb'', ''usbdevice'', ''keymap'', ''pci'' ] > + ''acpi'', ''apic'', ''usb'', ''usbdevice'', ''keymap'', ''pci'', ''vhpt'' ] > for a in args: > if a in vals.__dict__ and vals.__dict__[a] is not None: > config_image.append([a, vals.__dict__[a]]) > diff -r 2863852e02f6 xen/arch/ia64/vmx/vmmu.c > --- a/xen/arch/ia64/vmx/vmmu.c Mon Oct 15 11:41:28 2007 -0600 > +++ b/xen/arch/ia64/vmx/vmmu.c Tue Oct 16 10:12:40 2007 +0900 > @@ -96,8 +96,14 @@ static int init_domain_vhpt(struct vcpu > static int init_domain_vhpt(struct vcpu *v) > { > int rc; > - > - rc = thash_alloc(&(v->arch.vhpt), default_vhpt_sz, "vhpt"); > + u64 size = v->domain->arch.hvm_domain.params[HVM_PARAM_VHPT_SIZE]; > + > + if (size == 0) > + size = default_vhpt_sz; > + else > + size = canonicalize_vhpt_size(size); > + > + rc = thash_alloc(&(v->arch.vhpt), size, "vhpt"); > v->arch.arch_vmx.mpta = v->arch.vhpt.pta.val; > return rc; > } > diff -r 2863852e02f6 xen/include/public/hvm/params.h > --- a/xen/include/public/hvm/params.h Mon Oct 15 11:41:28 2007 -0600 > +++ b/xen/include/public/hvm/params.h Tue Oct 16 10:03:54 2007 +0900 > @@ -52,7 +52,8 @@ > > #ifdef __ia64__ > #define HVM_PARAM_NVRAM_FD 7 > -#define HVM_NR_PARAMS 8 > +#define HVM_PARAM_VHPT_SIZE 8 > +#define HVM_NR_PARAMS 9 > #else > #define HVM_NR_PARAMS 7 > #endif> _______________________________________________ > Xen-ia64-devel mailing list > Xen-ia64-devel@lists.xensource.com > http://lists.xensource.com/xen-ia64-devel-- yamahata _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2007-Oct-16 09:29 UTC
[Xen-ia64-devel] Re: [PATCH][IA64] configure VHPT size per HVM domain
I''ve cleaned up the xc.hvm_build() interface in changeset 16116. Please merge against that. The main change will be that you will set the new HVM parameter in IA64_HVM_ImageHandler.buildDomain(), rather than passing the new parameter down to xc.hvm_build(). -- Keir On 16/10/07 07:21, "Kouya Shimura" <kouya@jp.fujitsu.com> wrote:> Hi Keir and Alex, > > A Virtual Hash Page Table(VHPT) is a special feature of IA64. > It''s an extension of TLB that resides in memory and can be > automatically searched by the processor. > > This patch allows user to configure VHPT size per HVM domain. > > We have an interesting result. > We tried some large transaction benchmark, > for VHPT size in 512K, 2M, 4M, 8M: > - Linux is getting a better score (totally 20% up) > - Windows is getting a worse score (totally 10% down) > > The reason of windows degradation is, windows OS flushes > TLB more frequently. Xen hypervisor must clear the memory of VHPT > with TLB flushing, that becomes an overhead. > > This patch is significant for IA64 to support both linux guest > and windows guest simultaneously. > > Thanks, > Kouya > > Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com> > > diff -r 2863852e02f6 tools/examples/xmexample.vti > --- a/tools/examples/xmexample.vti Mon Oct 15 11:41:28 2007 -0600 > +++ b/tools/examples/xmexample.vti Tue Oct 16 11:31:53 2007 +0900 > @@ -34,6 +34,10 @@ name = "ExampleVTIDomain" > #cpus = "" # leave to Xen to pick > #cpus = "0" # all vcpus run on CPU0 > #cpus = "0-3,5,^1" # run on cpus 0,2,3,5 > + > +# VHPT size(2**n), default=23 (8MB), minimum=15 (32KB). > +# In Windows OS, smaller size shows better performance. > +#vhpt = 23 > > # Optionally define mac and/or bridge for the network interfaces. > # Random MACs are assigned if not given. > diff -r 2863852e02f6 tools/python/xen/lowlevel/xc/xc.c > --- a/tools/python/xen/lowlevel/xc/xc.c Mon Oct 15 11:41:28 2007 -0600 > +++ b/tools/python/xen/lowlevel/xc/xc.c Tue Oct 16 10:03:46 2007 +0900 > @@ -538,15 +538,20 @@ static PyObject *pyxc_hvm_build(XcObject > #endif > char *image; > int store_evtchn, memsize, vcpus = 1, pae = 0, acpi = 0, apic = 1; > + int vhpt = 0; > unsigned long store_mfn; > > static char *kwd_list[] = { "domid", "store_evtchn", > "memsize", "image", "vcpus", "pae", "acpi", > - "apic", NULL }; > - if ( !PyArg_ParseTupleAndKeywords(args, kwds, "iiis|iiii", kwd_list, > - &dom, &store_evtchn, &memsize, > - &image, &vcpus, &pae, &acpi, &apic) ) > - return NULL; > + "apic", "vhpt", NULL }; > + if ( !PyArg_ParseTupleAndKeywords(args, kwds, "iiis|iiiii", kwd_list, > + &dom, &store_evtchn, &memsize, &image, > + &vcpus, &pae, &acpi, &apic, &vhpt) ) > + return NULL; > + > +#ifdef __ia64__ > + xc_set_hvm_param(self->xc_handle, dom, HVM_PARAM_VHPT_SIZE, vhpt); > +#endif > > if ( xc_hvm_build(self->xc_handle, dom, memsize, image) != 0 ) > return pyxc_error_to_exception(); > diff -r 2863852e02f6 tools/python/xen/xend/XendConfig.py > --- a/tools/python/xen/xend/XendConfig.py Mon Oct 15 11:41:28 2007 -0600 > +++ b/tools/python/xen/xend/XendConfig.py Tue Oct 16 10:21:25 2007 +0900 > @@ -127,7 +127,7 @@ XENAPI_PLATFORM_CFG = [ ''acpi'', ''apic'', > ''nographic'', ''pae'', ''rtc_timeoffset'', ''serial'', > ''sdl'', > ''soundhw'',''stdvga'', ''usb'', ''usbdevice'', ''vnc'', > ''vncconsole'', ''vncdisplay'', ''vnclisten'', > - ''vncpasswd'', ''vncunused'', ''xauthority'', ''pci''] > + ''vncpasswd'', ''vncunused'', ''xauthority'', ''pci'', > ''vhpt''] > > # Xen API console ''other_config'' keys. > XENAPI_CONSOLE_OTHER_CFG = [''vncunused'', ''vncdisplay'', ''vnclisten'', > diff -r 2863852e02f6 tools/python/xen/xend/image.py > --- a/tools/python/xen/xend/image.py Mon Oct 15 11:41:28 2007 -0600 > +++ b/tools/python/xen/xend/image.py Tue Oct 16 10:03:46 2007 +0900 > @@ -277,6 +277,7 @@ class HVMImageHandler(ImageHandler): > self.pae = int(vmConfig[''platform''].get(''pae'', 0)) > self.apic = int(vmConfig[''platform''].get(''apic'', 0)) > self.acpi = int(vmConfig[''platform''].get(''acpi'', 0)) > + self.vhpt = int(vmConfig[''platform''].get(''vhpt'', 0)) > > > def buildDomain(self): > @@ -292,6 +293,7 @@ class HVMImageHandler(ImageHandler): > log.debug("pae = %d", self.pae) > log.debug("acpi = %d", self.acpi) > log.debug("apic = %d", self.apic) > + log.debug("vhpt = %d", self.vhpt) > > rc = xc.hvm_build(domid = self.vm.getDomid(), > image = self.kernel, > @@ -300,7 +302,8 @@ class HVMImageHandler(ImageHandler): > vcpus = self.vm.getVCpuCount(), > pae = self.pae, > acpi = self.acpi, > - apic = self.apic) > + apic = self.apic, > + vhpt = self.vhpt) > rc[''notes''] = { ''SUSPEND_CANCEL'': 1 } > return rc > > diff -r 2863852e02f6 tools/python/xen/xm/create.py > --- a/tools/python/xen/xm/create.py Mon Oct 15 11:41:28 2007 -0600 > +++ b/tools/python/xen/xm/create.py Tue Oct 16 11:22:10 2007 +0900 > @@ -209,6 +209,10 @@ gopts.var(''vcpu_avail'', val=''VCPUS'', > gopts.var(''vcpu_avail'', val=''VCPUS'', > fn=set_long, default=None, > use="Bitmask for virtual CPUs to make available immediately.") > + > +gopts.var(''vhpt'', val=''VHPT'', > + fn=set_int, default=0, > + use="VHPT Size(2**n) of IA64 HVM domain.") > > gopts.var(''cpu_cap'', val=''CAP'', > fn=set_int, default=None, > @@ -721,7 +725,7 @@ def configure_hvm(config_image, vals): > ''localtime'', ''serial'', ''stdvga'', ''isa'', ''nographic'', ''soundhw'', > ''vnc'', ''vncdisplay'', ''vncunused'', ''vncconsole'', ''vnclisten'', > ''sdl'', ''display'', ''xauthority'', ''rtc_timeoffset'', ''monitor'', > - ''acpi'', ''apic'', ''usb'', ''usbdevice'', ''keymap'', ''pci'' ] > + ''acpi'', ''apic'', ''usb'', ''usbdevice'', ''keymap'', ''pci'', ''vhpt'' ] > for a in args: > if a in vals.__dict__ and vals.__dict__[a] is not None: > config_image.append([a, vals.__dict__[a]]) > diff -r 2863852e02f6 xen/arch/ia64/vmx/vmmu.c > --- a/xen/arch/ia64/vmx/vmmu.c Mon Oct 15 11:41:28 2007 -0600 > +++ b/xen/arch/ia64/vmx/vmmu.c Tue Oct 16 10:12:40 2007 +0900 > @@ -96,8 +96,14 @@ static int init_domain_vhpt(struct vcpu > static int init_domain_vhpt(struct vcpu *v) > { > int rc; > - > - rc = thash_alloc(&(v->arch.vhpt), default_vhpt_sz, "vhpt"); > + u64 size = v->domain->arch.hvm_domain.params[HVM_PARAM_VHPT_SIZE]; > + > + if (size == 0) > + size = default_vhpt_sz; > + else > + size = canonicalize_vhpt_size(size); > + > + rc = thash_alloc(&(v->arch.vhpt), size, "vhpt"); > v->arch.arch_vmx.mpta = v->arch.vhpt.pta.val; > return rc; > } > diff -r 2863852e02f6 xen/include/public/hvm/params.h > --- a/xen/include/public/hvm/params.h Mon Oct 15 11:41:28 2007 -0600 > +++ b/xen/include/public/hvm/params.h Tue Oct 16 10:03:54 2007 +0900 > @@ -52,7 +52,8 @@ > > #ifdef __ia64__ > #define HVM_PARAM_NVRAM_FD 7 > -#define HVM_NR_PARAMS 8 > +#define HVM_PARAM_VHPT_SIZE 8 > +#define HVM_NR_PARAMS 9 > #else > #define HVM_NR_PARAMS 7 > #endif_______________________________________________ Xen-ia64-devel mailing list Xen-ia64-devel@lists.xensource.com http://lists.xensource.com/xen-ia64-devel
Isaku Yamahata
2007-Oct-16 11:33 UTC
[Xen-devel] Re: [Xen-ia64-devel] [PATCH][IA64] configure VHPT size per HVM domain
On Tue, Oct 16, 2007 at 01:51:25PM +0200, tgingold@free.fr wrote:> And if you want to go farther, you may also want to specify vtlb size!Yes. The results showed that reducing vTLB flush overhead even with smaller vTLB size is important for Windows performance. So possibly eliminating whole the collision chain might increase Windows performance. Kouya, do you have any idea about it? -- yamahata _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
tgingold@free.fr
2007-Oct-16 11:51 UTC
[Xen-devel] Re: [Xen-ia64-devel] [PATCH][IA64] configure VHPT size per HVM domain
Quoting Kouya Shimura <kouya@jp.fujitsu.com>:> Hi Keir and Alex, > > A Virtual Hash Page Table(VHPT) is a special feature of IA64. > It''s an extension of TLB that resides in memory and can be > automatically searched by the processor. > > This patch allows user to configure VHPT size per HVM domain.Good idea. As Isaku suggested it will be nice to have this option for pv too. And if you want to go farther, you may also want to specify vtlb size! Tristan. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Kouya Shimura
2007-Oct-16 12:33 UTC
Re: [Xen-devel] Re: [Xen-ia64-devel] [PATCH][IA64] configure VHPT size per HVM domain
Hi Yamahata-san, I''m now thinking about PV domain. Please stay tuned. As I mentioned before, vTLB is already minimum size(16KB) and no collision for windows. http://lists.xensource.com/archives/html/xen-ia64-devel/2007-08/msg00108.html So I feel it''s enough about vTLB. If smaller vTLB size is required, we have to prepare a brand new hash function. Thanks, Kouya Isaku Yamahata writes: > On Tue, Oct 16, 2007 at 01:51:25PM +0200, tgingold@free.fr wrote: > > > And if you want to go farther, you may also want to specify vtlb size! > > Yes. The results showed that reducing vTLB flush overhead even > with smaller vTLB size is important for Windows performance. > So possibly eliminating whole the collision chain might increase > Windows performance. > > Kouya, do you have any idea about it? > -- > yamahata > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Kouya Shimura
2007-Oct-19 05:52 UTC
[Xen-devel] [PATCH 0/2][IA64] configure VHPT size per domain
Hi Keir and Alex, I merged the patch and added support for PV domain. Please apply for Xen 3.2.0. patch 1/2: common part patch 2/2: ia64 part Thanks, Kouya Keir Fraser writes: > I''ve cleaned up the xc.hvm_build() interface in changeset 16116. Please > merge against that. The main change will be that you will set the new HVM > parameter in IA64_HVM_ImageHandler.buildDomain(), rather than passing the > new parameter down to xc.hvm_build(). > > -- Keir > > On 16/10/07 07:21, "Kouya Shimura" <kouya@jp.fujitsu.com> wrote: > > > Hi Keir and Alex, > > > > A Virtual Hash Page Table(VHPT) is a special feature of IA64. > > It''s an extension of TLB that resides in memory and can be > > automatically searched by the processor. > > > > This patch allows user to configure VHPT size per HVM domain. > > > > We have an interesting result. > > We tried some large transaction benchmark, > > for VHPT size in 512K, 2M, 4M, 8M: > > - Linux is getting a better score (totally 20% up) > > - Windows is getting a worse score (totally 10% down) > > > > The reason of windows degradation is, windows OS flushes > > TLB more frequently. Xen hypervisor must clear the memory of VHPT > > with TLB flushing, that becomes an overhead. > > > > This patch is significant for IA64 to support both linux guest > > and windows guest simultaneously. > > > > Thanks, > > Kouya > > > > Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com> > > > > diff -r 2863852e02f6 tools/examples/xmexample.vti > > --- a/tools/examples/xmexample.vti Mon Oct 15 11:41:28 2007 -0600 > > +++ b/tools/examples/xmexample.vti Tue Oct 16 11:31:53 2007 +0900 > > @@ -34,6 +34,10 @@ name = "ExampleVTIDomain" > > #cpus = "" # leave to Xen to pick > > #cpus = "0" # all vcpus run on CPU0 > > #cpus = "0-3,5,^1" # run on cpus 0,2,3,5 > > + > > +# VHPT size(2**n), default=23 (8MB), minimum=15 (32KB). > > +# In Windows OS, smaller size shows better performance. > > +#vhpt = 23 > > > > # Optionally define mac and/or bridge for the network interfaces. > > # Random MACs are assigned if not given. > > diff -r 2863852e02f6 tools/python/xen/lowlevel/xc/xc.c > > --- a/tools/python/xen/lowlevel/xc/xc.c Mon Oct 15 11:41:28 2007 -0600 > > +++ b/tools/python/xen/lowlevel/xc/xc.c Tue Oct 16 10:03:46 2007 +0900 > > @@ -538,15 +538,20 @@ static PyObject *pyxc_hvm_build(XcObject > > #endif > > char *image; > > int store_evtchn, memsize, vcpus = 1, pae = 0, acpi = 0, apic = 1; > > + int vhpt = 0; > > unsigned long store_mfn; > > > > static char *kwd_list[] = { "domid", "store_evtchn", > > "memsize", "image", "vcpus", "pae", "acpi", > > - "apic", NULL }; > > - if ( !PyArg_ParseTupleAndKeywords(args, kwds, "iiis|iiii", kwd_list, > > - &dom, &store_evtchn, &memsize, > > - &image, &vcpus, &pae, &acpi, &apic) ) > > - return NULL; > > + "apic", "vhpt", NULL }; > > + if ( !PyArg_ParseTupleAndKeywords(args, kwds, "iiis|iiiii", kwd_list, > > + &dom, &store_evtchn, &memsize, &image, > > + &vcpus, &pae, &acpi, &apic, &vhpt) ) > > + return NULL; > > + > > +#ifdef __ia64__ > > + xc_set_hvm_param(self->xc_handle, dom, HVM_PARAM_VHPT_SIZE, vhpt); > > +#endif > > > > if ( xc_hvm_build(self->xc_handle, dom, memsize, image) != 0 ) > > return pyxc_error_to_exception(); > > diff -r 2863852e02f6 tools/python/xen/xend/XendConfig.py > > --- a/tools/python/xen/xend/XendConfig.py Mon Oct 15 11:41:28 2007 -0600 > > +++ b/tools/python/xen/xend/XendConfig.py Tue Oct 16 10:21:25 2007 +0900 > > @@ -127,7 +127,7 @@ XENAPI_PLATFORM_CFG = [ ''acpi'', ''apic'', > > ''nographic'', ''pae'', ''rtc_timeoffset'', ''serial'', > > ''sdl'', > > ''soundhw'',''stdvga'', ''usb'', ''usbdevice'', ''vnc'', > > ''vncconsole'', ''vncdisplay'', ''vnclisten'', > > - ''vncpasswd'', ''vncunused'', ''xauthority'', ''pci''] > > + ''vncpasswd'', ''vncunused'', ''xauthority'', ''pci'', > > ''vhpt''] > > > > # Xen API console ''other_config'' keys. > > XENAPI_CONSOLE_OTHER_CFG = [''vncunused'', ''vncdisplay'', ''vnclisten'', > > diff -r 2863852e02f6 tools/python/xen/xend/image.py > > --- a/tools/python/xen/xend/image.py Mon Oct 15 11:41:28 2007 -0600 > > +++ b/tools/python/xen/xend/image.py Tue Oct 16 10:03:46 2007 +0900 > > @@ -277,6 +277,7 @@ class HVMImageHandler(ImageHandler): > > self.pae = int(vmConfig[''platform''].get(''pae'', 0)) > > self.apic = int(vmConfig[''platform''].get(''apic'', 0)) > > self.acpi = int(vmConfig[''platform''].get(''acpi'', 0)) > > + self.vhpt = int(vmConfig[''platform''].get(''vhpt'', 0)) > > > > > > def buildDomain(self): > > @@ -292,6 +293,7 @@ class HVMImageHandler(ImageHandler): > > log.debug("pae = %d", self.pae) > > log.debug("acpi = %d", self.acpi) > > log.debug("apic = %d", self.apic) > > + log.debug("vhpt = %d", self.vhpt) > > > > rc = xc.hvm_build(domid = self.vm.getDomid(), > > image = self.kernel, > > @@ -300,7 +302,8 @@ class HVMImageHandler(ImageHandler): > > vcpus = self.vm.getVCpuCount(), > > pae = self.pae, > > acpi = self.acpi, > > - apic = self.apic) > > + apic = self.apic, > > + vhpt = self.vhpt) > > rc[''notes''] = { ''SUSPEND_CANCEL'': 1 } > > return rc > > > > diff -r 2863852e02f6 tools/python/xen/xm/create.py > > --- a/tools/python/xen/xm/create.py Mon Oct 15 11:41:28 2007 -0600 > > +++ b/tools/python/xen/xm/create.py Tue Oct 16 11:22:10 2007 +0900 > > @@ -209,6 +209,10 @@ gopts.var(''vcpu_avail'', val=''VCPUS'', > > gopts.var(''vcpu_avail'', val=''VCPUS'', > > fn=set_long, default=None, > > use="Bitmask for virtual CPUs to make available immediately.") > > + > > +gopts.var(''vhpt'', val=''VHPT'', > > + fn=set_int, default=0, > > + use="VHPT Size(2**n) of IA64 HVM domain.") > > > > gopts.var(''cpu_cap'', val=''CAP'', > > fn=set_int, default=None, > > @@ -721,7 +725,7 @@ def configure_hvm(config_image, vals): > > ''localtime'', ''serial'', ''stdvga'', ''isa'', ''nographic'', ''soundhw'', > > ''vnc'', ''vncdisplay'', ''vncunused'', ''vncconsole'', ''vnclisten'', > > ''sdl'', ''display'', ''xauthority'', ''rtc_timeoffset'', ''monitor'', > > - ''acpi'', ''apic'', ''usb'', ''usbdevice'', ''keymap'', ''pci'' ] > > + ''acpi'', ''apic'', ''usb'', ''usbdevice'', ''keymap'', ''pci'', ''vhpt'' ] > > for a in args: > > if a in vals.__dict__ and vals.__dict__[a] is not None: > > config_image.append([a, vals.__dict__[a]]) > > diff -r 2863852e02f6 xen/arch/ia64/vmx/vmmu.c > > --- a/xen/arch/ia64/vmx/vmmu.c Mon Oct 15 11:41:28 2007 -0600 > > +++ b/xen/arch/ia64/vmx/vmmu.c Tue Oct 16 10:12:40 2007 +0900 > > @@ -96,8 +96,14 @@ static int init_domain_vhpt(struct vcpu > > static int init_domain_vhpt(struct vcpu *v) > > { > > int rc; > > - > > - rc = thash_alloc(&(v->arch.vhpt), default_vhpt_sz, "vhpt"); > > + u64 size = v->domain->arch.hvm_domain.params[HVM_PARAM_VHPT_SIZE]; > > + > > + if (size == 0) > > + size = default_vhpt_sz; > > + else > > + size = canonicalize_vhpt_size(size); > > + > > + rc = thash_alloc(&(v->arch.vhpt), size, "vhpt"); > > v->arch.arch_vmx.mpta = v->arch.vhpt.pta.val; > > return rc; > > } > > diff -r 2863852e02f6 xen/include/public/hvm/params.h > > --- a/xen/include/public/hvm/params.h Mon Oct 15 11:41:28 2007 -0600 > > +++ b/xen/include/public/hvm/params.h Tue Oct 16 10:03:54 2007 +0900 > > @@ -52,7 +52,8 @@ > > > > #ifdef __ia64__ > > #define HVM_PARAM_NVRAM_FD 7 > > -#define HVM_NR_PARAMS 8 > > +#define HVM_PARAM_VHPT_SIZE 8 > > +#define HVM_NR_PARAMS 9 > > #else > > #define HVM_NR_PARAMS 7 > > #endif > > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Kouya Shimura
2007-Oct-19 05:52 UTC
[Xen-devel] [PATCH 1/2][IA64] configure VHPT size per domain: common part
common part. Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com> _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Kouya Shimura
2007-Oct-19 05:52 UTC
[Xen-ia64-devel] [PATCH 2/2][IA64] configure VHPT size per domain: ia64 part
IA64 part. Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com> _______________________________________________ Xen-ia64-devel mailing list Xen-ia64-devel@lists.xensource.com http://lists.xensource.com/xen-ia64-devel
Keir Fraser
2007-Oct-19 08:28 UTC
[Xen-devel] Re: [PATCH 0/2][IA64] configure VHPT size per domain
Both parts are now applied to xen-unstable. -- Keir On 19/10/07 06:52, "Kouya Shimura" <kouya@jp.fujitsu.com> wrote:> Hi Keir and Alex, > > I merged the patch and added support for PV domain. > Please apply for Xen 3.2.0. > > patch 1/2: common part > patch 2/2: ia64 part > > Thanks, > Kouya > > Keir Fraser writes: >> I''ve cleaned up the xc.hvm_build() interface in changeset 16116. Please >> merge against that. The main change will be that you will set the new HVM >> parameter in IA64_HVM_ImageHandler.buildDomain(), rather than passing the >> new parameter down to xc.hvm_build(). >> >> -- Keir >> >> On 16/10/07 07:21, "Kouya Shimura" <kouya@jp.fujitsu.com> wrote: >> >>> Hi Keir and Alex, >>> >>> A Virtual Hash Page Table(VHPT) is a special feature of IA64. >>> It''s an extension of TLB that resides in memory and can be >>> automatically searched by the processor. >>> >>> This patch allows user to configure VHPT size per HVM domain. >>> >>> We have an interesting result. >>> We tried some large transaction benchmark, >>> for VHPT size in 512K, 2M, 4M, 8M: >>> - Linux is getting a better score (totally 20% up) >>> - Windows is getting a worse score (totally 10% down) >>> >>> The reason of windows degradation is, windows OS flushes >>> TLB more frequently. Xen hypervisor must clear the memory of VHPT >>> with TLB flushing, that becomes an overhead. >>> >>> This patch is significant for IA64 to support both linux guest >>> and windows guest simultaneously. >>> >>> Thanks, >>> Kouya >>> >>> Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com> >>> >>> diff -r 2863852e02f6 tools/examples/xmexample.vti >>> --- a/tools/examples/xmexample.vti Mon Oct 15 11:41:28 2007 -0600 >>> +++ b/tools/examples/xmexample.vti Tue Oct 16 11:31:53 2007 +0900 >>> @@ -34,6 +34,10 @@ name = "ExampleVTIDomain" >>> #cpus = "" # leave to Xen to pick >>> #cpus = "0" # all vcpus run on CPU0 >>> #cpus = "0-3,5,^1" # run on cpus 0,2,3,5 >>> + >>> +# VHPT size(2**n), default=23 (8MB), minimum=15 (32KB). >>> +# In Windows OS, smaller size shows better performance. >>> +#vhpt = 23 >>> >>> # Optionally define mac and/or bridge for the network interfaces. >>> # Random MACs are assigned if not given. >>> diff -r 2863852e02f6 tools/python/xen/lowlevel/xc/xc.c >>> --- a/tools/python/xen/lowlevel/xc/xc.c Mon Oct 15 11:41:28 2007 -0600 >>> +++ b/tools/python/xen/lowlevel/xc/xc.c Tue Oct 16 10:03:46 2007 +0900 >>> @@ -538,15 +538,20 @@ static PyObject *pyxc_hvm_build(XcObject >>> #endif >>> char *image; >>> int store_evtchn, memsize, vcpus = 1, pae = 0, acpi = 0, apic = 1; >>> + int vhpt = 0; >>> unsigned long store_mfn; >>> >>> static char *kwd_list[] = { "domid", "store_evtchn", >>> "memsize", "image", "vcpus", "pae", "acpi", >>> - "apic", NULL }; >>> - if ( !PyArg_ParseTupleAndKeywords(args, kwds, "iiis|iiii", kwd_list, >>> - &dom, &store_evtchn, &memsize, >>> - &image, &vcpus, &pae, &acpi, &apic) ) >>> - return NULL; >>> + "apic", "vhpt", NULL }; >>> + if ( !PyArg_ParseTupleAndKeywords(args, kwds, "iiis|iiiii", kwd_list, >>> + &dom, &store_evtchn, &memsize, >>> &image, >>> + &vcpus, &pae, &acpi, &apic, &vhpt) ) >>> + return NULL; >>> + >>> +#ifdef __ia64__ >>> + xc_set_hvm_param(self->xc_handle, dom, HVM_PARAM_VHPT_SIZE, vhpt); >>> +#endif >>> >>> if ( xc_hvm_build(self->xc_handle, dom, memsize, image) != 0 ) >>> return pyxc_error_to_exception(); >>> diff -r 2863852e02f6 tools/python/xen/xend/XendConfig.py >>> --- a/tools/python/xen/xend/XendConfig.py Mon Oct 15 11:41:28 2007 -0600 >>> +++ b/tools/python/xen/xend/XendConfig.py Tue Oct 16 10:21:25 2007 +0900 >>> @@ -127,7 +127,7 @@ XENAPI_PLATFORM_CFG = [ ''acpi'', ''apic'', >>> ''nographic'', ''pae'', ''rtc_timeoffset'', ''serial'', >>> ''sdl'', >>> ''soundhw'',''stdvga'', ''usb'', ''usbdevice'', ''vnc'', >>> ''vncconsole'', ''vncdisplay'', ''vnclisten'', >>> - ''vncpasswd'', ''vncunused'', ''xauthority'', ''pci''] >>> + ''vncpasswd'', ''vncunused'', ''xauthority'', ''pci'', >>> ''vhpt''] >>> >>> # Xen API console ''other_config'' keys. >>> XENAPI_CONSOLE_OTHER_CFG = [''vncunused'', ''vncdisplay'', ''vnclisten'', >>> diff -r 2863852e02f6 tools/python/xen/xend/image.py >>> --- a/tools/python/xen/xend/image.py Mon Oct 15 11:41:28 2007 -0600 >>> +++ b/tools/python/xen/xend/image.py Tue Oct 16 10:03:46 2007 +0900 >>> @@ -277,6 +277,7 @@ class HVMImageHandler(ImageHandler): >>> self.pae = int(vmConfig[''platform''].get(''pae'', 0)) >>> self.apic = int(vmConfig[''platform''].get(''apic'', 0)) >>> self.acpi = int(vmConfig[''platform''].get(''acpi'', 0)) >>> + self.vhpt = int(vmConfig[''platform''].get(''vhpt'', 0)) >>> >>> >>> def buildDomain(self): >>> @@ -292,6 +293,7 @@ class HVMImageHandler(ImageHandler): >>> log.debug("pae = %d", self.pae) >>> log.debug("acpi = %d", self.acpi) >>> log.debug("apic = %d", self.apic) >>> + log.debug("vhpt = %d", self.vhpt) >>> >>> rc = xc.hvm_build(domid = self.vm.getDomid(), >>> image = self.kernel, >>> @@ -300,7 +302,8 @@ class HVMImageHandler(ImageHandler): >>> vcpus = self.vm.getVCpuCount(), >>> pae = self.pae, >>> acpi = self.acpi, >>> - apic = self.apic) >>> + apic = self.apic, >>> + vhpt = self.vhpt) >>> rc[''notes''] = { ''SUSPEND_CANCEL'': 1 } >>> return rc >>> >>> diff -r 2863852e02f6 tools/python/xen/xm/create.py >>> --- a/tools/python/xen/xm/create.py Mon Oct 15 11:41:28 2007 -0600 >>> +++ b/tools/python/xen/xm/create.py Tue Oct 16 11:22:10 2007 +0900 >>> @@ -209,6 +209,10 @@ gopts.var(''vcpu_avail'', val=''VCPUS'', >>> gopts.var(''vcpu_avail'', val=''VCPUS'', >>> fn=set_long, default=None, >>> use="Bitmask for virtual CPUs to make available immediately.") >>> + >>> +gopts.var(''vhpt'', val=''VHPT'', >>> + fn=set_int, default=0, >>> + use="VHPT Size(2**n) of IA64 HVM domain.") >>> >>> gopts.var(''cpu_cap'', val=''CAP'', >>> fn=set_int, default=None, >>> @@ -721,7 +725,7 @@ def configure_hvm(config_image, vals): >>> ''localtime'', ''serial'', ''stdvga'', ''isa'', ''nographic'', >>> ''soundhw'', >>> ''vnc'', ''vncdisplay'', ''vncunused'', ''vncconsole'', ''vnclisten'', >>> ''sdl'', ''display'', ''xauthority'', ''rtc_timeoffset'', ''monitor'', >>> - ''acpi'', ''apic'', ''usb'', ''usbdevice'', ''keymap'', ''pci'' ] >>> + ''acpi'', ''apic'', ''usb'', ''usbdevice'', ''keymap'', ''pci'', ''vhpt'' ] >>> for a in args: >>> if a in vals.__dict__ and vals.__dict__[a] is not None: >>> config_image.append([a, vals.__dict__[a]]) >>> diff -r 2863852e02f6 xen/arch/ia64/vmx/vmmu.c >>> --- a/xen/arch/ia64/vmx/vmmu.c Mon Oct 15 11:41:28 2007 -0600 >>> +++ b/xen/arch/ia64/vmx/vmmu.c Tue Oct 16 10:12:40 2007 +0900 >>> @@ -96,8 +96,14 @@ static int init_domain_vhpt(struct vcpu >>> static int init_domain_vhpt(struct vcpu *v) >>> { >>> int rc; >>> - >>> - rc = thash_alloc(&(v->arch.vhpt), default_vhpt_sz, "vhpt"); >>> + u64 size = v->domain->arch.hvm_domain.params[HVM_PARAM_VHPT_SIZE]; >>> + >>> + if (size == 0) >>> + size = default_vhpt_sz; >>> + else >>> + size = canonicalize_vhpt_size(size); >>> + >>> + rc = thash_alloc(&(v->arch.vhpt), size, "vhpt"); >>> v->arch.arch_vmx.mpta = v->arch.vhpt.pta.val; >>> return rc; >>> } >>> diff -r 2863852e02f6 xen/include/public/hvm/params.h >>> --- a/xen/include/public/hvm/params.h Mon Oct 15 11:41:28 2007 -0600 >>> +++ b/xen/include/public/hvm/params.h Tue Oct 16 10:03:54 2007 +0900 >>> @@ -52,7 +52,8 @@ >>> >>> #ifdef __ia64__ >>> #define HVM_PARAM_NVRAM_FD 7 >>> -#define HVM_NR_PARAMS 8 >>> +#define HVM_PARAM_VHPT_SIZE 8 >>> +#define HVM_NR_PARAMS 9 >>> #else >>> #define HVM_NR_PARAMS 7 >>> #endif >> >> >> >> _______________________________________________ >> Xen-devel mailing list >> Xen-devel@lists.xensource.com >> http://lists.xensource.com/xen-devel_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel