[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAL3q7H5wOD4fJQ2BTpeqMmscbcS6pV9UN7ThHgi_W6vF4nPrAg@mail.gmail.com>
Date: Fri, 13 Dec 2024 12:04:08 +0000
From: Filipe Manana <fdmanana@...nel.org>
To: Johannes Thumshirn <jth@...nel.org>
Cc: Chris Mason <clm@...com>, Josef Bacik <josef@...icpanda.com>, David Sterba <dsterba@...e.com>,
linux-btrfs@...r.kernel.org, linux-kernel@...r.kernel.org,
Johannes Thumshirn <johannes.thjumshirn@....com>,
Johannes Thumshirn <johannes.thumshirn@....com>
Subject: Re: [PATCH 1/3] btrfs: cache stripe tree usage in io_geometry
On Thu, Dec 12, 2024 at 12:55 PM Johannes Thumshirn <jth@...nel.org> wrote:
>
> From: Johannes Thumshirn <johannes.thumshirn@....com>
>
> Cache the return of btrfs_need_stripe_tree_update() in struct
> btrfs_io_geometry.
>
> Signed-off-by: Johannes Thumshirn <johannes.thumshirn@....com>
You can also mention this reduces the object size, since
btrfs_need_stripe_tree_update() is inlined and has quite some logic
there.
Reviewed-by: Filipe Manana <fdmanana@...e.com>
Looks good, thanks.
> ---
> fs/btrfs/volumes.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
> index 1cccaf9c2b0d5d4029440c46a4a92c7d6541d474..fa190f7108545eacf82ef2b5f1f3838d56ca683e 100644
> --- a/fs/btrfs/volumes.c
> +++ b/fs/btrfs/volumes.c
> @@ -48,6 +48,7 @@ struct btrfs_io_geometry {
> u64 raid56_full_stripe_start;
> int max_errors;
> enum btrfs_map_op op;
> + bool use_rst;
> };
>
> const struct btrfs_raid_attr btrfs_raid_array[BTRFS_NR_RAID_TYPES] = {
> @@ -6346,8 +6347,7 @@ static int set_io_stripe(struct btrfs_fs_info *fs_info, u64 logical,
> {
> dst->dev = map->stripes[io_geom->stripe_index].dev;
>
> - if (io_geom->op == BTRFS_MAP_READ &&
> - btrfs_need_stripe_tree_update(fs_info, map->type))
> + if (io_geom->op == BTRFS_MAP_READ && io_geom->use_rst)
> return btrfs_get_raid_extent_offset(fs_info, logical, length,
> map->type,
> io_geom->stripe_index, dst);
> @@ -6579,6 +6579,7 @@ int btrfs_map_block(struct btrfs_fs_info *fs_info, enum btrfs_map_op op,
> io_geom.raid56_full_stripe_start = (u64)-1;
> max_len = btrfs_max_io_len(map, map_offset, &io_geom);
> *length = min_t(u64, map->chunk_len - map_offset, max_len);
> + io_geom.use_rst = btrfs_need_stripe_tree_update(fs_info, map->type);
>
> if (dev_replace->replace_task != current)
> down_read(&dev_replace->rwsem);
>
> --
> 2.43.0
>
>
Powered by blists - more mailing lists