From: Nikolay Borisov <nborisov@suse.com>
To: Johannes Thumshirn <Johannes.Thumshirn@wdc.com>,
Christoph Hellwig <hch@lst.de>, Chris Mason <clm@fb.com>,
Josef Bacik <josef@toxicpanda.com>,
David Sterba <dsterba@suse.com>
Cc: "linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH 10/11] btrfs: make the btrfs_io_context allocation in __btrfs_map_block optional
Date: Fri, 15 Jul 2022 11:30:11 +0300 [thread overview]
Message-ID: <c92d13d8-67cc-fe22-54e8-b53686d08ec6@suse.com> (raw)
In-Reply-To: <PH0PR04MB741647058825EF24A1E89CAA9B899@PH0PR04MB7416.namprd04.prod.outlook.com>
On 13.07.22 г. 12:58 ч., Johannes Thumshirn wrote:
> On 13.07.22 08:14, Christoph Hellwig wrote:
>> + /*
>> + * If this I/O maps to a single device, try to return the device and
>> + * physical block information on the stack instead of allocating an
>> + * I/O context structure.
>> + */
>> + if (smap && num_alloc_stripes == 1 &&
>> + !((map->type & BTRFS_BLOCK_GROUP_RAID56_MASK) && mirror_num > 1) &&
>> + (!need_full_stripe(op) || !dev_replace_is_ongoing ||
>> + !dev_replace->tgtdev)) {
>> + if (unlikely(patch_the_first_stripe_for_dev_replace)) {
>> + smap->dev = dev_replace->tgtdev;
>> + smap->physical = physical_to_patch_in_first_stripe;
>> + *mirror_num_p = map->num_stripes + 1;
>> + } else {
>> + set_stripe(smap, map, stripe_index, stripe_offset,
>> + stripe_nr);
>> + *mirror_num_p = mirror_num;
>> + }
>> + *bioc_ret = NULL;
>> + ret = 0;
>> + goto out;
>> + }
>> +
>
>
> Could be my changes on top, but in order to get RAID0 with a raid-stripe-tree
> working I needed the following change:
>
> diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
> index a7886e421153..344d2cf941a7 100644
> --- a/fs/btrfs/volumes.c
> +++ b/fs/btrfs/volumes.c
> @@ -6506,7 +6506,7 @@ static int __btrfs_map_block(struct btrfs_fs_info *fs_info,
> * physical block information on the stack instead of allocating an
> * I/O context structure.
> */
> - if (smap && num_alloc_stripes == 1 &&
> + if (smap && num_alloc_stripes == 1 && !(map->type & BTRFS_BLOCK_GROUP_STRIPE_MASK) &&
nit: BLOCK_GROUP_STRIPE_MASK already contains BLOCK_GROUP_RAID56_MASK so
BTRFS_BLOCK_GROUP_RAID56_MASK can be replaced. But I agree with hch that
this change should come with your series.
> !((map->type & BTRFS_BLOCK_GROUP_RAID56_MASK) && mirror_num > 1) &&
> (!need_full_stripe(op) || !dev_replace_is_ongoing ||
> !dev_replace->tgtdev)) {
>
next prev parent reply other threads:[~2022-07-15 8:30 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-13 6:13 btrfs I/O completion cleanup and single device I/O optimizations v2 Christoph Hellwig
2022-07-13 6:13 ` [PATCH 01/11] btrfs: don't call bioset_integrity_create for btrfs_bioset Christoph Hellwig
2022-07-13 6:13 ` [PATCH 02/11] btrfs: move btrfs_bio allocation to volumes.c Christoph Hellwig
2022-07-13 6:13 ` [PATCH 03/11] btrfs: pass the operation to btrfs_bio_alloc Christoph Hellwig
2022-07-13 6:13 ` [PATCH 04/11] btrfs: don't take a bio_counter reference for cloned bios Christoph Hellwig
2022-07-13 6:27 ` Johannes Thumshirn
2022-07-13 6:13 ` [PATCH 05/11] btrfs: remove bioc->stripes_pending Christoph Hellwig
2022-07-13 6:31 ` Johannes Thumshirn
2022-07-13 6:41 ` Johannes Thumshirn
2022-07-14 12:15 ` Nikolay Borisov
2022-07-13 6:13 ` [PATCH 06/11] btrfs: properly abstract the parity raid bio handling Christoph Hellwig
2022-07-13 6:13 ` [PATCH 07/11] btrfs: give struct btrfs_bio a real end_io handler Christoph Hellwig
2022-07-13 6:47 ` Johannes Thumshirn
2022-07-13 6:51 ` Christoph Hellwig
2022-07-13 6:13 ` [PATCH 08/11] btrfs: split submit_stripe_bio Christoph Hellwig
2022-07-13 6:46 ` Johannes Thumshirn
2022-07-13 6:50 ` Christoph Hellwig
2022-07-13 6:52 ` Johannes Thumshirn
2022-07-14 14:02 ` Nikolay Borisov
2022-07-13 6:13 ` [PATCH 09/11] btrfs: simplify the submit_stripe_bio calling convention Christoph Hellwig
2022-07-13 6:49 ` Johannes Thumshirn
2022-07-14 14:30 ` Nikolay Borisov
2022-07-13 6:13 ` [PATCH 10/11] btrfs: make the btrfs_io_context allocation in __btrfs_map_block optional Christoph Hellwig
2022-07-13 9:58 ` Johannes Thumshirn
2022-07-13 11:18 ` Christoph Hellwig
2022-07-15 8:30 ` Nikolay Borisov [this message]
2022-07-13 6:13 ` [PATCH 11/11] btrfs: stop allocation a btrfs_io_context for simple I/O Christoph Hellwig
2022-09-06 13:12 ` btrfs I/O completion cleanup and single device I/O optimizations v2 David Sterba
2022-09-07 9:08 ` Christoph Hellwig
2022-09-09 12:34 ` David Sterba
-- strict thread matches above, loose matches on Subject: below --
2022-08-06 8:03 btrfs I/O completion cleanup and single device I/O optimizations v3 Christoph Hellwig
2022-08-06 8:03 ` [PATCH 10/11] btrfs: make the btrfs_io_context allocation in __btrfs_map_block optional Christoph Hellwig
2022-08-20 11:34 ` Anand Jain
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=c92d13d8-67cc-fe22-54e8-b53686d08ec6@suse.com \
--to=nborisov@suse.com \
--cc=Johannes.Thumshirn@wdc.com \
--cc=clm@fb.com \
--cc=dsterba@suse.com \
--cc=hch@lst.de \
--cc=josef@toxicpanda.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;
as well as URLs for NNTP newsgroup(s).