[f2fs-dev] [PATCH] fs/writeback: convert wbc_account_cgroup_owner to take a folio

2024-09-26 Thread Pankaj Raghav (Samsung) via Linux-f2fs-devel
From: Pankaj Raghav Most of the callers of wbc_account_cgroup_owner() are converting a folio to page before calling the function. wbc_account_cgroup_owner() is converting the page back to a folio to call mem_cgroup_css_from_folio(). Convert wbc_account_cgroup_owner() to take a folio instead of

Re: [f2fs-dev] [PATCH 17/17] fs: add CONFIG_BUFFER_HEAD

2023-05-01 Thread Pankaj Raghav
>> No but the only place to add that would be in the block cache. Adding >> that alone to the block cache doesn't fix the issue. The below patch >> however does get us by. > > That's "working around the error", not fixing it ... probably the same > root cause as your other errors; at least I'm not

Re: [f2fs-dev] [PATCH 00/16] support non power of 2 zoned devices

2022-05-05 Thread Pankaj Raghav
On 2022-05-04 23:14, David Sterba wrote: >> This commit: `btrfs: zoned: relax the alignment constraint for zoned >> devices` makes sure the zone size is BTRFS_STRIPE_LEN aligned (64K). So >> even the npo2 zoned device should be aligned to `fs_info->sectorsize`, >> which is typically 4k. >> >> This

Re: [f2fs-dev] [PATCH 15/16] f2fs: ensure only power of 2 zone sizes are allowed

2022-05-04 Thread Pankaj Raghav
On 2022-05-03 22:05, Jaegeuk Kim wrote: > Applied to f2fs tree. Thanks, > Thanks Jaegeuk. I will remove the f2fs patches from my next revision Regards, Pankaj > On 04/27, Pankaj Raghav wrote: >> From: Luis Chamberlain >> >> F2FS zoned support has power of 2 zone siz

Re: [f2fs-dev] [PATCH 05/16] nvme: zns: Allow ZNS drives that have non-power_of_2 zone size

2022-05-04 Thread Pankaj Raghav
On 2022-05-03 18:50, Bart Van Assche wrote: > On 4/27/22 09:02, Pankaj Raghav wrote: >> -    sector &= ~(ns->zsze - 1); >> +    sector = rounddown(sector, ns->zsze); > > The above change breaks 32-bit builds since ns->zsze is 64 bits wide and > since rou

Re: [f2fs-dev] [PATCH 01/16] block: make blkdev_nr_zones and blk_queue_zone_no generic for npo2 zsze

2022-05-04 Thread Pankaj Raghav
On 2022-05-03 18:37, Bart Van Assche wrote: >>   sector_t zone_sectors = blk_queue_zone_sectors(disk->queue); >> +    sector_t capacity = get_capacity(disk); >>     if (!blk_queue_is_zoned(disk->queue)) >>   return 0; >> -    return (get_capacity(disk) + zone_sectors - 1) >> >> ilog

Re: [f2fs-dev] [PATCH 00/16] support non power of 2 zoned devices

2022-05-03 Thread Pankaj Raghav
Hi Johannes, On 2022-05-03 00:07, Johannes Thumshirn wrote: >> There was an effort previously [1] to add support to non po2 devices via >> device level emulation but that was rejected with a final conclusion >> to add support for non po2 zoned device in the complete stack[2]. > > Hey Pankaj, > >

[f2fs-dev] [PATCH 03/16] block: add bdev_zone_no helper

2022-04-27 Thread Pankaj Raghav
zone number. Reviewed-by: Luis Chamberlain Signed-off-by: Pankaj Raghav --- include/linux/blkdev.h | 9 + 1 file changed, 9 insertions(+) diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index f8f2d2998afb..55293e0a8702 100644 --- a/include/linux/blkdev.h +++ b/include/linux

[f2fs-dev] [PATCH 01/16] block: make blkdev_nr_zones and blk_queue_zone_no generic for npo2 zsze

2022-04-27 Thread Pankaj Raghav
just introduce one new branch per call. Reviewed-by: Luis Chamberlain Signed-off-by: Pankaj Raghav --- block/blk-zoned.c | 8 +++- include/linux/blkdev.h | 8 +++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/block/blk-zoned.c b/block/blk-zoned.c index

