public inbox for linux-nvme@lists.infradead.org
 help / color / mirror / Atom feed
From: Qu Wenruo <wqu@suse.com>
To: "hch@infradead.org" <hch@infradead.org>
Cc: Matthew Wilcox <willy@infradead.org>,
	Johannes Thumshirn <Johannes.Thumshirn@wdc.com>,
	Kanchan Joshi <joshi.k@samsung.com>,
	Theodore Ts'o <tytso@mit.edu>,
	"lsf-pc@lists.linux-foundation.org"
	<lsf-pc@lists.linux-foundation.org>,
	"linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>,
	"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
	"linux-nvme@lists.infradead.org" <linux-nvme@lists.infradead.org>,
	"linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
	"josef@toxicpanda.com" <josef@toxicpanda.com>
Subject: Re: [LSF/MM/BPF TOPIC] File system checksum offload
Date: Mon, 3 Feb 2025 19:21:08 +1030	[thread overview]
Message-ID: <26a5ee76-3e5c-441d-b335-41ee4c879e0e@suse.com> (raw)
In-Reply-To: <Z6CA9sDUZ_nDj5LD@infradead.org>



在 2025/2/3 19:10, hch@infradead.org 写道:
> On Mon, Feb 03, 2025 at 07:06:15PM +1030, Qu Wenruo wrote:
>> Thus my current plan to fix it is to make btrfs to skip csum for direct IO.
>> This will make btrfs to align with EXT4/XFS behavior, without the complex
>> AS_STABLE_FLAGS passing (and there is no way for user space to probe that
>> flag IIRC).
>>
>> But that will break the current per-inode level NODATASUM setting, and will
>> cause some incompatibility (a new incompat flag needed, extra handling if no
>> data csum found, extra fsck support etc).
> 
> I don't think simply removing the checksums when using direct I/O is
> a good idea as it unexpectedly reduces the protection envelope.  The
> best (or least bad) fix would be to simply not support actually direct
> I/O without NODATASUM and fall back to buffered I/O (preferably the new
> uncached variant from Jens) unless explicitly overridden.
> 

That always falling-back-to-buffered-IO sounds pretty good.
(For NODATASUM inodes, we do not need to fallback though).

The only concern is performance.
I guess even for the uncached write it still involves some extra folio 
copy, thus not completely the same performance level of direct IO?

And always falling back (for inodes with datacsum) may also sound a 
little overkilled.
If the program is properly coded, and no contents change halfway, we 
always pay the performance penalty but without really any extra benefit.

I guess it really depends on the performance of uncached writes.
(And I really hope it's not obviously slower than direct IO)

Thanks,
Qu


  reply	other threads:[~2025-02-03 10:00 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20250130092400epcas5p1a3a9d899583e9502ed45fe500ae8a824@epcas5p1.samsung.com>
2025-01-30  9:15 ` [LSF/MM/BPF TOPIC] File system checksum offload Kanchan Joshi
2025-01-30 14:28   ` Theodore Ts'o
2025-01-30 20:39     ` [Lsf-pc] " Martin K. Petersen
2025-01-31  4:40       ` Theodore Ts'o
2025-01-31  7:07         ` Christoph Hellwig
2025-01-31 13:11     ` Kanchan Joshi
2025-02-03  7:47       ` Johannes Thumshirn
2025-02-03  7:56         ` Christoph Hellwig
2025-02-03  8:04           ` Johannes Thumshirn
2025-02-03  8:06             ` hch
2025-02-03  8:16             ` Qu Wenruo
2025-02-03  8:26               ` Matthew Wilcox
2025-02-03  8:30                 ` hch
2025-02-03  8:36                   ` Qu Wenruo
2025-02-03  8:40                     ` hch
2025-02-03  8:51                       ` Qu Wenruo [this message]
2025-02-03  8:57                         ` hch
2025-02-03  8:26               ` hch
2025-02-03 13:27               ` Kanchan Joshi
2025-02-03 23:17                 ` Qu Wenruo
2025-02-04  5:48                   ` hch
2025-02-04  5:16                 ` hch
2025-03-18  7:06                   ` Kanchan Joshi
2025-03-18  8:07                     ` hch
2025-03-19 18:06                       ` Kanchan Joshi
2025-03-20  5:48                         ` hch
2025-02-03 13:32         ` Kanchan Joshi

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=26a5ee76-3e5c-441d-b335-41ee4c879e0e@suse.com \
    --to=wqu@suse.com \
    --cc=Johannes.Thumshirn@wdc.com \
    --cc=hch@infradead.org \
    --cc=josef@toxicpanda.com \
    --cc=joshi.k@samsung.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=lsf-pc@lists.linux-foundation.org \
    --cc=tytso@mit.edu \
    --cc=willy@infradead.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