From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D889923184A for ; Sun, 4 Jan 2026 03:20:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767496844; cv=none; b=XRHAMbBup6cRWLo3hOQdOAAEc43FdSB+JFBGj03Ytv7EZBw9vGugJVmU28+TeZTSeiDTiSmzfCledKe/BuoXsw+9xCNwp6Fc3IWJTAAGrsEsbJQKnsUYgSi2Trw3aRl/CJ0Gmt8Uu8m6whEwhu5VOeX6oIkPz9imO/K6qJL1nog= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767496844; c=relaxed/simple; bh=docKMmc0VR5dmjWUdAB2Vta8AaFQPvJ08yVISnVbnrA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Q4Hv+5S1LlyvfgvM82K+5nKvFJjlDRhZleFIM7rPGeMJfOmlKPoLoyYXmQnGiQGH6218sk4dGAspuOjqCXYJUV28JmWg5ISZSTsmCOwLmUgapmYHkEUPqvRrn/Yaz9xAc4yyCyJ9daNCsXhdiEoA4Ymh4/zRP6MCQBPIeRdPP/g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=WL3uCsYs; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="WL3uCsYs" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 80A9DC4CEF7; Sun, 4 Jan 2026 03:20:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1767496844; bh=docKMmc0VR5dmjWUdAB2Vta8AaFQPvJ08yVISnVbnrA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=WL3uCsYswzadGDaLTGGC8zX6v/IeVPkptDULPDx2g7gHHFD0XogF7eE574nfLrPOe IP49fSm9a372IMuc8pL/c3R5KUz8e3+UCMohP/N9YzIxLs5KNkOEaCOhApth2fQ3lb duSpWNC8/8LWWzTITN+qb0e71/EM9scWEbOAy7CA3aaRHE8RiUuwjhTa6GSNG9HV7M 2iNwQhuXApr0uxxnTW9VMltwHhkwe+CZGLIImMbMdSgZqqC7lPWP4IDoLiBpseIqnd 5LDbQpwk7QcxIOb0avlbaZk++O0hnuLtl97aKIffv+9Au5TPCW8fFB92sjqaBzfoL6 U43N9DAHApVmA== Date: Sun, 4 Jan 2026 03:20:42 +0000 From: Jaegeuk Kim To: Nanzhe Zhao Cc: Chao Yu , linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Subject: Re: [f2fs-dev] [PATCH 1/2 v4] f2fs: support large folio for immutable non-compressed case Message-ID: References: <20251120235446.1947532-1-jaegeuk@kernel.org> <0153ff69-789d-4fe1-a89c-0c607a9a7d6c@kernel.org> <0bf2eedd-eebb-440b-96f5-72ac3a68b608@kernel.org> <16d92acc.17ac.19b837e5d80.Coremail.nzzhao@126.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <16d92acc.17ac.19b837e5d80.Coremail.nzzhao@126.com> On 01/03, Nanzhe Zhao wrote: > 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. I think that's feasbile. Could you please post a patch to discuss further? Thanks, > > Best regards, > Nanzhe Zhao