Andrew Jones
2009-Jul-31 11:46 UTC
[xen-devel][PATCH][xend] save/restore cpu_weight and cpu_cap
This patch allows vcpus_params cpu_weight and cpu_cap to be saved and restored. Most the code to support this already existed, but the save path needed to be updated to explicitly save these params, and the restore path needed to be updated to resend the params down to the kernel. diff --git a/tools/python/xen/xend/XendConfig.py b/tools/python/xen/xend/XendConfig.py --- a/tools/python/xen/xend/XendConfig.py +++ b/tools/python/xen/xend/XendConfig.py @@ -1088,6 +1088,10 @@ if self.has_key(legacy) and self[legacy] not in (None, []): sxpr.append([legacy, self[legacy]]) + if self.has_key(''vcpus_params''): + sxpr.append([''cpu_weight'', int(self[''vcpus_params''].get(''weight'', 256))]) + sxpr.append([''cpu_cap'', int(self[''vcpus_params''].get(''cap'', 0))]) + if self.has_key(''security_label''): sxpr.append([''security_label'', self[''security_label'']]) diff --git a/tools/python/xen/xend/XendDomainInfo.py b/tools/python/xen/xend/XendDomainInfo.py --- a/tools/python/xen/xend/XendDomainInfo.py +++ b/tools/python/xen/xend/XendDomainInfo.py @@ -2448,6 +2448,8 @@ raise VmError("Cpu cap out of range, valid range is from 0 to %s for specified number of vcpus" % (self.getVCpuCount() * 100)) + xc.sched_credit_domain_set(self.domid, weight, cap) + # Test whether the devices can be assigned with VT-d self.info.update_platform_pci() pci = self.info["platform"].get("pci") _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Andrew Jones
2009-Jul-31 12:37 UTC
Re: [xen-devel][PATCH v2][xend] save/restore cpu_weight and cpu_cap
Argh... I shouldn''t cut+paste patches into email editors. Sending again without allowing evil auto-wrap to mess with it. Andrew _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Masaki Kanno
2009-Aug-03 01:43 UTC
Re: [xen-devel][PATCH v2][xend] save/restore cpu_weight and cpu_cap
Fri, 31 Jul 2009 14:37:01 +0200, Andrew Jones wrote:>Argh... I shouldn''t cut+paste patches into email editors. Sending again >without allowing evil auto-wrap to mess with it. >Hi Andrew, Without your patch, I can save/restore cpu_weight and cpu_cap as follows. # xm create vm1 cpu_weight=512 cpu_cap=100 Using config file "/etc/xen/vm1". Started domain vm1 (id=1) # xm sched-credit -d vm1 Name ID Weight Cap vm1 1 512 100 # xm list --long vm1 | grep cpu_ (cpu_weight 512) (cpu_cap 100) (cpu_time 22.504581706) # xm save vm1 /root/vm1.save # xm restore /root/vm1.save # xm sched-credit -d vm1 Name ID Weight Cap vm1 2 512 100 # xm list --long vm1 | grep cpu_ (cpu_weight 512) (cpu_cap 100) (cpu_time 2.200074199) What is your problem? How can I reproduce your problem? FYI, can changeset 19955 help you? Best regards, Kan _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Andrew Jones
2009-Aug-05 13:34 UTC
Re: [xen-devel][PATCH v2][xend] save/restore cpu_weight and cpu_cap
Hi Kan, Thanks for catching my mess-up. It looks like I messed-up and didn''t test on the tip. So I completely missed changeset 19955, which corrects the exact same issue I was attempting to correct. Please disregard my patch submittal. Andrew On Mon, 2009-08-03 at 10:43 +0900, Masaki Kanno wrote:> Fri, 31 Jul 2009 14:37:01 +0200, Andrew Jones wrote: > > >Argh... I shouldn''t cut+paste patches into email editors. Sending again > >without allowing evil auto-wrap to mess with it. > > > > Hi Andrew, > > Without your patch, I can save/restore cpu_weight and cpu_cap as follows. > > # xm create vm1 cpu_weight=512 cpu_cap=100 > Using config file "/etc/xen/vm1". > Started domain vm1 (id=1) > # xm sched-credit -d vm1 > Name ID Weight Cap > vm1 1 512 100 > # xm list --long vm1 | grep cpu_ > (cpu_weight 512) > (cpu_cap 100) > (cpu_time 22.504581706) > # xm save vm1 /root/vm1.save > # xm restore /root/vm1.save > # xm sched-credit -d vm1 > Name ID Weight Cap > vm1 2 512 100 > # xm list --long vm1 | grep cpu_ > (cpu_weight 512) > (cpu_cap 100) > (cpu_time 2.200074199) > > > What is your problem? > How can I reproduce your problem? > > FYI, can changeset 19955 help you? > > Best regards, > Kan > >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Andrew Jones
2009-Aug-05 15:05 UTC
Re: [xen-devel][PATCH v2][xend] save/restore cpu_weight and cpu_cap
Hi Kan, I just caught up on my mail and see that you''ve submitted a patch that reverts most of 19955 due to the redundant domctl calls after putting in this patch - changeset 20006. That works too. Andrew On Wed, 2009-08-05 at 15:34 +0200, Andrew Jones wrote:> Hi Kan, > > Thanks for catching my mess-up. It looks like I messed-up and didn''t > test on the tip. So I completely missed changeset 19955, which corrects > the exact same issue I was attempting to correct. Please disregard my > patch submittal. > > Andrew > > > On Mon, 2009-08-03 at 10:43 +0900, Masaki Kanno wrote: > > Fri, 31 Jul 2009 14:37:01 +0200, Andrew Jones wrote: > > > > >Argh... I shouldn''t cut+paste patches into email editors. Sending again > > >without allowing evil auto-wrap to mess with it. > > > > > > > Hi Andrew, > > > > Without your patch, I can save/restore cpu_weight and cpu_cap as follows. > > > > # xm create vm1 cpu_weight=512 cpu_cap=100 > > Using config file "/etc/xen/vm1". > > Started domain vm1 (id=1) > > # xm sched-credit -d vm1 > > Name ID Weight Cap > > vm1 1 512 100 > > # xm list --long vm1 | grep cpu_ > > (cpu_weight 512) > > (cpu_cap 100) > > (cpu_time 22.504581706) > > # xm save vm1 /root/vm1.save > > # xm restore /root/vm1.save > > # xm sched-credit -d vm1 > > Name ID Weight Cap > > vm1 2 512 100 > > # xm list --long vm1 | grep cpu_ > > (cpu_weight 512) > > (cpu_cap 100) > > (cpu_time 2.200074199) > > > > > > What is your problem? > > How can I reproduce your problem? > > > > FYI, can changeset 19955 help you? > > > > Best regards, > > Kan > > > > > > > _______________________________________________ > 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