[f2fs-dev] [PATCH 14/16] f2fs: call bdev_zone_sectors() only once on init_blkz_info()

2022-04-27 Thread Pankaj Raghav
From: Luis Chamberlain Instead of calling bdev_zone_sectors() multiple times, call it once and cache the value locally. This will make the subsequent change easier to read. Signed-off-by: Luis Chamberlain Signed-off-by: Pankaj Raghav --- fs/f2fs/super.c | 9 ++--- 1 file changed, 6

[f2fs-dev] [PATCH 00/16] support non power of 2 zoned devices

2022-04-27 Thread Pankaj Raghav
310094725.ga28...@lst.de/T/ [2] https://lore.kernel.org/all/20220315135245.eqf4tqngxxb7ymqa@unifi/ Luis Chamberlain (4): nvmet: use blk_queue_zone_no() f2fs: call bdev_zone_sectors() only once on init_blkz_info() f2fs: ensure only power of 2 zone sizes are allowed dm-zoned: ensure only pow

[f2fs-dev] [PATCH 13/16] null_blk: allow non power of 2 zoned devices

2022-04-27 Thread Pankaj Raghav
Chamberlain Signed-off-by: Pankaj Raghav --- drivers/block/null_blk/main.c | 4 ++-- drivers/block/null_blk/zoned.c | 14 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/block/null_blk/main.c b/drivers/block/null_blk/main.c index c441a4972064..82a62b543782

[f2fs-dev] [PATCH 11/16] btrfs: zoned: relax the alignment constraint for zoned devices

2022-04-27 Thread Pankaj Raghav
-by: Luis Chamberlain Signed-off-by: Pankaj Raghav --- fs/btrfs/zoned.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/fs/btrfs/zoned.c b/fs/btrfs/zoned.c index 8f3f542e174c..3ed085762f14 100644 --- a/fs/btrfs/zoned.c +++ b/fs/btrfs/zoned.c @@ -395,8 +395,7 @@ int

[f2fs-dev] [PATCH 08/16] btrfs: zoned: add generic btrfs helpers for zoned devices

2022-04-27 Thread Pankaj Raghav
added instead of reusing bdev_zone_aligned() helper is due to some use cases in btrfs where zone alignment is checked before having access to the underlying block device such as in this function: btrfs_load_block_group_zone_info(). Reviewed-by: Luis Chamberlain Signed-off-by: Pankaj Raghav --- fs

[f2fs-dev] [PATCH 16/16] dm-zoned: ensure only power of 2 zone sizes are allowed

2022-04-27 Thread Pankaj Raghav
Chamberlain Signed-off-by: Pankaj Raghav --- drivers/md/dm-zone.c | 12 1 file changed, 12 insertions(+) diff --git a/drivers/md/dm-zone.c b/drivers/md/dm-zone.c index 57daa86c19cf..221e0aa0f1a7 100644 --- a/drivers/md/dm-zone.c +++ b/drivers/md/dm-zone.c @@ -231,6 +231,18

[f2fs-dev] [PATCH 12/16] zonefs: allow non power of 2 zoned devices

2022-04-27 Thread Pankaj Raghav
The zone size shift variable is useful only if the zone sizes are known to be power of 2. Remove that variable and use generic helpers from block layer to calculate zone index in zonefs Reviewed-by: Luis Chamberlain Signed-off-by: Pankaj Raghav --- fs/zonefs/super.c | 6 ++ fs/zonefs

[f2fs-dev] [PATCH 02/16] block: add blk_queue_zone_aligned and bdev_zone_aligned helper

2022-04-27 Thread Pankaj Raghav
zone size devices. As the existing deployments of zoned devices had power-of-2 assumption, power-of-2 optimized calculation is done for devices with power-of-2 zone size Reviewed-by: Luis Chamberlain Signed-off-by: Pankaj Raghav --- include/linux/blkdev.h | 31 +++ 1

[f2fs-dev] [PATCH 04/16] block: allow blk-zoned devices to have non-power-of-2 zone size

2022-04-27 Thread Pankaj Raghav
: Luis Chamberlain Signed-off-by: Pankaj Raghav --- block/blk-core.c | 3 +-- block/blk-zoned.c | 12 ++-- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/block/blk-core.c b/block/blk-core.c index 937bb6b86331..850caf311064 100644 --- a/block/blk-core.c +++ b/block/blk

