From: "Austin S. Hemmelgarn" <ahferroin7@gmail.com>
To: Peter Becker <floyd.net@gmail.com>,
linux-btrfs <linux-btrfs@vger.kernel.org>
Subject: Re: [markfasheh/duperemove] Why blocksize is limit to 1MB?
Date: Tue, 3 Jan 2017 07:40:51 -0500 [thread overview]
Message-ID: <0d0a4169-8c09-56c5-a052-0c894c46081c@gmail.com> (raw)
In-Reply-To: <CAEtw4r0-wgdQj4nO9HxCFvzXpRVhU=nqcKxRmDUsFVBuVrfong@mail.gmail.com>
On 2016-12-30 15:28, Peter Becker wrote:
> Hello, i have a 8 TB volume with multiple files with hundreds of GB each.
> I try to dedupe this because the first hundred GB of many files are identical.
> With 128KB blocksize with nofiemap and lookup-extends=no option, will
> take more then a week (only dedupe, previously hashed). So i tryed -b
> 100M but this returned me an error: "Blocksize is bounded ...".
>
> The reason is that the blocksize is limit to
>
> #define MAX_BLOCKSIZE (1024U*1024)
>
> But i can't found any description why.
Beyond what Xin mentioned (namely that 1MB is a much larger block than
will be duplicated in most data-sets), there are a couple of other reasons:
1. Smaller blocks will actually get you better deduplication on average
because they're more likely to match. As an example, assume you have 2
files with the same 8 4k blocks in different orders:
FileA: 1 2 3 4 5 6 7 8
FileB: 7 8 5 6 3 4 1 2
In such a case, deduplicating at any block size above 8k would result in
zero deduplication between these files, while 8k or less would
completely deduplicate them. This is of course a highly specific and
somewhat contrived example (in most cases it will be scattered duplicate
blocks over dozens of files), but it does convey this specific point.
2. The kernel will do a byte-wise comparison of all ranges you pass into
the ioctl at the same time. Larger block sizes here mean that:
a) The extents will be locked longer, which will prevent any I/O to the
files being deduplicated for the duration of the comparison, which may
in turn cause other issues on the system.
b) The deduplication process will be stuck in uninterruptible sleep
longer, which on many systems will trigger hung task detection, which
will in turn either spam the system log or panic the system depending on
how it's configured.
next prev parent reply other threads:[~2017-01-03 12:41 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-30 20:28 [markfasheh/duperemove] Why blocksize is limit to 1MB? Peter Becker
2017-01-01 4:38 ` Xin Zhou
2017-01-02 12:32 ` Peter Becker
2017-01-02 19:36 ` Xin Zhou
2017-01-03 12:40 ` Austin S. Hemmelgarn [this message]
2017-01-03 19:24 ` Peter Becker
2017-01-03 23:07 ` Hans van Kranenburg
2017-01-03 23:12 ` Peter Becker
2017-01-03 23:43 ` Hans van Kranenburg
2017-01-04 0:08 ` Martin Raiber
[not found] ` <CAEtw4r3mUA_4vcS-dbxagQn3NPRh8Cxcz0iF0L7jHwv5c9Ui+g@mail.gmail.com>
[not found] ` <7b0c897f-844c-e7f4-0ce7-c9f888b95983@gmail.com>
2017-01-03 20:20 ` Peter Becker
2017-01-03 20:40 ` Austin S. Hemmelgarn
2017-01-03 21:35 ` Peter Becker
2017-01-04 12:58 ` Austin S. Hemmelgarn
2017-01-04 14:42 ` Peter Becker
2017-01-09 1:09 ` Zygo Blaxell
2017-01-09 9:29 ` Peter Becker
2017-01-10 4:12 ` Zygo Blaxell
2017-01-03 20:21 ` Fwd: " Peter Becker
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=0d0a4169-8c09-56c5-a052-0c894c46081c@gmail.com \
--to=ahferroin7@gmail.com \
--cc=floyd.net@gmail.com \
--cc=linux-btrfs@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.