From: Michael Palmeter Subject: Re: Xen credit scheduler question Date: Thu, 15 Nov 2012 11:03:56 -0800 (PST) Message-ID: <27449f60-0433-4e5f-b1fb-06914b84c6f1@default> References: <50A53479.5050901@eu.citrix.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="__1353006237677169871abhmt114.oracle.com" Return-path: In-Reply-To: <50A53479.5050901@eu.citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: George Dunlap Cc: Ashok Aletty , Dario Faggioli , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org --__1353006237677169871abhmt114.oracle.com Content-Type: multipart/alternative; boundary="__1353006237677169872abhmt114.oracle.com" --__1353006237677169872abhmt114.oracle.com Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Thank you for your answer, George. =A0 The origin of my question is more of a business concern than a technical on= e.=A0 Many software products are licensed based on a cost per processor cor= e.=A0 It is desirable to sometimes allow customers to pay a fraction of sof= tware license costs in exchange for running that software using only a comm= ensurate fraction of available compute power (capacity sub-licensing).=A0 I= f the cap is a means of making a vCPU more-or-less deterministic (in terms = of its effective computational capacity) then that would be useful as a pro= grammatic means of enabling capacity sub-licensing.=A0 My example below was= based on a case where I have a customer that would like to use 'cap' to co= nstrain their single vCPU VM to only =BD of a core worth of compute capacit= y (logically 1/32 of the compute power) in exchange for only paying 1/32 of= the license cost for the physical server. =A0 Below you answered: =A0 "You can use 'cap' to make the VM in question get 50% of logical vcpu time,= which on an idle system will give it 0.5 of the capacity of a physical cor= e (if we don't consider Intel's Turbo Boost technology).=A0 But if the syst= em becomes busy, it will get less than 0.5 of the processing capacity of a = physical core." =A0 Are you saying that cap would be able to CONSTRAIN a vCPU to an effective c= ompute capacity equal to 50% of a physical core, but it does not GUARANTEE = effective compute capacity equal to 50% of a physical core?=20 =A0 Can you offer any guidance regarding real-world scheduler overhead (when ca= p>0 is used) and precision (how variable is actual compute power for a vCPU= with a cap of 100%, for example)? =A0 - Mike HYPERLINK "http://www.oracle.com/" \nOracle Michael Palmeter | Sr. Director of Product Management, Oracle Exalogic Elas= tic Cloud Phone: HYPERLINK "tel:+14153736497"+14153736497 | Mobile: HYPERLINK "tel:+1= 4156949573"+14156949573 | VOIP: HYPERLINK "tel:+14154027422"+14154027422=20 Oracle Exalogic Development 200 Oracle Parkway | Redwood Shores, California 94065=20 HYPERLINK "http://www.oracle.com/commitment" \nGreen Oracle Oracle is committed to developing practices and products that help protect = the environment =A0 HYPERLINK "http://www.oracle.com/pls/ebn/swf_viewer.load?p_shows_id=3D12641= 667&p_referred=3D0&p_width=3D1000&p_height=3D675"Watch the Exalogic 5-minut= e Demo at http://www.oracle.com/pls/ebn/swf_viewer.load?p_shows_id=3D126416= 67 =A0 From: George Dunlap [mailto:george.dunlap@eu.citrix.com]=20 Sent: November 15, 2012 10:29 AM To: Michael Palmeter Cc: Dario Faggioli; xen-devel@lists.xen.org Subject: Re: [Xen-devel] Xen credit scheduler question =A0 On 15/11/12 15:43, Michael Palmeter wrote: Hi all (and Mr. Dunlap in particular), Haha -- please don't call me "Mr"; I prefer "George", but if you want a tit= le, use "Dr" (since I have=A0 PhD). :-) Example scenario: =A0 Server hardware: 2 sockets, 8-cores per socket, 2 hardware threads per core= (total of 32 hardware threads) Test VM: a single virtual machine with a single vCPU, weight=3D256 and cap= =3D100% =A0 In this scenario, from what I understand, I should be able to load the Test= VM with traffic to a maximum of approximately 1/32 of the aggregate comput= e capacity of the server.=A0 The total CPU utilization of the server hardwa= re should be approximately 3.4%, plus the overhead of dom0 (say 1-2).=A0 Th= e credits available to any vCPU capped at 100% should be equal to 1/32 of t= he aggregate compute available for the whole server, correct? I think to really be precise, you should say, "1/32nd of the logical cpu ti= me available", where "logical cpu time" simply means, "time processing on o= ne logical CPU".=A0 At the moment, that is all that either the credit1 or c= redit2 schedulers look at. As I'm sure you're aware, not all "logical cpu time" is equal.=A0 If one th= read of a hyperthread pair is running but the other idle, it will get signi= ficantly higher performance than if the other thread is busy.=A0 How much i= s highly unpredictable, and depends very much on exactly what units are sha= red with the other hyperthread, and the workload running on each unit.=A0 B= ut even when both threads are busy, it should (in theory) be rare for both = threads to get a throughput of 50%; the whole idea of HT is that threads ty= pically get 70-80% of the full performance of the core (so the overall thro= ughput is increased). But if course, while this is particularly extreme in the case of hyperthrea= ds, it's also true on a smaller scale even without that -- cores share cach= es, NUMA nodes share memory bandwidth, and so on.=A0 No attempt is made to = compensate VMs for cache misses or extra memory latency due to sharing eith= er. :-) Put simply, is there a way to constrain a VM with 1 vCPU to consume no more= than 0.5 of a physical core (hyper-threaded) on the server hardware mentio= ned below? Does the cap help in that respect? You can use "cap" to make the VM in question get 50% of logical vcpu time, = which on an idle system will give it 0.5 of the capacity of a physical core= (if we don't consider Intel's Turbo Boost technology).=A0 But if the syste= m becomes busy, it will get less than 0.5 of the processing capacity of a p= hysical core. I have been struggling to understand how the scheduler can deal with the un= certainty that hyperthreading introduces, however.=A0 I know this is an iss= ue that you are tackling in the credit2 scheduler, but I would like to know= what your thoughts are on this problem (if you are able to share).=A0 Any = insight or assistance you could offer would be greatly appreciated.=A0=20 At the moment it does not attempt to; the only thing it does is try not to = schedule two hyperthreads that share a core if there is an idle core.=A0 Bu= t if there are more active vcpus than cores, then some will share; and the = ones that share a core with another vcpu will be charged the same as the on= es that have the core all to themselves. Could you explain why you your question is important to you -- i.e,. what a= re you trying to accomplish?=A0 It sounds a bit like you're more concerned = with accuracy in reporting, and control of resources, rather than fairness,= for instance. =A0-George --__1353006237677169872abhmt114.oracle.com Content-Type: multipart/related; boundary="__1353006237677169873abhmt114.oracle.com" --__1353006237677169873abhmt114.oracle.com Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable

= Thank you for your answer, George.=

 

The origi= n of my question is more of a business concern than a technical one.  = Many software products are licensed based on a cost per processor core.&nbs= p; It is desirable to sometimes allow customers to pay a fraction of softwa= re license costs in exchange for running that software using only a commens= urate fraction of available compute power (capacity sub-licensing).  I= f the cap is a means of making a vCPU more-or-less deterministic (in terms = of its effective computational capacity) then that would be useful as a pro= grammatic means of enabling capacity sub-licensing.  My example below = was based on a case where I have a customer that would like to use ‘c= ap’ to constrain their single vCPU VM to only ½ of a core wort= h of compute capacity (logically 1/32 of the compute power) in exchange for= only paying 1/32 of the license cost for the physical server.

 

Below you a= nswered:

 

“You can use ‘cap’ to make the VM in question g= et 50% of logical vcpu time, which on an idle system will give it 0.5 of th= e capacity of a physical core (if we don't consider Intel's Turbo Boost tec= hnology).  But if the system becomes busy, it will get less than 0.5 o= f the processing capacity of a physical core.”

<= p class=3DMsoNormal> <= /p>

Are you saying that c= ap would be able to CONSTRAIN a vCPU to an effective compute capacity equal= to 50% of a physical core, but it does not GUARANTEE effective compute cap= acity equal to 50% of a physical core?

 

Can you offer any guidance regar= ding real-world scheduler overhead (when cap>0 is used) and precision (h= ow variable is actual compute power for a vCPU with a cap of 100%, for exam= ple)?

 

- Mike

3DOracle
Michael Palmeter= | Sr. Director of Product Management, Oracle Exalogic Elastic Cloud
Pho= ne: +14153736497 | Mobile: +14156949573 | VOIP: +14154027422
Oracle= Exalogic Development
200 Oracle Parkway | Redwood Shores, California 94= 065

3D"Green

Oracle is comm= itted to developing practices and products that help protect the environmen= t

 

Watch the Exalogic 5-mi= nute Demo at http://www.oracle.= com/pls/ebn/swf_viewer.load?p_shows_id=3D12641667

=

 =

From: George Dunlap [mailto:george.dunlap@eu.citrix.com]
Sent: Novem= ber 15, 2012 10:29 AM
To: Michael Palmeter
Cc: Dario Fa= ggioli; xen-devel@lists.xen.org
Subject: Re: [Xen-devel] Xen cred= it scheduler question

 

On 15/11/12 15:43, Michael = Palmeter wrote:

Hi all (and Mr. Dunlap in particul= ar),


Haha -- please don't c= all me "Mr"; I prefer "George", but if you want a title= , use "Dr" (since I have  PhD). :-)


Example scenario:

 

  • Server hardware: 2 socke= ts, 8-cores per socket, 2 hardware threads per core (total of 32 hardware t= hreads)
  • Test VM: a single virtual machine with a single vCPU, weight=3D256 and = cap=3D100%

 

In this scenario, from what I understand, I should be ab= le to load the Test VM with traffic to a maximum of approximately 1/32 of t= he aggregate compute capacity of the server.  The total CPU utilizatio= n of the server hardware should be approximately 3.4%, plus the overhead of= dom0 (say 1-2).  The credits available to any vCPU capped at 100% sho= uld be equal to 1/32 of the aggregate compute available for the whole serve= r, correct?


I think to really be precise= , you should say, "1/32nd of the logical cpu time available", whe= re "logical cpu time" simply means, "time processing on one = logical CPU".  At the moment, that is all that either the credit1= or credit2 schedulers look at.

As I'm sure you're aware, not all &q= uot;logical cpu time" is equal.  If one thread of a hyperthread p= air is running but the other idle, it will get significantly higher perform= ance than if the other thread is busy.  How much is highly unpredictab= le, and depends very much on exactly what units are shared with the other h= yperthread, and the workload running on each unit.  But even when both= threads are busy, it should (in theory) be rare for both threads to get a = throughput of 50%; the whole idea of HT is that threads typically get 70-80= % of the full performance of the core (so the overall throughput is increas= ed).

But if course, while this is particularly extreme in the case o= f hyperthreads, it's also true on a smaller scale even without that -- core= s share caches, NUMA nodes share memory bandwidth, and so on.  No atte= mpt is made to compensate VMs for cache misses or extra memory latency due = to sharing either. :-)


Put simply, is there a way to constrain a VM with 1 vCPU to consume no mo= re than 0.5 of a physical core (hyper-threaded) on the server hardware ment= ioned below? Does the cap help in that respect?


You can use "cap" to make the VM in question get 50% of l= ogical vcpu time, which on an idle system will give it 0.5 of the capacity = of a physical core (if we don't consider Intel's Turbo Boost technology).&n= bsp; But if the system becomes busy, it will get less than 0.5 of the proce= ssing capacity of a physical core.


I have been struggling to understand how the scheduler can de= al with the uncertainty that hyperthreading introduces, however.  I kn= ow this is an issue that you are tackling in the credit2 scheduler, but I w= ould like to know what your thoughts are on this problem (if you are able t= o share).  Any insight or assistance you could offer would be greatly = appreciated. 


