[Top] [All Lists]

Re: allocsize mount option, was: [PATCH 1/2] xfs: dynamic speculative EO

To: Michael Monnerie <michael.monnerie@xxxxxxxxxxxxxxxxxxx>
Subject: Re: allocsize mount option, was: [PATCH 1/2] xfs: dynamic speculative EOF preallocation
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Fri, 15 Oct 2010 22:59:07 +1100
Cc: xfs@xxxxxxxxxxx
In-reply-to: <201010150851.25327@xxxxxx>
References: <1286187236-16682-1-git-send-email-david@xxxxxxxxxxxxx> <1287076965.2362.520.camel@doink> <20101014213325.GF4681@dastard> <201010150851.25327@xxxxxx>
User-agent: Mutt/1.5.20 (2009-06-14)
On Fri, Oct 15, 2010 at 08:51:24AM +0200, Michael Monnerie wrote:
> On Donnerstag, 14. Oktober 2010 Dave Chinner wrote:
> > > I guess the reason one might want the "allocsize" mount
> > > option now becomes the opposite of why one might have
> > > wanted it before.  I.e., it would be used to reduce
> > > the size of the preallocated range beyond EOF, which I
> > > could envision might be reasonable in some circumstances.
> > 
> > It now becomes the minimum preallocation size, rather than both the
> > minimum and the maximum....
> Until now, I often set allocsize to be <nr of data disks>*<stripe size>, 
> i.e. in a 8 disk RAID-6 with 64KB stripe size = 6*64 = 384KB
> I guess this should provide the best performance.

It's not doing what you think it is:

> Is my assumption true?


        Sets the buffered I/O end-of-file preallocation size when
        doing delayed allocation writeout (default size is 64KiB).
        Valid values for this option are page size (typically 4KiB)
        through to 1GiB, inclusive, in power-of-2 increments.

The code will round the value down to the nearest power of 2, which
means you're actually telling it to preallocate 256k at a time.

> Will it change with the new code?

Entirely possible. We can and do change behaviour of mount options
when it results in an improvement.

> Does XFS automatically use allocsize=<1 full stripe> so I can skip my 
> manual allocsize options?

No. I will refer you to the swalloc mount option, though:

        Data allocations will be rounded up to stripe width boundaries
        when the current end of file is being extended and the file
        size is larger than the stripe width size.

Which affects both delayed allocation (after speculative prealloc
has been calculated) and physical allocation for direct IO.


Dave Chinner

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