Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Chengfeng Lin <lin2530632123@gmail.com>
Cc: Leo Martins <loemra.dev@gmail.com>,
	David Sterba <dsterba@suse.com>,
	linux-btrfs@vger.kernel.org, kernel-team@fb.com,
	Filipe Manana <fdmanana@kernel.org>, Boris Burkov <boris@bur.io>,
	Sun YangKai <sunk67188@gmail.com>,
	kernel test robot <oliver.sang@intel.com>
Subject: Re: [PATCH v2] btrfs: replace writeback inhibition xarray with a fixed inline buffer
Date: Tue, 21 Jul 2026 14:32:02 +0200	[thread overview]
Message-ID: <20260721123202.GK10684@twin.jikos.cz> (raw)
In-Reply-To: <CANGjgd=fQkHht2PdDi-+EAdzWH7UtxxWhhJ7b80Rr17PbpgxOw@mail.gmail.com>

On Fri, Jul 17, 2026 at 01:11:11AM +0800, Chengfeng Lin wrote:
> Hi Leo,
> 
> I independently tested the exact v2 code diff on a physical x86-64 machine.
> In this narrow synthetic Btrfs remap-range microbenchmark, it was consistently
> faster than the unpatched xarray control.  This is not an application
> workload.  It also differs from the LKP fio 4 KiB random-write case: this test
> exercises the same Btrfs writeback-inhibition functions through 4 KiB clone
> and dedupe ioctls.
> 
> I applied the code diff from this v2 message to a frozen Linux 7.1.0 source
> snapshot containing the Btrfs change at
> f9a48549a15aa369d42cebc08a6a72b71a53d547.  The exact saved diff used for the
> build has SHA-256
> 5ec741be5a89d6dae0c0608cc036512770b55d6a49e9b576b4aa3115ebfdffd3.
> Aside from the v2 diff, the control and patched kernels used the same base
> source snapshot, normalized config, GCC 15.2.0 toolchain and Kbuild metadata,
> with `CONFIG_PREEMPT_DYNAMIC=y` and `preempt=none`.
> 
> The machine was an Intel Core i7-12700KF system with 20 logical CPUs and
> 32 GiB RAM.  For each kernel point I created a fresh Btrfs filesystem on a
> 1 GiB RAM-backed brd device.  The timed process was pinned to P-core logical
> CPU 2 with the `intel_pstate` `performance` governor.  Each point ran 15
> rounds; each round performed 10,000 4 KiB FICLONERANGE operations and 10,000
> 4 KiB FIDEDUPERANGE operations.
> 
> In a control -> v2 -> control sandwich, the means across all 15 rounds were in
> ns/op (lower is better):
> 
>   operation          control A   v2         control B   v2 vs control midpoint
>   FICLONERANGE 4 KiB  2943.790    2159.123   2970.446    -26.986%
>   FIDEDUPERANGE 4 KiB 3535.456    2762.835   3546.942    -21.980%
> 
> The two control points drifted by only 0.905% for clone and 0.325% for dedupe.
> Dropping the first round from each point produced deltas of -27.178% and
> -22.128%.
> 
> All 90 timing rows passed the semantic checks: expected_match_ratio=100 and
> unexpected_results=0.  A separate ftrace direct-hit run on the v2 kernel with
> 1,000 clone plus 1,000 dedupe operations observed 2,000 calls to
> btrfs_remap_file_range, 7,473 to btrfs_inhibit_eb_writeback, and 2,033 to
> btrfs_uninhibit_all_eb_writeback.
> 
> For this specific brd-backed 4 KiB clone/dedupe workload, v2 reduced the
> measured per-operation latency relative to the unpatched xarray control by
> about 27% for clone and 22% for dedupe.  I have not tested application-level
> impact, physical-storage impact, or a broad filesystem matrix.  The Tested-by
> below applies to the v2 code diff identified by this message and the SHA-256
> above.
> 
> Evidence bundle:
> 
>   https://github.com/lcf0399/linux-regression-evidence/tree/7e47ea94a4d151610f16e98429efc3c3b8865265/btrfs-remap-writeback-inhibition-v2
> 
> Standalone workload:
> 
>   https://github.com/lcf0399/linux-regression-evidence/tree/7e47ea94a4d151610f16e98429efc3c3b8865265/btrfs-remap-writeback-inhibition-v2/reproducer
> 
> Tested-by: Chengfeng Lin <lin2530632123@gmail.com>

Thanks for the report, I've added link to the patch.

  reply	other threads:[~2026-07-21 12:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-16 17:11 [PATCH v2] btrfs: replace writeback inhibition xarray with a fixed inline buffer Chengfeng Lin
2026-07-21 12:32 ` David Sterba [this message]
  -- strict thread matches above, loose matches on Subject: below --
2026-07-01 23:47 Leo Martins
2026-07-02 16:46 ` Filipe Manana
2026-07-21 12:27 ` David Sterba

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=20260721123202.GK10684@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=boris@bur.io \
    --cc=dsterba@suse.com \
    --cc=fdmanana@kernel.org \
    --cc=kernel-team@fb.com \
    --cc=lin2530632123@gmail.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=loemra.dev@gmail.com \
    --cc=oliver.sang@intel.com \
    --cc=sunk67188@gmail.com \
    /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