xfs
[Top] [All Lists]

Re: Preallocation with direct IO?

To: Dave Chinner <david@xxxxxxxxxxxxx>
Subject: Re: Preallocation with direct IO?
From: Amit Sahrawat <amit.sahrawat83@xxxxxxxxx>
Date: Fri, 30 Dec 2011 08:37:00 +0530
Cc: "hch@xxxxxxxxxxxxx" <hch@xxxxxxxxxxxxx>, "xfs@xxxxxxxxxxx" <xfs@xxxxxxxxxxx>
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=p5U4a2/mpuDeXAMtTP3m3U+Qb0fu5LxnzKmJA8crpYs=; b=hsaeLDDI+T/aZeTwMg8G6TdGAV00rwWWaRcsC4CC5RetXGVahapdKtJsFD53l2GBsn KQhu6AwzxXnSU2MHsLef0TDBqSppeu6+NpcMNKg/ctKwm29o7WDI//uMZa/KyUy3DdQV fouJV+5ar+Hp8bTDwlyoVBb+YfL3Ne0tiFrT8=
In-reply-to: <20111229205745.GH12731@dastard>
References: <4efc665b.d139e30a.2f32.fffff97a@xxxxxxxxxxxxx> <20111229205745.GH12731@dastard>
On Fri, Dec 30, 2011 at 2:27 AM, Dave Chinner <david@xxxxxxxxxxxxx> wrote:
> On Thu, Dec 29, 2011 at 01:10:49PM +0000, amit.sahrawat83@xxxxxxxxx wrote:
>> Hi, I am using a test setup which is doing write using multiple
>> threads using direct IO. The buffer size which is used to write is
>> 512KB.  After continously running this for long duration - i
>> observe that number of extents in each file is getting
>> huge(2K..4K..). I observed that each extent is of 512KB(aligned to
>> write buffer size). I wish to have low number of extents(i.e,
>> reduce fragmentation)... In case of buffered IO- preallocation
>> works good alongwith the mount option 'allocsize'. Is there
>> anything which can be done for Direct IO?  Please advice for
>> reducing fragmentation with direct IO.
>
> Direct IO does not do any implicit preallocation. The filesystem
> simply gets out of the way of direct IO as it is assumed you know
> what you are doing.
This is the supporting line I was looking for.
>
> i.e. you know how to use the fallocate() or ioctl(XFS_IOC_RESVSP64)
> calls to preallocate space or to set up extent size hints to use
> larger allocations than the IO being done during syscalls...
I tried to make use of preallocating space using
ioctl(XFS_IOC_RESVSP64) - but over time - this is also not working
well with the Direct I/O. Is there any call to set up extent size
also? please update I can try to make use of that also.

Thanks & Regards,
Amit Sahrawat
>
> Cheers,
>
> Dave.
> --
> Dave Chinner
> david@xxxxxxxxxxxxx

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