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
>> 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
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
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
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
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
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,
>
>
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
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
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
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
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
-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
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
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
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
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
: 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
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
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
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
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
.
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
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
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
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
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
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
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
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
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
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 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
.
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
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
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
36 matches
Mail list logo