From: Forza <forza@tnonline.net>
To: dsterba@suse.cz, Zygo Blaxell <ce3g8jdj@umail.furryterror.org>,
Btrfs BTRFS <linux-btrfs@vger.kernel.org>
Subject: Re: Support for compressed inline extents
Date: Sun, 29 Aug 2021 13:22:22 +0200 [thread overview]
Message-ID: <3d3b0bc0-4804-2c40-a343-d6e52bbfa642@tnonline.net> (raw)
In-Reply-To: <20210827100855.GV3379@twin.jikos.cz>
On 2021-08-27 12:08, David Sterba wrote:
> On Mon, Aug 23, 2021 at 04:23:29PM -0400, Zygo Blaxell wrote:
>> On Mon, Aug 23, 2021 at 09:34:27PM +0200, Forza wrote:
>>> Further up you showed that we can read encoded inlined data. What is missing
>>> for that we can read encoded inlined data that decode to >page_size in size?
>>
>> In uncompress_inline():
>>
>> // decoded length of extent on disk...
>> max_size = btrfs_file_extent_ram_bytes(leaf, item);
>>
>> ...
>>
>> // ...can never be more than one page because of this line(*)
>> max_size = min_t(unsigned long, PAGE_SIZE, max_size);
>>
>> There might be further constraints around this code (e.g. the caller
>> only fills in structures for one page, or doesn't bother to call this
>> function at all for offsets above PAGE_SIZE).
>>
>> All the restrictions would need to be removed in the kernel and support
>> for reading multi-page inline extents added where necessary. There would
>> have to be an incompat bit on the filesystem to prevent old kernels from
>> trying (and failing) to read longer inline extents. The disk format is
>> already technically capable of specifying a longer inline extent (up to
>> min(UINT32_MAX, metadata_page_size)) but that was never the problem.
>
> Regarding the idea of compressed inline extents, I'm not much in favor
> of increasing the limit beyond one page (or sector). The metadata space
> is more precious and that's also the motivation behind low default
> max_inline. Another thing is mixing data and metadata with potentially
> different block group profiles.
We already mix profiles today with inlining small extents. It is not a
problem as most people use a better/higher redundancy for metadata than
for data.
> The inline files is IMO a nice little optimization and helps when the
> size is below certain limit to avoid wasting data blocks and the
> indirection.
>
To be fair, I think the benefit is that we inline instead of creating
4KiB extents for small amounts of data. This benefit would be true even
if that data was compressed data and the compressed size was <2KiB.
I do understand the earlier points that this would perhaps be a big
thing to change, also incompatible with earlier kernels. Given that work
the benefit is rather small.
Perhaps if we are doing incompatible changes in the future, this could
be considered at that time? One reference is what Qu wrote here about
taking in more factors to consider for inlining?
https://lore.kernel.org/linux-btrfs/d0dccd5e-c67f-a18d-8d6e-559504b5ee91@suse.com/
Thanks
next prev parent reply other threads:[~2021-08-29 11:22 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-21 23:25 Support for compressed inline extents Forza
2021-08-22 5:45 ` Zygo Blaxell
2021-08-22 7:09 ` Forza
2021-08-22 8:33 ` Zygo Blaxell
2021-08-23 19:34 ` Forza
2021-08-23 20:23 ` Zygo Blaxell
2021-08-27 10:08 ` David Sterba
2021-08-29 11:22 ` Forza [this message]
2021-08-29 12:07 ` Qu Wenruo
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=3d3b0bc0-4804-2c40-a343-d6e52bbfa642@tnonline.net \
--to=forza@tnonline.net \
--cc=ce3g8jdj@umail.furryterror.org \
--cc=dsterba@suse.cz \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.