Re: [f2fs-dev] [PATCH 1/5] zonefs: pass GFP_KERNEL to blkdev_zone_mgmt() call

2024-01-23 Thread Dave Chinner via Linux-f2fs-devel
On Tue, Jan 23, 2024 at 09:39:02PM +0100, Mikulas Patocka wrote: > > > On Tue, 23 Jan 2024, Johannes Thumshirn wrote: > > > Pass GFP_KERNEL instead of GFP_NOFS to the blkdev_zone_mgmt() call in > > zonefs_zone_mgmt(). > > > > As as zonefs_zone_mgmt() and zonefs_inode_zone_mgmt() are never

Re: [f2fs-dev] [PATCH 1/5] zonefs: pass GFP_KERNEL to blkdev_zone_mgmt() call

2024-01-23 Thread Damien Le Moal
On 1/24/24 08:21, Dave Chinner wrote: > On Tue, Jan 23, 2024 at 09:39:02PM +0100, Mikulas Patocka wrote: >> >> >> On Tue, 23 Jan 2024, Johannes Thumshirn wrote: >> >>> Pass GFP_KERNEL instead of GFP_NOFS to the blkdev_zone_mgmt() call in >>> zonefs_zone_mgmt(). >>> >>> As as zonefs_zone_mgmt() and

Re: [f2fs-dev] [PATCH 1/5] zonefs: pass GFP_KERNEL to blkdev_zone_mgmt() call

2024-01-23 Thread Mikulas Patocka
On Tue, 23 Jan 2024, Johannes Thumshirn wrote: > Pass GFP_KERNEL instead of GFP_NOFS to the blkdev_zone_mgmt() call in > zonefs_zone_mgmt(). > > As as zonefs_zone_mgmt() and zonefs_inode_zone_mgmt() are never called > from a place that can recurse back into the filesystem on memory reclaim, >

Re: [f2fs-dev] [PATCH 2/5] dm: dm-zoned: pass GFP_KERNEL to blkdev_zone_mgmt

2024-01-23 Thread Mikulas Patocka
On Tue, 23 Jan 2024, Johannes Thumshirn wrote: > The call to blkdev_zone_mgmt() in dm-zoned is only used to perform a > ZONE_RESET operation when freeing a zone. > > This is not done in the IO path, so we can use GFP_KERNEL here, as it will > never recurse back into the driver on reclaim. Hi

[f2fs-dev] [PATCH] f2fs-tools: don't call fsync on a clean image

2024-01-23 Thread Chao Yu
generic/019 50s ... _check_generic_filesystem: filesystem on /dev/vdc is inconsistent (see /media/fstests/results//generic/019.full for details) [FSCK] Max image size: 16196 MB, Free space: 188 MB [FSCK] Unreachable nat entries[Ok..] [0x0] [FSCK] SIT valid block bitmap

[f2fs-dev] [PATCH v4] f2fs: unify the error handling of f2fs_is_valid_blkaddr

2024-01-23 Thread Zhiguo Niu
There are some cases of f2fs_is_valid_blkaddr not handled as ERROR_INVALID_BLKADDR,so unify the error handling about all of f2fs_is_valid_blkaddr. Signed-off-by: Zhiguo Niu --- changes of v2: improve patch according Chao's suggestions. changes of v3: -rebase patch to dev-test

[f2fs-dev] [PATCH 0/5] block: remove gfp_mask for blkdev_zone_mgmt()

2024-01-23 Thread Johannes Thumshirn via Linux-f2fs-devel
Fueled by the LSFMM discussion on removing GFP_NOFS initiated by Willy, I've looked into the sole GFP_NOFS allocation in zonefs. As it turned out, it is only done for zone management commands and can be removed. After digging into more callers of blkdev_zone_mgmt() I came to the conclusion that

[f2fs-dev] [PATCH 5/5] block: remove gfp_flags from blkdev_zone_mgmt

2024-01-23 Thread Johannes Thumshirn via Linux-f2fs-devel
Now that all callers pass in GFP_KERNEL to blkdev_zone_mgmt() and use memalloc_no{io,fs}_{save,restore}() to define the allocation scope, we can drop the gfp_mask parameter from blkdev_zone_mgmt() as well as blkdev_zone_reset_all() and blkdev_zone_reset_all_emulated(). Signed-off-by: Johannes

[f2fs-dev] [PATCH 4/5] f2fs: guard blkdev_zone_mgmt with nofs scope

2024-01-23 Thread Johannes Thumshirn via Linux-f2fs-devel
Guard the calls to blkdev_zone_mgmt() with a memalloc_nofs scope. This helps us getting rid of the GFP_NOFS argument to blkdev_zone_mgmt(); Signed-off-by: Johannes Thumshirn --- fs/f2fs/segment.c | 15 --- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git

[f2fs-dev] [PATCH 2/5] dm: dm-zoned: pass GFP_KERNEL to blkdev_zone_mgmt

2024-01-23 Thread Johannes Thumshirn via Linux-f2fs-devel
The call to blkdev_zone_mgmt() in dm-zoned is only used to perform a ZONE_RESET operation when freeing a zone. This is not done in the IO path, so we can use GFP_KERNEL here, as it will never recurse back into the driver on reclaim. Signed-off-by: Johannes Thumshirn ---

[f2fs-dev] [PATCH 3/5] btrfs: zoned: call blkdev_zone_mgmt in nofs scope

2024-01-23 Thread Johannes Thumshirn via Linux-f2fs-devel
Add a memalloc_nofs scope around all calls to blkdev_zone_mgmt(). This allows us to further get rid of the GFP_NOFS argument for blkdev_zone_mgmt(). Signed-off-by: Johannes Thumshirn --- fs/btrfs/zoned.c | 33 ++--- 1 file changed, 26 insertions(+), 7 deletions(-)

[f2fs-dev] [PATCH 1/5] zonefs: pass GFP_KERNEL to blkdev_zone_mgmt() call

2024-01-23 Thread Johannes Thumshirn via Linux-f2fs-devel
Pass GFP_KERNEL instead of GFP_NOFS to the blkdev_zone_mgmt() call in zonefs_zone_mgmt(). As as zonefs_zone_mgmt() and zonefs_inode_zone_mgmt() are never called from a place that can recurse back into the filesystem on memory reclaim, it is save to call blkdev_zone_mgmt() with GFP_KERNEL.

Re: [f2fs-dev] [PATCH v3] f2fs: fix zoned block device information initialization

2024-01-23 Thread Yongpeng Yang via Linux-f2fs-devel
Hi Wenjie, It seems more reasonable to use bdev_max_open_zones instead of bdev_max_active_zones. If an NVMe device has multiple namespaces, and the device contains a total of 11 open zones, two of the namespaces, nvme0n1 and nvme0n2, each correspond to an instance of the F2FS filesystem, and

[f2fs-dev] [PATCH v3] f2fs: fix zoned block device information initialization

2024-01-23 Thread Wenjie Qi
If the max active zones of zoned devices are less than the active logs of F2FS, the device may error due to insufficient zone resources when multiple active logs are being written at the same time. If this value is 0, there is no limit. Signed-off-by: Wenjie Qi --- fs/f2fs/f2fs.h | 1 +