<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://elinux.org/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://elinux.org/index.php?title=IDE_Preempt&amp;feed=atom&amp;action=history</id>
		<title>IDE Preempt - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://elinux.org/index.php?title=IDE_Preempt&amp;feed=atom&amp;action=history"/>
		<link rel="alternate" type="text/html" href="http://elinux.org/index.php?title=IDE_Preempt&amp;action=history"/>
		<updated>2013-06-19T10:41:20Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.22alpha</generator>

	<entry>
		<id>http://elinux.org/index.php?title=IDE_Preempt&amp;diff=74191&amp;oldid=prev</id>
		<title>Cschalle: Add categories</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/index.php?title=IDE_Preempt&amp;diff=74191&amp;oldid=prev"/>
				<updated>2011-10-28T10:38:49Z</updated>
		
		<summary type="html">&lt;p&gt;Add categories&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; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 10:38, 28 October 2011&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;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-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&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-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Introduction ==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Introduction ==&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 81:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 80:&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-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; - port the patch to 2.6&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; - port the patch to 2.6&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-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; - determine if and how this could be converted into a generalized driver init concurrency mechanism&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; - determine if and how this could be converted into a generalized driver init concurrency mechanism&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;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;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;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Kernel]]&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;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Linux]]&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;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Tips and Tricks]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Cschalle</name></author>	</entry>

	<entry>
		<id>http://elinux.org/index.php?title=IDE_Preempt&amp;diff=1993&amp;oldid=prev</id>
		<title>RBot: Bot (Edward's framework)</title>
		<link rel="alternate" type="text/html" href="http://elinux.org/index.php?title=IDE_Preempt&amp;diff=1993&amp;oldid=prev"/>
				<updated>2007-03-06T03:33:33Z</updated>
		
		<summary type="html">&lt;p&gt;Bot (Edward&amp;#039;s framework)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&amp;quot;IDE Preempt&amp;quot; is the shorthand name for a feature which allows the IDE driver to be&lt;br /&gt;
preempted during its initialization.  There are long delays associated with&lt;br /&gt;
the initialization of the IDE driver.  Use of the IDE-preempt feature allows other kernel&lt;br /&gt;
initialization work to proceed while the IDE driver is initializing, under&lt;br /&gt;
certain circumstances.&lt;br /&gt;
&lt;br /&gt;
Currently, the set of conditions under which this feature is useful is&lt;br /&gt;
pretty limited.  The IDE driver must be configured and compiled as a&lt;br /&gt;
kernel loadable module.  This rules out most desktop uses of&lt;br /&gt;
the IDE-preempt feature.&lt;br /&gt;
&lt;br /&gt;
This code basically turns the main busywait routine, &amp;lt;code&amp;gt;ide_delay_50ms()&amp;lt;/code&amp;gt;, in the IDE driver&lt;br /&gt;
into scheduled timeout and yield.&lt;br /&gt;
&lt;br /&gt;
=== Rationale ===&lt;br /&gt;
Allowing other initialization operations to occur during IDE driver init prevents&lt;br /&gt;
wasting CPU cycles in IDE driver busywait calls.&lt;br /&gt;
&lt;br /&gt;
== Downloads ==&lt;br /&gt;
=== Patch ===&lt;br /&gt;
 - Patch for CELF version 040304, AND for 2.4.20 is here: [[Media:ide-preempt-2.patch]]&lt;br /&gt;
   - /\ THIS PATCH (IN ISOLATED FORM) HAS NOT BEEN TESTED /\&lt;br /&gt;
 - [Patch for 2.6.xx is *here*]&lt;br /&gt;
&lt;br /&gt;
=== Utility programs ===&lt;br /&gt;
None&lt;br /&gt;
&lt;br /&gt;
== How To Use ==&lt;br /&gt;
 - Apply the patch to your 2.4.20-based (CELF or kernel.org) source tree&lt;br /&gt;
 - Configure the kernel:&lt;br /&gt;
   - with &amp;quot;Preemptible IDE delays&amp;quot; turned on&lt;br /&gt;
   - with the IDE driver configured as a module&lt;br /&gt;
 - Compile the kernel and modules&lt;br /&gt;
 - Set up your system to load the IDE driver module during system startup, after kernel boot&lt;br /&gt;
 - Set up your system to perform other initialization operations during the IDE driver initialization&lt;br /&gt;
 - Measure the decrease in total system boot time from running the IDE driver init concurrently&lt;br /&gt;
 with other system initialization tasks&lt;br /&gt;
&lt;br /&gt;
Note that to benefit from this feature you load the IDE driver as a module.  When the IDE driver is&lt;br /&gt;
linked statically with the kernel, then when the driver initializes there are no other kernel threads&lt;br /&gt;
running which can take advantage of the time freed up from the busywait conversion.&lt;br /&gt;
Also, in order to benefit from this there must be additional user-space or kernel&lt;br /&gt;
tasks to run when loading the IDE driver.&lt;br /&gt;
&lt;br /&gt;
== Sample Results ==&lt;br /&gt;
Busywait-style delays such as udelay() in module init functions inhibit kernel preemption because the Big Kernel Lock is held, while yielding [[APIs]] such as schedule_timeout() allow preemption (because the kernel handles the BKL specially and releases and reacquires it across reschedules alloowed by the current thread).&lt;br /&gt;
&lt;br /&gt;
IDE modules were one of the major offenders in this regard identified while looking at a couple of embedded platforms.   The ide-probe-mod driver spends a great deal of time in repeated calls to ide_delay_50ms() during probe and drive identification, which busy waits (in order to let the IDE controller make progress before polling for status or to allow previous operations to complete).  The ide-preempt fix changes these to schedule_timeout().&lt;br /&gt;
&lt;br /&gt;
Todd Poynor of [[Monta Vista]] measured the effect on a 200MHz IBM 405GP &amp;quot;Walnut&amp;quot; evaluation board with a 33MHz PCI bus. A Seagate Barracuda ATA IV 60GB disk drive with an ext2 filesystem was cabled to one of the two IDE interfaces on a Promise Ultra66 PCI-IDE bridge card (PDC20262 chipset).  The ide-mod, ide-probe-mod, and ide-disk drivers were loaded as modules.  The drivers for PCI, PCI-IDE disk, and ext2 filesystem were built statically into the kernel.&lt;br /&gt;
&lt;br /&gt;
Use of this feature had these effects on module loading time:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Original: 255.221 ms&lt;br /&gt;
New: 296.977 ms&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note the elapsed time increased somewhat for two reasons. First, waiting times are slightly longer due to back porting a bug fix from the 2.5 kernel (which waits for an extra millisecond each time).  Second, extra overhead was introduced by use of the schedule() function.&lt;br /&gt;
&lt;br /&gt;
The fix had these effects on maximum preemption-off windows, measured via /proc/latencytimes:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Original: 251.065 ms&lt;br /&gt;
New: 9.865 ms&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The ide-probe-mod driver spent almost all its time in about five calls to ide_delay_50ms(); use of preemptible delays freed up almost 250 milliseconds of time for other threads to run.&lt;br /&gt;
&lt;br /&gt;
== Future Work ==&lt;br /&gt;
Here is a list of things that could be worked on for this feature:&lt;br /&gt;
 - version 2 of patch uses CONFIG_INSTANT_ON instead of CONFIG_FASTBOOT - this is a bug&lt;br /&gt;
 - test the patch&lt;br /&gt;
 - port the patch to 2.6&lt;br /&gt;
 - determine if and how this could be converted into a generalized driver init concurrency mechanism&lt;/div&gt;</summary>
		<author><name>RBot</name></author>	</entry>

	</feed>