All of lore.kernel.org
 help / color / mirror / Atom feed
From: Qu Wenruo <quwenruo.btrfs@gmx.com>
To: dsterba@suse.cz, Qu Wenruo <wqu@suse.com>, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH v4 0/9] btrfs: compression: refactor and enhancement preparing for subpage compression support
Date: Fri, 18 Jun 2021 06:46:51 +0800	[thread overview]
Message-ID: <d184445f-a1a1-3f17-c33d-ffe3fc066c66@gmx.com> (raw)
In-Reply-To: <20210617164703.GW28158@twin.jikos.cz>



On 2021/6/18 上午12:47, David Sterba wrote:
> On Thu, Jun 17, 2021 at 01:14:41PM +0800, Qu Wenruo wrote:
>> There are quite some problems in compression code:
>>
>> - Weird compressed_bio::pending_bios dance
>>    If we just don't want compressed_bio being freed halfway, we have more
>>    sane methods, just like btrfs_subpage::readers.
>>
>>    So here we fix it by introducing compressed_bio::io_sectors to do the
>>    job.
>>
>> - BUG_ON()s inside btrfs_submit_compressed_*()
>>    Even they are just ENOMEM, we should handle them.
>>    With io_sectors introduced, we have a way to finish compressed_bio
>>    all by ourselves, as long as we haven't submitted last bio.
>>
>>    If we have last bio submitted, then endio will handle it well.
>>
>> - Duplicated code for compressed bio allocation and submission
>>    Just small refactor can handle it
>>
>> - Stripe boundary is checked every time one page is added
>>    This is overkilled.
>>    Just learn from extent_io.c refactor which use bio_ctrl to do the
>>    boundary check only once for each bio.
>>
>>    Although in compression context, we don't need extra checks in
>>    extent_io.c, thus we don't need bio_ctrl structure, but
>>    can afford to do it locally.
>>
>> - Dead code removal
>>    One dead comment and a new zombie function,
>>    btrfs_bio_fits_in_stripe(), can be removed now.
>
> I went through it several times, the changes are scary, but the overall
> direction is IMHO the right one, not to say it's fixing the difficult
> BUG_ONs.
>
> I'll put it to for-next once it passes a few rounds of fstests. Taking
> it to 5.14 could be risky if we don't have enough review and testing,
> time is almost up before the code freeze.
>
Please don't put it into 5.14.

It's really a preparation for subpage compression support.
However we don't even have subpage queued for v5.14, thus I'm not in a
hurry.

Thanks,
Qu

  reply	other threads:[~2021-06-17 22:47 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-17  5:14 [PATCH v4 0/9] btrfs: compression: refactor and enhancement preparing for subpage compression support Qu Wenruo
2021-06-17  5:14 ` [PATCH v4 1/9] btrfs: remove a dead comment for btrfs_decompress_bio() Qu Wenruo
2021-06-17  5:14 ` [PATCH v4 2/9] btrfs: introduce compressed_bio::pending_sectors to trace compressed bio more elegantly Qu Wenruo
2021-06-18  4:16   ` Anand Jain
2021-06-18  5:18     ` Qu Wenruo
2021-06-17  5:14 ` [PATCH v4 3/9] btrfs: handle errors properly inside btrfs_submit_compressed_read() Qu Wenruo
2021-06-17  5:14 ` [PATCH v4 4/9] btrfs: handle errors properly inside btrfs_submit_compressed_write() Qu Wenruo
2021-06-17  5:14 ` [PATCH v4 5/9] btrfs: introduce submit_compressed_bio() for compression Qu Wenruo
2021-06-17  5:14 ` [PATCH v4 6/9] btrfs: introduce alloc_compressed_bio() " Qu Wenruo
2021-06-17  5:14 ` [PATCH v4 7/9] btrfs: make btrfs_submit_compressed_read() to determine stripe boundary at bio allocation time Qu Wenruo
2021-06-17  5:14 ` [PATCH v4 8/9] btrfs: make btrfs_submit_compressed_write() " Qu Wenruo
2021-06-17  5:14 ` [PATCH v4 9/9] btrfs: remove unused function btrfs_bio_fits_in_stripe() Qu Wenruo
2021-06-17 16:47 ` [PATCH v4 0/9] btrfs: compression: refactor and enhancement preparing for subpage compression support David Sterba
2021-06-17 22:46   ` Qu Wenruo [this message]
2021-06-22 11:14     ` David Sterba
2021-06-22 11:50       ` Qu Wenruo
2021-06-22 12:41         ` David Sterba

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=d184445f-a1a1-3f17-c33d-ffe3fc066c66@gmx.com \
    --to=quwenruo.btrfs@gmx.com \
    --cc=dsterba@suse.cz \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=wqu@suse.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 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.