From: Chris Mason <clm@meta.com>
To: Sweet Tea Dorminy <sweettea-kernel@dorminy.me>,
Chris Mason <clm@fb.com>,
linux-btrfs@vger.kernel.org, dsterba@suse.com,
josef@toxicpanda.com, hch@lst.de
Subject: Re: [PATCH RFC] Btrfs: only subtract from len_to_oe_boundary when it is tracking an extent
Date: Mon, 31 Jul 2023 15:22:13 -0400 [thread overview]
Message-ID: <0375397a-dd5c-4b3b-53b7-1d2da33ef845@meta.com> (raw)
In-Reply-To: <d83bd29b-9744-cf48-c5a5-24668a6ec4f5@dorminy.me>
On 7/30/23 4:27 PM, Sweet Tea Dorminy wrote:
>
>> + /*
>> + * len_to_oe_boundary defaults to U32_MAX, which isn't page or
>> + * sector aligned. So, we don't really want to do math on
>> + * len_to_oe_boundary unless it has been intentionally set by
>> + * alloc_new_bio(). If we decrement here, we'll potentially
>> + * end up sending down an unaligned bio once we get close to
>> + * zero.
>> + */
>
> As I understand it, the important part is: nothing should use
> len_to_oe_boundary unless there's an actual oe boundary, U32_MAX is just
> a placeholder to convey the information that there's no oe boundary.
>
> So maybe:
> /*
> * len_to_oe_boundary being U32_MAX indicates that no ordered extent was
> * found by alloc_new_bio(), so there's no boundary.
> */
>
> I think talking about doing math on U32_MAX here obscures the main point.
>
Jens wasn't surprised by the idea of a bio almost U32_MAX bytes long,
but I needed a printk to convince myself it was really happening.
Talking about alignment and seeing bios in the wild of these sizes helps
anyone changing the code keep these corner cases in mind.
+/- the part where Christoph is deleting len_to_oe_boundary completely,
and he'll drive this code up to a nice farm in the country where it can
retire in the sunshine.
-chris
next prev parent reply other threads:[~2023-07-31 19:22 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 [this message]
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
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=0375397a-dd5c-4b3b-53b7-1d2da33ef845@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=sweettea-kernel@dorminy.me \
/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