Skip to contentSkip to conversation

Fix xmexamples about cpus

PATCH In review Masaki Kanno 3 participants 7 messages May 9, 2008 – May 12, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix xmexamples about cpus

Hi,

This patch fixes xmexamples about example of cpus.

Best regards,
Kan

tools/examples/xmexample.hvm +2 -1
diff -r 810d8c3ac992 tools/examples/xmexample.hvm
@@ -56,7 +56,8 @@ name = "ExampleHVMDomain"
 # List of which CPUS this domain is allowed to use, default Xen picks
 #cpus = ""         # leave to Xen to pick
 #cpus = "0"        # all vcpus run on CPU0
-#cpus = "0-3,5,^1" # run on cpus 0,2,3,5
+#cpus = "0-3,5,^1" # all vcpus run on cpus 0,2,3,5
+#cpus = ["2", "3"] # VCPU0 runs on CPU2, VCPU1 runs on CPU3
 
 # Optionally define mac and/or bridge for the network interfaces.
 # Random MACs are assigned if not given.
tools/examples/xmexample.vti +2 -1
diff -r 810d8c3ac992 tools/examples/xmexample.vti
@@ -33,7 +33,8 @@ name = "ExampleVTIDomain"
 # List of which CPUS this domain is allowed to use, default Xen picks
 #cpus = ""         # leave to Xen to pick
 #cpus = "0"        # all vcpus run on CPU0
-#cpus = "0-3,5,^1" # run on cpus 0,2,3,5
+#cpus = "0-3,5,^1" # all vcpus run on cpus 0,2,3,5
+#cpus = ["2", "3"] # VCPU0 runs on CPU2, VCPU1 runs on CPU3
 
 # Log2 of VHPT size, default=23 (8MB), minimum=15 (32KB).
 # In Windows OS, smaller size shows better performance.
tools/examples/xmexample1 +2 -1
diff -r 810d8c3ac992 tools/examples/xmexample1
@@ -33,7 +33,8 @@ name = "ExampleDomain"
 # List of which CPUS this domain is allowed to use, default Xen picks
 #cpus = ""         # leave to Xen to pick
 #cpus = "0"        # all vcpus run on CPU0
-#cpus = "0-3,5,^1" # run on cpus 0,2,3,5
+#cpus = "0-3,5,^1" # all vcpus run on cpus 0,2,3,5
+#cpus = ["2", "3"] # VCPU0 runs on CPU2, VCPU1 runs on CPU3
 
 # Number of Virtual CPUS to use, default is 1
 #vcpus = 1
tools/examples/xmexample2 +2 -1
diff -r 810d8c3ac992 tools/examples/xmexample2
@@ -62,7 +62,8 @@ name = "VM%d" % vmid
 # List of which CPUS this domain is allowed to use, default Xen picks
 #cpus = ""         # leave to Xen to pick
 #cpus = "0"        # all vcpus run on CPU0
-#cpus = "0-3,5,^1" # run on cpus 0,2,3,5
+#cpus = "0-3,5,^1" # all vcpus run on cpus 0,2,3,5
+#cpus = ["2", "3"] # VCPU0 runs on CPU2, VCPU1 runs on CPU3
 #cpus = "%s" % vmid # set based on vmid (mod number of CPUs)
 
 # Number of Virtual CPUS to use, default is 1
tools/examples/xmexample3 +2 -1
diff -r 810d8c3ac992 tools/examples/xmexample3
@@ -62,7 +62,8 @@ name = "VM%d" % vmid
 # List of which CPUS this domain is allowed to use, default Xen picks
 #cpus = ""         # leave to Xen to pick
 #cpus = "0"        # all vcpus run on CPU0
-#cpus = "0-3,5,^1" # run on cpus 0,2,3,5
+#cpus = "0-3,5,^1" # all vcpus run on cpus 0,2,3,5
+#cpus = ["2", "3"] # VCPU0 runs on CPU2, VCPU1 runs on CPU3
 cpus = "%s" % vmid # set based on vmid (mod number of CPUs)
 
 #----------------------------------------------------------------------------

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

#1 lore raw
Quoted 8 lines · Masaki Kanno

Hi,

This patch fixes xmexamples about example of cpus.

Best regards,
Kan

Hi Kanno,
We have tried cpus="^1" in the past. For we want to drop only CPU1
no matter how many CPUs are on the machine. The result shows: CPU1 can still be used by HVM and all the VCPU's affinity are "any cpu".
So, do you think this setting is available? Or do we need some more
comments on this? Thanks!

Thanks,
Zhang Jingke

#2 lore raw
Quoted 10 lines · Jingke
Quoted 8 lines · Masaki Kanno

