<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Feb 8, 2013 at 12:30 AM, Edward Z. Yang <span dir="ltr">&lt;<a href="mailto:ezyang@mit.edu" target="_blank">ezyang@mit.edu</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">OK. I think it is high priority for us to get some latency benchmarks<br>

into nofib so that GHC devs (including me) can start measuring changes<br>
off them.  I know Edsko has some benchmarks here:<br>
<a href="http://www.edsko.net/2013/02/06/performance-problems-with-threaded/" target="_blank">http://www.edsko.net/2013/02/06/performance-problems-with-threaded/</a><br>
but they depend on network which makes it a little difficult to move into nofib.<br>
I&#39;m working on other scheduler changes that may help you guys out; we<br>
should keep each other updated.<br></blockquote><div><br></div><div style>That would be great :)</div><div style> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<br>
I noticed your patch also incorporates the &quot;make yield actually work&quot; patch;<br>
do you think the improvement in 7.4.1 was due to that specific change?<br></blockquote><div> </div><div>Actually, I believe that patch is irrelevant to the scheduler change and probably should not be in there, strictly speaking. I actually needed that patch for the IO manager revisions to work properly.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
(Have you instrumented the run queues and checked how your patch changes<br>
the distribution of jobs over your runtime?)<br>
<br></blockquote><div style>I didn&#39;t do this very rigorously, but I think I added some print statements in the scheduler and I looked at some eventlogs in threadscope to see that threads work pushing slows down after a while. I had planned to write a script to analyze an event log file to extract these stats, but I never got around to it. </div>
<div style><br></div><div style>-Andi</div><div style><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