[f2fs-dev] [PATCH 06/16] nvmet: use blk_queue_zone_no()

2022-04-27 Thread Pankaj Raghav
From: Luis Chamberlain Instead of open coding the number of zones given a sector, use the helper blk_queue_zone_no(). This let's us make modifications to the math if needed in one place and adds now support for npo2 zone devices. Signed-off-by: Luis Chamberlain Signed-off-by: Pankaj R

[f2fs-dev] [PATCH 05/16] nvme: zns: Allow ZNS drives that have non-power_of_2 zone size

2022-04-27 Thread Pankaj Raghav
special handling. Both modified functions are not used in hot paths, they are only used during initialization & revalidation of the ZNS device. Reviewed-by: Luis Chamberlain Signed-off-by: Pankaj Raghav --- drivers/nvme/host/zns.c | 11 ++- 1 file changed, 2 insertions(+), 9 delet

[f2fs-dev] [PATCH 10/16] btrfs: zoned: use btrfs zone helpers to support non po2 zoned devices

2022-04-27 Thread Pankaj Raghav
Use the generic btrfs zone helpers to calculate zone index, check zone alignment, round up and round down operations. The zone_size_shift field is not needed anymore as generic helpers are used for calculation. Reviewed-by: Luis Chamberlain Signed-off-by: Pankaj Raghav --- fs/btrfs/volumes.c

[f2fs-dev] [PATCH 07/16] btrfs: zoned: Cache superblock location in btrfs_zoned_device_info

2022-04-27 Thread Pankaj Raghav
to use the sb_zone_number because btrfs_zoned_device_info struct might not have been initialized at that point. This patch will enable non power-of-2 zoned devices to not perform division to lookup superblock and its mirror location. Reviewed-by: Luis Chamberlain Signed-off-by: Pankaj Raghav

[f2fs-dev] [PATCH 15/16] f2fs: ensure only power of 2 zone sizes are allowed

2022-04-27 Thread Pankaj Raghav
. This condition will be relaxed once those calculation based on power of 2 is made generic. Signed-off-by: Luis Chamberlain Signed-off-by: Pankaj Raghav --- fs/f2fs/super.c | 4 1 file changed, 4 insertions(+) diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index f64761a15df7..db79abf30002

[f2fs-dev] [PATCH 09/16] btrfs: zoned: Make sb_zone_number function non power of 2 compatible

2022-04-27 Thread Pankaj Raghav
zone location. Reviewed-by: Luis Chamberlain Signed-off-by: Pankaj Raghav --- fs/btrfs/zoned.c | 25 +++-- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/fs/btrfs/zoned.c b/fs/btrfs/zoned.c index 6f76942d0ea5..8f574a474420 100644 --- a/fs/btrfs/zoned.c +++ b/fs

Re: [f2fs-dev] [PATCH v2] libf2fs: don't allow mkfs / fsck on non power-of-2 zoned devices

2022-04-20 Thread Pankaj Raghav
On 2022-04-20 01:07, Jaegeuk Kim wrote: >> TL;DR until we change some calculations in f2fs for zoned device to be >> generic, we need to bail out during mkfs time for non power of 2 zone >> size devices. > > Ah, I see. Yeah, that in f2fs is actually PO2. Let me merge this patch to > force it befor

Re: [f2fs-dev] [PATCH v2] libf2fs: don't allow mkfs / fsck on non power-of-2 zoned devices

2022-04-20 Thread Pankaj Raghav
On 2022-04-20 01:07, Jaegeuk Kim wrote:>> TL;DR until we change some calculations in f2fs for zoned device to be >> generic, we need to bail out during mkfs time for non power of 2 zone >> size devices. > > Ah, I see. Yeah, that in f2fs is actually PO2. Let me merge this patch to > force it before

Re: [f2fs-dev] [PATCH v2] libf2fs: don't allow mkfs / fsck on non power-of-2 zoned devices