Hi,

This patch fixes xmexamples about example of cpus.

Best regards,
Kan

Quoted 6 lines

Hi Kanno,
We have tried cpus="^1" in the past. For we want to drop only CPU1
no matter how many CPUs are on the machine. The result shows: CPU1 can still be used by HVM and all the VCPU's affinity are "any cpu".
So, do you think this setting is available? Or do we need some more
comments on this? Thanks!

Hi Zhang,

I think that a purpose to set "cpus" is to confine CPUs which VCPUs run to a CPU or some CPUs. If there are many CPUs on a machine, I think that we should avoid the setting for performance.

Best regards,
Kan

#3 lore raw
Quoted 2 lines
Quoted 2 lines

Hi Kanno,
We have tried cpus="^1" in the past. For we want to drop only

CPU1

Quoted 1 line
Quoted 1 line

no matter how many CPUs are on the machine. The result shows: CPU1

can

Quoted 8 lines
Quoted 2 lines

still be used by HVM and all the VCPU's affinity are "any cpu".
So, do you think this setting is available? Or do we need some

more

Quoted 1 line

comments on this? Thanks!

Hi Zhang,

I think that a purpose to set "cpus" is to confine CPUs which VCPUs

run

Quoted 2 lines

to a CPU or some CPUs. If there are many CPUs on a machine, I think that we should avoid the setting for performance.

The "^1" syntax is quite useful if you're trying to reserve a CPU for use by another domain e.g. domain0, but don't want to otherwise restrict the guest.

We need to be able to deal with setting the affinity mask for a domain (that is replicated to all VCPUs) as for individual VCPUs. I assume your patch doesn't change the behaviour of the former?

BTW, it would also be nice to be able to specify CPUs by node.socket.core.thread as opposed to just enumerated CPU number. It should be possible to omit unused levels of the hierarchy, e.g. "0.3" could be used to refer to the 4th core of the first socket on a dual socket quad core machine.

If you're looking for further improvements in this area, enable CPU groups to be defined and then allow domains/VCPUs to be assigned to a group.

Thanks,
Ian

Quoted 10 lines

Best regards,
Kan

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

#4 lore raw

Hi Ian,

Quoted 9 lines · Ian Pratt
Quoted 9 lines
Quoted 6 lines

Hi Kanno,
We have tried cpus="^1" in the past. For we want to drop only CPU1
no matter how many CPUs are on the machine. The result shows: CPU1 can still be used by HVM and all the VCPU's affinity are "any cpu".
So, do you think this setting is available? Or do we need some more
comments on this? Thanks!

Hi Zhang,

Quoted 7 lines
Quoted 3 lines

I think that a purpose to set "cpus" is to confine CPUs which VCPUs run to a CPU or some CPUs. If there are many CPUs on a machine, I think that we should avoid the setting for performance.

The "^1" syntax is quite useful if you're trying to reserve a CPU for use by another domain e.g. domain0, but don't want to otherwise restrict the guest.

"cpus" is parsed from left side, and the "^1" negates the values which was already parsed. So "0-3,^1,1" and "0-3" are equivalent. The parsing of "cpus" cannot handle "negation" from a beginning because there is not a value to negate.

But, I'm thinking that I want to implement Zhang's demand since I get your comment. So I have idea as follows.

cpus = "0:,^1"

The "0:" means "0 or later". How about it?

Quoted 3 lines

We need to be able to deal with setting the affinity mask for a domain (that is replicated to all VCPUs) as for individual VCPUs. I assume your patch doesn't change the behaviour of the former?

Could you look at the following changest?

http://xenbits.xensource.com/xen-unstable.hg/rev/5c3df1bded82

Quoted 9 lines

BTW, it would also be nice to be able to specify CPUs by node.socket.core.thread as opposed to just enumerated CPU number. It should be possible to omit unused levels of the hierarchy, e.g. "0.3" could be used to refer to the 4th core of the first socket on a dual socket quad core machine.

If you're looking for further improvements in this area, enable CPU groups to be defined and then allow domains/VCPUs to be assigned to a group.

I got interest for your suggestion. Let me think for the time being.

Best regards,
Kan

#5 lore raw
Quoted 26 lines · Masaki Kanno

Hi Ian,

Quoted 9 lines · Ian Pratt
Quoted 9 lines
Quoted 6 lines

Hi Kanno,
We have tried cpus="^1" in the past. For we want to drop only
CPU1 no matter how many CPUs are on the machine. The result shows:
CPU1 can still be used by HVM and all the VCPU's affinity are "any
cpu". So, do you think this setting is available? Or do we need
some more comments on this? Thanks!

