public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Wang Yugui <wangyugui@e16-tech.com>
To: Josef Bacik <josef@toxicpanda.com>
Cc: linux-btrfs@vger.kernel.org, kernel-team@fb.com
Subject: Re: [PATCH 0/8] extent buffer dirty cleanups
Date: Thu, 15 Dec 2022 12:38:23 +0800	[thread overview]
Message-ID: <20221215123822.CF28.409509F4@e16-tech.com> (raw)
In-Reply-To: <cover.1670451918.git.josef@toxicpanda.com>

Hi,

> Hello,
> 
> While sync'ing ctree.c to btrfs-progs I noticed we have some oddities when it
> comes to how we deal with the extent buffer being dirty.  We have
> btrfs_clean_tree_block, which is sort of meant to be run against extent buffers
> we've modified in this transaction.  However we have some other places where
> we've open coded the same work without the generation check.  This makes it kind
> of confusing, and is inconsistent with how we deal with the
> fs_info->dirty_metadata_bytes.
> 
> So clean this stuff up so we have one helper we use for setting the extent
> buffer dirty (btrfs_mark_buffer_dirty) and one for clearing dirty
> (btrfs_clear_buffer_dirty).  This makes everything more consistent and clean
> across the board.  I've additionally cleaned up a random writeback thing we had
> in tree-log that I noticed while doing these cleanups.  Thanks,
> 
> Josef
> 
> Josef Bacik (8):
>   btrfs: always lock the block before calling btrfs_clean_tree_block
>   btrfs: do not check header generation in btrfs_clean_tree_block
>   btrfs: do not set the header generation before btrfs_clean_tree_block
>   btrfs: replace clearing extent buffer dirty bit with btrfs_clean_block
>   btrfs: do not increment dirty_metadata_bytes in set_btree_ioerr
>   btrfs: rename btrfs_clean_tree_block => btrfs_clear_buffer_dirty
>   btrfs: combine btrfs_clear_buffer_dirty and clear_extent_buffer_dirty
>   btrfs: remove btrfs_wait_tree_block_writeback

xfstests result with/without these patches.
with the patches [1-8]	btrfs/066 btrfs/072 btrfs/074 failed
with the patches [1-5]	btrfs/066 btrfs/072 btrfs/074 failed
without the patches 	OK. no failure.

Best Regards
Wang Yugui (wangyugui@e16-tech.com)
2022/12/15

>  fs/btrfs/ctree.c           | 16 +++++++--------
>  fs/btrfs/disk-io.c         | 25 +++++-------------------
>  fs/btrfs/disk-io.h         |  2 +-
>  fs/btrfs/extent-tree.c     | 12 ++++--------
>  fs/btrfs/extent_io.c       | 18 +++++++++--------
>  fs/btrfs/extent_io.h       |  2 +-
>  fs/btrfs/free-space-tree.c |  2 +-
>  fs/btrfs/ioctl.c           |  2 +-
>  fs/btrfs/qgroup.c          |  2 +-
>  fs/btrfs/tree-log.c        | 40 ++++++++++++++------------------------
>  10 files changed, 47 insertions(+), 74 deletions(-)
> 
> -- 
> 2.26.3



      parent reply	other threads:[~2022-12-15  4:38 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-07 22:28 [PATCH 0/8] extent buffer dirty cleanups Josef Bacik
2022-12-07 22:28 ` [PATCH 1/8] btrfs: always lock the block before calling btrfs_clean_tree_block Josef Bacik
2022-12-07 22:28 ` [PATCH 2/8] btrfs: do not check header generation in btrfs_clean_tree_block Josef Bacik
2022-12-16  5:32   ` Qu Wenruo
2022-12-17  2:10     ` Qu Wenruo
2023-01-10 15:33       ` David Sterba
2023-01-10 23:03         ` Qu Wenruo
2023-01-11 20:44           ` David Sterba
2023-01-11 19:56       ` Josef Bacik
2022-12-07 22:28 ` [PATCH 3/8] btrfs: do not set the header generation before btrfs_clean_tree_block Josef Bacik
2022-12-07 22:28 ` [PATCH 4/8] btrfs: replace clearing extent buffer dirty bit with btrfs_clean_block Josef Bacik
2022-12-07 22:28 ` [PATCH 5/8] btrfs: do not increment dirty_metadata_bytes in set_btree_ioerr Josef Bacik
2022-12-07 22:28 ` [PATCH 6/8] btrfs: rename btrfs_clean_tree_block => btrfs_clear_buffer_dirty Josef Bacik
2022-12-07 22:28 ` [PATCH 7/8] btrfs: combine btrfs_clear_buffer_dirty and clear_extent_buffer_dirty Josef Bacik
2022-12-07 22:28 ` [PATCH 8/8] btrfs: remove btrfs_wait_tree_block_writeback Josef Bacik
2022-12-14 17:49 ` [PATCH 0/8] extent buffer dirty cleanups David Sterba
2022-12-15  4:38 ` Wang Yugui [this message]

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=20221215123822.CF28.409509F4@e16-tech.com \
    --to=wangyugui@e16-tech.com \
    --cc=josef@toxicpanda.com \
    --cc=kernel-team@fb.com \
    --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