<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://linux-vserver.at/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://linux-vserver.at/index.php?action=history&amp;feed=atom&amp;title=CPU_Scheduler</id>
		<title>CPU Scheduler - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://linux-vserver.at/index.php?action=history&amp;feed=atom&amp;title=CPU_Scheduler"/>
		<link rel="alternate" type="text/html" href="http://linux-vserver.at/index.php?title=CPU_Scheduler&amp;action=history"/>
		<updated>2026-04-09T15:48:40Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.20.2</generator>

	<entry>
		<id>http://linux-vserver.at/index.php?title=CPU_Scheduler&amp;diff=4890&amp;oldid=prev</id>
		<title>Glenn: +cat</title>
		<link rel="alternate" type="text/html" href="http://linux-vserver.at/index.php?title=CPU_Scheduler&amp;diff=4890&amp;oldid=prev"/>
				<updated>2011-10-21T19:25:00Z</updated>
		
		<summary type="html">&lt;p&gt;+cat&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr style='vertical-align: top;'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 19:25, 21 October 2011&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 175:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 175:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\left ( \frac{2}{5} \cdot \frac{1}{3} + \frac{1}{5} \right ) \cdot 100 \approx 33\%\mbox{ CPU allocation}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\left ( \frac{2}{5} \cdot \frac{1}{3} + \frac{1}{5} \right ) \cdot 100 \approx 33\%\mbox{ CPU allocation}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Theory]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Glenn</name></author>	</entry>

	<entry>
		<id>http://linux-vserver.at/index.php?title=CPU_Scheduler&amp;diff=3474&amp;oldid=prev</id>
		<title>88.168.38.63: /* Fair Share */</title>
		<link rel="alternate" type="text/html" href="http://linux-vserver.at/index.php?title=CPU_Scheduler&amp;diff=3474&amp;oldid=prev"/>
				<updated>2008-11-25T20:42:50Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Fair Share&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr style='vertical-align: top;'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 20:42, 25 November 2008&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 137:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 137:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;=== Fair Share ===&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;=== Fair Share ===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;The fair share configuration is similar to guarantees, except that if the CPU is idle&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;The fair share configuration is similar to guarantees, except that if the CPU is idle&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;,&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;a context can allocate more CPU time than its guarantee/limit. The scheduler and&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;a context can allocate more CPU time than its guarantee/limit. The scheduler and&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;bucket configuration was extended in Linux-VServer 2.1.1 to allow fair share&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;bucket configuration was extended in Linux-VServer 2.1.1 to allow fair share&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>88.168.38.63</name></author>	</entry>

	<entry>
		<id>http://linux-vserver.at/index.php?title=CPU_Scheduler&amp;diff=3245&amp;oldid=prev</id>
		<title>66.100.227.144: /* Programs and Processes */</title>
		<link rel="alternate" type="text/html" href="http://linux-vserver.at/index.php?title=CPU_Scheduler&amp;diff=3245&amp;oldid=prev"/>
				<updated>2008-08-31T03:40:36Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Programs and Processes&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr style='vertical-align: top;'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 03:40, 31 August 2008&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 7:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 7:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;A program is a combination of instructions and data put together to &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;A program is a combination of instructions and data put together to &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;perform a task when executed. A process is simply a running or idle instance of a program; using the top utility in Linux or Task Manager in Windows would show you all running processes&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;. A &lt;/del&gt;thread is simply a mini-part of that program running concurrently within the same process and can often communicate with (and cause conflicts with) other threads running within the same process. An analogy using a programming metaphor is that programs &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;perform a task when executed. A process is simply a running or idle instance of a program; using the top utility in Linux or Task Manager in Windows would show you all running processes&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;, while a &lt;/ins&gt;thread is simply a mini-part of that program running concurrently within the same process and can often communicate with (and cause conflicts with) other threads running within the same process &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;(see the next section for additional information on threads)&lt;/ins&gt;. An analogy using a programming metaphor is that programs &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;are like classes in languages like C++ and Java, and processes are &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;are like classes in languages like C++ and Java, and processes are &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;like objects (instantiated instances of classes). Processes are an &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;like objects (instantiated instances of classes). Processes are an &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>66.100.227.144</name></author>	</entry>

	<entry>
		<id>http://linux-vserver.at/index.php?title=CPU_Scheduler&amp;diff=3244&amp;oldid=prev</id>
		<title>66.100.227.144: /* Programs and Processes */  added a few clarifications to processes vs threads</title>
		<link rel="alternate" type="text/html" href="http://linux-vserver.at/index.php?title=CPU_Scheduler&amp;diff=3244&amp;oldid=prev"/>
				<updated>2008-08-31T03:39:54Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Programs and Processes: &lt;/span&gt;  added a few clarifications to processes vs threads&lt;/span&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr style='vertical-align: top;'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 03:39, 31 August 2008&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 7:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 7:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;A program is a combination of instructions and data put together to &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;A program is a combination of instructions and data put together to &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;perform a task when executed. A process is &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;an &lt;/del&gt;instance of a program &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;perform a task when executed. A process is &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;simply a running or idle &lt;/ins&gt;instance of a program&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;; using the top utility in Linux or Task Manager in Windows would show you all &lt;/ins&gt;running &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;processes. A thread is simply a mini-part of that &lt;/ins&gt;program &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;running concurrently within the same process and can often communicate with (and cause conflicts with&lt;/ins&gt;) &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;other threads running within the same process&lt;/ins&gt;. An analogy &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;using a programming metaphor &lt;/ins&gt;is that programs &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;(what one might call a &amp;quot;&lt;/del&gt;running&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;quot; &lt;/del&gt;program). An analogy is that programs &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;are like classes in languages like C++ and Java, and processes are &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;are like classes in languages like C++ and Java, and processes are &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;like objects (instantiated instances of classes). Processes are an &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;like objects (instantiated instances of classes). Processes are an &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>66.100.227.144</name></author>	</entry>

	<entry>
		<id>http://linux-vserver.at/index.php?title=CPU_Scheduler&amp;diff=3029&amp;oldid=prev</id>
		<title>80.248.178.79: /* Token Bucket Extension */</title>
		<link rel="alternate" type="text/html" href="http://linux-vserver.at/index.php?title=CPU_Scheduler&amp;diff=3029&amp;oldid=prev"/>
				<updated>2008-03-29T11:47:00Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Token Bucket Extension&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr style='vertical-align: top;'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 11:47, 29 March 2008&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 68:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 68:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;The Linux-VServer scheduler uses this mechanism in the following way: consider a&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;The Linux-VServer scheduler uses this mechanism in the following way: consider a&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;bucket of a certain size ''S'' which is filled with a specified amount of tokens ''R''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;bucket of a certain size ''S'' which is filled with a specified amount of tokens ''R''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;every interval ''T'', &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;until &lt;/del&gt;the bucket is &amp;quot;full&amp;quot; - excess tokens are spilled.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;every interval ''T'', &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;when &lt;/ins&gt;the bucket is &amp;quot;full&amp;quot; - excess tokens are spilled.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;At each timer tick, a running process (here running means actually needing&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;At each timer tick, a running process (here running means actually needing&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;the CPU as opposed to &amp;quot;running&amp;quot; as in &amp;quot;existing&amp;quot;) consumes exactly one token from the&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;the CPU as opposed to &amp;quot;running&amp;quot; as in &amp;quot;existing&amp;quot;) consumes exactly one token from the&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>80.248.178.79</name></author>	</entry>

	<entry>
		<id>http://linux-vserver.at/index.php?title=CPU_Scheduler&amp;diff=2928&amp;oldid=prev</id>
		<title>198.24.6.134: /* Burst time */</title>
		<link rel="alternate" type="text/html" href="http://linux-vserver.at/index.php?title=CPU_Scheduler&amp;diff=2928&amp;oldid=prev"/>
				<updated>2008-01-21T20:30:03Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Burst time&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr style='vertical-align: top;'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 20:30, 21 January 2008&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 113:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 113:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Consider a context with a limit of 1/2 of CPU time, a bucket of 15000 tokens and&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Consider a context with a limit of 1/2 of CPU time, a bucket of 15000 tokens and&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;a minimum of 2500 tokens. Given that your scheduler runs at 1000Hz processes that&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;a minimum of 2500 tokens. Given that your scheduler runs at 1000Hz&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;, &lt;/ins&gt;processes that&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;have used the CPU for 30 seconds will be put on hold for 5 seconds. The following&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;have used the CPU for 30 seconds will be put on hold for 5 seconds. The following&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;formula can be used to calculate S and M, using ''B'' as burst time and ''H'' as&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;formula can be used to calculate S and M, using ''B'' as burst time and ''H'' as&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 123:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 123:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;S = \mbox{Hz} \cdot B (1 - \frac{R}{T})&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;S = \mbox{Hz} \cdot B (1 - \frac{R}{T})&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;=== Guarantees ===&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;=== Guarantees ===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>198.24.6.134</name></author>	</entry>

	<entry>
		<id>http://linux-vserver.at/index.php?title=CPU_Scheduler&amp;diff=2341&amp;oldid=prev</id>
		<title>Hollow: add simple formula for fair scheduling</title>
		<link rel="alternate" type="text/html" href="http://linux-vserver.at/index.php?title=CPU_Scheduler&amp;diff=2341&amp;oldid=prev"/>
				<updated>2007-02-20T16:55:33Z</updated>
		
		<summary type="html">&lt;p&gt;add simple formula for fair scheduling&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr style='vertical-align: top;'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 16:55, 20 February 2007&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 165:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 165:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\left ( \frac{\frac{3}{5} \cdot \frac{1}{4}}{\frac{1}{2} + \frac{1}{4}} + \frac{1}{5} \right ) \cdot 100 = 40\%\mbox{ CPU allocation for context 2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\left ( \frac{\frac{3}{5} \cdot \frac{1}{4}}{\frac{1}{2} + \frac{1}{4}} + \frac{1}{5} \right ) \cdot 100 = 40\%\mbox{ CPU allocation for context 2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;If the idle time ratio is the same for all contexts, the formula can be simplified:&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\left ( C \cdot \frac{1}{N} + \frac{R_k}{T_k} \right ) \cdot 100 = \%\mbox{ CPU allocation}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;Therefore, if 3 of the above 5 contexts would run, i.e. &amp;lt;math&amp;gt;C = \frac{2}{5}, N = 3&amp;lt;/math&amp;gt;, it would result in the expted 33% split:&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\left ( \frac{2}{5} \cdot \frac{1}{3} + \frac{1}{5} \right ) \cdot 100 \approx 33\%\mbox{ CPU allocation}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Hollow</name></author>	</entry>

	<entry>
		<id>http://linux-vserver.at/index.php?title=CPU_Scheduler&amp;diff=2340&amp;oldid=prev</id>
		<title>Hollow: use brackets</title>
		<link rel="alternate" type="text/html" href="http://linux-vserver.at/index.php?title=CPU_Scheduler&amp;diff=2340&amp;oldid=prev"/>
				<updated>2007-02-20T16:38:05Z</updated>
		
		<summary type="html">&lt;p&gt;use brackets&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr style='vertical-align: top;'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 16:38, 20 February 2007&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 154:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 154:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{C \cdot \frac{R2_k}{T2_k}}{\sum_{i=1}^N \frac{R2_i}{T2_i}} + \frac{R_k}{T_k} \cdot 100 = \%\mbox{ CPU allocation}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;\left ( &lt;/ins&gt;\frac{C \cdot \frac{R2_k}{T2_k}}{\sum_{i=1}^N \frac{R2_i}{T2_i}} + \frac{R_k}{T_k} &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;\right ) &lt;/ins&gt;\cdot 100 = \%\mbox{ CPU allocation}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 161:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 161:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{\frac{3}{5} \cdot \frac{1}{2}}{\frac{1}{2} + \frac{1}{4}} + \frac{1}{5} \cdot 100 = 60\%\mbox{ CPU allocation for context 1}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;\left ( &lt;/ins&gt;\frac{\frac{3}{5} \cdot \frac{1}{2}}{\frac{1}{2} + \frac{1}{4}} + \frac{1}{5} &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;\right ) &lt;/ins&gt;\cdot 100 = 60\%\mbox{ CPU allocation for context 1}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{\frac{3}{5} \cdot \frac{1}{4}}{\frac{1}{2} + \frac{1}{4}} + \frac{1}{5} \cdot 100 = 40\%\mbox{ CPU allocation for context 2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;\left ( &lt;/ins&gt;\frac{\frac{3}{5} \cdot \frac{1}{4}}{\frac{1}{2} + \frac{1}{4}} + \frac{1}{5} &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;\right ) &lt;/ins&gt;\cdot 100 = 40\%\mbox{ CPU allocation for context 2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Hollow</name></author>	</entry>

	<entry>
		<id>http://linux-vserver.at/index.php?title=CPU_Scheduler&amp;diff=2187&amp;oldid=prev</id>
		<title>84.227.243.97: /* Hard Limit */</title>
		<link rel="alternate" type="text/html" href="http://linux-vserver.at/index.php?title=CPU_Scheduler&amp;diff=2187&amp;oldid=prev"/>
				<updated>2007-01-02T15:56:40Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Hard Limit&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr style='vertical-align: top;'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 15:56, 2 January 2007&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 98:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 98:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Note &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;that &lt;/del&gt;that this is the proportion of a ''single'' CPU in the system. So,&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Note that this is the proportion of a ''single'' CPU in the system. So,&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;if you have four CPUs and you want one context to get an average of one whole&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;if you have four CPUs and you want one context to get an average of one whole&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;CPU to itself, then you would set fill-rate to 1 and interval to 4.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;CPU to itself, then you would set fill-rate to 1 and interval to 4.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>84.227.243.97</name></author>	</entry>

	<entry>
		<id>http://linux-vserver.at/index.php?title=CPU_Scheduler&amp;diff=2037&amp;oldid=prev</id>
		<title>Hollow at 10:57, 1 December 2006</title>
		<link rel="alternate" type="text/html" href="http://linux-vserver.at/index.php?title=CPU_Scheduler&amp;diff=2037&amp;oldid=prev"/>
				<updated>2006-12-01T10:57:56Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Overview of Processes and Threads ==&lt;br /&gt;
&lt;br /&gt;
It is important to have a decent understanding of both processes and &lt;br /&gt;
threads before learning about schedulers.&lt;br /&gt;
&lt;br /&gt;
=== Programs and Processes ===&lt;br /&gt;
&lt;br /&gt;
A program is a combination of instructions and data put together to &lt;br /&gt;
perform a task when executed. A process is an instance of a program &lt;br /&gt;
(what one might call a &amp;quot;running&amp;quot; program). An analogy is that programs &lt;br /&gt;
are like classes in languages like C++ and Java, and processes are &lt;br /&gt;
like objects (instantiated instances of classes). Processes are an &lt;br /&gt;
abstraction created to embody the state of a program during its &lt;br /&gt;
execution. This means keeping track of the data that is associated &lt;br /&gt;
with a thread or threads of execution, which includes variables, &lt;br /&gt;
hardware state (e.g. registers and the program counter, etc...), and &lt;br /&gt;
the contents of an address space.&lt;br /&gt;
&lt;br /&gt;
=== Threads ===&lt;br /&gt;
&lt;br /&gt;
A process can have multiple threads of execution that work together to &lt;br /&gt;
accomplish its goals. These threads of execution are aptly named &lt;br /&gt;
threads. A kernel must keep track of each thread's stack and hardware &lt;br /&gt;
state, or whatever is necessary to track a single flow of execution &lt;br /&gt;
within a process. Usually threads share address spaces, but they do &lt;br /&gt;
not have to (often they merely overlap). It is important to remember &lt;br /&gt;
that only one thread may be executing on a CPU at any given time, &lt;br /&gt;
which is basically the reason kernels have CPU schedulers. An example &lt;br /&gt;
of multiple threads within a process can be found in most web &lt;br /&gt;
browsers. Usually at least one thread exists to handle user interface &lt;br /&gt;
events (like stopping a page load), one thread exists to handle &lt;br /&gt;
network transactions, and one thread exists to render web pages.&lt;br /&gt;
&lt;br /&gt;
== Scheduling in Linux ==&lt;br /&gt;
&lt;br /&gt;
Multitasking kernels (like Linux) allow more than one process to exist &lt;br /&gt;
at any given time, and furthermore each process is allowed to run as &lt;br /&gt;
if it were the only process on the system. Processes do not need to be &lt;br /&gt;
aware of any other processes unless they are explicitly designed to &lt;br /&gt;
be. This makes programs easier to develop, maintain, and port. Though &lt;br /&gt;
each CPU in a system can execute only one thread within a process at a &lt;br /&gt;
time, many threads from many processes appear to be executing at the &lt;br /&gt;
same time. This is because threads are scheduled to run for very short &lt;br /&gt;
periods of time and then other threads are given a chance to run. A &lt;br /&gt;
kernel's scheduler enforces a thread scheduling policy, including &lt;br /&gt;
when, for how long, and in some cases where (on Symmetric &lt;br /&gt;
Multiprocessing (SMP) systems) threads can execute. Normally the &lt;br /&gt;
scheduler runs in its own thread, which is woken up by a timer &lt;br /&gt;
interrupt. Otherwise it is invoked via a system call or another kernel &lt;br /&gt;
thread that wishes to yield the CPU. A thread will be allowed to &lt;br /&gt;
execute for a certain amount of time, then a context switch to the &lt;br /&gt;
scheduler thread will occur, followed by another context switch to a &lt;br /&gt;
thread of the scheduler's choice. This cycle continues, and in this &lt;br /&gt;
way a certain policy for CPU usage is carried out.&lt;br /&gt;
&lt;br /&gt;
== Token Bucket Extension ==&lt;br /&gt;
&lt;br /&gt;
While the basic idea of Linux-VServer is a peaceful coexistence of all&lt;br /&gt;
contexts, sharing the common resources in a respectful way, it is&lt;br /&gt;
sometimes useful to control the resource distribution for resource hungry&lt;br /&gt;
processes.&lt;br /&gt;
&lt;br /&gt;
The basic principle of a Token Bucket is not very new. It is given here&lt;br /&gt;
as an example for the Hard CPU Limit. The same principle also applies&lt;br /&gt;
to scheduler priorities, network bandwidth limitation and resource&lt;br /&gt;
control in general.&lt;br /&gt;
&lt;br /&gt;
The Linux-VServer scheduler uses this mechanism in the following way: consider a&lt;br /&gt;
bucket of a certain size ''S'' which is filled with a specified amount of tokens ''R''&lt;br /&gt;
every interval ''T'', until the bucket is &amp;quot;full&amp;quot; - excess tokens are spilled.&lt;br /&gt;
At each timer tick, a running process (here running means actually needing&lt;br /&gt;
the CPU as opposed to &amp;quot;running&amp;quot; as in &amp;quot;existing&amp;quot;) consumes exactly one token from the&lt;br /&gt;
bucket, unless the bucket is empty, in which case the process is put on a&lt;br /&gt;
hold queue until the bucket has been refilled with a minimum ''M'' of tokens.&lt;br /&gt;
The process is then rescheduled.&lt;br /&gt;
&lt;br /&gt;
A major advantage of a Token Bucket is that a certain amount of tokens can&lt;br /&gt;
be accumulated in times of quiescence, which later can be used to burst when&lt;br /&gt;
resources are required. &lt;br /&gt;
&lt;br /&gt;
Where a per-process Token Bucket would allow for a CPU resource limitation&lt;br /&gt;
of a single process, a Context Token Bucket allows to control the CPU usage&lt;br /&gt;
of all confined processes.&lt;br /&gt;
&lt;br /&gt;
Another approach, which is also implemented, is to use the current fill&lt;br /&gt;
level of the bucket to adjust the process priority, thus reducing the&lt;br /&gt;
priority of processes belonging to excessive contexts.&lt;br /&gt;
&lt;br /&gt;
== Token Bucket Examples ==&lt;br /&gt;
&lt;br /&gt;
=== Hard Limit ===&lt;br /&gt;
&lt;br /&gt;
The simplest configuration is to just give every context an upper bound for&lt;br /&gt;
CPU allocation. The important factor is the ratio:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{R}{T} \cdot 100 = \%\mbox{ CPU allocation}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note that that this is the proportion of a ''single'' CPU in the system. So,&lt;br /&gt;
if you have four CPUs and you want one context to get an average of one whole&lt;br /&gt;
CPU to itself, then you would set fill-rate to 1 and interval to 4.&lt;br /&gt;
&lt;br /&gt;
It is advantageous to smooth operation of the algorithm to make the interval&lt;br /&gt;
as small as possible (or much smaller than the bucket size). You can in most&lt;br /&gt;
cases simplify the fraction, such as changing 30/100 to 3/10.&lt;br /&gt;
&lt;br /&gt;
=== Burst time ===&lt;br /&gt;
&lt;br /&gt;
To penalize processes after a certain amount of ''burst time'', i.e. putting them&lt;br /&gt;
on the hold queue, you can use the maximum size S of the bucket and the minimum&lt;br /&gt;
number of tokens M to ''hold'' processes.&lt;br /&gt;
&lt;br /&gt;
Consider a context with a limit of 1/2 of CPU time, a bucket of 15000 tokens and&lt;br /&gt;
a minimum of 2500 tokens. Given that your scheduler runs at 1000Hz processes that&lt;br /&gt;
have used the CPU for 30 seconds will be put on hold for 5 seconds. The following&lt;br /&gt;
formula can be used to calculate S and M, using ''B'' as burst time and ''H'' as&lt;br /&gt;
hold time:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;M = \mbox{Hz} \cdot H \cdot \frac{R}{T}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;S = \mbox{Hz} \cdot B (1 - \frac{R}{T})&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Guarantees ===&lt;br /&gt;
&lt;br /&gt;
A guarantee is nearly the same as a pure hard limit, except that you must not&lt;br /&gt;
allocate more than 100% CPU time to all contexts. In other words, if you have&lt;br /&gt;
''N'' contexts and give each one a guarantee of more than 1/N CPU time, it would result in&lt;br /&gt;
more CPU time needed than physically available, which cannot work out. The&lt;br /&gt;
important factor here is the sum of all ratios:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\sum_{i=1}^N \frac{R_i}{T_i} \le 1&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Fair Share ===&lt;br /&gt;
&lt;br /&gt;
The fair share configuration is similar to guarantees, except that if the CPU is idle&lt;br /&gt;
a context can allocate more CPU time than its guarantee/limit. The scheduler and&lt;br /&gt;
bucket configuration was extended in Linux-VServer 2.1.1 to allow fair share&lt;br /&gt;
scheduling and is also know as ''IDLE time''.&lt;br /&gt;
&lt;br /&gt;
Consider a configuration with 5 contexts each limited to 1/5 of CPU time, where&lt;br /&gt;
two of these contexts run CPU intensive processes and the rest is idle. Given&lt;br /&gt;
that each context may only allocate 1/5 of CPU time, 3/5 of CPU time are wasted&lt;br /&gt;
since 3 contexts are idle.&lt;br /&gt;
&lt;br /&gt;
To distribute the wasted CPU time ''fair'' among contexts that could need it, you&lt;br /&gt;
can configure an allocation ratio for R/T during idle times, namely ''R2''/''T2''. To&lt;br /&gt;
calculate the cpu distribution for context ''k'' the following formula is used:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{C \cdot \frac{R2_k}{T2_k}}{\sum_{i=1}^N \frac{R2_i}{T2_i}} + \frac{R_k}{T_k} \cdot 100 = \%\mbox{ CPU allocation}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
where ''C'' is the idle CPU time, 3/5 in our example. Consider a R2/T2 ratio of 1/2 for&lt;br /&gt;
the first guest and 1/4 for the second. This would result in:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{\frac{3}{5} \cdot \frac{1}{2}}{\frac{1}{2} + \frac{1}{4}} + \frac{1}{5} \cdot 100 = 60\%\mbox{ CPU allocation for context 1}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;&amp;lt;math&amp;gt;\frac{\frac{3}{5} \cdot \frac{1}{4}}{\frac{1}{2} + \frac{1}{4}} + \frac{1}{5} \cdot 100 = 40\%\mbox{ CPU allocation for context 2}&amp;lt;/math&amp;gt;&amp;lt;/center&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hollow</name></author>	</entry>

	</feed>