Hello,<br><br><div class="gmail_quote">On Mon, Jan 16, 2012 at 6:25 PM, Dave Chinner <span dir="ltr"><<a href="mailto:david@fromorbit.com">david@fromorbit.com</a>></span> wrote:<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
> 0xffffffff81288b6a : xfs_aio_write_newsize_update+0x3a/0x90 [kernel]<br>
<br>
Only ever taken when doing appending writes. Are you -sure- you are<br>
not doing appending writes?<br></blockquote><div>This is weird. Yes, I'm sure. I use pwrite() to write data to a 4G file, and I check the offset of each write and they are always smaller than 4G.</div><div>I instrument the code with systemtap and it shows me that ip->i_new_size and new_size in xfs_aio_write_newsize_update are both 0. </div>
<div>Since in my case there is only overwrite, ip->i_new_size will always be 0 (the only place that updates ip->i_new_size is xfs_file_aio_write_checks). Because of the same reason, new_size returned by xfs_file_aio_write_checks is always 0.</div>
<div>Is it what you expected?</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
> 0xffffffff812829f4 : __xfs_get_blocks+0x94/0x4a0 [kernel]<br>
<br>
And for direct IO writes, this will be the block mapping lookup so<br>
always hit.<br>
<br>
<br>
What this says to me is that you are probably doing is lots of very<br>
small concurrent write IOs, but I'm only guessing. Can you provide<br>
your test case and a description of your test hardware so we can try<br>
to reproduce the problem?<br></blockquote><div><span class="Apple-style-span" style>I build XFS on the top of ramdisk. </span><span class="Apple-style-span" style>So yes, there is a lot of small concurrent writes in a second.</span></div>
<div><span class="Apple-style-span" style>I create a file of 4GB in XFS (the ramdisk has 5GB of space). My test program overwrites 4G of data to the file and each time writes a page of data randomly to the file. It's always overwriting, and no appending. The offset of each write is always aligned to the page size. There is no overlapping between writes. </span></div>
<div><span class="Apple-style-span" style>So the test case is pretty simple and I think it's easy to reproduce it. It'll be great if you can try the test case.</span></div><div><span class="Apple-style-span" style><br>
</span></div></div>Thanks,<div>Da</div>