public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Wang Yugui <wangyugui@e16-tech.com>
To: Christoph Hellwig <hch@lst.de>
Cc: linux-btrfs@vger.kernel.org, Chris Mason <clm@fb.com>
Subject: Re: btrfs write-bandwidth performance regression of 6.5-rc4/rc3
Date: Fri, 11 Aug 2023 22:23:28 +0800	[thread overview]
Message-ID: <20230811222321.2AD2.409509F4@e16-tech.com> (raw)
In-Reply-To: <20230802092631.GA27963@lst.de>

Hi,


> On Wed, Aug 02, 2023 at 08:04:57AM +0800, Wang Yugui wrote:
> > > And with only a revert of
> > > 
> > > "btrfs: submit IO synchronously for fast checksum implementations"?
> > 
> > GOOD performance when only (Revert "btrfs: submit IO synchronously for fast
> > checksum implementations") 
> 
> Ok, so you have a case where the offload for the checksumming generation
> actually helps (by a lot).  Adding Chris to the Cc list as he was
> involved with this.
> 
> > > > -       if (test_bit(BTRFS_FS_CSUM_IMPL_FAST, &bbio->fs_info->flags))
> > > > +       if ((bbio->bio.bi_opf & REQ_META) && test_bit(BTRFS_FS_CSUM_IMPL_FAST, &bbio->fs_info->flags))
> > > >                 return false;
> > > 
> > > This disables synchronous checksum calculation entirely for data I/O.
> > 
> > without this fix, data I/O checksum is always synchronous?
> > this is a feature change of "btrfs: submit IO synchronously for fast checksum implementations"?
> 
> It is never with the above patch.
> 
> > 
> > > Also I'm curious if you see any differents for a non-RAID0 (i.e.
> > > single profile) workload.
> > 
> > '-m single -d single' is about 10% slow that '-m raid1 -d raid0' in this test
> > case.
> 
> How does it compare with and without the revert?  Can you add the numbers?

the patch from wangyugui
diff --git a/fs/btrfs/bio.c b/fs/btrfs/bio.c
index 12b12443efaa..8ef968f0957d 100644
--- a/fs/btrfs/bio.c
+++ b/fs/btrfs/bio.c
@@ -598,7 +598,7 @@ static void run_one_async_free(struct btrfs_work *work)
 static bool should_async_write(struct btrfs_bio *bbio)
 {
 	/* Submit synchronously if the checksum implementation is fast. */
-	if (test_bit(BTRFS_FS_CSUM_IMPL_FAST, &bbio->fs_info->flags))
+	if ((bbio->bio.bi_opf & REQ_META) && test_bit(BTRFS_FS_CSUM_IMPL_FAST, &bbio->fs_info->flags))
 		return false;
 
 	/*

btrfs device: NVMe SSD PCIe3  x4

fio(-numjobs=4 ) on linux 6.5-rc5 with the patch, btrfs '-m raid1 -d raid0' 
  WRITE: bw=3858MiB/s (4045MB/s)
  WRITE: bw=3781MiB/s (3965MB/s)

fio(-numjobs=4 ) on linux 6.5-rc5 with the patch, btrfs '-m single -d single' 
  WRITE: bw=3004MiB/s (3149MB/s),
  WRITE: bw=2851MiB/s (2990MB/s)


fio(-numjobs=4 ) on linux 6.5-rc5 without the patch, btrfs '-m raid1 -d raid0' 
  WRITE: bw=1311MiB/s (1375MB/s)
  WRITE: bw=1435MiB/s (1504MB/s)

fio(-numjobs=4 ) on linux 6.5-rc5 without the patch, btrfs '-m single -d single' 
  WRITE: bw=1337MiB/s (1402MB/s)
  WRITE: bw=1413MiB/s (1481MB/s),


Best Regards
Wang Yugui (wangyugui@e16-tech.com)
2023/08/11




  parent reply	other threads:[~2023-08-11 14:23 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-31  7:22 btrfs write-bandwidth performance regression of 6.5-rc4/rc3 Wang Yugui
2023-08-01  2:22 ` Wang Yugui
2023-08-01  8:35   ` Christoph Hellwig
2023-08-01  8:56     ` Wang Yugui
2023-08-01  9:03       ` Christoph Hellwig
2023-08-01  9:32         ` Wang Yugui
2023-08-01 10:00           ` Christoph Hellwig
2023-08-01 13:04             ` Wang Yugui
2023-08-01 14:59               ` Christoph Hellwig
2023-08-01 15:51                 ` Wang Yugui
2023-08-01 15:56                   ` Christoph Hellwig
2023-08-01 15:57                     ` Christoph Hellwig
2023-08-02  0:04                     ` Wang Yugui
2023-08-02  9:26                       ` Christoph Hellwig
2023-08-11  8:58                         ` Linux regression tracking (Thorsten Leemhuis)
2023-08-11 10:31                           ` Christoph Hellwig
2023-08-11 14:23                         ` Wang Yugui [this message]
2023-08-11 14:52                           ` Chris Mason
2023-08-13  9:50                             ` Wang Yugui
2023-08-29  9:45                               ` Linux regression tracking (Thorsten Leemhuis)
2023-09-11  7:02                                 ` Thorsten Leemhuis
2023-09-11 23:20                                   ` Wang Yugui
2023-09-12  7:58                                     ` Linux regression tracking (Thorsten Leemhuis)
2023-09-26 10:55                                       ` Thorsten Leemhuis
2023-09-26 17:18                                         ` Chris Mason
2023-09-27 11:30                                           ` Linux regression tracking (Thorsten Leemhuis)
2023-12-06 14:22                                 ` Linux regression tracking (Thorsten Leemhuis)
2023-12-13 15:57                                   ` Naohiro Aota
2023-08-02  8:45 ` Linux regression tracking #adding (Thorsten Leemhuis)

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=20230811222321.2AD2.409509F4@e16-tech.com \
    --to=wangyugui@e16-tech.com \
    --cc=clm@fb.com \
    --cc=hch@lst.de \
    --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