From: Chris Mason <clm@meta.com>
To: Christoph Hellwig <hch@lst.de>, Qu Wenruo <quwenruo.btrfs@gmx.com>
Cc: Chris Mason <clm@fb.com>,
linux-btrfs@vger.kernel.org, dsterba@suse.com,
josef@toxicpanda.com
Subject: Re: [PATCH RFC] Btrfs: only subtract from len_to_oe_boundary when it is tracking an extent
Date: Mon, 31 Jul 2023 14:10:21 -0400 [thread overview]
Message-ID: <c059da8d-b5d5-20bd-fadb-c6c241323cc1@meta.com> (raw)
In-Reply-To: <20230731070251.GB31096@lst.de>
On 7/31/23 3:02 AM, Christoph Hellwig wrote:
> On Mon, Jul 31, 2023 at 10:27:02AM +0800, Qu Wenruo wrote:
>> Personally speaking, I think we'd better moving the ordered extent based
>> split (only for zoned devices) to btrfs bio layer.
>
> That goes completely counter the direction I've been working to. The
> ordered extent is the "container" for writeback, so having a bio
> that spawns them creates all kinds of problems. Thats's the reason
> why we now have a bbio->ordered pointer now.
>
>> Another concern is, how we could hit a bio which has a size larger than
>> U32_MAX?
>>
>> The bio->bi_iter.size is only unsigned int, it should never exceed U32_MAX.
>>
>> It would help a lot if you can provide a backtrace of such unaligned bio.
>
> That's indeed a bit weird.
>
bio_full() is using a slightly different test:
if (bio->bi_iter.bi_size > UINT_MAX - len)
return true;
We're doing:
/* Cap to the current ordered extent boundary if there is one. */
if (len > bio_ctrl->len_to_oe_boundary) {
ASSERT(bio_ctrl->compress_type == BTRFS_COMPRESS_NONE);
ASSERT(is_data_inode(&inode->vfs_inode));
len = bio_ctrl->len_to_oe_boundary;
}
The end result of this is that when we get to a
bio sized U32_MAX - PAGE_SIZE, both our len_to_oe_boundary and the
bio_add_page() check will correctly decide we can only fit 4095 bytes.
The difference is bio_add_page() would just say no triggering bio
submission. But submit_extent_page()'s check is first, cutting the
IO down to 4095 bytes instead.
(I do have the stack trace, it's just a boring filemap_fdata_write_and_wait() path off of file release)
-chris
next prev parent reply other threads:[~2023-07-31 18:10 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-30 19:02 [PATCH RFC] Btrfs: only subtract from len_to_oe_boundary when it is tracking an extent Chris Mason
2023-07-30 20:27 ` Sweet Tea Dorminy
2023-07-31 19:22 ` Chris Mason
2023-08-01 2:59 ` Sweet Tea Dorminy
2023-07-31 2:27 ` Qu Wenruo
2023-07-31 7:02 ` Christoph Hellwig
2023-07-31 18:10 ` Chris Mason [this message]
2023-08-01 0:58 ` Qu Wenruo
2023-07-31 7:00 ` Christoph Hellwig
2023-07-31 18:52 ` Chris Mason
2023-07-31 19:35 ` Christoph Hellwig
2023-07-31 21:05 ` Chris Mason
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=c059da8d-b5d5-20bd-fadb-c6c241323cc1@meta.com \
--to=clm@meta.com \
--cc=clm@fb.com \
--cc=dsterba@suse.com \
--cc=hch@lst.de \
--cc=josef@toxicpanda.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=quwenruo.btrfs@gmx.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