Hi Zhang,

Quoted 7 lines
Quoted 3 lines

I think that a purpose to set "cpus" is to confine CPUs which VCPUs run to a CPU or some CPUs. If there are many CPUs on a machine, I think that we should avoid the setting for performance.

The "^1" syntax is quite useful if you're trying to reserve a CPU for use by another domain e.g. domain0, but don't want to otherwise restrict the guest.

"cpus" is parsed from left side, and the "^1" negates the values which was already parsed. So "0-3,^1,1" and "0-3" are equivalent. The parsing of "cpus" cannot handle "negation" from a beginning because there is not a value to negate.

Quoted 7 lines

But, I'm thinking that I want to implement Zhang's demand since I get your comment. So I have idea as follows.

cpus = "0:,^1"

The "0:" means "0 or later". How about it?

Hi Kanno,
I think a "non-boundary" range may be needed to define the
expression. How about this:
"x-", means from CPUx to the last CPU. For example, "0-" means 0 or
later.

    "-x", means from CPU0 to CPUx, for example, "-3" means "0,1,2,3". 
    Thank you!
Quoted 20 lines
Quoted 4 lines

We need to be able to deal with setting the affinity mask for a domain (that is replicated to all VCPUs) as for individual VCPUs. I assume your patch doesn't change the behaviour of the former?

Could you look at the following changest?

http://xenbits.xensource.com/xen-unstable.hg/rev/5c3df1bded82

Quoted 9 lines

BTW, it would also be nice to be able to specify CPUs by node.socket.core.thread as opposed to just enumerated CPU number. It should be possible to omit unused levels of the hierarchy, e.g. "0.3" could be used to refer to the 4th core of the first socket on a dual socket quad core machine.

If you're looking for further improvements in this area, enable CPU groups to be defined and then allow domains/VCPUs to be assigned to a group.

Quoted 5 lines

I got interest for your suggestion. Let me think for the time being.

Best regards,
Kan

Thanks,
Zhang Jingke

#6 lore raw
Quoted 35 lines · Jingke
Quoted 26 lines · Masaki Kanno

Hi Ian,

Quoted 9 lines · Ian Pratt
Quoted 9 lines
Quoted 6 lines

Hi Kanno,
We have tried cpus="^1" in the past. For we want to drop only
CPU1 no matter how many CPUs are on the machine. The result shows:
CPU1 can still be used by HVM and all the VCPU's affinity are "any
cpu". So, do you think this setting is available? Or do we need
some more comments on this? Thanks!

Hi Zhang,

Quoted 7 lines
Quoted 3 lines

I think that a purpose to set "cpus" is to confine CPUs which VCPUs run to a CPU or some CPUs. If there are many CPUs on a machine, I think that we should avoid the setting for performance.

The "^1" syntax is quite useful if you're trying to reserve a CPU for use by another domain e.g. domain0, but don't want to otherwise restrict the guest.

"cpus" is parsed from left side, and the "^1" negates the values which was already parsed. So "0-3,^1,1" and "0-3" are equivalent. The parsing of "cpus" cannot handle "negation" from a beginning because there is not a value to negate.

Quoted 7 lines

But, I'm thinking that I want to implement Zhang's demand since I get your comment. So I have idea as follows.

cpus = "0:,^1"

The "0:" means "0 or later". How about it?

Quoted 7 lines

Hi Kanno,
I think a "non-boundary" range may be needed to define the
expression. How about this:
"x-", means from CPUx to the last CPU. For example, "0-" means 0 or
later.
"-x", means from CPU0 to CPUx, for example, "-3" means "0,1,2,3". Thank you!

Hi Zhang,

Sounds good. I will make a patch with your idea.

Best regards,
Kan

Quoted 34 lines
Quoted 19 lines
Quoted 3 lines

We need to be able to deal with setting the affinity mask for a domain (that is replicated to all VCPUs) as for individual VCPUs. I assume your patch doesn't change the behaviour of the former?

Could you look at the following changest?

http://xenbits.xensource.com/xen-unstable.hg/rev/5c3df1bded82

Quoted 9 lines

BTW, it would also be nice to be able to specify CPUs by node.socket.core.thread as opposed to just enumerated CPU number. It should be possible to omit unused levels of the hierarchy, e.g. "0.3" could be used to refer to the 4th core of the first socket on a dual socket quad core machine.

If you're looking for further improvements in this area, enable CPU groups to be defined and then allow domains/VCPUs to be assigned to a group.

Quoted 5 lines

I got interest for your suggestion. Let me think for the time being.

Best regards,
Kan

Thanks,
Zhang Jingke

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