Somewhat unrelatedly, if you have some good latency tests already,<br>
it may be worth a try compiling your copy of GHC -fno-omit-yields, so that<br>
forced context switches get serviced more predictably.<br>
<br>
Cheers,<br>
Edward<br>
<br>
Excerpts from Andreas Voellmy&#39;s message of Thu Feb 07 21:20:<a href="tel:25%20-0800%202013" value="+12508002013">25 -0800 2013</a>:<br>
<div class=""><div class="h5">&gt; Hi Edward,<br>
&gt;<br>
&gt; I did two things to improve latency for my application: (1) rework the IO<br>
&gt; manager and (2) stabilize the work pushing. (1) seems like a big win and we<br>
&gt; are almost done with the work on that part. It is less clear whether (2)<br>
&gt; will generally help much. It helped me when I developed it against 7.4.1,<br>
&gt; but it doesn&#39;t seem to have much impact on HEAD on the few measurements I<br>
&gt; did. The idea of (2) was to keep running averages of the run queue length<br>
&gt; of each capability, then push work when these running averages get too<br>
&gt; out-of-balance. The desired effect (which seems to work on my particular<br>
&gt; application) is to avoid cases in which threads are pushed back and forth<br>
&gt; among cores, which may make cache usage worse. You can see my patch here:<br>
&gt; <a href="https://github.com/AndreasVoellmy/ghc-arv/commits/push-work-exchange-squashed" target="_blank">https://github.com/AndreasVoellmy/ghc-arv/commits/push-work-exchange-squashed</a><br>
&gt; .<br>
&gt;<br>
&gt; -Andi<br>
&gt;<br>
&gt; On Fri, Feb 8, 2013 at 12:10 AM, Edward Z. Yang &lt;<a href="mailto:ezyang@mit.edu">ezyang@mit.edu</a>&gt; wrote:<br>
&gt;<br>
&gt; &gt; Hey folks,<br>
&gt; &gt;<br>
&gt; &gt; The latency changes sound relevant to some work on the scheduler I&#39;m doing;<br>
&gt; &gt; is there a place I can see the changes?<br>
&gt; &gt;<br>
&gt; &gt; Thanks,<br>
&gt; &gt; Edward<br>
&gt; &gt;<br>
&gt; &gt; Excerpts from Simon Peyton-Jones&#39;s message of Wed Feb 06 10:10:10 -0800<br>
&gt; &gt; 2013:<br>
&gt; &gt; &gt; I (with help from Kazu and helpful comments from Bryan and Johan) have<br>
&gt; &gt; nearly completed an overhaul to the IO manager based on my observations and<br>
&gt; &gt; we are in the final stages of getting it into GHC<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; This is really helpful. Thank you very much Andreas, Kazu, Bryan, Johan.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Simon<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; From: <a href="mailto:parallel-haskell@googlegroups.com">parallel-haskell@googlegroups.com</a> [mailto:<br>
&gt; &gt; <a href="mailto:parallel-haskell@googlegroups.com">parallel-haskell@googlegroups.com</a>] On Behalf Of Andreas Voellmy<br>
&gt; &gt; &gt; Sent: 06 February 2013 14:28<br>
&gt; &gt; &gt; To: <a href="mailto:watson.timothy@gmail.com">watson.timothy@gmail.com</a><br>
&gt; &gt; &gt; Cc: <a href="mailto:kostirya@gmail.com">kostirya@gmail.com</a>; parallel-haskell;<br>
&gt; &gt; <a href="mailto:glasgow-haskell-users@haskell.org">glasgow-haskell-users@haskell.org</a><br>
&gt; &gt; &gt; Subject: Re: Cloud Haskell and network latency issues with -threaded<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Hi all,<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; I haven&#39;t followed the conversations around CloudHaskell closely, but I<br>
&gt; &gt; noticed the discussion around latency using the threaded runtime system,<br>
&gt; &gt; and I thought I&#39;d jump in here.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; I&#39;ve been developing a server in Haskell that serves hundreds to<br>
&gt; &gt; thousands of clients over very long-lived TCP sockets. I also had latency<br>
&gt; &gt; problems with GHC. For example, with 100 clients I had a 10 ms<br>
&gt; &gt; (millisecond) latency and with 500 clients I had a 29ms latency. I looked<br>
&gt; &gt; into the problem and found that some bottlenecks in the threaded IO manager<br>
&gt; &gt; were the cause. I made some hacks there and got the latency for 100 and 500<br>
&gt; &gt; clients down to under 0.2 ms. I (with help from Kazu and helpful comments<br>
&gt; &gt; from Bryan and Johan) have nearly completed an overhaul to the IO manager<br>
&gt; &gt; based on my observations and we are in the final stages of getting it into<br>
&gt; &gt; GHC. Hopefully our work will also fix the latency issues in CloudHaskell<br>
&gt; &gt; programs :)<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; It would be very helpful if someone has some benchmark CloudHaskell<br>
&gt; &gt; applications and workloads to test with. Does anyone have these handy?<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Cheers,<br>
&gt; &gt; &gt; Andi<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; On Wed, Feb 6, 2013 at 9:09 AM, Tim Watson &lt;<a href="mailto:watson.timothy@gmail.com">watson.timothy@gmail.com</a><br>
&gt; &gt; &lt;mailto:<a href="mailto:watson.timothy@gmail.com">watson.timothy@gmail.com</a>&gt;&gt; wrote:<br>
&gt; &gt; &gt; Hi Kostirya,<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; I&#39;m putting the parallel-haskell and ghc-users lists on cc, just in case<br>
&gt; &gt; other (better informed) folks want to chip in here.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; ----<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; First of all, I&#39;m assuming you&#39;re talking about network latency when<br>
&gt; &gt; compiling with -threaded - if not I apologise for misunderstanding!<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; There is apparently an outstanding network latency issue when compiling<br>
&gt; &gt; with -threaded, but according to a conversation I had with the other<br>
&gt; &gt; developers on #haskell-distributed, this is not something that&#39;s specific<br>
&gt; &gt; to Cloud Haskell. It is something to do with the threaded runtime system,<br>
&gt; &gt; so would need to be solved for GHC (or is it just the Network package!?) in<br>
&gt; &gt; general. Writing up a simple C program and equivalent socket use in Haskell<br>
&gt; &gt; and comparing the latency using -threaded will show this up.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; See the latency section in<br>
&gt; &gt; <a href="http://haskell-distributed.github.com/wiki/networktransport.html" target="_blank">http://haskell-distributed.github.com/wiki/networktransport.html</a> for some<br>
&gt; &gt; more details. According to that, there *are* some things we might be able<br>
&gt; &gt; to do, but the 20% latency isn&#39;t going to change significantly on the face<br>
&gt; &gt; of things.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; We have an open ticket to look into this (<br>
&gt; &gt; <a href="https://cloud-haskell.atlassian.net/browse/NTTCP-4" target="_blank">https://cloud-haskell.atlassian.net/browse/NTTCP-4</a>) and at some point<br>
&gt; &gt; we&#39;ll try and put together the sample programs in a github repository (if<br>
&gt; &gt; that&#39;s not already done - I might&#39;ve missed previous spikes done by Edsko<br>
&gt; &gt; or others) and investigate further.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; One of the other (more experienced!) devs might be able to chip in and<br>
&gt; &gt; proffer a better explanation.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Cheers,<br>
&gt; &gt; &gt; Tim<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; On 6 Feb 2013, at 13:27, <a href="mailto:kostirya@gmail.com">kostirya@gmail.com</a>&lt;mailto:<a href="mailto:kostirya@gmail.com">kostirya@gmail.com</a>&gt;<br>
&gt; &gt; wrote:<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; Haven&#39;t you had a necessity to launch Haskell in no-threaded mode<br>
&gt; &gt; during the intense network data exchange?<br>
&gt; &gt; &gt; &gt; I am getting the double performance penalty in threaded mode. But I<br>
&gt; &gt; must use threaded mode because epoll and kevent are available in the<br>
&gt; &gt; threaded mode only.<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; [snip]<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; среда, 6 февраля 2013 г., 12:33:36 UTC+2 пользователь Tim Watson<br>
&gt; &gt; написал:<br>
&gt; &gt; &gt; &gt; Hello all,<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; It&#39;s been a busy week for Cloud Haskell and I wanted to share a few of<br>
&gt; &gt; &gt; &gt; our news items with you all.<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; Firstly, we have a new home page at<br>
&gt; &gt; <a href="http://haskell-distributed.github.com" target="_blank">http://haskell-distributed.github.com</a>,<br>
&gt; &gt; &gt; &gt; into which most of the documentation and wiki pages have been merged.<br>
&gt; &gt; Making<br>
&gt; &gt; &gt; &gt; sassy looking websites is not really my bag, so I&#39;m very grateful to<br>
&gt; &gt; the<br>
&gt; &gt; &gt; &gt; various author&#39;s whose Creative Commons licensed designs and layouts<br>
&gt; &gt; made<br>
&gt; &gt; &gt; &gt; it easy to put together. We&#39;ve already had some pull requests to fix<br>
&gt; &gt; minor<br>
&gt; &gt; &gt; &gt; problems on the site, so thanks very much to those who&#39;ve contributed<br>
&gt; &gt; already!<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; As well as the new site, you will find a few of us hanging out on the<br>
&gt; &gt; &gt; &gt; #haskell-distributed channel on freenode. Please do come along and<br>
&gt; &gt; join in<br>
&gt; &gt; &gt; &gt; the conversation.<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; We also recently split up the distributed-process project into separate<br>
&gt; &gt; &gt; &gt; git repositories, one for each component that makes up Cloud Haskell.<br>
&gt; &gt; This<br>
&gt; &gt; &gt; &gt; was done partly for administrative purposes and partly because we&#39;re<br>
&gt; &gt; in the<br>
&gt; &gt; &gt; &gt; process of setting up CI builds for all the projects.<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; Finally, we&#39;ve moved from Github&#39;s issue tracker to a hosted<br>
&gt; &gt; Jira/Bamboo setup<br>
&gt; &gt; &gt; &gt; at <a href="https://cloud-haskell.atlassian.net" target="_blank">https://cloud-haskell.atlassian.net</a> - pull requests are naturally<br>
&gt; &gt; still welcome<br>
&gt; &gt; &gt; &gt; via Github! Although you can browse issues freely without logging in,<br>
&gt; &gt; you will<br>
&gt; &gt; &gt; &gt; need to provide an email address and get an account in order to submit<br>
&gt; &gt; new ones.<br>
&gt; &gt; &gt; &gt; If you have any difficulties logging in, please don&#39;t hesitate to<br>
&gt; &gt; contact me<br>
&gt; &gt; &gt; &gt; directly, via this forum or the cloud-haskell-developers mailing list<br>
&gt; &gt; (on<br>
&gt; &gt; &gt; &gt; google groups).<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; As always, we&#39;d be delighted to hear any feedback!<br>
&gt; &gt; &gt; &gt;<br>
&gt; &gt; &gt; &gt; Cheers,<br>
&gt; &gt; &gt; &gt; Tim<br>
&gt; &gt; &gt;<br>
&gt; &gt;<br>
<br>
</div></div><div class=""><div class="h5">--<br>
You received this message because you are subscribed to the Google Groups &quot;parallel-haskell&quot; group.<br>
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="mailto:parallel-haskell%2Bunsubscribe@googlegroups.com">parallel-haskell+unsubscribe@googlegroups.com</a>.<br>
For more options, visit <a href="https://groups.google.com/groups/opt_out" target="_blank">https://groups.google.com/groups/opt_out</a>.<br>
<br>
<br>
</div></div></blockquote></div><br></div></div>