At the moment it doe= s not attempt to; the only thing it does is try not to schedule two hyperth= reads that share a core if there is an idle core.  But if there are mo= re active vcpus than cores, then some will share; and the ones that share a= core with another vcpu will be charged the same as the ones that have the = core all to themselves.

Could you explain why you your question is i= mportant to you -- i.e,. what are you trying to accomplish?  It sounds= a bit like you're more concerned with accuracy in reporting, and control o= f resources, rather than fairness, for instance.

 -George<= /o:p>

--__1353006237677169873abhmt114.oracle.com Content-Type: image/gif; name="image001.gif" Content-Transfer-Encoding: base64 Content-Disposition: inline; filename="image001.gif" Content-ID: R0lGODlhcgAaAMQAAP8QEP/w8P/Q0P/g4P8wMP9gYP8gIP+goP9QUP+QkP+wsP9wcP+AgP9AQP/A wP8AAP///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAAA AAAALAAAAAByABoAAAX/ICSOZGmeaKqubOu+cCzPdC0GCqPvvBKUDp5wp1gFdIPVIDfcOQa6A8yR aO4gweQoUHh4v2Bw4SdihM9egyBF8ALIpkEXDR44vA2XwkD/IgYGAAZbbX1nBGRmhl8AWiUJYicC AIsPDFh4LXOGjQ4NAAhrEIUPBQcOqKmoB5sEZV4JqqoHhQVxlGAOJQG4AAunsqg/dw95KwdfBgzB qKIEBMaQDwCiKpOwEIq6KANuJg14igZwEHPULMTGKbxetjF8D1ItxK7aKl8lCl8DAfALW1+2rUi3 QtqgGN2mwYCXzYvAON624LoEQZ9DEfRcEFSBIE2DjyBDfnyIqRgMcA8a/z5AZQWXOxEdHxwUgfIg sX/zMqlAWclVCQFefLpAqdJBAFJn3owgtpJEQkslEWjUmYLnomokcDlS4s0eFzQNqvXDEyzmAwFP yaXYmGJBuxlzELWIacueiE0AFGyF4HbaNTquUEpFRxUFUC9YXQzARYAkEJSNipKQ9kDu0i9SKKNZ 9iXswMIoYgI4oJYFskpgzkkmcdrviELqmPVt1HpRAaaLqCE1lBgjvEpqRtgl8Tevygd7TcCuiKvP m8OVEkAIYLYPThSsRIpEQJr1x94QBIT09FH6QJC6AiRAoB1kEb7tRb4MvyB+AwSlbejfz7+///8A BijggAQWaOCBCCao4A+CDDbo4IMQRijhhBQKGAIAOw== --__1353006237677169873abhmt114.oracle.com Content-Type: image/gif; name="image002.gif" Content-Transfer-Encoding: base64 Content-Disposition: inline; filename="image002.gif" Content-ID: R0lGODlhLAAcAMQAAP///0x9RHmec9Pf0aa+oleFULHGrmKNW+nv6I+uivT39N7n3W6VZ7zPuZu2 lsjXxYSmfwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAAA AAAALAAAAAAsABwAQAXhICCOZGmeaDoaReC+sKAMR7GopIA6boIvLgPAVSAgALxjSYdrOp/Q6NPg YqIEPkTBV2taTwgGbEw+PAZo3FfKbqMQQfeJ8DoY0Hg0wxhAKBgHCl5XLgMqDwFCAAIFPIYDgidr OUQGkSh0cQMJAQyXOXKhoqOkpaanI2aoIwMErq+uCY0BMlANKpxkYwQGBH82TpMicD0pAgQACToD AchqhAG3KQ4HIlQNnErG0IYqB9EAiEQvwEsozC43hy0CAeXMwsLDLS8MAvf497ruCZ+gOA0gfNt3 AIK0J/JWKVzIsEQIADs= --__1353006237677169873abhmt114.oracle.com-- --__1353006237677169872abhmt114.oracle.com-- --__1353006237677169871abhmt114.oracle.com Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --__1353006237677169871abhmt114.oracle.com--