xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] libxl: correct xl cpupool-numa-split with vcpu limited dom0
@ 2016-06-14  4:30 Juergen Gross
  2016-06-14  9:01 ` Dario Faggioli
  0 siblings, 1 reply; 9+ messages in thread
From: Juergen Gross @ 2016-06-14  4:30 UTC (permalink / raw)
  To: xen-devel; +Cc: Juergen Gross, wei.liu2, ian.jackson, glenn

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.

Reported-by: Glenn Enright <glenn@rimuhosting.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
---
 tools/libxl/xl_cmdimpl.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 8696ca7..d912c39 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -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);
-- 
2.6.6


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] libxl: correct xl cpupool-numa-split with vcpu limited dom0
  2016-06-14  4:30 [PATCH] libxl: correct xl cpupool-numa-split with vcpu limited dom0 Juergen Gross
@ 2016-06-14  9:01 ` Dario Faggioli
  2016-06-14  9:56   ` Wei Liu
  0 siblings, 1 reply; 9+ messages in thread
From: Dario Faggioli @ 2016-06-14  9:01 UTC (permalink / raw)
  To: Juergen Gross, xen-devel; +Cc: ian.jackson, wei.liu2, glenn


[-- Attachment #1.1: Type: text/plain, Size: 683 bytes --]

On Tue, 2016-06-14 at 06:30 +0200, Juergen Gross wrote:
> 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.
> 
> Reported-by: Glenn Enright <glenn@rimuhosting.com>
> Signed-off-by: Juergen Gross <jgross@suse.com>
>
Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>

Regards,
Dario
-- 
<<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)


[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] libxl: correct xl cpupool-numa-split with vcpu limited dom0
  2016-06-14  9:01 ` Dario Faggioli
@ 2016-06-14  9:56   ` Wei Liu
  2016-06-14  9:58     ` Wei Liu
  2016-06-14 10:07     ` Ian Jackson
  0 siblings, 2 replies; 9+ messages in thread
From: Wei Liu @ 2016-06-14  9:56 UTC (permalink / raw)
  To: Dario Faggioli; +Cc: Juergen Gross, ian.jackson, glenn, wei.liu2, xen-devel

On Tue, Jun 14, 2016 at 11:01:50AM +0200, Dario Faggioli wrote:
> On Tue, 2016-06-14 at 06:30 +0200, Juergen Gross wrote:
> > 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.
> > 
> > Reported-by: Glenn Enright <glenn@rimuhosting.com>
> > Signed-off-by: Juergen Gross <jgross@suse.com>
> >
> Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
> 

Acked-by: Wei Liu <wei.liu2@citrix.com>

I think this is also a backport candidate?

> Regards,
> Dario
> -- 
> <<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
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] libxl: correct xl cpupool-numa-split with vcpu limited dom0
  2016-06-14  9:56   ` Wei Liu
@ 2016-06-14  9:58     ` Wei Liu
  2016-06-14 10:05       ` Juergen Gross
  2016-06-14 10:07     ` Ian Jackson
  1 sibling, 1 reply; 9+ messages in thread
From: Wei Liu @ 2016-06-14  9:58 UTC (permalink / raw)
  To: Dario Faggioli; +Cc: Juergen Gross, ian.jackson, glenn, wei.liu2, xen-devel

On Tue, Jun 14, 2016 at 10:56:52AM +0100, Wei Liu wrote:
> On Tue, Jun 14, 2016 at 11:01:50AM +0200, Dario Faggioli wrote:
> > On Tue, 2016-06-14 at 06:30 +0200, Juergen Gross wrote:
> > > 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.
> > > 
> > > Reported-by: Glenn Enright <glenn@rimuhosting.com>
> > > Signed-off-by: Juergen Gross <jgross@suse.com>
> > >
> > Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
> > 
> 
> Acked-by: Wei Liu <wei.liu2@citrix.com>
> 

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

Wei.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] libxl: correct xl cpupool-numa-split with vcpu limited dom0
  2016-06-14  9:58     ` Wei Liu
@ 2016-06-14 10:05       ` Juergen Gross
  2016-06-17 10:44         ` Wei Liu
  0 siblings, 1 reply; 9+ messages in thread
From: Juergen Gross @ 2016-06-14 10:05 UTC (permalink / raw)
  To: Wei Liu, Dario Faggioli; +Cc: xen-devel, ian.jackson, glenn

On 14/06/16 11:58, Wei Liu wrote:
> On Tue, Jun 14, 2016 at 10:56:52AM +0100, Wei Liu wrote:
>> On Tue, Jun 14, 2016 at 11:01:50AM +0200, Dario Faggioli wrote:
>>> On Tue, 2016-06-14 at 06:30 +0200, Juergen Gross wrote:
>>>> 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.
>>>>
>>>> Reported-by: Glenn Enright <glenn@rimuhosting.com>
>>>> Signed-off-by: Juergen Gross <jgross@suse.com>
>>>>
>>> Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
>>>
>>
>> Acked-by: Wei Liu <wei.liu2@citrix.com>
>>
> 
> 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
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] libxl: correct xl cpupool-numa-split with vcpu limited dom0
  2016-06-14  9:56   ` Wei Liu
  2016-06-14  9:58     ` Wei Liu
