Skip to contentSkip to conversation

libxl: correct xl cpupool-numa-split with vcpu limited dom0

PATCH Applied Juergen Gross 4 participants 9 messages Jun 14, 2016 – Jun 17, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libxl: correct xl cpupool-numa-split with vcpu limited dom0

When trying to use xl cpupool-numa-split and dom0 is limited to less vcpus than one numa node the operation will fail.

Correct this by allowing this configuration.

---
 tools/libxl/xl_cmdimpl.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
tools/libxl/xl_cmdimpl.c +6 -2
index 8696ca7..d912c39 100644
@@ -8537,7 +8537,11 @@ int main_cpupoolnumasplit(int argc, char **argv)
             n++;
         }
     }
-    if (libxl_set_vcpuonline(ctx, 0, &cpumap)) {
+    if (libxl_domain_info(ctx, &info, 0)) {
+        fprintf(stderr, "error on getting info for Domain-0\n");
+        goto out;
+    }
+    if (info.vcpu_online > n && libxl_set_vcpuonline(ctx, 0, &cpumap)) {
         fprintf(stderr, "error on removing vcpus for Domain-0\n");
         goto out;
     }
@@ -8552,7 +8556,7 @@ int main_cpupoolnumasplit(int argc, char **argv)
             fprintf(stderr, "error on getting info for Domain-0\n");
             goto out;
         }
-        if (info.vcpu_online == n) {
+        if (info.vcpu_online <= n) {
             break;
         }
         sleep(1);
Signature · 7 lines
2.6.6


_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Juergen Gross

When trying to use xl cpupool-numa-split and dom0 is limited to less vcpus than one numa node the operation will fail.

Correct this by allowing this configuration.

Regards,
Dario

Signature · 4 lines
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://about.me/dario.faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

Acked-by
#2 lore raw
Quoted 11 lines · Dario Faggioli
Quoted 8 lines · Juergen Gross

When trying to use xl cpupool-numa-split and dom0 is limited to less vcpus than one numa node the operation will fail.

Correct this by allowing this configuration.

I think this is also a backport candidate?

Quoted 8 lines

Regards,
Dario

Signature · 4 lines
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://about.me/dario.faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#3 lore raw
Quoted 7 lines · Wei Liu
Quoted 6 lines · Dario Faggioli
Quoted 5 lines · Juergen Gross

When trying to use xl cpupool-numa-split and dom0 is limited to less vcpus than one numa node the operation will fail.

Correct this by allowing this configuration.

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

BTW I will change the "libxl" to "xl" in patch title while committing if you don't object.

Wei.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#4 lore raw
Quoted 11 lines · Wei Liu
Quoted 10 lines · Wei Liu
Quoted 9 lines · Dario Faggioli
Quoted 8 lines · Juergen Gross

When trying to use xl cpupool-numa-split and dom0 is limited to less vcpus than one numa node the operation will fail.

Correct this by allowing this configuration.

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

BTW I will change the "libxl" to "xl" in patch title while committing if you don't object.

NP.

Regarding backport: yes

Juergen

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

Applied
#5 lore raw
Quoted 15 lines · Juergen Gross
Quoted 14 lines · Wei Liu
Quoted 13 lines · Wei Liu
Quoted 11 lines · Dario Faggioli
Quoted 8 lines · Juergen Gross

When trying to use xl cpupool-numa-split and dom0 is limited to less vcpus than one numa node the operation will fail.

Correct this by allowing this configuration.

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

BTW I will change the "libxl" to "xl" in patch title while committing if you don't object.

NP.

Pushed to staging with updated subject line.

Wei.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#6 lore raw
In reply to Wei Liu

Wei Liu writes ("Re: [Xen-devel] [PATCH] libxl: correct xl cpupool-numa-split with vcpu limited dom0"):

Quoted 7 lines · Dario Faggioli
Quoted 6 lines · Juergen Gross
Quoted 5 lines

When trying to use xl cpupool-numa-split and dom0 is limited to less vcpus than one numa node the operation will fail.

Correct this by allowing this configuration.

Quoted 8 lines
Quoted 4 lines
Quoted 3 lines

I think this is also a backport candidate?

Possibly.

I looked at the code for a minute or two, and perhaps I'm being dense this morning, but I wasn't able to see (from the code and the commit message and from the diff) precisely what misunderstanding the original author of the code had, and how this patch fixes it.

I don't want to backport (non-security) things unless they have a very low chance of regressions. So perhaps someone could either explain it to me, or assert convincingly that they are sure it's right :-).

Thanks,
Ian.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#7 lore raw
Quoted 15 lines · Ian Jackson

Wei Liu writes ("Re: [Xen-devel] [PATCH] libxl: correct xl cpupool-numa-split with vcpu limited dom0"):

Quoted 14 lines · Dario Faggioli
Quoted 10 lines · Juergen Gross
Quoted 8 lines

When trying to use xl cpupool-numa-split and dom0 is limited to less vcpus than one numa node the operation will fail.

Correct this by allowing this configuration.

Quoted 8 lines
Quoted 1 line

I think this is also a backport candidate?

Possibly.

I looked at the code for a minute or two, and perhaps I'm being dense this morning, but I wasn't able to see (from the code and the commit message and from the diff) precisely what misunderstanding the original author of the code had, and how this patch fixes it.

The problem arises if dom0 has less vcpus than a numa node. In this case libxl_set_vcpuonline() will fail as the cpumap has more bits set than the number of dom0's vcpus.

My patch will result in a call of libxl_set_vcpuonline() only in case dom0 has more vcpus online than the number of cpus of node it is to be restricted to.

Quoted 3 lines

I don't want to backport (non-security) things unless they have a very low chance of regressions. So perhaps someone could either explain it to me, or assert convincingly that they are sure it's right :-).

Juergen

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#8 lore raw

Juergen Gross writes ("Re: [Xen-devel] [PATCH] libxl: correct xl cpupool-numa-split with vcpu limited dom0"):

Quoted 9 lines · Ian Jackson
Quoted 4 lines

I looked at the code for a minute or two, and perhaps I'm being dense this morning, but I wasn't able to see (from the code and the commit message and from the diff) precisely what misunderstanding the original author of the code had, and how this patch fixes it.

The problem arises if dom0 has less vcpus than a numa node. In this case libxl_set_vcpuonline() will fail as the cpumap has more bits set than the number of dom0's vcpus.

Oh, right, of course.

Quoted 3 lines

My patch will result in a call of libxl_set_vcpuonline() only in case dom0 has more vcpus online than the number of cpus of node it is to be restricted to.

That makes sense, thanks.

I have made a note of this patch in my backport list.

Ian.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel