Hello Christoph,<div><br></div><div>Right now I&#39;m using kernel 3.2. </div><div>My test program writes 4G of data to a file that has been preallocated and each time it writes a page of data randomly to the file. It&#39;s always overwriting, and no appending. The offset of each write is always aligned to the page size. There is no overlapping between writes as I said before. </div>
<div>I also tried mixing reads and writes and got the similar result.</div><div>Can you write data to a file with multiple threads and the performance can scale up with more threads?</div><div><br></div><div>Thanks,</div>
<div>Da<br><br><div class="gmail_quote">On Mon, Jan 16, 2012 at 12:48 PM, Christoph Hellwig <span dir="ltr">&lt;<a href="mailto:hch@infradead.org">hch@infradead.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Sun, Jan 15, 2012 at 07:01:42PM -0500, Zheng Da wrote:<br>
&gt; Hello,<br>
&gt;<br>
&gt; I surprisedly found that writing data to a file (no appending) with direct<br>
&gt; IO and with multiple threads has the same performance as a single thread.<br>
&gt; Actually, it seems there is only one core is working at a time. In my case,<br>
&gt; each time I write a page to a file and the offset is always aligned to the<br>
&gt; page size, so there is no overlapping between writes.<br>
<br>
</div>What kernel version are you using?  Also, what is the exact I/O<br>
pattern?<br>
<br>
</blockquote></div><br></div>