linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Duncan <1i5t5.duncan@cox.net>
To: linux-btrfs@vger.kernel.org
Subject: Re: -musage=>0 means always reporting relocation
Date: Tue, 13 May 2014 18:06:15 +0000 (UTC)	[thread overview]
Message-ID: <pan$a3b8$51a4e271$bdd12d08$cc38c3c0@cox.net> (raw)
In-Reply-To: 2427848.SjNntC7t9e@xev

Russell Coker posted on Tue, 13 May 2014 17:57:00 +1000 as excerpted:

>> The pathological case is where you have a chunk that is 1% full and
>> *every* other in-use chunk on the device is 100% full. In that
>> situation, a balance will simply move that data into a new chunk (which
>> will only ever reach 1% full). Thus, all subsequent balances will
>> relocate that same data again to another new chunk.
> 
> In that pathological case surely the correct thing to do is to not move
> that chunk.  If moving a chunk doesn't achieve filesystem tuning goals
> (EG converting to a different RAID level) and doesn't result in a
> decrease of the number of chunks in use then surely there's no point to
> doing it.

But what balance and the resulting multi-chunk interactions does is 
complex enough, that in general it doesn't know whether it's going to 
decrease the number of chunks used until it actually goes thru the 
motions and tries it.  In theory, a "dry-run" option could be added, but 
it would still take near the same amount of time as it has to check the 
same stuff, just not do the rewrite, and potentially, tracking the dry-
run results would increase memory usage significantly.

Meanwhile, what if an admin is wanting to simply rewrite the data, to 
check the filesystem validity and renew the on-media signal strength to 
avoid bit-rot, defragging in the process?  That's a valid balance use-
case as that's what it actually does.

Someone mentioned trying to use scrub to check filesystem validity, and I 
said that was the wrong tool for the job as all it did was validate 
checksums; it didn't validate internal structure.  But balance obviously 
must validate that internal structure as well as checksums, as it's 
actually reading and rewriting, potentially the entire filesystem, as it 
goes.

So I'd say the correct thing to do *IS* to rewrite that chunk, because 
that's what balance *DOES*.  That it happens to consolidate chunks as it 
goes is one effect, certainly a good one, but it's not the only effect, 
and not rewriting chunks simply because there would be no consolidation 
would both seriously complexify things, and ignore the other reasons one 
might be running the balance.

-- 
Duncan - List replies preferred.   No HTML msgs.
"Every nonfree program has a lord, a master --
and if you use the program, he is your master."  Richard Stallman


  reply	other threads:[~2014-05-13 18:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-11  9:43 -musage=>0 means always reporting relocation Russell Coker
2014-05-11  9:52 ` Russell Coker
2014-05-11 14:11   ` Brendan Hide
2014-05-12 16:17     ` David Sterba
2014-05-13  7:57     ` Russell Coker
2014-05-13 18:06       ` Duncan [this message]
2014-05-11 16:17 ` Duncan

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='pan$a3b8$51a4e271$bdd12d08$cc38c3c0@cox.net' \
    --to=1i5t5.duncan@cox.net \
    --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 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).