<div dir="ltr">Hi Eric,<div><br></div><div>Thank you for your quick reply.<br></div><div><br></div><div>Using xfs_io as per your suggestion, I am able to reproduce the issue. However, I need to falloc for 256K and write for 257K to see this issue.<br></div><div><br></div><div><div># xfs_io -f -c "falloc 0 256k" -c "pwrite 0 257k" /srv/node/r1/t1.txt</div><div># stat /srv/node/r1/t4.txt | grep Blocks</div><div>  Size: 263168    <span style="white-space:pre-wrap"> </span>Blocks: 1536       IO Block: 4096   regular file</div></div><div>







<p><span># xfs_io -f -c "pwrite 0 257k" /srv/node/r1/t2.txt</span></p><div># stat  /srv/node/r1/t2.txt | grep Blocks<br></div><div>Size: 263168    <b>Blocks</b>: 520        IO Block: 4096   regular file</div></div><div><br></div><div><div># xfs_info /srv/node/r1</div><div>meta-data=/dev/mapper/35000cca05831283c-part2 isize=256    agcount=4, agsize=183141504 blks</div><div>         =                       sectsz=512   attr=2, projid32bit=1</div><div>         =                       crc=0        finobt=0</div><div>data     =                       bsize=4096   blocks=732566016, imaxpct=5</div><div>         =                       sunit=0      swidth=0 blks</div><div>naming   =version 2              bsize=4096   ascii-ci=0 ftype=0</div><div>log      =internal               bsize=4096   blocks=357698, version=2</div><div>         =                       sectsz=512   sunit=0 blks, lazy-count=1</div><div>realtime =none                   extsz=4096   blocks=0, rtextents=0</div></div><div><br></div><div>







<p class=""><span class=""># cat /proc/mounts | grep r1</span></p><p class=""><span class="">/dev/mapper/35000cca05831283c-part2 /srv/node/</span><span class=""><b>r1</b></span><span class=""> xfs rw,nosuid,nodev,noexec,noatime,nodiratime,attr2,inode64,logbufs=8,noquota 0 0</span></p></div><div>I waited for around 15 mins before collecting the stat output to give the background reclamation logic a fair chance to do its job. I also tried changing the value of speculative_prealloc_lifetime from 300 to 10. But it was of no use.</div><div>







<div><br></div><div>cat /proc/sys/fs/xfs/speculative_prealloc_lifetime<br></div><div>10</div></div><div><br></div><div>Regards,</div><div>Dilip</div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Feb 2, 2016 at 6:47 PM, Eric Sandeen <span dir="ltr"><<a href="mailto:sandeen@sandeen.net" target="_blank">sandeen@sandeen.net</a>></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"><span><br>
<br>
On 2/2/16 4:32 PM, Dilip Simha wrote:<br>
> Hi,<br>
><br>
> I have a question regarding speculated preallocation in XFS, w.r.t<br>
> kernel version: 3.16.0-46-generic. I am using Swift version: 1.0 and<br>
> mkfs.xfs version 3.2.1<br>
><br>
> When I write a 256KiB file to Swift, I see that the underlying XFS<br>
> uses 3x the amount of space/blocks to write that data. Upon<br>
> performing detailed experiments, I see that when Swift uses fallocate<br>
> (default approach), XFS doesn't reclaim the preallocated blocks that<br>
> XFS allocated. Swift fallocate doesn't exceed the body size(256<br>
> KiB).<br>
><br>
> Interestingly, when either allocsize=4k or when swift doesn't use<br>
> fallocate, XFS doesn't consume additional space.<br>
><br>
> Can you please let me know if this is a known bug and if its fixed in<br>
> the later versions?<br>
<br>
</span>Can you clarify the exact sequence of events?<br>
<br>
i.e. -<br>
<br>
xfs_io -f -c "fallocate 0 256k" -c "pwrite 0 256k" somefile<br>
<br>
leads to unreaclaimed preallocation, while<br>
<br>
xfs_io -f -c "pwrite 0 256k" somefile<br>
<br>
does not?  Or is it some other sequence?  I don't have a<br>
3.16 handy to test, but if you can describe it in more detail<br>
that'd help.  Some of this is influenced by fs geometry, too<br>
so xfs_info output would be good, along with any mount options<br>
you might be using.<br>
<br>
Are you preallocating with or without KEEP_SIZE?<br>
<br>
-Eric<br>
<br>
_______________________________________________<br>
xfs mailing list<br>
<a href="mailto:xfs@oss.sgi.com" target="_blank">xfs@oss.sgi.com</a><br>
<a href="http://oss.sgi.com/mailman/listinfo/xfs" rel="noreferrer" target="_blank">http://oss.sgi.com/mailman/listinfo/xfs</a><br>
</blockquote></div><br></div></div>