@ 2016-06-14 10:07     ` Ian Jackson
  2016-06-14 10:31       ` Juergen Gross
  1 sibling, 1 reply; 9+ messages in thread
From: Ian Jackson @ 2016-06-14 10:07 UTC (permalink / raw)
  To: Wei Liu; +Cc: Juergen Gross, Dario Faggioli, glenn, xen-devel

Wei Liu writes ("Re: [Xen-devel] [PATCH] libxl: correct xl cpupool-numa-split with vcpu limited dom0"):
> On Tue, Jun 14, 2016 at 11:01:50AM +0200, Dario Faggioli wrote:
> > On Tue, 2016-06-14 at 06:30 +0200, Juergen Gross wrote:
> > > 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.
> > > 
> > > Reported-by: Glenn Enright <glenn@rimuhosting.com>
> > > Signed-off-by: Juergen Gross <jgross@suse.com>
> > >
> > Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
> 
> Acked-by: Wei Liu <wei.liu2@citrix.com>
> 
> 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
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] libxl: correct xl cpupool-numa-split with vcpu limited dom0
  2016-06-14 10:07     ` Ian Jackson
@ 2016-06-14 10:31       ` Juergen Gross
  2016-06-14 14:28         ` Ian Jackson
  0 siblings, 1 reply; 9+ messages in thread
From: Juergen Gross @ 2016-06-14 10:31 UTC (permalink / raw)
  To: Ian Jackson, Wei Liu; +Cc: Dario Faggioli, glenn, xen-devel

On 14/06/16 12:07, Ian Jackson wrote:
> Wei Liu writes ("Re: [Xen-devel] [PATCH] libxl: correct xl cpupool-numa-split with vcpu limited dom0"):
>> On Tue, Jun 14, 2016 at 11:01:50AM +0200, Dario Faggioli wrote:
>>> On Tue, 2016-06-14 at 06:30 +0200, Juergen Gross wrote:
>>>> 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.
>>>>
>>>> Reported-by: Glenn Enright <glenn@rimuhosting.com>
>>>> Signed-off-by: Juergen Gross <jgross@suse.com>
>>>>
>>> Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
>>
>> Acked-by: Wei Liu <wei.liu2@citrix.com>
>>
>> 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.

> 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
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] libxl: correct xl cpupool-numa-split with vcpu limited dom0
  2016-06-14 10:31       ` Juergen Gross
@ 2016-06-14 14:28         ` Ian Jackson
  0 siblings, 0 replies; 9+ messages in thread
From: Ian Jackson @ 2016-06-14 14:28 UTC (permalink / raw)
  To: Juergen Gross; +Cc: Dario Faggioli, glenn, Wei Liu, xen-devel

Juergen Gross writes ("Re: [Xen-devel] [PATCH] libxl: correct xl cpupool-numa-split with vcpu limited dom0"):
> On 14/06/16 12:07, Ian Jackson wrote:
> > 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.

> 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
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] libxl: correct xl cpupool-numa-split with vcpu limited dom0
  2016-06-14 10:05       ` Juergen Gross
@ 2016-06-17 10:44         ` Wei Liu
  0 siblings, 0 replies; 9+ messages in thread
From: Wei Liu @ 2016-06-17 10:44 UTC (permalink / raw)
  To: Juergen Gross; +Cc: ian.jackson, Dario Faggioli, xen-devel, Wei Liu, glenn

On Tue, Jun 14, 2016 at 12:05:35PM +0200, Juergen Gross wrote:
> On 14/06/16 11:58, Wei Liu wrote:
> > On Tue, Jun 14, 2016 at 10:56:52AM +0100, Wei Liu wrote:
> >> On Tue, Jun 14, 2016 at 11:01:50AM +0200, Dario Faggioli wrote:
> >>> On Tue, 2016-06-14 at 06:30 +0200, Juergen Gross wrote:
> >>>> 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.
> >>>>
> >>>> Reported-by: Glenn Enright <glenn@rimuhosting.com>
> >>>> Signed-off-by: Juergen Gross <jgross@suse.com>
> >>>>
> >>> Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
> >>>
> >>
> >> Acked-by: Wei Liu <wei.liu2@citrix.com>
> >>
> > 
> > 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
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2016-06-17 10:44 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-14  4:30 [PATCH] libxl: correct xl cpupool-numa-split with vcpu limited dom0 Juergen Gross
2016-06-14  9:01 ` Dario Faggioli
2016-06-14  9:56   ` Wei Liu
2016-06-14  9:58     ` Wei Liu
2016-06-14 10:05       ` Juergen Gross
2016-06-17 10:44         ` Wei Liu
2016-06-14 10:07     ` Ian Jackson
2016-06-14 10:31       ` Juergen Gross
2016-06-14 14:28         ` Ian Jackson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).