xfs
[Top] [All Lists]

Re: allocsize mount option

To: Ivan.Novick@xxxxxxx
Subject: Re: allocsize mount option
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Wed, 29 Sep 2010 10:31:10 +1000
Cc: xfs@xxxxxxxxxxx, Timothy.Heath@xxxxxxx
In-reply-to: <C8C787CA.44AA%ivan.novick@xxxxxxx>
References: <C8C787CA.44AA%ivan.novick@xxxxxxx>
User-agent: Mutt/1.5.20 (2009-06-14)
On Tue, Sep 28, 2010 at 02:53:46PM -0400, Ivan.Novick@xxxxxxx wrote:
> Hi all,
> 
> According to the documentation the allocsize mount option: "Sets the
> buffered I/O end-of-file preallocation size when doing delayed allocation
> writeout"
> 
> Will this value limit "extent" sizes to be be no smaller than the allocsize?

No - it's specualtive preallocation.

> I have set the following mount options:
> (rw,noatime,nodiratime,logbufs=8,allocsize=512m)

/me wishes he could run a sed script across the internet.

noatime implies nodiratime, and logbufs=8 is the default, so you
only need "noatime,allocsize=512m"

> And yet, depending on the workload, the extent sizes are often 1 or 2 orders
> of magnitude lower than 512 MB ...

It's speculative and there's no guarantee that it can find a big
enough extent to complete the full allocsize allocation. Also, when
you close the file the speculative allocation beyond EOF is
truncated away. This is a particular problem with NFS servers.

> If I wanted to do further reading on the subject, can someone point me to an
> approximate location in the code where the size of a newly created extent is
> determined?

Start here:

fs/xfs/xfs_iomap.c::xfs_iomap_write_delay()

Cheers,

Dave.
-- 
Dave Chinner
david@xxxxxxxxxxxxx

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