xfs
[Top] [All Lists]

Re: hole punching performance

To: "Bradley C. Kuszmaul" <kuszmaul@xxxxxxxxx>
Subject: Re: hole punching performance
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Wed, 16 Jan 2013 14:22:10 +1100
Cc: Florian Weimer <fw@xxxxxxxxxxxxx>, Ben Myers <bpm@xxxxxxx>, xfs@xxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <CAKSyJXfc22B77Y5633tP8t6=JVn7vS_q2jXxAj5tZYV3GF1KmA@xxxxxxxxxxxxxx>
References: <87pq195t8q.fsf@xxxxxxxxxxxxxxxxx> <CAKSyJXfQsmemZ3H9A92UezsPCXfn37LXP3tpPMkiwtvR4=eY2g@xxxxxxxxxxxxxx> <20130113194941.GB27055@xxxxxxx> <20130113225545.GA19173@dastard> <87mwwaqgkj.fsf@xxxxxxxxxxxxxxxxx> <CAKSyJXdejNhNgqq6g8N4n6Cjz2s3+m=JUvanTRfDtF72d2RxFg@xxxxxxxxxxxxxx> <20130115225435.GB2498@dastard> <CAKSyJXfs-vfUKybDiQR2mSdP18am06CHsx0io6bF9HLWmvWoFA@xxxxxxxxxxxxxx> <20130116000051.GC2498@dastard> <CAKSyJXfc22B77Y5633tP8t6=JVn7vS_q2jXxAj5tZYV3GF1KmA@xxxxxxxxxxxxxx>
User-agent: Mutt/1.5.21 (2010-09-15)
On Tue, Jan 15, 2013 at 09:46:36PM -0500, Bradley C. Kuszmaul wrote:
> But if I populate the file with a collection of near-1MB writes at random
> offsets, I'm likely to end up with one extent per write.

Maybe. What you get depends on a lot of factors

e.g. buffered IO will give different extent allocations to direct
IO. Synchronous buffered IO will give different patterns to async
buffered IO. Adding random fdatasync() calls will give different
patterns again. And even better, if you are doing async buffered IO,
different amounts of memory pressure can give you different
results...

> Each non-hole
> line in xfs_bmap is an extent, right?

Well, that depends on your definition of an extent. e.g. is a
contiguous region on disk that alternates between written and
unwritten state one extent? From an physical perspective
it is a single extent, but from a logical perspective (i.e.
for indexing) it is multiple extents....

FWIW, if you are intending that the file is non-sparse at the end of
all the writes (i.e. you fill all the holes), they preallocating the
file before starting any writes is a good idea because it guarantees
you'll end up with a minimal number of physical extents when the
file is completely written....

Cheers,

Dave.
-- 
Dave Chinner
david@xxxxxxxxxxxxx

<Prev in Thread] Current Thread [Next in Thread>