mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Nanzhe Zhao" <nzzhao@126.com>
To: "Jaegeuk Kim" <jaegeuk@kernel.org>
Cc: "Chao Yu" <chao@kernel.org>,
	linux-kernel@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net
Subject: Re:Re: [f2fs-dev] [PATCH 1/2 v4] f2fs: support large folio for immutable non-compressed case
Date: Sat, 3 Jan 2026 18:54:15 +0800 (CST)	[thread overview]
Message-ID: <16d92acc.17ac.19b837e5d80.Coremail.nzzhao@126.com> (raw)
In-Reply-To: <aVdkSZeuwzsNq7pE@google.com>

Dear Kim:
Thanks for your quick reply!

I applied the two bug fixes on my local branch and found that
I still couldn't pass my test of generating and reading a heavily
fragmented file.

The root cause is that current code will treat hole blocks as mapped
blocks as well and mistakenly increment read_pages_pending, resulting
task hung in readahead.

Inside f2fs_map_blocks():

/* DIO READ and hole case, should not map the blocks. */
if (!(flag == F2FS_GET_BLOCK_DIO && is_hole && !map->m_may_create))
	map->m_flags |= F2FS_MAP_MAPPED;

it will have map->m_flags marked with F2FS_MAP_MAPPED in non-DIO and
no blocks creation context for NULL_ADDR and NEW_ADDR, except for
holes mapped to an unallocated dnode.

Personally, I think a better fix is to add a helper function
f2fs_block_needs_zeroing(). The condition could be: return true if the
current blkaddr is NULL_ADDR or NEW_ADDR.

Then we can reverse the order of the checks under the got_it: label:
first `if (f2fs_block_needs_zeroing()) ...`, and then `else if
(map->m_flags & F2FS_MAP_MAPPED)`, while keeping all the logic inside
those statements unchanged.

For the parameters of f2fs_block_needs_zeroing(), I think we can pass
`struct f2fs_map_blocks` directly, because it already contains all the
information we need. Also, if we later want to support batching
contiguous physical block mappings and bio additions inside the loop,
this signature should be more extensible.

If you think this approach makes sense, I can send a patch to fix all
three bugs. Thank you.

Best regards,
Nanzhe Zhao

  reply	other threads:[~2026-01-03 10:54 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-20 23:54 [PATCH 1/2] " Jaegeuk Kim
2025-11-20 23:54 ` [PATCH 2/2] f2fs: add a tracepoint to see large folio read submission Jaegeuk Kim
2025-11-21 10:23   ` [f2fs-dev] " Chao Yu
2025-11-21 10:20 ` [f2fs-dev] [PATCH 1/2] f2fs: support large folio for immutable non-compressed case Chao Yu
2025-11-22  1:17   ` Jaegeuk Kim
2025-11-25  1:38     ` Chao Yu
2025-12-01 19:31   ` [f2fs-dev] [PATCH 1/2 v2] " Jaegeuk Kim
2025-12-01 21:37     ` Chao Yu
2025-12-01 22:30     ` [f2fs-dev] [PATCH 1/2 v3] " Jaegeuk Kim
2025-12-01 22:37       ` Chao Yu
2025-12-02  2:38       ` [f2fs-dev] [PATCH 1/2 v4] " Jaegeuk Kim
2025-12-02 18:07         ` Chao Yu
2025-12-09  8:32         ` Chao Yu
2025-12-09 18:38           ` Jaegeuk Kim
2026-01-01 11:20             ` Nanzhe Zhao
2026-01-02  6:23               ` Jaegeuk Kim
2026-01-03 10:54                 ` Nanzhe Zhao [this message]
2026-01-04  3:20                   ` Jaegeuk Kim
2025-11-22  1:18 ` [PATCH 1/2 v2] " Jaegeuk Kim
2025-12-16 19:20 ` [f2fs-dev] [PATCH 1/2] " patchwork-bot+f2fs

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=16d92acc.17ac.19b837e5d80.Coremail.nzzhao@126.com \
    --to=nzzhao@126.com \
    --cc=chao@kernel.org \
    --cc=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-kernel@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

all inboxes | Powered by JetHome®