2022-04-19 Thread Pankaj Raghav
On 2022-04-13 21:45, Jaegeuk Kim wrote:>> As I explained in the v1 thread, zoned support for f2fs assumes po2 zone >> sizes. For e.g., >> static int __f2fs_issue_discard_zone(struct f2fs_sb_info *sbi, >> struct block_device *bdev, block_t blkstart, block_t blklen) >> { >> sector_t

Re: [f2fs-dev] [PATCH 0/3] f2fs-tools: return error for zoned devices with non power-of-2 zone size

2022-04-13 Thread Pankaj Raghav
Hi Jaegeuk, On 2022-04-13 18:22, Jaegeuk Kim wrote: >>> The section size actually supports multiple 2MBs, not PO2. >>> >> Thanks a lot for the clarification. I will remove this statement in the >> next revision. >> >> I was partially misled by [1] where it is stated "Segments are collected >> into

Re: [f2fs-dev] [PATCH v2] libf2fs: don't allow mkfs / fsck on non power-of-2 zoned devices

2022-04-13 Thread Pankaj Raghav
Hi Jaegeuk, On 2022-04-13 19:03, Jaegeuk Kim wrote >> @@ -882,6 +882,11 @@ static int open_check_fs(char *path, int flag) >> return open(path, O_RDONLY | flag); >> } >> >> +static int is_power_of_2(unsigned long n) > > So, this needs to check 2MB alignment only? > As I explained in the v

[f2fs-dev] [PATCH v2] libf2fs: don't allow mkfs / fsck on non power-of-2 zoned devices

2022-04-13 Thread Pankaj Raghav
today's kernel does not allow NPO2 zoned devices to exist as a block device. But NPO2 zoned devices do exist so proactively put a stop-gap measure in place to prevent it from being incorrectly used. Signed-off-by: Luis Chamberlain Signed-off-by: Pankaj Raghav --- Changes since v1: - Squas

Re: [f2fs-dev] [PATCH 0/3] f2fs-tools: return error for zoned devices with non power-of-2 zone size

2022-04-13 Thread Pankaj Raghav
Hi Jaegeuk, On 2022-04-12 18:33, Jaegeuk Kim wrote: > On 04/12, Pankaj Raghav wrote: >> F2FS only works for zoned devices with power-of-2 zone sizes as the >> f2fs section needs to be a power-of-2. > > The section size actually supports multiple 2MBs, not PO2. &g

Re: [f2fs-dev] [PATCH 3/3] libf2fs: don't allow mkfs / fsck on zoned NPO2

2022-04-12 Thread Pankaj Raghav
Hi Damien, On 2022-04-12 14:16, Damien Le Moal wrote:>> int get_device_info(int i) >> { >> int32_t fd = 0; >> @@ -1043,6 +1048,13 @@ int get_device_info(int i) >> return -1; >> } >> >> +if (!dev->zone_size || !is_power_of_2(dev->zone_size)) {

[f2fs-dev] [PATCH 0/3] f2fs-tools: return error for zoned devices with non power-of-2 zone size

2022-04-12 Thread Pankaj Raghav
F2FS only works for zoned devices with power-of-2 zone sizes as the f2fs section needs to be a power-of-2. At the moment the linux kernel only accepts zoned devices which are power-of-2 as block devices but there are zoned devices in the market which have non power-of-2 zone sizes. As a proactive

[f2fs-dev] [PATCH 2/3] libf2fs: add support to report zone size

2022-04-12 Thread Pankaj Raghav
. Signed-off-by: Luis Chamberlain Signed-off-by: Pankaj Raghav --- include/f2fs_fs.h | 1 + lib/libf2fs.c | 5 +++-- lib/libf2fs_zoned.c | 5 +++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/include/f2fs_fs.h b/include/f2fs_fs.h index d236437..83c5b33 100644 --- a/include

[f2fs-dev] [PATCH 3/3] libf2fs: don't allow mkfs / fsck on zoned NPO2

2022-04-12 Thread Pankaj Raghav
today's kernel does not allow NPO2 zon devices to exist. But these devices do exist, and so proactively put a stop-gap measure in place to prevent the from being assumed to be used. Signed-off-by: Luis Chamberlain Signed-off-by: Pankaj Raghav --- lib/libf2fs.c | 12 1 file change

[f2fs-dev] [PATCH 1/3] libf2fs_zoned: factor out helper to get chunk sectors

2022-04-12 Thread Pankaj Raghav
From: Luis Chamberlain This moves the code which fetches the chunk_sectors into a helper. Yes, this could in theory be used by non-zoned devices but that's not the case yet, so no need to make this a generic routine. This makes it clear what this is doing, and helps us make the subsequent change