Fragmentation and hole punching

Bradley C. Kuszmaul kuszmaul at gmail.com
Sat Jan 5 18:52:46 CST 2013


I'm using hole punching now in my code.  Should I have any concerns about
fragmentation?

Here's how I use it:
 I perform pwrite() operations of various sizes.  These are "blocks" in my
application.  These blocks are always 4KB-aligned, but they are of many
different sizes.  Most writes are near a megabyte in size, but hardly ever
exactly a megabyte.
 I also punch holes.  The holes always correspond exactly to a previously
written pwrite().
 A pwrite() always writes into a hole.  (It never overwrites current data).

For example I might write
 1MB at offset 1MB
then write 3MB at offset 2MB
then punch a hole of size 1MB at offset 1MB
then do some more activity elsewhere in the file
then write 512K at an offset of 1MB (partially filling the hole that I had
punched)

I have a lot of experience running this code on xfs without the hole
punching.  The pattern of the pwrite()'s are the same with or without hole
punching.  So I'd hope that the hole punching didn't make things any worse,
and maybe made things better.

Can I expect that this will work reasonably well?

By the way, all of your help has been outstanding.

-Bradley
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://oss.sgi.com/pipermail/xfs/attachments/20130105/3046ef5c/attachment-0001.htm>


More information about the xfs mailing list