All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Austin S. Hemmelgarn" <ahferroin7@gmail.com>
To: Martin Raiber <martin@urbackup.org>,
	Chris Murphy <lists@colorremedies.com>
Cc: Cerem Cem ASLAN <ceremcem@ceremcem.net>,
	Btrfs BTRFS <linux-btrfs@vger.kernel.org>
Subject: Re: Citation Needed: BTRFS Failure Resistance
Date: Thu, 23 May 2019 13:41:12 -0400	[thread overview]
Message-ID: <2ef383f2-7d70-406c-eb60-6d45a6f8f86f@gmail.com> (raw)
In-Reply-To: <0102016ae5bf1e51-7cedfda5-aff2-4ecb-801b-ec8c04ce84b5-000000@eu-west-1.amazonses.com>

On 2019-05-23 13:31, Martin Raiber wrote:
> On 23.05.2019 19:13 Austin S. Hemmelgarn wrote:
>> On 2019-05-23 12:24, Chris Murphy wrote:
>>> On Thu, May 23, 2019 at 5:19 AM Austin S. Hemmelgarn
>>> <ahferroin7@gmail.com> wrote:
>>>>
>>>> On 2019-05-22 14:46, Cerem Cem ASLAN wrote:
>>>>> Could you confirm or disclaim the following explanation:
>>>>> https://unix.stackexchange.com/a/520063/65781
>>>>>
>>>> Aside from what Hugo mentioned (which is correct), it's worth
>>>> mentioning
>>>> that the example listed in the answer of how hardware issues could
>>>> screw
>>>> things up assumes that for some reason write barriers aren't honored.
>>>> BTRFS explicitly requests write barriers to prevent that type of
>>>> reordering of writes from happening, and it's actually pretty
>>>> unusual on
>>>> modern hardware for those write barriers to not be honored unless the
>>>> user is doing something stupid (like mounting with 'nobarrier' or using
>>>> LVM with write barrier support disabled).
>>>
>>> 'man xfs'
>>>
>>>          barrier|nobarrier
>>>                 Note: This option has been deprecated as of kernel
>>> v4.10; in that version, integrity operations are always performed and
>>> the mount option is ignored.  These mount options will be removed no
>>> earlier than kernel v4.15.
>>>
>>> Since they're getting rid of it, I wonder if it's sane for most any
>>> sane file system use case.
>>>
>> As Adam mentioned, it's mostly volatile storage that benefits from
>> this.  For example, on the systems where I have /var/cache configured
>> as a separate filesystem, I mount it with barriers disabled because
>> the data there just doesn't matter (all of it can be regenerated
>> easily) and it gives me a few percent better performance.  In essence,
>> it's the mostly same type of stuff where you might consider running
>> ext4 without a journal for performance reasons.
>>
>> In the case of XFS, it probably got removed to keep people who fancy
>> themselves to be power users but really have no clue what they're
>> doing from shooting themselves in the foot to try and get some more
>> performance.
>>
>> IIRC, the option originally got added to both XFS and ext* because
>> early write barrier support was a bigger performance hit than it is
>> today, and BTRFS just kind of inherited it.
> 
> When I google for it I find that flushing the device can also be
> disabled via
> 
> echo "write through" > /sys/block/$device/queue/write_cache
Disabling write caching (which is what that does) is not really the same 
as mounting with 'nobarrier'.  Write caching actually improves 
performance in most cases, it just makes things a bit riskier because of 
the possibility of write reordering (which barriers prevent).
> 
> I actually used nobarrier recently (albeit with ext4), because a steam
> download was taking forever (hours), when remounting with nobarrier it
> went down to minutes (next time I started it with eatmydata). But ext4
> fsck is probably able to recover nobarrier file systems with unfortunate
> powerlosses and btrfs fsck... isn't. So combined with the above I'd
> remove nobarrier.
> 
Yeah, Steam is another pathological case actually, though that's mostly 
because their distribution format is generously described as 
'excessively segmented' and they fsync after _every single file_.  If 
you ever use Steam's game backup feature, you'll see similar results 
because it actually serializes the data to the same format that is used 
when downloading the game in the first place.

  reply	other threads:[~2019-05-23 17:41 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-22 18:46 Citation Needed: BTRFS Failure Resistance Cerem Cem ASLAN
2019-05-22 19:00 ` Hugo Mills
2019-05-23 16:48   ` Jeff Mahoney
2019-05-23 11:19 ` Austin S. Hemmelgarn
2019-05-23 16:24   ` Chris Murphy
2019-05-23 16:34     ` Adam Borowski
2019-05-23 16:46       ` Chris Murphy
2019-05-23 17:04         ` Austin S. Hemmelgarn
2019-05-23 17:13     ` Austin S. Hemmelgarn
2019-05-23 17:31       ` Martin Raiber
2019-05-23 17:41         ` Austin S. Hemmelgarn [this message]
2019-05-24 13:41           ` Martin Raiber

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=2ef383f2-7d70-406c-eb60-6d45a6f8f86f@gmail.com \
    --to=ahferroin7@gmail.com \
    --cc=ceremcem@ceremcem.net \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=lists@colorremedies.com \
    --cc=martin@urbackup.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.