linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Austin S. Hemmelgarn" <ahferroin7@gmail.com>
To: Andrei Borzenkov <arvidjaar@gmail.com>,
	Martin Steigerwald <martin@lichtvoll.de>
Cc: waxhead@dirtcellar.net, Adam Hunt <voxadam@gmail.com>,
	linux-btrfs@vger.kernel.org
Subject: Re: lazytime mount option—no support in Btrfs
Date: Mon, 20 Aug 2018 08:16:16 -0400	[thread overview]
Message-ID: <088684be-c1ff-c144-6ff7-e41670669c7e@gmail.com> (raw)
In-Reply-To: <E6FB1ABD-4C84-422B-BD9D-E46D96D03155@gmail.com>

On 2018-08-19 06:25, Andrei Borzenkov wrote:
> 
> 
> Отправлено с iPhone
> 
>> 19 авг. 2018 г., в 11:37, Martin Steigerwald <martin@lichtvoll.de> написал(а):
>>
>> waxhead - 18.08.18, 22:45:
>>> Adam Hunt wrote:
>>>> Back in 2014 Ted Tso introduced the lazytime mount option for ext4
>>>> and shortly thereafter a more generic VFS implementation which was
>>>> then merged into mainline. His early patches included support for
>>>> Btrfs but those changes were removed prior to the feature being
>>>> merged. His>
>>>> changelog includes the following note about the removal:
>>>>    - Per Christoph's suggestion, drop support for btrfs and xfs for
>>>>    now,
>>>>
>>>>      issues with how btrfs and xfs handle dirty inode tracking.  We
>>>>      can add btrfs and xfs support back later or at the end of this
>>>>      series if we want to revisit this decision.
>>>>
>>>> My reading of the current mainline shows that Btrfs still lacks any
>>>> support for lazytime. Has any thought been given to adding support
>>>> for lazytime to Btrfs?
>> […]
>>> Is there any new regarding this?
>>
>> I´d like to know whether there is any news about this as well.
>>
>> If I understand it correctly this could even help BTRFS performance a
>> lot cause it is COW´ing metadata.
>>
> 
> I do not see how btrfs can support it exactly due to cow. Modified atime means checksum no more matches so you must update all related metadata. At which point you have kind of shadow in-memory metadata trees. And if this metadata is not written out, then some other metadata that refers to them becomes invalid.
I think you might be misunderstanding something here, either how 
lazytime actually works, or how BTRFS checksumming works.

Lazytime prevents timestamp updates from triggering writeback of a 
cached inode.  Other changes will trigger writeback, as will anything 
that evicts the inode from the cache, and an automatic writeback will be 
triggered if the timestamp changed more than 24 hours ago, but until any 
of those situations happens, no writeback will be triggered.

BTRFS checksumming only verifies checksums of blocks which are being 
read.  If the inode is in the cache (which it has to be for lazytime to 
have _any_ effect on it), the block containing it on disk does not need 
to be read, so no checksum verification happens.  Even if there was 
verification, we would not be verifying blocks that are in memory using 
the on-disk checksums (because that would break writeback caching, which 
we already do and already works correctly).

So, given all this, the only inconsistency on-disk for BTRFS with this 
would be identical to the inconsistency it causes for other filesystems, 
namely that mtimes and atimes may not be accurate.

Also, slightly OT, but atimes are not where the real benefit is here for 
most people.  No sane software other than mutt uses atimes (and mutt's 
use of them is not sane, but that's a different argument), so pretty 
much everyone who wants to avoid the overhead from them can just use the 
`noatime` mount option.  The real benefit for most people is with 
mtimes, for which there is no other way to limit the impact they have on 
performance.
> 
> I suspect any file system that keeps checksums of metadata will run into the same issue.
> 
Nope, only if they verify checksums on stuff that's already cached _and_ 
they pull the checksums for verification from the block device and not 
the cache.

  reply	other threads:[~2018-08-20 15:31 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-13 11:50 lazytime mount option—no support in Btrfs Adam Hunt
2017-08-14 13:19 ` Austin S. Hemmelgarn
2018-08-18 20:45 ` waxhead
2018-08-19  8:37   ` Martin Steigerwald
2018-08-19 10:25     ` Andrei Borzenkov
2018-08-20 12:16       ` Austin S. Hemmelgarn [this message]
2018-08-21 12:06         ` Adam Borowski
2018-08-21 12:17           ` Austin S. Hemmelgarn
2018-08-21 13:32             ` Janos Toth F.
2018-08-21 14:10               ` Austin S. Hemmelgarn
2018-08-21 16:05                 ` David Sterba
2018-08-21 17:01                   ` Austin S. Hemmelgarn
2018-08-22  3:57                     ` Duncan
2018-08-22 11:30                       ` Austin S. Hemmelgarn
2018-08-23  4:46                         ` Duncan
2018-08-22 13:48                     ` David Sterba
2018-08-22 13:56                       ` Austin S. Hemmelgarn
2018-08-22 15:01                         ` David Sterba
2018-08-22 16:59                           ` Austin S. Hemmelgarn
2018-08-23 23:33                 ` Janos Toth F.

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=088684be-c1ff-c144-6ff7-e41670669c7e@gmail.com \
    --to=ahferroin7@gmail.com \
    --cc=arvidjaar@gmail.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=martin@lichtvoll.de \
    --cc=voxadam@gmail.com \
    --cc=waxhead@dirtcellar.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).