From: Ted Ts'o <tytso@mit.edu>
To: Dave Chinner <david@fromorbit.com>
Cc: Richard Laager <rlaager@wiktel.com>, linux-fsdevel@vger.kernel.org
Subject: Re: fallocate(FALLOC_FL_PUNCH_HOLE)
Date: Wed, 14 Mar 2012 08:56:26 -0400 [thread overview]
Message-ID: <20120314125626.GI15379@thunk.org> (raw)
In-Reply-To: <20120314032709.GW3592@dastard>
On Wed, Mar 14, 2012 at 02:27:09PM +1100, Dave Chinner wrote:
> > If the answer to #2 is not C, it would appear there's no atomic way to
> > indicate that I'm done with certain data* but I want the filesystem to
> > continue to guarantee space for me. Is this correct?
>
> Not through fallocate() right now. XFS has an ioctl that will turn
> written ranges and holes back into preallocated space:
> XFS_IOC_ZERO_RANGE. I've got a patch that introduces this zeroing
> capability to fallocate (see below) which currently works on XFS.
If this is something that an important application or set of
applications really want, maybe we should provide an interface through
fallocate(2) TO DO THIS.
> > * so the filesystem can send a TRIM/UNMAP to an underlying SSD.
>
> It does not, however, issue discards on the range, because it is
> still allocated space in the filesystem. It could probably be
> made to do so, especially as the folks that requested the
> XFS_IOC_ZERO_RANGE functionality asking about extending it to do
> this last week.
... and if we know that discards will persistently cause blocks to
return zero (the device exports a flag indicating whether this is
true), and that trims are fast (i.e., they export the SATA 3.1 queable
trim command), it might make sense to simply issue a discard on the
range and not even mess with the metadata flags (since messing with
the metadata flags has overhead at punch time and the next time oyu
want to write to that block).
The choice of what to do should be hidden from the application, though
and be handled at the file system level.
- Ted
prev parent reply other threads:[~2012-03-14 12:56 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-10 20:07 fallocate(FALLOC_FL_PUNCH_HOLE) Richard Laager
2012-03-14 3:27 ` fallocate(FALLOC_FL_PUNCH_HOLE) Dave Chinner
2012-03-14 6:01 ` fallocate(FALLOC_FL_PUNCH_HOLE) Richard Laager
2012-03-14 12:56 ` Ted Ts'o [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120314125626.GI15379@thunk.org \
--to=tytso@mit.edu \
--cc=david@fromorbit.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=rlaager@wiktel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).