libxl: Make 'xl vcpu-set' work properly on overcommited hosts.
PATCH 1/1 libxl: Make 'xl vcpu-set' work properly on overcommited hosts.
The libxl_cpu_bitmap_alloc(..) function, if provided with a zero value for max CPUs will call xc_get_max_cpus() which will retrieve the number of physical CPUs the host has. This is usually OK if the guest's maxvcpus <= host pcpus. But if the value is different, then the bitmap for VCPUs is limited by the number of CPUs the host has.
This is incorrect as what we want is to hotplug in the guest the amount of CPUs that the user specified on the command line and not be limited by the amount of physical CPUs.
--- tools/libxl/xl_cmdimpl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/libxl/xl_cmdimpl.c +1 -1
@@ -4499,7 +4499,7 @@ static void vcpuset(uint32_t domid, const char* nr_vcpus)return ; } -if (libxl_cpu_bitmap_alloc (ctx, &cpumap,0 )) { +if (libxl_cpu_bitmap_alloc (ctx, &cpumap, max_vcpus)) {fprintf (stderr,"libxl_cpu_bitmap_alloc failed\n" );return ; }
Signature · 1 line
1.8.1.4
Quoted 7 lines · Konrad Rzeszutek Wilk
The
libxl_cpu_bitmap_alloc(..)function, if provided with a zero value for max CPUs will callxc_get_max_cpus()which will retrieve the number of physical CPUs the host has. This is usually OK if the guest's maxvcpus <= host pcpus. But if the value is different, then the bitmap for VCPUs is limited by the number of CPUs the host has.
Quoted 5 lines
This is incorrect as what we want is to hotplug in the guest the amount of CPUs that the user specified on the command line and not be limited by the amount of physical CPUs.
Signed-off-by Konrad Rzeszutek Wilk <[email protected]>
Given the cost/benefits of this, I'm inclined to say this should wait until the 4.4 window opens. Having more guest vcpus than host pcpus is not an urgent need, and there is a chance (however small) of this exposing some other kind of bug.
-George
Quoted 13 lines · George Dunlap
Quoted 11 lines · Konrad Rzeszutek Wilk
The
libxl_cpu_bitmap_alloc(..)function, if provided with a zero value for max CPUs will callxc_get_max_cpus()which will retrieve the number of physical CPUs the host has. This is usually OK if the guest's maxvcpus <= host pcpus. But if the value is different, then the bitmap for VCPUs is limited by the number of CPUs the host has.This is incorrect as what we want is to hotplug in the guest the amount of CPUs that the user specified on the command line and not be limited by the amount of physical CPUs.
Quoted 6 lines
Quoted 1 line
Signed-off-by Konrad Rzeszutek Wilk <[email protected]>Given the cost/benefits of this, I'm inclined to say this should wait until the 4.4 window opens. Having more guest vcpus than host pcpus is not an urgent need, and there is a chance (however small) of this exposing some other kind of bug.
Not disputing this.
I imagine the desire is to add vcpus to a guest after migrating to a larger host. If so then this should be in the commit log because you are right that as the commit message currently stands the immediate response is "why on earth..."
My only other concern would be that the existing code has a buffer overrun under these circumstances. I've not checked this either.
Ian.
Quoted 23 lines · Ian Campbell
Quoted 13 lines · George Dunlap
Quoted 11 lines · Konrad Rzeszutek Wilk
The
libxl_cpu_bitmap_alloc(..)function, if provided with a zero value for max CPUs will callxc_get_max_cpus()which will retrieve the number of physical CPUs the host has. This is usually OK if the guest's maxvcpus <= host pcpus. But if the value is different, then the bitmap for VCPUs is limited by the number of CPUs the host has.This is incorrect as what we want is to hotplug in the guest the amount of CPUs that the user specified on the command line and not be limited by the amount of physical CPUs.
Quoted 6 lines
Quoted 1 line
Signed-off-by Konrad Rzeszutek Wilk <[email protected]>Given the cost/benefits of this, I'm inclined to say this should wait until the 4.4 window opens. Having more guest vcpus than host pcpus is not an urgent need, and there is a chance (however small) of this exposing some other kind of bug.
Not disputing this.
Quoted 8 lines
I imagine the desire is to add vcpus to a guest after migrating to a larger host. If so then this should be in the commit log because you are right that as the commit message currently stands the immediate response is "why on earth..."
My only other concern would be that the existing code has a buffer overrun under these circumstances. I've not checked this either.
No over-runs, but this is a regression compared to Xend.
Here is a bit of expanded git commit
Quoted 1 line
From
42eef8cc5624bab907b6064fb183a5ae21b99df0Mon Sep 17 00:00:00 2001
From: Konrad Rzeszutek Wilk <[email protected]>
Date: Tue, 7 May 2013 16:32:20 -0400
Subject: [PATCH] libxl: Make 'xl vcpu-set' work properly on overcommited hosts.
The libxl_cpu_bitmap_alloc(..) function, if provided with a zero value for max CPUs will call xc_get_max_cpus() which will retrieve the number of physical CPUs the host has. This is usually OK if the guest's maxvcpus <= host pcpus. But if the value is different, then the bitmap for VCPUs is limited by the number of CPUs the host has.
This is incorrect as what we want is to hotplug in the guest the amount of CPUs that the user specified on the command line and not be limited by the amount of physical CPUs.
This means that a guest config like this:
vcpus=8
maxvcpus=32
and on a 4 PCPU machine doing
xl vcpu-set <guest name> 16
won't work. This is b/c the the size of the bitmap is one byte so it can only hold up to 8 VCPUs. Hence anything above that is going to be ignored.
Note that all of the libxl_cpu_bitmap_[test|set] silently ignore any test or sets above its size:
if (bit >= bitmap->size * 8)
return 0;so we were never notified off this bug.
--- tools/libxl/xl_cmdimpl.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
tools/libxl/xl_cmdimpl.c +1 -1
@@ -4499,7 +4499,7 @@ static void vcpuset(uint32_t domid, const char* nr_vcpus)return ; } -if (libxl_cpu_bitmap_alloc (ctx, &cpumap,0 )) { +if (libxl_cpu_bitmap_alloc (ctx, &cpumap, max_vcpus)) {fprintf (stderr,"libxl_cpu_bitmap_alloc failed\n" );return ; }
Signature · 1 line
1.7.3.4
Quoted 10 lines
Ian.
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Quoted 30 lines · Konrad Rzeszutek Wilk
Quoted 29 lines · Ian Campbell
Quoted 13 lines · George Dunlap
Quoted 11 lines · Konrad Rzeszutek Wilk
The
libxl_cpu_bitmap_alloc(..)function, if provided with a zero value for max CPUs will callxc_get_max_cpus()which will retrieve the number of physical CPUs the host has. This is usually OK if the guest's maxvcpus <= host pcpus. But if the value is different, then the bitmap for VCPUs is limited by the number of CPUs the host has.This is incorrect as what we want is to hotplug in the guest the amount of CPUs that the user specified on the command line and not be limited by the amount of physical CPUs.
Quoted 6 lines
Quoted 1 line
Signed-off-by Konrad Rzeszutek Wilk <[email protected]>Given the cost/benefits of this, I'm inclined to say this should wait until the 4.4 window opens. Having more guest vcpus than host pcpus is not an urgent need, and there is a chance (however small) of this exposing some other kind of bug.
Not disputing this.
I imagine the desire is to add vcpus to a guest after migrating to a larger host. If so then this should be in the commit log because you are right that as the commit message currently stands the immediate response is "why on earth..."
Quoted 6 lines
Quoted 2 lines
My only other concern would be that the existing code has a buffer overrun under these circumstances. I've not checked this either.
No over-runs, but this is a regression compared to Xend.
From your updated description it seems like if you migrated to a larger
host you could indeed plug more VCPUS, up to the limit on that host, is that right?
If that's the case then it sounds to me as if the xl behaviour is actually an improvement over xend's, except perhaps for some slightly niche test scenarios.
Quoted 15 lines
Here is a bit of expanded git commit
From
42eef8cc5624bab907b6064fb183a5ae21b99df0Mon Sep 17 00:00:00 2001
From: Konrad Rzeszutek Wilk <[email protected]>
Date: Tue, 7 May 2013 16:32:20 -0400
Subject: [PATCH] libxl: Make 'xl vcpu-set' work properly on overcommited hosts.The
libxl_cpu_bitmap_alloc(..)function, if provided with a zero value for max CPUs will callxc_get_max_cpus()which will retrieve the number of physical CPUs the host has. This is usually OK if the guest's maxvcpus <= host pcpus. But if the value is different, then the bitmap for VCPUs is limited by the number of CPUs the host has.
Quoted 3 lines
This is incorrect as what we want is to hotplug in the guest the amount of CPUs that the user specified on the command line and not be limited by the amount of physical CPUs.
IOW what I'm saying above is that this is statement is not axiomatically true, I think what is missing is the why anyone would want to do this.
Quoted 40 lines
This means that a guest config like this:
vcpus=8
maxvcpus=32and on a 4 PCPU machine doing
xl vcpu-set <guest name> 16
won't work. This is b/c the the size of the bitmap is one byte so it can only hold up to 8 VCPUs. Hence anything above that is going to be ignored.
Note that all of the libxl_cpu_bitmap_[test|set] silently ignore any test or sets above its size:
if (bit >= bitmap->size * 8) return 0;so we were never notified off this bug.
Signed-off-by Konrad Rzeszutek Wilk <[email protected]>--- tools/libxl/xl_cmdimpl.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)tools/libxl/xl_cmdimpl.c +1
-1@@ -4499,7 +4499,7 @@ static void vcpuset(uint32_t domid, const char* nr_vcpus)return ; } -if (libxl_cpu_bitmap_alloc (ctx, &cpumap,0 )) { +if (libxl_cpu_bitmap_alloc (ctx, &cpumap, max_vcpus)) {fprintf (stderr,"libxl_cpu_bitmap_alloc failed\n" );return ; }
Ian Campbell writes ("Re: [Xen-devel] [PATCH] libxl: Make 'xl vcpu-set' work properly on overcommited hosts."):
Quoted 2 lines
IOW what I'm saying above is that this is statement is not axiomatically true, I think what is missing is the why anyone would want to do this.
Another reason someone might want to do this is testing, of course. If you want to stress out your guest pv spinlocks, that's one way to do it.
Ian.
Quoted 36 lines · Ian Campbell
Quoted 34 lines · Konrad Rzeszutek Wilk
Quoted 23 lines · Ian Campbell
Quoted 13 lines · George Dunlap
Quoted 11 lines · Konrad Rzeszutek Wilk
The
libxl_cpu_bitmap_alloc(..)function, if provided with a zero value for max CPUs will callxc_get_max_cpus()which will retrieve the number of physical CPUs the host has. This is usually OK if the guest's maxvcpus <= host pcpus. But if the value is different, then the bitmap for VCPUs is limited by the number of CPUs the host has.This is incorrect as what we want is to hotplug in the guest the amount of CPUs that the user specified on the command line and not be limited by the amount of physical CPUs.
Quoted 6 lines
Quoted 1 line
Signed-off-by Konrad Rzeszutek Wilk <[email protected]>Given the cost/benefits of this, I'm inclined to say this should wait until the 4.4 window opens. Having more guest vcpus than host pcpus is not an urgent need, and there is a chance (however small) of this exposing some other kind of bug.
Not disputing this.
Quoted 8 lines
I imagine the desire is to add vcpus to a guest after migrating to a larger host. If so then this should be in the commit log because you are right that as the commit message currently stands the immediate response is "why on earth..."
My only other concern would be that the existing code has a buffer overrun under these circumstances. I've not checked this either.
No over-runs, but this is a regression compared to Xend.
Quoted 7 lines
Quoted 1 line
From your updated description it seems like if you migrated to a larger
host you could indeed plug more VCPUS, up to the limit on that host, is that right?
If that's the case then it sounds to me as if the xl behaviour is actually an improvement over xend's, except perhaps for some slightly niche test scenarios.
Well, overcommit comes in mind. Say you migrate to a 4PCPU box and you have 12VCPUs, then you decide to go down to 4, then back to 16 before migrating it to some other box. Can't do.
Quoted 16 lines
Quoted 16 lines
Here is a bit of expanded git commit
From
42eef8cc5624bab907b6064fb183a5ae21b99df0Mon Sep 17 00:00:00 2001
From: Konrad Rzeszutek Wilk <[email protected]>
Date: Tue, 7 May 2013 16:32:20 -0400
Subject: [PATCH] libxl: Make 'xl vcpu-set' work properly on overcommited hosts.The
libxl_cpu_bitmap_alloc(..)function, if provided with a zero value for max CPUs will callxc_get_max_cpus()which will retrieve the number of physical CPUs the host has. This is usually OK if the guest's maxvcpus <= host pcpus. But if the value is different, then the bitmap for VCPUs is limited by the number of CPUs the host has.
Quoted 6 lines
Quoted 3 lines
This is incorrect as what we want is to hotplug in the guest the amount of CPUs that the user specified on the command line and not be limited by the amount of physical CPUs.
IOW what I'm saying above is that this is statement is not axiomatically true, I think what is missing is the why anyone would want to do this.
See above.
Quoted 43 lines
Quoted 41 lines
This means that a guest config like this:
vcpus=8
maxvcpus=32and on a 4 PCPU machine doing
xl vcpu-set <guest name> 16
won't work. This is b/c the the size of the bitmap is one byte so it can only hold up to 8 VCPUs. Hence anything above that is going to be ignored.
Note that all of the libxl_cpu_bitmap_[test|set] silently ignore any test or sets above its size:
if (bit >= bitmap->size * 8) return 0;so we were never notified off this bug.
Signed-off-by Konrad Rzeszutek Wilk <[email protected]>--- tools/libxl/xl_cmdimpl.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)tools/libxl/xl_cmdimpl.c +1
-1@@ -4499,7 +4499,7 @@ static void vcpuset(uint32_t domid, const char* nr_vcpus)return ; } -if (libxl_cpu_bitmap_alloc (ctx, &cpumap,0 )) { +if (libxl_cpu_bitmap_alloc (ctx, &cpumap, max_vcpus)) {fprintf (stderr,"libxl_cpu_bitmap_alloc failed\n" );return ; }
Quoted 41 lines · Konrad Rzeszutek Wilk
Quoted 40 lines · Ian Campbell
Quoted 30 lines · Konrad Rzeszutek Wilk
Quoted 29 lines · Ian Campbell
Quoted 13 lines · George Dunlap
Quoted 11 lines · Konrad Rzeszutek Wilk
The
libxl_cpu_bitmap_alloc(..)function, if provided with a zero value for max CPUs will callxc_get_max_cpus()which will retrieve the number of physical CPUs the host has. This is usually OK if the guest's maxvcpus <= host pcpus. But if the value is different, then the bitmap for VCPUs is limited by the number of CPUs the host has.This is incorrect as what we want is to hotplug in the guest the amount of CPUs that the user specified on the command line and not be limited by the amount of physical CPUs.
Quoted 6 lines
Quoted 1 line
Signed-off-by Konrad Rzeszutek Wilk <[email protected]>Given the cost/benefits of this, I'm inclined to say this should wait until the 4.4 window opens. Having more guest vcpus than host pcpus is not an urgent need, and there is a chance (however small) of this exposing some other kind of bug.
Not disputing this.
I imagine the desire is to add vcpus to a guest after migrating to a larger host. If so then this should be in the commit log because you are right that as the commit message currently stands the immediate response is "why on earth..."
Quoted 6 lines
Quoted 2 lines
My only other concern would be that the existing code has a buffer overrun under these circumstances. I've not checked this either.
No over-runs, but this is a regression compared to Xend.
From your updated description it seems like if you migrated to a larger
host you could indeed plug more VCPUS, up to the limit on that host, is that right?
Quoted 7 lines
Quoted 3 lines
If that's the case then it sounds to me as if the xl behaviour is actually an improvement over xend's, except perhaps for some slightly niche test scenarios.
Well, overcommit comes in mind. Say you migrate to a 4PCPU box and you have 12VCPUs, then you decide to go down to 4, then back to 16 before migrating it to some other box. Can't do.
You could do it *after* the migration back to a 16 way box n stead of before though, which is most likely when you would actually want to do it...
Ian.
Quoted 46 lines · Ian Campbell
Quoted 45 lines · Konrad Rzeszutek Wilk
Quoted 43 lines · Ian Campbell
Quoted 30 lines · Konrad Rzeszutek Wilk
Quoted 29 lines · Ian Campbell
Quoted 13 lines · George Dunlap
Quoted 11 lines · Konrad Rzeszutek Wilk
The
libxl_cpu_bitmap_alloc(..)function, if provided with a zero value for max CPUs will callxc_get_max_cpus()which will retrieve the number of physical CPUs the host has. This is usually OK if the guest's maxvcpus <= host pcpus. But if the value is different, then the bitmap for VCPUs is limited by the number of CPUs the host has.This is incorrect as what we want is to hotplug in the guest the amount of CPUs that the user specified on the command line and not be limited by the amount of physical CPUs.
Quoted 6 lines
Quoted 1 line
Signed-off-by Konrad Rzeszutek Wilk <[email protected]>Given the cost/benefits of this, I'm inclined to say this should wait until the 4.4 window opens. Having more guest vcpus than host pcpus is not an urgent need, and there is a chance (however small) of this exposing some other kind of bug.
Not disputing this.
I imagine the desire is to add vcpus to a guest after migrating to a larger host. If so then this should be in the commit log because you are right that as the commit message currently stands the immediate response is "why on earth..."
Quoted 6 lines
Quoted 2 lines
My only other concern would be that the existing code has a buffer overrun under these circumstances. I've not checked this either.
No over-runs, but this is a regression compared to Xend.
From your updated description it seems like if you migrated to a larger
host you could indeed plug more VCPUS, up to the limit on that host, is that right?
If that's the case then it sounds to me as if the xl behaviour is actually an improvement over xend's, except perhaps for some slightly niche test scenarios.
Quoted 7 lines
Quoted 3 lines
Well, overcommit comes in mind. Say you migrate to a 4PCPU box and you have 12VCPUs, then you decide to go down to 4, then back to 16 before migrating it to some other box. Can't do.
You could do it *after* the migration back to a 16 way box n stead of before though, which is most likely when you would actually want to do it...
I am kind of lost. Are we arguing for this being a bug or whether there is justification for putting in Xen 4.3?
If you want to delay it to Xen 4.4 that is OK with me - I can carry the patch in my tree and post it then.
Quoted 3 lines
Ian.
Quoted 51 lines · Konrad Rzeszutek Wilk
Quoted 50 lines · Ian Campbell
Quoted 48 lines · Konrad Rzeszutek Wilk
Quoted 36 lines · Ian Campbell
Quoted 34 lines · Konrad Rzeszutek Wilk
Quoted 23 lines · Ian Campbell
Quoted 13 lines · George Dunlap
Quoted 11 lines · Konrad Rzeszutek Wilk
The
libxl_cpu_bitmap_alloc(..)function, if provided with a zero value for max CPUs will callxc_get_max_cpus()which will retrieve the number of physical CPUs the host has. This is usually OK if the guest's maxvcpus <= host pcpus. But if the value is different, then the bitmap for VCPUs is limited by the number of CPUs the host has.This is incorrect as what we want is to hotplug in the guest the amount of CPUs that the user specified on the command line and not be limited by the amount of physical CPUs.
Quoted 6 lines
Quoted 1 line
Signed-off-by Konrad Rzeszutek Wilk <[email protected]>Given the cost/benefits of this, I'm inclined to say this should wait until the 4.4 window opens. Having more guest vcpus than host pcpus is not an urgent need, and there is a chance (however small) of this exposing some other kind of bug.
Not disputing this.
Quoted 8 lines
I imagine the desire is to add vcpus to a guest after migrating to a larger host. If so then this should be in the commit log because you are right that as the commit message currently stands the immediate response is "why on earth..."
My only other concern would be that the existing code has a buffer overrun under these circumstances. I've not checked this either.
No over-runs, but this is a regression compared to Xend.
Quoted 7 lines
Quoted 1 line
From your updated description it seems like if you migrated to a larger
host you could indeed plug more VCPUS, up to the limit on that host, is that right?
If that's the case then it sounds to me as if the xl behaviour is actually an improvement over xend's, except perhaps for some slightly niche test scenarios.
Well, overcommit comes in mind. Say you migrate to a 4PCPU box and you have 12VCPUs, then you decide to go down to 4, then back to 16 before migrating it to some other box. Can't do.
Quoted 6 lines
Quoted 3 lines
You could do it *after* the migration back to a 16 way box n stead of before though, which is most likely when you would actually want to do it...
I am kind of lost. Are we arguing for this being a bug or whether there is justification for putting in Xen 4.3?
The former needs deciding before the latter.
I'm not convinced that the current xl behaviour of refusing to overcommit VCPUs on a host isn't the right one for the majority of use cases. Obviously the silently refusing bit is a bug which should be fixed.
I don't buy that this is a "regression compared to Xend". It's certainly a difference from how xend behaved but it seems on the whole to be a positive one (i.e. xend was wrong).
Can you explain the use case for wanting to do this? I don't think the migration one you give above is very convincing since a normal user wouldn't want to overcommit on the source host, they would want to migrate and then increase the number of vcpus, without ever overcommitting, and therefore without the terrible performance of overcommitting.
A compromise might be a non-default option to allow users to force overcommit but to otherwise deny it.
Ian.
Quoted 13 lines
Quoted 10 lines
Quoted 7 lines
Quoted 3 lines
Well, overcommit comes in mind. Say you migrate to a 4PCPU box and you have 12VCPUs, then you decide to go down to 4, then back to 16 before migrating it to some other box. Can't do.
You could do it *after* the migration back to a 16 way box n stead of before though, which is most likely when you would actually want to do it...
I am kind of lost. Are we arguing for this being a bug or whether there is justification for putting in Xen 4.3?
The former needs deciding before the latter.
Quoted 8 lines
I'm not convinced that the current xl behaviour of refusing to overcommit VCPUs on a host isn't the right one for the majority of use cases. Obviously the silently refusing bit is a bug which should be fixed.
I don't buy that this is a "regression compared to Xend". It's certainly a difference from how xend behaved but it seems on the whole to be a positive one (i.e. xend was wrong).
CC-ing Juergen here as he added this in.
Quoted 7 lines
Can you explain the use case for wanting to do this? I don't think the migration one you give above is very convincing since a normal user wouldn't want to overcommit on the source host, they would want to migrate and then increase the number of vcpus, without ever overcommitting, and therefore without the terrible performance of overcommitting.
It seems clear to me if a user wants to over-commit, then we should allow the user to do so. If we provide a command to set X vCPUs it should work as described - without the extra checks (unless that is enabled by some other option).
That is currently not the case and the documentation does not mention why or why the choice to limit the amount was implemented - and looking back at the changeset that introduced this: c/s 22918 (CC Juergen here) it looks as the original behavior was to do it as Xend does.
If we want a behavior where we don't allow to overcommit (which sounds bogus - that is part allure of virtualization) then we should also tweak other 'xl' commands. For example you can do a similar scenario in which you launch say sixteen 1VCPU guests and you get the same performance characteristics as if you launch one guest with 16VCPUs on a 4PCPU machine. Or perhaps worst.
Or say you launch a guest with sixteen VCPUs without trouble right now, but then if you decrease to one and then want to go back to sixteen it refuses to do so (without telling you why).
But if tells you why (say by adding a warning that says "You don't want to overcommit") then the user will ask two questions (I would :-)):
a) Why didn't xl create complain then initially?
b) Why can't I overcommit? I want to and this 'xl' is refusing me to do it!
c) It worked with xend!
Quoted 3 lines
A compromise might be a non-default option to allow users to force overcommit but to otherwise deny it.
That can be done. But I would turn it around. Allow it by default and provide another option (perhaps a default global in /etc/xen/xl.conf) that will disable overcommiting as much as possible.
And also why don't we want overcommiting?
Quoted 3 lines
Ian.
Quoted 36 lines · Konrad Rzeszutek Wilk
Quoted 13 lines
Quoted 10 lines
Quoted 7 lines
Quoted 3 lines
Well, overcommit comes in mind. Say you migrate to a 4PCPU box and you have 12VCPUs, then you decide to go down to 4, then back to 16 before migrating it to some other box. Can't do.
You could do it *after* the migration back to a 16 way box n stead of before though, which is most likely when you would actually want to do it...
I am kind of lost. Are we arguing for this being a bug or whether there is justification for putting in Xen 4.3?
The former needs deciding before the latter.
Quoted 8 lines
I'm not convinced that the current xl behaviour of refusing to overcommit VCPUs on a host isn't the right one for the majority of use cases. Obviously the silently refusing bit is a bug which should be fixed.
I don't buy that this is a "regression compared to Xend". It's certainly a difference from how xend behaved but it seems on the whole to be a positive one (i.e. xend was wrong).
CC-ing Juergen here as he added this in.
Quoted 7 lines
Can you explain the use case for wanting to do this? I don't think the migration one you give above is very convincing since a normal user wouldn't want to overcommit on the source host, they would want to migrate and then increase the number of vcpus, without ever overcommitting, and therefore without the terrible performance of overcommitting.
It seems clear to me if a user wants to over-commit, then we should allow the user to do so. If we provide a command to set X vCPUs it should work as described - without the extra checks (unless that is enabled by some other option).
Quoted 4 lines
That is currently not the case and the documentation does not mention why or why the choice to limit the amount was implemented - and looking back at the changeset that introduced this: c/s 22918 (CC Juergen here) it looks as the original behavior was to do it as Xend does.
I'm afraid that doesn't make it correct.
Quoted 2 lines
If we want a behavior where we don't allow to overcommit (which sounds bogus - that is part allure of virtualization)
Note that I'm not against overcommitting the PCPUS on the host in general, just against the idea that giving a single VM more VCPUs than PCPUs. Giving a single VM more VCPUs than the host has PCPUs has only negative effects.
Quoted 5 lines
then we should also
tweak other 'xl' commands. For example you can do a similar scenario in which you launch say sixteen 1VCPU guests and you get the same performance characteristics as if you launch one guest with 16VCPUs on a 4PCPU machine. Or perhaps worst.
The latter case is much worse and that's the only one I'm arguing we should avoid.
In the 16VMsx1VCPUs sharing 4PCPUs case those 16 VCPUs can be idling etc and so you can quite possibly pack them onto 4 PCPUs. Or if they are busy then they get timesliced in a fair way etc. All good and proper and yes this is part of the allure of virtualisation.
If you have 1VMx16VCPUs sharing 4CPUs then this is not the same situation. That guest can only ever see 4VCPUs running simultaneously, so at most it can only ever use 400% of a CPU, all the other 12VCPUs do is divide that 400% more thinly, cause scheduling contention, locking overhead (especially internally to the guest) and other negative impacts. The VM is contending with itself for no benefit.
If you have a scenario where running a 16VCPU VM on a 4PCPU system is beneficial to the guest (or perhaps the host) then please tell us what it is, because that would indeed be a useful justification for allowing this behaviour by default.
The only scenario which has been mentioned so far in this thread is deliberately provoking the kinds of bad behaviours I've mentioned above, for testing and development purposes (i.e. exposing guest locking contention), which is the main reason I'm willing to consider an override to allow this, but this isn't an argument for allowing it by default.
Quoted 3 lines
Or say you launch a guest with sixteen VCPUs without trouble right now, but then if you decrease to one and then want to go back to sixteen it refuses to do so (without telling you why).
I think it is a bug that xl lets you silently create a 16VCPU guest on a 4PCPU host without at least warning you or better requiring you to say "yes I mean it".
Quoted 5 lines
But if tells you why (say by adding a warning that says "You don't want to overcommit") then the user will ask two questions (I would :-)):
a) Why didn't xl create complain then initially?
b) Why can't I overcommit? I want to and this 'xl' is refusing me to do it!
c) It worked with xend!
Please stop making argument c). The purpose of xl's xm compatibility is to offer an upgrade path, it is not to copy every possible misbehaviour which xend had.
Yes, this is your mother's classic "if xend jumped off a bridge" argument.
Quoted 8 lines
Quoted 2 lines
A compromise might be a non-default option to allow users to force overcommit but to otherwise deny it.
That can be done. But I would turn it around. Allow it by default and provide another option (perhaps a default global in
/etc/xen/xl.conf) that will disable overcommiting as much as possible.And also why don't we want overcommiting?
Because the sort of overcommit we are talking about here has only negative effects on the guest.
Ian.
Quoted 25 lines · Konrad Rzeszutek Wilk
Quoted 10 lines
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
Well, overcommit comes in mind. Say you migrate to a 4PCPU box and you have 12VCPUs, then you decide to go down to 4, then back to 16 before migrating it to some other box. Can't do.
You could do it *after* the migration back to a 16 way box n stead of before though, which is most likely when you would actually want to do it...
I am kind of lost. Are we arguing for this being a bug or whether there is justification for putting in Xen 4.3?
The former needs deciding before the latter.
Quoted 8 lines
I'm not convinced that the current xl behaviour of refusing to overcommit VCPUs on a host isn't the right one for the majority of use cases. Obviously the silently refusing bit is a bug which should be fixed.
I don't buy that this is a "regression compared to Xend". It's certainly a difference from how xend behaved but it seems on the whole to be a positive one (i.e. xend was wrong).
CC-ing Juergen here as he added this in.
Quoted 6 lines
Can you explain the use case for wanting to do this? I don't think the migration one you give above is very convincing since a normal user wouldn't want to overcommit on the source host, they would want to migrate and then increase the number of vcpus, without ever overcommitting, and therefore without the terrible performance of overcommitting.
Quoted 4 lines
It seems clear to me if a user wants to over-commit, then we should allow the user to do so. If we provide a command to set X vCPUs it should work as described - without the extra checks (unless that is enabled by some other option).
I tend to agree with this; I hate it when some piece of software tells me, "I'm not going to let you do this for your own good." When that happens to me, it's almost always the case that I *do* have a good reason for doing so that the author of the software didn't think about. Our users are sysadmins; we should allow them to shoot themselves in the foot if they want to.
So I think the right thing to do long-term is to make it possible to do in xl. Having a "seatbelt" restriction by default that can be overridden would be OK with me, but I think a warning message when vcpus > pcpus would suffice. (We do occasionally see people show up who don't realize that in the vast majority of cases, vcpus > pcpus is a stupid way to run things.)
Having a "seatbelt" which is off by default is pretty useless; as anyone that knows to turn it on almost surely doesn't need it.
My argument was that for the 4.3 release, the potential use cases of vcpus > pcpus are basically of 0 value as far as I'm concerned; it's not worth introducing a risk of regression, no matter how small, in order to allow the "vcpu overcommit" scenario to work.
But as IanJ says:
1. You can already do "vcpu overcommit" by setting things in the config file
2. This fixes a bug when you are running vcpu-set
Fixing a bug *is* worth the tiny amount of risk this represents; so probably is making the interface consistent.
-George
Quoted 53 lines · George Dunlap
Quoted 25 lines · Konrad Rzeszutek Wilk
Quoted 10 lines
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
Well, overcommit comes in mind. Say you migrate to a 4PCPU box and you have 12VCPUs, then you decide to go down to 4, then back to 16 before migrating it to some other box. Can't do.
You could do it *after* the migration back to a 16 way box n stead of before though, which is most likely when you would actually want to do it...
I am kind of lost. Are we arguing for this being a bug or whether there is justification for putting in Xen 4.3?
The former needs deciding before the latter.
Quoted 8 lines
I'm not convinced that the current xl behaviour of refusing to overcommit VCPUs on a host isn't the right one for the majority of use cases. Obviously the silently refusing bit is a bug which should be fixed.
I don't buy that this is a "regression compared to Xend". It's certainly a difference from how xend behaved but it seems on the whole to be a positive one (i.e. xend was wrong).
CC-ing Juergen here as he added this in.
Quoted 6 lines
Can you explain the use case for wanting to do this? I don't think the migration one you give above is very convincing since a normal user wouldn't want to overcommit on the source host, they would want to migrate and then increase the number of vcpus, without ever overcommitting, and therefore without the terrible performance of overcommitting.
Quoted 4 lines
It seems clear to me if a user wants to over-commit, then we should allow the user to do so. If we provide a command to set X vCPUs it should work as described - without the extra checks (unless that is enabled by some other option).
I tend to agree with this; I hate it when some piece of software tells me, "I'm not going to let you do this for your own good." When that happens to me, it's almost always the case that I *do* have a good reason for doing so that the author of the software didn't think about. Our users are sysadmins; we should allow them to shoot themselves in the foot if they want to.
So I think the right thing to do long-term is to make it possible to do in xl. Having a "seatbelt" restriction by default that can be overridden would be OK with me, but I think a warning message when vcpus > pcpus would suffice. (We do occasionally see people show up who don't realize that in the vast majority of cases, vcpus > pcpus is a stupid way to run things.)
Having a "seatbelt" which is off by default is pretty useless; as anyone that knows to turn it on almost surely doesn't need it.
My argument was that for the 4.3 release, the potential use cases of vcpus > pcpus are basically of 0 value as far as I'm concerned; it's not worth introducing a risk of regression, no matter how small, in order to allow the "vcpu overcommit" scenario to work.
Quoted 6 lines
But as IanJ says:
1. You can already do "vcpu overcommit" by setting things in the config file
2. This fixes a bug when you are running vcpu-setFixing a bug *is* worth the tiny amount of risk this represents; so probably is making the interface consistent.
OK, I am bit lost here. You and Ian seem to have different viewpoints of what is the right way, or perhaps more likely is that I am misreading it. The interface consistent in my reading sounds like you are agreeing that the "I am not going to let you do this for your own good" is silly.
I think what you and Ian would like me to do:
For Xen 4.3:
- Add a warning to the vcpu-set that the user might be doing something silly if they are trying to set 'xl vcpu-set vcpus' where vcpus > pcpus. Something along: "You are overcommiting. You have x PCPUs and you want y vCPUS. Aborting - if you would like to do this please use --no-seatbelt'.
- If user is trying to do vcpu-set on more than pcpus abort the request unless the '--no-seatbelt' option is provided.
For Xen 4.4:
- Remove those two things above and make vcpu-set work irregardless of the pcpus value? No that does not sound right.
<goes off to get some coffee>
Quoted 57 lines · Konrad Rzeszutek Wilk
Quoted 56 lines · George Dunlap
Quoted 25 lines · Konrad Rzeszutek Wilk
Quoted 10 lines
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
Well, overcommit comes in mind. Say you migrate to a 4PCPU box and you have 12VCPUs, then you decide to go down to 4, then back to 16 before migrating it to some other box. Can't do.
You could do it *after* the migration back to a 16 way box n stead of before though, which is most likely when you would actually want to do it...
I am kind of lost. Are we arguing for this being a bug or whether there is justification for putting in Xen 4.3?
The former needs deciding before the latter.
Quoted 8 lines
I'm not convinced that the current xl behaviour of refusing to overcommit VCPUs on a host isn't the right one for the majority of use cases. Obviously the silently refusing bit is a bug which should be fixed.
I don't buy that this is a "regression compared to Xend". It's certainly a difference from how xend behaved but it seems on the whole to be a positive one (i.e. xend was wrong).
CC-ing Juergen here as he added this in.
Quoted 6 lines
Can you explain the use case for wanting to do this? I don't think the migration one you give above is very convincing since a normal user wouldn't want to overcommit on the source host, they would want to migrate and then increase the number of vcpus, without ever overcommitting, and therefore without the terrible performance of overcommitting.
Quoted 4 lines
It seems clear to me if a user wants to over-commit, then we should allow the user to do so. If we provide a command to set X vCPUs it should work as described - without the extra checks (unless that is enabled by some other option).
I tend to agree with this; I hate it when some piece of software tells me, "I'm not going to let you do this for your own good." When that happens to me, it's almost always the case that I *do* have a good reason for doing so that the author of the software didn't think about. Our users are sysadmins; we should allow them to shoot themselves in the foot if they want to.
So I think the right thing to do long-term is to make it possible to do in xl. Having a "seatbelt" restriction by default that can be overridden would be OK with me, but I think a warning message when vcpus > pcpus would suffice. (We do occasionally see people show up who don't realize that in the vast majority of cases, vcpus > pcpus is a stupid way to run things.)
Having a "seatbelt" which is off by default is pretty useless; as anyone that knows to turn it on almost surely doesn't need it.
My argument was that for the 4.3 release, the potential use cases of vcpus > pcpus are basically of 0 value as far as I'm concerned; it's not worth introducing a risk of regression, no matter how small, in order to allow the "vcpu overcommit" scenario to work.
But as IanJ says:
1. You can already do "vcpu overcommit" by setting things in the config file
2. This fixes a bug when you are running vcpu-set
Quoted 6 lines
Quoted 2 lines
Fixing a bug *is* worth the tiny amount of risk this represents; so probably is making the interface consistent.
OK, I am bit lost here. You and Ian seem to have different viewpoints of what is the right way, or perhaps more likely is that I am misreading it. The interface consistent in my reading sounds like you are agreeing that the "I am not going to let you do this for your own good" is silly.
Yes, I think IanC and I are disagreeing about ideal xl behavior. We both agree that "vcpus > pcpus" is a bad configuration. I think ideally we should support it (because administrators should be allowed to shoot themselves in the foot) and Ian seems to be making the case that we shouldn't support it.
But I think IanC and I also both agree that, "This patch enables vcpus > pcpus" is not a good argument to accept any patch at this point in the release cycle.
Quoted 11 lines
I think what you and Ian would like me to do:
For Xen 4.3:
- Add a warning to the vcpu-set that the user might be doing something silly if they are trying to set 'xl vcpu-set vcpus' where vcpus > pcpus. Something along: "You are overcommiting. You have x PCPUs and you want y vCPUS. Aborting - if you would like to do this please use --no-seatbelt'.
- If user is trying to do vcpu-set on more than pcpus abort the request unless the '--no-seatbelt' option is provided.
Quoted 3 lines
For Xen 4.4:
- Remove those two things above and make vcpu-set work irregardless of the pcpus value? No that does not sound right.
I think for 4.3, if this patch is the quickest way to get rid of the bug of xl crashing, we should just accept it.
Then for 4.4, we can discuss warnings or "seatbelt" options.
-George
George Dunlap writes ("Re: [Xen-devel] [PATCH] libxl: Make 'xl vcpu-set' work properly on overcommited hosts."):
Quoted 5 lines
Yes, I think IanC and I are disagreeing about ideal xl behavior. We both agree that "vcpus > pcpus" is a bad configuration. I think ideally we should support it (because administrators should be allowed to shoot themselves in the foot) and Ian seems to be making the case that we shouldn't support it.
I'm with George on this one.
Quoted 11 lines
Quoted 11 lines
I think what you and Ian would like me to do:
For Xen 4.3:
- Add a warning to the vcpu-set that the user might be doing something silly if they are trying to set 'xl vcpu-set vcpus' where vcpus > pcpus. Something along: "You are overcommiting. You have x PCPUs and you want y vCPUS. Aborting - if you would like to do this please use --no-seatbelt'.
- If user is trying to do vcpu-set on more than pcpus abort the request unless the '--no-seatbelt' option is provided.
Quoted 6 lines
Quoted 3 lines
For Xen 4.4:
- Remove those two things above and make vcpu-set work irregardless of the pcpus value? No that does not sound right.I think for 4.3, if this patch is the quickest way to get rid of the bug of xl crashing, we should just accept it.
Yes, absolutely. I think the patch should go into 4.3.
Ian.
Quoted 18 lines · Konrad Rzeszutek Wilk
Quoted 18 lines
Quoted 10 lines
Quoted 7 lines
Quoted 3 lines
Well, overcommit comes in mind. Say you migrate to a 4PCPU box and you have 12VCPUs, then you decide to go down to 4, then back to 16 before migrating it to some other box. Can't do.
You could do it *after* the migration back to a 16 way box n stead of before though, which is most likely when you would actually want to do it...
I am kind of lost. Are we arguing for this being a bug or whether there is justification for putting in Xen 4.3?
The former needs deciding before the latter.
I'm not convinced that the current xl behaviour of refusing to overcommit VCPUs on a host isn't the right one for the majority of use cases. Obviously the silently refusing bit is a bug which should be fixed.
Quoted 5 lines
Quoted 3 lines
I don't buy that this is a "regression compared to Xend". It's certainly a difference from how xend behaved but it seems on the whole to be a positive one (i.e. xend was wrong).
CC-ing Juergen here as he added this in.
I surely didn't mean to disable overcommitting. So I'm fine with your patch to do the cpumap allocation with maxvcpus.
Juergen
Signature · 5 lines
Juergen Gross Principal Developer Operating Systems PBG PDG ES&S SWE OS6 Telephone: +49 (0) 89 3222 2967 Fujitsu Technology Solutions e-mail: [email protected] Domagkstr. 28 Internet: ts.fujitsu.com D-80807 Muenchen Company details: ts.fujitsu.com/imprint.html
Ian Jackson
Acked-byKonrad Rzeszutek Wilk writes ("Re: [Xen-devel] [PATCH] libxl: Make 'xl vcpu-set' work properly on overcommited hosts."):
Quoted 7 lines
Note that all of the libxl_cpu_bitmap_[test|set] silently ignore any test or sets above its size:
if (bit >= bitmap->size * 8) return 0;so we were never notified off this bug.
I hadn't spotted that. Arguably "return 0" should be "abort()".
Quoted 1 line
Signed-off-by Konrad Rzeszutek Wilk <[email protected]>
Thanks,
Ian.
Quoted 10 lines · Ian Jackson
Konrad Rzeszutek Wilk writes ("Re: [Xen-devel] [PATCH] libxl: Make 'xl vcpu-set' work properly on overcommited hosts."):
Quoted 7 lines
Note that all of the libxl_cpu_bitmap_[test|set] silently ignore any test or sets above its size:
if (bit >= bitmap->size * 8) return 0;so we were never notified off this bug.
I hadn't spotted that. Arguably "return 0" should be "
abort()".
I am really hesistant about doing this in Xen 4.3. There are a bunch of places where this is used and I fear this will cause tons of asserts and more bugs to crep up which will make George MAD!!!
I can certainly prep a patch for Xen 4.4 and slowly fix the fallout.
Quoted 4 lines
Quoted 2 lines
Signed-off-by Konrad Rzeszutek Wilk <[email protected]>Acked-by Ian Jackson <[email protected]>
Is that for adding an assert or to the patch?
Quoted 9 lines
Thanks,
Ian._______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Konrad Rzeszutek Wilk writes ("Re: [Xen-devel] [PATCH] libxl: Make 'xl vcpu-set' work properly on overcommited hosts."):
Quoted 4 lines · Ian Jackson
Quoted 1 line
Acked-by Ian Jackson <[email protected]>Is that for adding an assert or to the patch?
The patch. Naturally I'm not acking my own assert (which is a bad idea at this stage for all the reasons you give).
Ian.
George Dunlap writes ("Re: [Xen-devel] [PATCH] libxl: Make 'xl vcpu-set' work properly on overcommited hosts."):
Quoted 4 lines
Given the cost/benefits of this, I'm inclined to say this should wait until the 4.4 window opens. Having more guest vcpus than host pcpus is not an urgent need, and there is a chance (however small) of this exposing some other kind of bug.
I would say that this is a bugfix which should go into 4.3. This bug isn't limiting vcpus to <= pcpus because you can create the guest with more. AIUI what happens right now is that if you try to vcpu-set with vcpus>pcups xl will crash (or do something else undefined). This is only not a security hole because xl isn't exposed to untrusted users.
Ian.