[Top] [All Lists]

Re: [PATCH 4/7][TAKE5] support new modes in fallocate

To: Nathan Scott <nscott@xxxxxxxxxx>
Subject: Re: [PATCH 4/7][TAKE5] support new modes in fallocate
From: David Chinner <dgc@xxxxxxx>
Date: Thu, 28 Jun 2007 10:39:21 +1000
Cc: David Chinner <dgc@xxxxxxx>, Andreas Dilger <adilger@xxxxxxxxxxxxx>, xfs-oss <xfs@xxxxxxxxxxx>, "Amit K. Arora" <aarora@xxxxxxxxxxxxxxxxxx>, linux-fsdevel@xxxxxxxxxxxxxxx, linux-ext4@xxxxxxxxxxxxxxx, suparna@xxxxxxxxxx, cmm@xxxxxxxxxx
In-reply-to: <1182986916.15488.88.camel@xxxxxxxxxxxxxx>
References: <20070614120413.GD86004887@xxxxxxx> <20070614193347.GN5181@xxxxxxxxxxxxxxxxxxxx> <20070625132810.GA1951@xxxxxxxxxxxxxxxxxxxx> <20070625134500.GE1951@xxxxxxxxxxxxxxxxxxxx> <20070625150320.GA8686@xxxxxxxxxxxxxxxxxxxx> <20070625214626.GJ5181@xxxxxxxxxxxxxxxxxxxx> <20070626231431.GO31489@xxxxxxx> <20070627034915.GR6652@xxxxxxxxxxxxxxxxxxxx> <20070627133657.GQ989688@xxxxxxx> <1182986916.15488.88.camel@xxxxxxxxxxxxxx>
Sender: xfs-bounce@xxxxxxxxxxx
User-agent: Mutt/
On Thu, Jun 28, 2007 at 09:28:36AM +1000, Nathan Scott wrote:
> On Wed, 2007-06-27 at 23:36 +1000, David Chinner wrote:
> > .... Allows setup_swap_extents() to use preallocated files on XFS
> > filesystems for swap files without ever needing to convert them.
> Using unwritten extents (as opposed to the MKSWAP flag mentioned
> earlier) has the unfortunate down side of requiring transactions,
> possibly additional IO, and memory allocation during swap.  (but,
> this patch should probably go in regardless, as teaching generic
> code about unwritten extents is not a bad idea).

I don't think it does - swapfile I/O looks like it goes direct to
bio without passing through the filesystem.  When the swapfile is
mapped, it scans and records the extent map of the entire swapfile
in a separate structure and AFAICT the swap code uses that built map
without touching the filesystem at all.

If that is true then the written/unwritten state of the extents is
irrelevant; all we need is allocated disk space for the file and
swapping should work. And it's not like anyone should be reading
the contents of that swapfile through the filesystem, either. ;)


Dave Chinner
Principal Engineer
SGI Australian Software Group

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