linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mark Fasheh <mfasheh@suse.de>
To: "Austin S. Hemmelgarn" <ahferroin7@gmail.com>
Cc: Rich Freeman <r-btrfs@gw.thefreemanclan.net>,
	Duncan <1i5t5.duncan@cox.net>,
	Btrfs BTRFS <linux-btrfs@vger.kernel.org>
Subject: Re: Why is dedup inline, not delayed (as opposed to offline)? Explain like I'm five pls.
Date: Sat, 23 Jan 2016 14:22:05 -0800	[thread overview]
Message-ID: <20160123222205.GE24672@wotan.suse.de> (raw)
In-Reply-To: <569CD935.4030708@gmail.com>

On Mon, Jan 18, 2016 at 07:23:17AM -0500, Austin S. Hemmelgarn wrote:
> On 2016-01-16 13:07, Rich Freeman wrote:
> >On Sat, Jan 16, 2016 at 9:10 AM, Duncan <1i5t5.duncan@cox.net> wrote:
> >>Al posted on Sat, 16 Jan 2016 12:27:16 +0000 as excerpted:
> >>
> >>>Is there any urgency for dedup? What's wrong with storing the hash on
> >>>disk with the block and having a separate process dedup the written data
> >>>over time;
> >>
> >>There's actually uses for both inline and out-of-line[1] aka delayed
> >>dedup.  Btrfs already has a number of independent products doing various
> >>forms of out-of-line dedup, so what's missing and being developed now is
> >>the inline dedup option, which being directly in the write processing,
> >>must be handled by btrfs itself -- it can't be primarily done by third
> >>parties with just a few kernel calls, like out-of-line dedup can.
> >
> >Does the out-of-line dedup option actually utilize stored hashes, or
> >is it forced to re-read all the data to compute hashes?  If it is
> >collecting checksums/etc is this done efficiently?
> AFAIK, duperemove has the option to store block hashes in a database
> to save them between runs (I'm pretty sure that it invalidates
> hashes if the file containing the block changed, but I'm not
> certain).

Yes, duperemove can use a hashfile (this is the recommened way of running
it). right now they're more or less temporary storage for one run (though as
you noted you can reuse the hashfile later).

The feature to rescan only the changed parts of a filesystem (and reuse the
hashfile) is in development and will be available with the next major
release.


> >I think he is actually suggesting a hybrid approach where a bit of
> >effort is done during operations to greatly streamline out-of-line
> >deduplication.  I'm not sure how close we are to that already, or if
> >any room for improvement remains.
> There isn't any implementation I know of that does this.  In theory,
> it would be pretty easy if we could somehow get block checksums
> from BTRFS in userspace.

btrfs block checksums are there for us to see if a block was corrupted.
It is generally agreed that they will be colliding a lot which would cause
unnecessary file reads during the dedupe ioctl.

Also, if we get them from the FS we can only get them in blocksized chunks
which at 4K make dedupe expensive. Duperemove for example, defaults to 128K
chunks for this reason.
	--Mark

--
Mark Fasheh

  reply	other threads:[~2016-01-23 22:22 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-16 12:27 Why is dedup inline, not delayed (as opposed to offline)? Explain like I'm five pls Al
2016-01-16 14:10 ` Duncan
2016-01-16 18:07   ` Rich Freeman
2016-01-18 12:23     ` Austin S. Hemmelgarn
2016-01-23 22:22       ` Mark Fasheh [this message]
2016-01-20 14:49     ` Al
2016-01-20 14:43   ` Al
2016-01-21  8:23     ` Qu Wenruo
2016-01-21 14:53       ` Al
2016-01-21 17:23         ` Chris Murphy
2016-01-22 11:33           ` Al
2016-01-23  2:44             ` Chris Murphy
2016-02-02  2:55             ` Qu Wenruo
2016-01-18  1:36 ` Qu Wenruo
2016-01-18  3:10   ` Duncan
2016-01-18  3:16     ` Qu Wenruo
2016-01-18  3:51       ` Duncan
2016-01-18 12:48         ` Austin S. Hemmelgarn
2016-01-19  8:30           ` Duncan
2016-01-19  9:14             ` Duncan
2016-01-19 12:28               ` Austin S. Hemmelgarn
2016-01-19 15:40                 ` Duncan
2016-01-20  8:32                 ` Brendan Hide
2016-01-19 12:21             ` Austin S. Hemmelgarn
2016-01-20 15:12               ` Al
2016-01-20 18:21                 ` Duncan
2016-01-20 14:53   ` Al

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=20160123222205.GE24672@wotan.suse.de \
    --to=mfasheh@suse.de \
    --cc=1i5t5.duncan@cox.net \
    --cc=ahferroin7@gmail.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=r-btrfs@gw.thefreemanclan.net \
    /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).