Re: [libvirt] [PATCH RFC V2 1/2] Resctrl: Add new xml element to support cache tune
On Friday, 30 June 2017 at 7:06 PM, Martin Kletzander wrote: > On Mon, Jun 26, 2017 at 06:33:39PM +0800, Eli Qiao wrote: > > This patch adds new xml element to support cache tune as: > > > > > > ... > > > > ... > > > > > > cacheId: reference of the host's cache banks id, it's from capabilities > > xml. > > type: cache bank type, it could be both, code, data. > > sizeKiB: must be multiple of granularity, must be greater than or equal > > to minimum. > > > > > Why would you come up with something like 'sizeKib'? That's so > inconvenient. > > Sure, > > > vcpus: cache allocation on vcpu set, if empty, will apply the allocation > > on all vcpus. > > > > Signed-off-by: Eli Qiao> (mailto:liyong.q...@intel.com)> > > --- > > docs/schemas/domaincommon.rng | 29 +++ > > src/conf/domain_conf.c | 113 +- > > src/conf/domain_conf.h | 19 +++ > > 3 files changed, 160 insertions(+), 1 deletion(-) > > > > diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c > > index 0409c62..fa8d03e 100644 > > --- a/src/conf/domain_conf.c > > +++ b/src/conf/domain_conf.c > > @@ -17642,7 +17730,6 @@ virDomainDefParseXML(xmlDocPtr xml, > > virReportError(VIR_ERR_INTERNAL_ERROR, "%s", > > _("cannot extract vcpusched nodes")); > > goto error; > > - } > > > > for (i = 0; i < n; i++) { > > if (virDomainVcpuThreadSchedParse(nodes[i], def) < 0) > > > > > And this hunk breaks the whole compilation, of course. > ops, stupid me. > > I'm not at work for few days plus there's a public holiday in my > country, so I won't be here for a while. That shouldn't stop anyone > else reviewing your code, but I'm giving you a heads-up that I'll > probably work on a separate solution if I have some extra time on my > hands during vacation. > Sure, that’s great if you can have your version, I would like to help reviewing and testing > > Have a nice day, > Martin > > -- > libvir-list mailing list > libvir-list@redhat.com (mailto:libvir-list@redhat.com) > https://www.redhat.com/mailman/listinfo/libvir-list > > -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH RFC V2 1/2] Resctrl: Add new xml element to support cache tune
On Mon, Jun 26, 2017 at 06:33:39PM +0800, Eli Qiao wrote: This patch adds new xml element to support cache tune as: ... ... cacheId: reference of the host's cache banks id, it's from capabilities xml. type:cache bank type, it could be both, code, data. sizeKiB: must be multiple of granularity, must be greater than or equal to minimum. Why would you come up with something like 'sizeKib'? That's so inconvenient. vcpus: cache allocation on vcpu set, if empty, will apply the allocation on all vcpus. Signed-off-by: Eli Qiao--- docs/schemas/domaincommon.rng | 29 +++ src/conf/domain_conf.c| 113 +- src/conf/domain_conf.h| 19 +++ 3 files changed, 160 insertions(+), 1 deletion(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 0409c62..fa8d03e 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -17642,7 +17730,6 @@ virDomainDefParseXML(xmlDocPtr xml, virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("cannot extract vcpusched nodes")); goto error; -} for (i = 0; i < n; i++) { if (virDomainVcpuThreadSchedParse(nodes[i], def) < 0) And this hunk breaks the whole compilation, of course. I'm not at work for few days plus there's a public holiday in my country, so I won't be here for a while. That shouldn't stop anyone else reviewing your code, but I'm giving you a heads-up that I'll probably work on a separate solution if I have some extra time on my hands during vacation. Have a nice day, Martin signature.asc Description: Digital signature -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [PATCH RFC V2 1/2] Resctrl: Add new xml element to support cache tune
This patch adds new xml element to support cache tune as: ... ... cacheId: reference of the host's cache banks id, it's from capabilities xml. type:cache bank type, it could be both, code, data. sizeKiB: must be multiple of granularity, must be greater than or equal to minimum. vcpus: cache allocation on vcpu set, if empty, will apply the allocation on all vcpus. Signed-off-by: Eli Qiao--- docs/schemas/domaincommon.rng | 29 +++ src/conf/domain_conf.c| 113 +- src/conf/domain_conf.h| 19 +++ 3 files changed, 160 insertions(+), 1 deletion(-) diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index e259e3e..6e0262e 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -834,6 +834,25 @@ + + + + + + + + + + + + + + + + + + + @@ -5693,6 +5712,16 @@ -1 + + + [0-9]+ + + + + + (both|code|data) + + diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 0409c62..fa8d03e 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -2927,6 +2927,11 @@ void virDomainDefFree(virDomainDefPtr def) xmlFreeNode(def->metadata); +for (i = 0; i < def->cachetune.n_banks; i++) +virBitmapFree(def->cachetune.cache_banks[i].vcpus); + +VIR_FREE(def->cachetune.cache_banks); + VIR_FREE(def); } @@ -16318,6 +16323,81 @@ virDomainVcpuPinDefParseXML(virDomainDefPtr def, return ret; } +/* Parse the XML definition for cachetune + * and a cachetune has the form + *