linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: "Lukáš Czerner" <lczerner@redhat.com>,
	"Richard W.M. Jones" <rjones@redhat.com>
Cc: linux-fsdevel@vger.kernel.org
Subject: Re: Making discard/fstrim reliable
Date: Thu, 03 Apr 2014 19:57:59 +0200	[thread overview]
Message-ID: <533DA127.5090909@redhat.com> (raw)
In-Reply-To: <alpine.LFD.2.00.1404031853360.2124@localhost.localdomain>

Il 03/04/2014 19:08, Lukáš Czerner ha scritto:
> However if we're talking about raw file system images in files in
> the host, then much better solution would be to use fsck. Ext4
> already has option -E discard which will send a discard down for
> ever free range (similarly as fstrim would do on mounted file
> system). I suspect that other fs utilities might have similar
> functionality.
>
> Of course in order for it to work you need a layer to translate
> discard requests to punch holes to the underlying file system (such
> as loop device for example). But I think that if there is enough
> interest we might do this directly from e2fsck when we notice that
> we're running on the file rather than block device.

The e2fsck can also be done from within libguestfs easily.  libguestfs 
runs within a VM so QEMU would handle the translation to hole-punching.

But fstrim is much faster than e2fsck.

 From Richard's description, what seems to happen is that ext4 FITRIM 
scans the filesystem and prepares the discard requests; but then it 
sends them down to the filesystem after the ioctl has finished.  Does 
that make any sense?  And would that be considered a bug?

Paolo
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2014-04-03 17:58 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-26 20:47 Making discard/fstrim reliable Richard W.M. Jones
2014-04-02 18:18 ` Jeff Moyer
2014-04-02 18:59   ` Richard W.M. Jones
2014-04-02 20:02     ` Jeff Moyer
2014-04-02 20:26       ` Richard W.M. Jones
2014-04-10 15:05       ` Richard W.M. Jones
2014-04-03 17:08 ` Lukáš Czerner
2014-04-03 17:23   ` Richard W.M. Jones
2014-04-03 17:57   ` Paolo Bonzini [this message]
2014-04-03 18:08     ` Richard W.M. Jones

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=533DA127.5090909@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=lczerner@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=rjones@redhat.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).