xfs
[Top] [All Lists]

Re: Issues with delalloc->real extent allocation

To: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Subject: Re: Issues with delalloc->real extent allocation
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Wed, 19 Jan 2011 09:03:35 +1100
Cc: Geoffrey Wehrman <gwehrman@xxxxxxx>, xfs@xxxxxxxxxxx
In-reply-to: <20110118204008.GA28791@xxxxxxxxxxxxx>
References: <20110114002900.GF16267@dastard> <20110114164016.GB30134@xxxxxxx> <20110114225907.GH16267@dastard> <20110115041629.GC11968@xxxxxxx> <20110117051827.GL16267@dastard> <20110117143708.GE11968@xxxxxxx> <20110118002437.GS28803@dastard> <20110118143000.GB8803@xxxxxxx> <20110118204008.GA28791@xxxxxxxxxxxxx>
User-agent: Mutt/1.5.20 (2009-06-14)
On Tue, Jan 18, 2011 at 03:40:09PM -0500, Christoph Hellwig wrote:
> On Tue, Jan 18, 2011 at 08:30:00AM -0600, Geoffrey Wehrman wrote:
> > Glad you were able to understand what I meant.  Something I didn't think
> > of earlier though:  What happens when I try to use an 8 GB on a system
> > with only 4 GB of memory?  I'm not really worried about this pathological
> > case, but I do wonder what the effects will be of allocating what could
> > be significant quantities of memory in .aio_write.
> 
> I think for large regions we'd be much better off to only zero the
> blocks on disk, not in-memory - for example like the code in
> xfs_zero_remaining_bytes does.

That doesn't help us, because the .writepage allocation code will
still allocate extsize aligned extents and expose the problem that
we have blocks on disk with no data in the page cache covering
them. The point of zeroing at .aio_write is that it avoids the
problem of .writepage allocating blocks we don't have dirty pages
for.

My preferred optimisation for this problem is that once we get above
a certain extsize threshold we simply preallocate extsized and
aligned chunks that cover the entire range for the write instead of
writing zeros. That preserves the extsize allocation alignment, and
unaligned writes and future IO see the space as unwritten and hence
get zeroed correctly...

Cheers,

Dave.
-- 
Dave Chinner
david@xxxxxxxxxxxxx

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