public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Qu Wenruo <wqu@suse.com>
To: dsterba@suse.cz
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH v5 0/2] btrfs: fix beyond EOF truncation for subpage generic/363 failures
Date: Tue, 6 May 2025 09:35:32 +0930	[thread overview]
Message-ID: <daa36106-0667-4c45-a1a2-74c2f04725ed@suse.com> (raw)
In-Reply-To: <20250505153347.GY9140@twin.jikos.cz>



在 2025/5/6 01:03, David Sterba 写道:
> On Sat, Apr 26, 2025 at 08:06:48AM +0930, Qu Wenruo wrote:
>> [CHANGELOG]
>> v5:
>> - Shrink the parameter list for btrfs_truncate_block()
>>    Remove the @front and @len, instead passing a new pair of @start/@end,
>>    so that we can determine if @from is in the head or tail block,
>>    thus no need for @front.
>>
>>    This will give callers more freedom (a little too much),
>>    e.g. for the following zero range/hole punch case:
>>
>>      Page size is 64K, fs block size is 4K.
>>      Truncation range is [6K, 58K).
>>
>>      0        8K                32K                  56K      64K
>>      |      |/|//////////////////////////////////////|/|      |
>>             6K                                         58K
>>
>>      To truncate the first block to zero out range [6K, 8K),
>>      caller can pass @from = 6K, @start = 6K, @end = 58K - 1.
>>      In fact, any @from inside range [6K, 8K) will work.
>>
>>      To truncate the last block to zero out range [56K, 58K),
>>      caller can pass @from=58K - 1, @start = 6K, @end = 58K -1.
>>      Any @from inside range [56K, 58K) will also work.
>>
>>      Furthermore, if aligned @from is passed in, e.g. 8K,
>>      btrfs_truncate_block() will detect that there is nothing to do,
>>      and exit properly.
>>
>> - Only do the extra zeroing if we're truncating beyond EOF
>>    Especially for the recent large folios support, we can do a lot of
>>    unnecessary zeroing for a very large folio.
>>
>> - Remove the lock-wait-retry loop if we're doing aligned truncation
>>    beyond EOF
>>    Since it's already EOF, there is no need to wait for the OE anyway.
> 
> The patches have been in linux-next but I don't think they got coverage
> on the 64k/4k setups. If you don't have further updates please add the
> series to for-next. Thanks.

I'd prefer Boris to give it a final glance.

This v5 changes the parameter list, thus it is different from previous 
versions.

Although tests wise it's pretty boring on x86_64 and aarch64.

Thanks,
Qu

      reply	other threads:[~2025-05-06  0:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-25 22:36 [PATCH v5 0/2] btrfs: fix beyond EOF truncation for subpage generic/363 failures Qu Wenruo
2025-04-25 22:36 ` [PATCH v5 1/2] btrfs: handle unaligned EOF truncation correctly for subpage cases Qu Wenruo
2025-05-06 17:29   ` Boris Burkov
2025-04-25 22:36 ` [PATCH v5 2/2] btrfs: handle aligned " Qu Wenruo
2025-05-06 17:25   ` Boris Burkov
2025-05-05 15:33 ` [PATCH v5 0/2] btrfs: fix beyond EOF truncation for subpage generic/363 failures David Sterba
2025-05-06  0:05   ` Qu Wenruo [this message]

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=daa36106-0667-4c45-a1a2-74c2f04725ed@suse.com \
    --to=wqu@suse.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox