<?xml version="1.0" encoding="UTF-8"?><rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
> <channel><title>Comments on: When high-performance programming goes bad &#8211; scheduler starvation</title> <atom:link href="http://dwellonit.taterunino.net/2010/03/08/when-high-performance-programming-goes-bad-scheduler-starvation/feed/" rel="self" type="application/rss+xml" /><link>http://dwellonit.taterunino.net/2010/03/08/when-high-performance-programming-goes-bad-scheduler-starvation/</link> <description>Tateru Nino writes about virtual worlds, second life, statistics, culture, law, gaming, and eclectic oddities</description> <lastBuildDate>Fri, 10 Feb 2012 04:42:11 +0000</lastBuildDate> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <item><title>By: CaptainCrunch</title><link>http://dwellonit.taterunino.net/2010/03/08/when-high-performance-programming-goes-bad-scheduler-starvation/comment-page-1/#comment-8686</link> <dc:creator>CaptainCrunch</dc:creator> <pubDate>Wed, 10 Mar 2010 14:50:11 +0000</pubDate> <guid
isPermaLink="false">http://dwellonit.taterunino.net/?p=2254#comment-8686</guid> <description>A very similar problem appears when you have multiple execution-contexts that have to share signalling or state data.
If you have the option, changing execution priority can help a lot, as can moving to a different scheduling engine. Using a Real-Time scheduler and flagging the cache-process as such will do a lot for maintaining a steady maximum throughput.
To be frank, I have never have much trusted fair-share style scheduling systems - while they work well for the common workloads, they really &lt;b&gt;only work well&lt;/b&gt; for the common workloads.
Give them a workload that has a feeder component, or one that is heavily DMA and/or IO bound and things get strange.
Additionally, most of the development and modelling that has been done for Scheduler performance is based on Multiple-Process workloads, not on the newer Multiple-Thread environment.
The tuning paramaters (and the associated bottlenecks and scheduler (&lt;i&gt;and dont forget the memory manager&lt;/i&gt;) prioritisation quirks) change subtly (but significantly) when you are looking at using int&lt;b&gt;er&lt;/b&gt;-process communication (pipes, sockets &amp; the like) rather than int&lt;b&gt;ra&lt;/b&gt;-process communication (shared memory regions, mutex-locks, etc).
Part of this will be to do with Process vs. Process prioritisation as opposed to Process vs. (Thread vs. Thread vs. Thread) prioritisation.
Marshall K McKusick has some very interesting things to say about thread scheduling in his ACM&lt;a href=&quot;http://delivery.acm.org/10.1145/1040000/1035622/p58-mckusick.pdf&quot; rel=&quot;nofollow&quot;&gt;presentation from 2004&lt;/a&gt;.
MKK&#039;s scheduling work has been the basis for that done by many other people. In particular, he has the following to say about how the legacy queuing systems work:
&lt;blockquote&gt;
The system tailors this &lt;i&gt;short-term scheduling algorithm&lt;/i&gt; to favor interactive
jobs by raising the scheduling priority of threads that are blocked waiting for
I/O for one or more seconds and by lowering the priority of threads that
accumulate significant amounts of CPU time.
&lt;/blockquote&gt;
Your post is wonderfully composed, and does a very good job of exposing a rarely approached portion of the system to a much wider audience - thankyou.</description> <content:encoded><![CDATA[<p>A very similar problem appears when you have multiple execution-contexts that have to share signalling or state data.</p><p>If you have the option, changing execution priority can help a lot, as can moving to a different scheduling engine. Using a Real-Time scheduler and flagging the cache-process as such will do a lot for maintaining a steady maximum throughput.</p><p>To be frank, I have never have much trusted fair-share style scheduling systems &#8211; while they work well for the common workloads, they really <b>only work well</b> for the common workloads.</p><p>Give them a workload that has a feeder component, or one that is heavily DMA and/or IO bound and things get strange.</p><p>Additionally, most of the development and modelling that has been done for Scheduler performance is based on Multiple-Process workloads, not on the newer Multiple-Thread environment.</p><p>The tuning paramaters (and the associated bottlenecks and scheduler (<i>and dont forget the memory manager</i>) prioritisation quirks) change subtly (but significantly) when you are looking at using int<b>er</b>-process communication (pipes, sockets &amp; the like) rather than int<b>ra</b>-process communication (shared memory regions, mutex-locks, etc).</p><p>Part of this will be to do with Process vs. Process prioritisation as opposed to Process vs. (Thread vs. Thread vs. Thread) prioritisation.</p><p>Marshall K McKusick has some very interesting things to say about thread scheduling in his ACM<a
href="http://delivery.acm.org/10.1145/1040000/1035622/p58-mckusick.pdf" rel="nofollow">presentation from 2004</a>.</p><p>MKK&#8217;s scheduling work has been the basis for that done by many other people. In particular, he has the following to say about how the legacy queuing systems work:</p><blockquote><p> The system tailors this <i>short-term scheduling algorithm</i> to favor interactive<br
/> jobs by raising the scheduling priority of threads that are blocked waiting for<br
/> I/O for one or more seconds and by lowering the priority of threads that<br
/> accumulate significant amounts of CPU time.</p></blockquote><p>Your post is wonderfully composed, and does a very good job of exposing a rarely approached portion of the system to a much wider audience &#8211; thankyou.</p> ]]></content:encoded> </item> <item><title>By: Tateru Nino</title><link>http://dwellonit.taterunino.net/2010/03/08/when-high-performance-programming-goes-bad-scheduler-starvation/comment-page-1/#comment-8669</link> <dc:creator>Tateru Nino</dc:creator> <pubDate>Wed, 10 Mar 2010 07:14:09 +0000</pubDate> <guid
isPermaLink="false">http://dwellonit.taterunino.net/?p=2254#comment-8669</guid> <description>It doesn&#039;t really care. Higher priority applications get more cycles - &#039;badly behaved&#039; (which can include &#039;working as designed&#039;) processes tend to get pushed down to the point where they only get idle cycles, if they&#039;re consistently running to the end of their allocated timeslices.
That&#039;s what generates the staccato behaviour - the system starves, causing the whole pipeline to stop, the ends eventually block, leaving idle cycles, which then bring the pipeline to life. All the parts start working again, and then scheduler starvation stalls the components in the middle again, bringing everything to an eventual halt. Rinse and repeat.</description> <content:encoded><![CDATA[<p>It doesn&#8217;t really care. Higher priority applications get more cycles &#8211; &#8216;badly behaved&#8217; (which can include &#8216;working as designed&#8217;) processes tend to get pushed down to the point where they only get idle cycles, if they&#8217;re consistently running to the end of their allocated timeslices.</p><p>That&#8217;s what generates the staccato behaviour &#8211; the system starves, causing the whole pipeline to stop, the ends eventually block, leaving idle cycles, which then bring the pipeline to life. All the parts start working again, and then scheduler starvation stalls the components in the middle again, bringing everything to an eventual halt. Rinse and repeat.</p> ]]></content:encoded> </item> <item><title>By: Nightbird Glineux</title><link>http://dwellonit.taterunino.net/2010/03/08/when-high-performance-programming-goes-bad-scheduler-starvation/comment-page-1/#comment-8668</link> <dc:creator>Nightbird Glineux</dc:creator> <pubDate>Wed, 10 Mar 2010 07:07:44 +0000</pubDate> <guid
isPermaLink="false">http://dwellonit.taterunino.net/?p=2254#comment-8668</guid> <description>Question:  Does the scheduler care if it gives cycles to the application (or the database) that it can&#039;t use?  In other words, would the scheduler prefer for the CPU be idle than give cycles to the naughty *giggle* cache manager?</description> <content:encoded><![CDATA[<p>Question:  Does the scheduler care if it gives cycles to the application (or the database) that it can&#8217;t use?  In other words, would the scheduler prefer for the CPU be idle than give cycles to the naughty *giggle* cache manager?</p> ]]></content:encoded> </item> <item><title>By: Thoria</title><link>http://dwellonit.taterunino.net/2010/03/08/when-high-performance-programming-goes-bad-scheduler-starvation/comment-page-1/#comment-8648</link> <dc:creator>Thoria</dc:creator> <pubDate>Tue, 09 Mar 2010 17:01:15 +0000</pubDate> <guid
isPermaLink="false">http://dwellonit.taterunino.net/?p=2254#comment-8648</guid> <description>Excellent, thank you! That&#039;s worth keeping in mind, and is also a good illustration of unintended consequences. One wonders if a recent communication from the technical side of Linden Lab about hyper-threading performance problems is dealing with a situation similar to this.</description> <content:encoded><![CDATA[<p>Excellent, thank you! That&#8217;s worth keeping in mind, and is also a good illustration of unintended consequences. One wonders if a recent communication from the technical side of Linden Lab about hyper-threading performance problems is dealing with a situation similar to this.</p> ]]></content:encoded> </item> <item><title>By: Simon Newstead</title><link>http://dwellonit.taterunino.net/2010/03/08/when-high-performance-programming-goes-bad-scheduler-starvation/comment-page-1/#comment-8636</link> <dc:creator>Simon Newstead</dc:creator> <pubDate>Tue, 09 Mar 2010 11:20:21 +0000</pubDate> <guid
isPermaLink="false">http://dwellonit.taterunino.net/?p=2254#comment-8636</guid> <description>That&#039;s a good thing, I enjoyed the post (by coincidence we&#039;re in the middle of a cache tuning/cdn implementation exercise :)</description> <content:encoded><![CDATA[<p>That&#8217;s a good thing, I enjoyed the post (by coincidence we&#8217;re in the middle of a cache tuning/cdn implementation exercise <img
src='http://dwellonit.taterunino.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p> ]]></content:encoded> </item> <item><title>By: Tateru Nino</title><link>http://dwellonit.taterunino.net/2010/03/08/when-high-performance-programming-goes-bad-scheduler-starvation/comment-page-1/#comment-8634</link> <dc:creator>Tateru Nino</dc:creator> <pubDate>Tue, 09 Mar 2010 11:14:36 +0000</pubDate> <guid
isPermaLink="false">http://dwellonit.taterunino.net/?p=2254#comment-8634</guid> <description>It&#039;s a little out of my usual line, but I used to manage development teams and even did a stint as a CTO for a while. May as well share some of the fruits.</description> <content:encoded><![CDATA[<p>It&#8217;s a little out of my usual line, but I used to manage development teams and even did a stint as a CTO for a while. May as well share some of the fruits.</p> ]]></content:encoded> </item> <item><title>By: Simon Newstead</title><link>http://dwellonit.taterunino.net/2010/03/08/when-high-performance-programming-goes-bad-scheduler-starvation/comment-page-1/#comment-8633</link> <dc:creator>Simon Newstead</dc:creator> <pubDate>Tue, 09 Mar 2010 11:11:00 +0000</pubDate> <guid
isPermaLink="false">http://dwellonit.taterunino.net/?p=2254#comment-8633</guid> <description>That was fun.  For a second I thought I had accidentally clicked through to an nginx forum *smiles*</description> <content:encoded><![CDATA[<p>That was fun.  For a second I thought I had accidentally clicked through to an nginx forum *smiles*</p> ]]></content:encoded> </item> <item><title>By: Nightbird Glineux</title><link>http://dwellonit.taterunino.net/2010/03/08/when-high-performance-programming-goes-bad-scheduler-starvation/comment-page-1/#comment-8627</link> <dc:creator>Nightbird Glineux</dc:creator> <pubDate>Tue, 09 Mar 2010 08:32:57 +0000</pubDate> <guid
isPermaLink="false">http://dwellonit.taterunino.net/?p=2254#comment-8627</guid> <description>Naughty code that must be punished.  OK.  *grin*</description> <content:encoded><![CDATA[<p>Naughty code that must be punished.  OK.  *grin*</p> ]]></content:encoded> </item> </channel> </rss>
