* [PATCH v2] f2fs: Use mapping->gfp_mask to get file cache for writing
@ 2025-10-10 10:45 Jiucheng Xu via B4 Relay
2025-10-10 11:22 ` Chao Yu
2025-11-11 22:50 ` [f2fs-dev] " patchwork-bot+f2fs
0 siblings, 2 replies; 3+ messages in thread
From: Jiucheng Xu via B4 Relay @ 2025-10-10 10:45 UTC (permalink / raw)
To: Jaegeuk Kim, Chao Yu
Cc: linux-f2fs-devel, linux-kernel, tuan.zhang, jianxin.pan,
Jiucheng Xu
From: Jiucheng Xu <jiucheng.xu@amlogic.com>
On 32-bit architectures, when GFP_NOFS is used, the file cache for write
operations cannot be allocated from the highmem and CMA.
Since mapping->gfp_mask is set to GFP_HIGHUSER_MOVABLE during inode
allocation, using mapping_gfp_mask(mapping) as the GFP flag of getting file
cache for writing is more efficient for 32-bit architectures.
Additionally, use FGP_NOFS to avoid potential deadlock issues caused by
GFP_FS in GFP_HIGHUSER_MOVABLE
Signed-off-by: Jiucheng Xu <jiucheng.xu@amlogic.com>
---
Changes in v2:
- Add FGP_NOFS to keep original GFP_NOFS flag.
- Link to v1: https://lore.kernel.org/r/20250918-origin-dev-v1-1-8d9877df9e77@amlogic.com
---
fs/f2fs/data.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index 7961e0ddfca3aaa332b7dbd4985ae7766551834f..b449edb519d9069f58572685d607a2502e4c9473 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -3587,7 +3587,8 @@ static int f2fs_write_begin(const struct kiocb *iocb,
* Will wait that below with our IO control.
*/
folio = __filemap_get_folio(mapping, index,
- FGP_LOCK | FGP_WRITE | FGP_CREAT, GFP_NOFS);
+ FGP_LOCK | FGP_WRITE | FGP_CREAT | FGP_NOFS,
+ mapping_gfp_mask(mapping));
if (IS_ERR(folio)) {
err = PTR_ERR(folio);
goto fail;
---
base-commit: c872b6279cd26762339ff02513e2a3f16149a6f1
change-id: 20250910-origin-dev-8a5ff6bee1f2
Best regards,
--
Jiucheng Xu <jiucheng.xu@amlogic.com>
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2] f2fs: Use mapping->gfp_mask to get file cache for writing
2025-10-10 10:45 [PATCH v2] f2fs: Use mapping->gfp_mask to get file cache for writing Jiucheng Xu via B4 Relay
@ 2025-10-10 11:22 ` Chao Yu
2025-11-11 22:50 ` [f2fs-dev] " patchwork-bot+f2fs
1 sibling, 0 replies; 3+ messages in thread
From: Chao Yu @ 2025-10-10 11:22 UTC (permalink / raw)
To: jiucheng.xu, Jaegeuk Kim
Cc: chao, linux-f2fs-devel, linux-kernel, tuan.zhang, jianxin.pan
On 10/10/25 18:45, Jiucheng Xu via B4 Relay wrote:
> From: Jiucheng Xu <jiucheng.xu@amlogic.com>
>
> On 32-bit architectures, when GFP_NOFS is used, the file cache for write
> operations cannot be allocated from the highmem and CMA.
>
> Since mapping->gfp_mask is set to GFP_HIGHUSER_MOVABLE during inode
> allocation, using mapping_gfp_mask(mapping) as the GFP flag of getting file
> cache for writing is more efficient for 32-bit architectures.
>
> Additionally, use FGP_NOFS to avoid potential deadlock issues caused by
> GFP_FS in GFP_HIGHUSER_MOVABLE
>
> Signed-off-by: Jiucheng Xu <jiucheng.xu@amlogic.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Thanks,
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [f2fs-dev] [PATCH v2] f2fs: Use mapping->gfp_mask to get file cache for writing
2025-10-10 10:45 [PATCH v2] f2fs: Use mapping->gfp_mask to get file cache for writing Jiucheng Xu via B4 Relay
2025-10-10 11:22 ` Chao Yu
@ 2025-11-11 22:50 ` patchwork-bot+f2fs
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+f2fs @ 2025-11-11 22:50 UTC (permalink / raw)
To: Jiucheng Xu
Cc: jaegeuk, chao, devnull+jiucheng.xu.amlogic.com, tuan.zhang,
linux-kernel, jianxin.pan, linux-f2fs-devel
Hello:
This patch was applied to jaegeuk/f2fs.git (dev)
by Jaegeuk Kim <jaegeuk@kernel.org>:
On Fri, 10 Oct 2025 10:45:50 +0000 you wrote:
> From: Jiucheng Xu <jiucheng.xu@amlogic.com>
>
> On 32-bit architectures, when GFP_NOFS is used, the file cache for write
> operations cannot be allocated from the highmem and CMA.
>
> Since mapping->gfp_mask is set to GFP_HIGHUSER_MOVABLE during inode
> allocation, using mapping_gfp_mask(mapping) as the GFP flag of getting file
> cache for writing is more efficient for 32-bit architectures.
>
> [...]
Here is the summary with links:
- [f2fs-dev,v2] f2fs: Use mapping->gfp_mask to get file cache for writing
https://git.kernel.org/jaegeuk/f2fs/c/2308de27c03d
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-11-11 22:51 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-10 10:45 [PATCH v2] f2fs: Use mapping->gfp_mask to get file cache for writing Jiucheng Xu via B4 Relay
2025-10-10 11:22 ` Chao Yu
2025-11-11 22:50 ` [f2fs-dev] " patchwork-bot+f2fs
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox