From: David Sterba <dsterba@suse.cz>
To: Christoph Hellwig <hch@lst.de>
Cc: Chris Mason <clm@fb.com>, Josef Bacik <josef@toxicpanda.com>,
David Sterba <dsterba@suse.com>,
"open list:BTRFS FILE SYSTEM" <linux-btrfs@vger.kernel.org>,
naohiro.aota@wdc.com
Subject: Re: [PATCH 3/3] btrfs: don't hold an extra reference for redirtied buffers
Date: Wed, 10 May 2023 00:57:37 +0200 [thread overview]
Message-ID: <20230509225737.GK32559@twin.jikos.cz> (raw)
In-Reply-To: <20230508145839.43725-4-hch@lst.de>
On Mon, May 08, 2023 at 07:58:39AM -0700, Christoph Hellwig wrote:
> When btrfs_redirty_list_add redirties a buffer, it also acquires
> an extra reference that is released on transaction commit. But
> this is not required as buffers that are dirty or under writeback
> are never freed (look for calls to extent_buffer_under_io())).
>
> Remove the extra reference and the infrastructure used to drop it
> again.
I vaguely remember that the redirty list was need for zoned to avoid
some write pattern that disrupts the ordering, added in d3575156f662
("btrfs: zoned: redirty released extent buffers").
I'd appreciate more eyes on this patch, with the indirections and
writeback involved it's not clear to me that we don't need the list at
all. Pointing to extent_buffer_under_io() is a good start but the state
transitions of eb are complex so a more concrete example how it works
should be in the changelog.
For testing I'll add the series to misc-next, changelog update can be
done later. Thanks.
next prev parent reply other threads:[~2023-05-09 23:03 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-08 14:58 buffer redirtying fixes and cleanup Christoph Hellwig
2023-05-08 14:58 ` [PATCH 1/3] btrfs: zero the buffer before marking it dirty in btrfs_redirty_list_add Christoph Hellwig
2023-05-08 14:58 ` [PATCH 2/3] btrfs: fix dirty_metadata_bytes for redirtied buffers Christoph Hellwig
2023-05-08 14:58 ` [PATCH 3/3] btrfs: don't hold an extra reference " Christoph Hellwig
2023-05-09 22:57 ` David Sterba [this message]
2023-05-15 9:22 ` Christoph Hellwig
2023-05-30 15:56 ` David Sterba
2023-05-31 4:16 ` Christoph Hellwig
2023-05-31 15:04 ` Naohiro Aota
2023-06-05 15:58 ` 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=20230509225737.GK32559@twin.jikos.cz \
--to=dsterba@suse.cz \
--cc=clm@fb.com \
--cc=dsterba@suse.com \
--cc=hch@lst.de \
--cc=josef@toxicpanda.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=naohiro.aota@wdc.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