From: David Sterba <dsterba@suse.cz>
To: Filipe Manana <fdmanana@kernel.org>
Cc: Leo Martins <loemra.dev@gmail.com>,
linux-btrfs@vger.kernel.org, kernel-team@fb.com,
jlayton@kernel.org
Subject: Re: [PATCH] btrfs: implement ref_tracker for delayed_nodes
Date: Fri, 11 Jul 2025 12:38:53 +0200 [thread overview]
Message-ID: <20250711103853.GC22472@twin.jikos.cz> (raw)
In-Reply-To: <CAL3q7H5pDTDK6zOj_85dNTbARcfaTHwqZXOGbZ-We0N5Jg8rtQ@mail.gmail.com>
On Thu, Jul 10, 2025 at 12:54:34PM +0100, Filipe Manana wrote:
> > @@ -63,10 +109,18 @@ struct btrfs_delayed_node {
> > struct rb_root_cached del_root;
> > struct mutex mutex;
> > struct btrfs_inode_item inode_item;
> > +
> > refcount_t refs;
> > - int count;
> > + /* Used to track all references to this delayed node. */
> > + btrfs_delayed_node_ref_tracker_dir ref_dir;
> > + /* Used to track delayed node reference stored in node list. */
> > + btrfs_delayed_node_ref_tracker node_list_tracker;
> > + /* Used to track delayed node reference stored in inode cache. */
> > + btrfs_delayed_node_ref_tracker inode_cache_tracker;
> > +
> > u64 index_cnt;
> > unsigned long flags;
> > + int count;
>
> Why are you moving the count field?
> This increases the size of the struct even without the new config
> option enabled and as a result we get less objects per page.
> You are essentially reverting this commit:
>
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=a20725e1e7014642fc8ba4c7dd2c4ef6d4ec56a9
>
> Without any explanation about why.
>
> I'm also not a big fan of the typedefs and would prefer to have
> struct ref_tracker used directly in the structure surrounded by an
> #ifdef block.
Agreed, we use typedefs only for function callbacks, for variable types
not anymore.
> I also don't like adding a new Kconfig option just for this... How
> much slower would a build with CONFIG_BTRFS_DEBUG=y be?
>
> If that's really a lot slower, then perhaps a more generic config
> option name in case we add similar tracking to other data structures
> one day.
Right, we want to keep the config options at minimum and for debugging
features it should be fine under BTRFS_DEBUG. If this needs to be
configured for performance reasons then it can be a mount option, same
as we have ref-verify or fragment already.
next prev parent reply other threads:[~2025-07-11 10:38 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-09 22:04 [PATCH] btrfs: implement ref_tracker for delayed_nodes Leo Martins
2025-07-10 11:54 ` Filipe Manana
2025-07-11 10:38 ` David Sterba [this message]
2025-07-23 17:44 ` Leo Martins
2025-07-23 18:04 ` Filipe Manana
2025-07-10 23:49 ` kernel test robot
2025-07-11 3:42 ` kernel test robot
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=20250711103853.GC22472@twin.jikos.cz \
--to=dsterba@suse.cz \
--cc=fdmanana@kernel.org \
--cc=jlayton@kernel.org \
--cc=kernel-team@fb.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=loemra.dev@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