From: David Sterba <dsterba@suse.cz>
To: David Sterba <dsterba@suse.cz>
Cc: Josef Bacik <josef@toxicpanda.com>,
linux-btrfs@vger.kernel.org, kernel-team@fb.com
Subject: Re: [PATCH 08/16] btrfs: move incompat and compat flag helpers to fs.c
Date: Tue, 11 Oct 2022 14:01:50 +0200 [thread overview]
Message-ID: <20221011120150.GQ13389@twin.jikos.cz> (raw)
In-Reply-To: <20221011103327.GM13389@twin.jikos.cz>
On Tue, Oct 11, 2022 at 12:33:27PM +0200, David Sterba wrote:
> On Wed, Sep 14, 2022 at 01:18:13PM -0400, Josef Bacik wrote:
> > These helpers use functions not defined in fs.h, move them to fs.c to
> > keep the header clean.
>
> This is one of the examples where functions are switched from inline to
> out-of-line, so I'll reply for all of them.
>
> > +bool __btrfs_fs_incompat(struct btrfs_fs_info *fs_info, u64 flag)
> > +{
> > + struct btrfs_super_block *disk_super;
> > + disk_super = fs_info->super_copy;
> > + return !!(btrfs_super_incompat_flags(disk_super) & flag);
> > +}
>
> This needs a separate function and unlike for the inline it needs a
> call which has some impact on the instruction flow. This should be
> evaluated if the un-inlined function is on a hot path or not.
>
> In this case I think the incompat bits should be inline as it's in many
> places part of switching access to some structures or lookup.
>
> At minimum some numbers and assembly examination should be done before
> ding that. The header cleanup part is nice but if the changes have
> performance implications it's suddenly not so easy.
>
> I'll do some analysis to get an idea how bad/good it is.
Not that good. When inlined it's basically
mov memory, rax
mov memory(rax), rax
test 0x1, rax
while uninlined it's
mov memory, rdi
mov memory, rsi
call
test rax, rax
the function itself is 4 instructions but with some additional ones
compared to the inlined version (2).
next prev parent reply other threads:[~2022-10-11 12:02 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-14 17:18 [PATCH 00/16] btrfs: split out larger chunks of ctree.h Josef Bacik
2022-09-14 17:18 ` [PATCH 01/16] btrfs: move fs wide helpers out " Josef Bacik
2022-09-16 10:34 ` Anand Jain
2022-09-14 17:18 ` [PATCH 02/16] btrfs: move larger compat flag helpers to their own c file Josef Bacik
2022-09-16 11:11 ` Anand Jain
2022-09-16 11:30 ` Anand Jain
2022-10-11 9:46 ` David Sterba
2022-09-14 17:18 ` [PATCH 03/16] btrfs: move the printk helpers out of ctree.h Josef Bacik
2022-09-16 12:13 ` Anand Jain
2022-09-14 17:18 ` [PATCH 04/16] btrfs: push extra checks into __btrfs_abort_transaction Josef Bacik
2022-09-16 12:28 ` Anand Jain
2022-10-11 9:55 ` David Sterba
2022-09-14 17:18 ` [PATCH 05/16] btrfs: move assert and error helpers out of btrfs-printk.h Josef Bacik
2022-09-16 13:21 ` Anand Jain
2022-09-14 17:18 ` [PATCH 06/16] btrfs: push printk index code into their respective helpers Josef Bacik
2022-09-19 12:24 ` Anand Jain
2022-09-14 17:18 ` [PATCH 07/16] btrfs: move BTRFS_FS_STATE* defs and helpers to fs.h Josef Bacik
2022-09-19 12:25 ` Anand Jain
2022-09-14 17:18 ` [PATCH 08/16] btrfs: move incompat and compat flag helpers to fs.c Josef Bacik
2022-09-19 12:26 ` Anand Jain
2022-10-11 10:33 ` David Sterba
2022-10-11 12:01 ` David Sterba [this message]
2022-09-14 17:18 ` [PATCH 09/16] btrfs: move mount option definitions to fs.h Josef Bacik
2022-09-19 12:26 ` Anand Jain
2022-09-14 17:18 ` [PATCH 10/16] btrfs: move fs_info->flags enum " Josef Bacik
2022-09-19 12:27 ` Anand Jain
2022-09-14 17:18 ` [PATCH 11/16] btrfs: add a BTRFS_FS_NEED_TRANS_COMMIT flag Josef Bacik
2022-09-19 12:30 ` Anand Jain
2022-09-19 12:33 ` Anand Jain
2022-09-14 17:18 ` [PATCH 12/16] btrfs: remove fs_info::pending_changes and related code Josef Bacik
2022-09-19 12:41 ` Anand Jain
2022-10-11 10:20 ` David Sterba
2022-09-14 17:18 ` [PATCH 13/16] btrfs: move the compat/incompat flag masks to fs.h Josef Bacik
2022-09-19 12:44 ` Anand Jain
2022-09-14 17:18 ` [PATCH 14/16] btrfs: rename struct-funcs.c -> item-accessors.c Josef Bacik
2022-09-19 12:46 ` Anand Jain
2022-09-14 17:18 ` [PATCH 15/16] btrfs: move btrfs_map_token to item-accessors Josef Bacik
2022-09-19 12:53 ` Anand Jain
2022-10-11 10:39 ` David Sterba
2022-10-11 11:37 ` David Sterba
2022-09-14 17:18 ` [PATCH 16/16] btrfs: move accessor helpers into item-accessors.h Josef Bacik
2022-09-15 8:27 ` Anand Jain
2022-09-15 9:51 ` [PATCH 00/16] btrfs: split out larger chunks of ctree.h Qu Wenruo
2022-10-11 10:48 ` David Sterba
2022-10-10 20:28 ` 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=20221011120150.GQ13389@twin.jikos.cz \
--to=dsterba@suse.cz \
--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