<div dir="ltr">Hi Timothy,<div><br></div><div>I don&#39;t know why you didn&#39;t see that reply with code. Anyway, it&#39;s like this: </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"><div style="font-size:12.8000001907349px">CPU: Intel(R) Xeon(R) CPU E3-1230 V2 @ 3.30GHz</div><div style="font-size:12.8000001907349px"><br></div><div style="font-size:12.8000001907349px">QEMU execution time:           5509153 us</div><div style="font-size:12.8000001907349px">Bare-metal execution time: 10802345 us</div><div style="font-size:12.8000001907349px">w/o hyper-threading:              6065235 us</div><div style="font-size:12.8000001907349px"><br></div><div style="font-size:12.8000001907349px">code:</div><div style="font-size:12.8000001907349px"><blockquote>#include &lt;stdio.h&gt;<br>#include &lt;sys/time.h&gt;<br>long fib(long a, long b, long depth)<br>{<br>    if (depth &gt; 0) {<br>        return fib(b, a + b, depth - 1);<br>    }<br>    return b;<br>}<br>int main(void)<br>{<br>    struct timeval start;<br>    gettimeofday(&amp;start, NULL);<br>    printf(&quot;fib: %ld\n&quot;, fib(1, 1, 10000000000));<br>    struct timeval end;<br>    gettimeofday(&amp;end, NULL);<br>    printf(&quot;time: %ld us\n&quot;, end.tv_usec - start.tv_usec + (end.tv_sec - start.tv_sec) * 10000\00);<br>    return 0;<br>}</blockquote></div></blockquote></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Feb 8, 2015 at 7:10 PM, Timothy Roscoe <span dir="ltr">&lt;<a href="mailto:troscoe@inf.ethz.ch" target="_blank">troscoe@inf.ethz.ch</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Dear Tom,<br>
<br>
Perhaps it would be easier for us to understand your problem if you<br>
posted the code you running, and also how you are taking your<br>
measurements.   Can you share that with us?<br>
<span class="HOEnZb"><font color="#888888"><br>
 -- Timothy<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
At Sun, 8 Feb 2015 12:37:09 +0800, &quot;tomsun.0.7&quot; &lt;<a href="mailto:tomsun.0.7@gmail.com">tomsun.0.7@gmail.com</a>&gt; wrote:<br>
&gt; Really sorry for misunderstanding your reply but I also considered about<br>
&gt; QEMU&#39;s imprecise measure of time. I increased the steps of additions by 10<br>
&gt; times so that it will take around one minute to finish. Then I started<br>
&gt; two Barrelfish (one in QEMU and one on bare-metal) and spawned the same<br>
&gt; application at the same time (nearly, no guarantee for submillisecond<br>
&gt; difference), but I found there is a obvious gap (about 5 seconds) between<br>
&gt; their end time to finish.<br>
&gt;<br>
&gt; And I have read your SOSP paper, which gives an evaluation with OpenMP.<br>
&gt; Indeed, the performance for insert sort is nearly the same with the one on<br>
&gt; Linux while running on one core. So, I become more curious about why I got<br>
&gt; different performance.<br>
&gt;<br>
&gt; Is there any tools, like profiling tools, I can leverage to find out the<br>
&gt; reasons?<br>
&gt;<br>
&gt; On Sun, Feb 8, 2015 at 3:51 AM, Simon Peter &lt;<a href="mailto:speter@inf.ethz.ch">speter@inf.ethz.ch</a>&gt; wrote:<br>
&gt;<br>
&gt; &gt; What I mean is that in order to measure performance in terms of execution<br>
&gt; &gt; time (as I can glance from your previous email that had results in it), you<br>
&gt; &gt; first need a notion of time. Barrelfish&#39;s notion of time is off on QEMU.<br>
&gt; &gt; Hence, you might be seeing wrong results.<br>
&gt; &gt;<br>
&gt; &gt; We have compared Barrelfish to Linux performance on bare-metal hardware in<br>
&gt; &gt; various papers, such as our SOSP paper.<br>
&gt; &gt;<br>
&gt; &gt; On 02/06/2015 07:02 PM, tomsun.0.7 wrote:<br>
&gt; &gt;<br>
&gt; &gt;&gt; I don&#39;t actually care about the measure of CPU speed, I want to know why<br>
&gt; &gt;&gt; Barrelfish performs worse on bare-metal than on QEMU with KVM.<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; As my second reply demonstrated, I got worse performance while running<br>
&gt; &gt;&gt; applications on bare-metal than both QEMU with KVM and native Linux.<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; I made sure that it doesn&#39;t result from CPU frequency, because I<br>
&gt; &gt;&gt; accessed the hardware performance registers directly within kernel and<br>
&gt; &gt;&gt; found it did run with full speed.<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; Now, I&#39;m suspecting that is it possible that the performance is<br>
&gt; &gt;&gt; influenced by some other factors like, device interrupts?<br>
&gt; &gt;&gt; Have you ever measured the performance of Barrelfish and compared it<br>
&gt; &gt;&gt; with Linux or other operating system?<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; On Sat, Feb 7, 2015 at 3:47 AM, Simon Peter &lt;<a href="mailto:speter@inf.ethz.ch">speter@inf.ethz.ch</a><br>
&gt; &gt;&gt; &lt;mailto:<a href="mailto:speter@inf.ethz.ch">speter@inf.ethz.ch</a>&gt;&gt; wrote:<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt;     I&#39;m also suspecting that it might just be jittery CPU emulation<br>
&gt; &gt;&gt;     speed that&#39;s getting you different results. Barrelfish&#39;s usleep<br>
&gt; &gt;&gt;     ultimately uses sys_debug_get_tsc_per_ms, so your 2 ways might<br>
&gt; &gt;&gt;     actually be the same. Barrelfish measures CPU speed at bootup, but<br>
&gt; &gt;&gt;     it&#39;s very bad at figuring it out correctly on QEMU. I&#39;m not sure<br>
&gt; &gt;&gt;     what the best way is to get accurate results on QEMU.<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt;     On 15-02-04 09:46 PM, tomsun.0.7 wrote:<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt;&gt;     Hi,<br>
&gt; &gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt;     I started a network application who is dedicated to produce<br>
&gt; &gt;&gt;&gt;     packets all the time. However, when I started it on bare-metal, I<br>
&gt; &gt;&gt;&gt;     found the throughput is only a half of running in QEMU (of course,<br>
&gt; &gt;&gt;&gt;     with KVM enabled).<br>
&gt; &gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt;     This application is only CPU-intensive, it just produces a lot of<br>
&gt; &gt;&gt;&gt;     packets and then destroys them. So it&#39;s none of the devices&#39;<br>
&gt; &gt;&gt;&gt;     business. At first, I think it results from the low frequency of<br>
&gt; &gt;&gt;&gt;     cores, so I measured this by two ways: 1. invoking native<br>
&gt; &gt;&gt;&gt;     Barrelfish interface, sys_debug_get_tsc_per_ms, directly; 2.<br>
&gt; &gt;&gt;&gt;     reading tsc and sleeping for 1 second using POSIX sleep (which is<br>
&gt; &gt;&gt;&gt;     implemented by invoking Barrelfish&#39;s usleep as I know). However, I<br>
&gt; &gt;&gt;&gt;     got the full-speed results under both conditions.<br>
&gt; &gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt;     So, I don&#39;t know whether it results from incorrect measure of<br>
&gt; &gt;&gt;&gt;     frequency or some other CPU problems because I even tried to start<br>
&gt; &gt;&gt;&gt;     it with PXE in QEMU, and got full performance.<br>
&gt; &gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt;     What can I do to get normal performance on bare-metal? Or, if it<br>
&gt; &gt;&gt;&gt;     results from low frequency of CPUs, what can I do to tune up the<br>
&gt; &gt;&gt;&gt;     frequency?<br>
&gt; &gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt;     Tom<br>
&gt; &gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt;     _______________________________________________<br>
&gt; &gt;&gt;&gt;     Barrelfish-users mailing list<br>
&gt; &gt;&gt;&gt;     <a href="mailto:Barrelfish-users@lists.inf.ethz.ch">Barrelfish-users@lists.inf.ethz.ch</a>  &lt;mailto:<a href="mailto:Barrelfish-users@">Barrelfish-users@</a><br>
&gt; &gt;&gt;&gt; <a href="http://lists.inf.ethz.ch" target="_blank">lists.inf.ethz.ch</a>&gt;<br>
&gt; &gt;&gt;&gt;     <a href="https://lists.inf.ethz.ch/mailman/listinfo/barrelfish-users" target="_blank">https://lists.inf.ethz.ch/mailman/listinfo/barrelfish-users</a><br>
&gt; &gt;&gt;&gt;<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt;<br>
&gt; &gt;<br>
&gt;<br>
</div></div></blockquote></div><br></div>