All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] btrfs: zoned: remove fs_info->max_zone_append_size
@ 2021-06-28  9:13 Johannes Thumshirn
  2021-06-28 10:38 ` Anand Jain
  2021-06-28 11:45 ` [PATCH RFC] btrfs: drop check for lowest max_zone_append_size in btrfs_check_zoned_mode Anand Jain
  0 siblings, 2 replies; 6+ messages in thread
From: Johannes Thumshirn @ 2021-06-28  9:13 UTC (permalink / raw)
  To: David Sterba; +Cc: Johannes Thumshirn, linux-btrfs, Naohiro Aota

Remove fs_info->max_zone_append_size, it doesn't serve any purpose.

Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
---
 fs/btrfs/ctree.h     | 2 --
 fs/btrfs/extent_io.c | 1 -
 fs/btrfs/zoned.c     | 4 ----
 3 files changed, 7 deletions(-)

diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index d7ef4d7d2c1a..7a9cf4d12157 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -1014,8 +1014,6 @@ struct btrfs_fs_info {
 		u64 zoned;
 	};
 
-	/* Max size to emit ZONE_APPEND write command */
-	u64 max_zone_append_size;
 	struct mutex zoned_meta_io_lock;
 	spinlock_t treelog_bg_lock;
 	u64 treelog_bg;
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index 9e81d25dea70..1f947e24091a 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -3266,7 +3266,6 @@ static int calc_bio_boundaries(struct btrfs_bio_ctrl *bio_ctrl,
 		return 0;
 	}
 
-	ASSERT(fs_info->max_zone_append_size > 0);
 	/* Ordered extent not yet created, so we're good */
 	ordered = btrfs_lookup_ordered_extent(inode, logical);
 	if (!ordered) {
diff --git a/fs/btrfs/zoned.c b/fs/btrfs/zoned.c
index 297c0b1c0634..fa481d1ce524 100644
--- a/fs/btrfs/zoned.c
+++ b/fs/btrfs/zoned.c
@@ -619,7 +619,6 @@ int btrfs_check_zoned_mode(struct btrfs_fs_info *fs_info)
 	}
 
 	fs_info->zone_size = zone_size;
-	fs_info->max_zone_append_size = max_zone_append_size;
 	fs_info->fs_devices->chunk_alloc_policy = BTRFS_CHUNK_ALLOC_ZONED;
 
 	/*
@@ -1318,9 +1317,6 @@ bool btrfs_use_zone_append(struct btrfs_inode *inode, u64 start)
 	if (!btrfs_is_zoned(fs_info))
 		return false;
 
-	if (!fs_info->max_zone_append_size)
-		return false;
-
 	if (!is_data_inode(&inode->vfs_inode))
 		return false;
 
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] btrfs: zoned: remove fs_info->max_zone_append_size
  2021-06-28  9:13 [PATCH] btrfs: zoned: remove fs_info->max_zone_append_size Johannes Thumshirn
@ 2021-06-28 10:38 ` Anand Jain
  2021-06-28 11:12   ` Johannes Thumshirn
  2021-06-28 11:45 ` [PATCH RFC] btrfs: drop check for lowest max_zone_append_size in btrfs_check_zoned_mode Anand Jain
  1 sibling, 1 reply; 6+ messages in thread
From: Anand Jain @ 2021-06-28 10:38 UTC (permalink / raw)
  To: Johannes Thumshirn, David Sterba; +Cc: linux-btrfs, Naohiro Aota

On 28/6/21 5:13 pm, Johannes Thumshirn wrote:
> Remove fs_info->max_zone_append_size, it doesn't serve any purpose.
> 


Commit 862931c76327 (btrfs: introduce max_zone_append_size) add it.
The purpose of it is to limit all IO append size. So now, we shall
only track the max_zone_append_size in
device->zone_info->max_zone_append_size, which is per device.

btrfs_check_zoned_mode() found the lowest of these per device
max_zone_append_size but it didn't do much about it.

It looks like I am missing the big picture.

Thanks, Anand

> Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
> ---
>   fs/btrfs/ctree.h     | 2 --
>   fs/btrfs/extent_io.c | 1 -
>   fs/btrfs/zoned.c     | 4 ----
>   3 files changed, 7 deletions(-)
> 
> diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
> index d7ef4d7d2c1a..7a9cf4d12157 100644
> --- a/fs/btrfs/ctree.h
> +++ b/fs/btrfs/ctree.h
> @@ -1014,8 +1014,6 @@ struct btrfs_fs_info {
>   		u64 zoned;
>   	};
>   
> -	/* Max size to emit ZONE_APPEND write command */
> -	u64 max_zone_append_size;
>   	struct mutex zoned_meta_io_lock;
>   	spinlock_t treelog_bg_lock;
>   	u64 treelog_bg;
> diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
> index 9e81d25dea70..1f947e24091a 100644
> --- a/fs/btrfs/extent_io.c
> +++ b/fs/btrfs/extent_io.c
> @@ -3266,7 +3266,6 @@ static int calc_bio_boundaries(struct btrfs_bio_ctrl *bio_ctrl,
>   		return 0;
>   	}
>   
> -	ASSERT(fs_info->max_zone_append_size > 0);
>   	/* Ordered extent not yet created, so we're good */
>   	ordered = btrfs_lookup_ordered_extent(inode, logical);
>   	if (!ordered) {
> diff --git a/fs/btrfs/zoned.c b/fs/btrfs/zoned.c
> index 297c0b1c0634..fa481d1ce524 100644
> --- a/fs/btrfs/zoned.c
> +++ b/fs/btrfs/zoned.c
> @@ -619,7 +619,6 @@ int btrfs_check_zoned_mode(struct btrfs_fs_info *fs_info)
>   	}
>   
>   	fs_info->zone_size = zone_size;
> -	fs_info->max_zone_append_size = max_zone_append_size;
>   	fs_info->fs_devices->chunk_alloc_policy = BTRFS_CHUNK_ALLOC_ZONED;
>   
>   	/*
> @@ -1318,9 +1317,6 @@ bool btrfs_use_zone_append(struct btrfs_inode *inode, u64 start)
>   	if (!btrfs_is_zoned(fs_info))
>   		return false;
>   
> -	if (!fs_info->max_zone_append_size)
> -		return false;
> -
>   	if (!is_data_inode(&inode->vfs_inode))
>   		return false;
>   
> 


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] btrfs: zoned: remove fs_info->max_zone_append_size
  2021-06-28 10:38 ` Anand Jain
@ 2021-06-28 11:12   ` Johannes Thumshirn
  2021-06-28 11:42     ` Anand Jain
  0 siblings, 1 reply; 6+ messages in thread
From: Johannes Thumshirn @ 2021-06-28 11:12 UTC (permalink / raw)
  To: Anand Jain, David Sterba; +Cc: linux-btrfs, Naohiro Aota

On 28/06/2021 12:39, Anand Jain wrote:
> On 28/6/21 5:13 pm, Johannes Thumshirn wrote:
>> Remove fs_info->max_zone_append_size, it doesn't serve any purpose.
>>
> 
> 
> Commit 862931c76327 (btrfs: introduce max_zone_append_size) add it.
> The purpose of it is to limit all IO append size. So now, we shall
> only track the max_zone_append_size in
> device->zone_info->max_zone_append_size, which is per device.
> 
> btrfs_check_zoned_mode() found the lowest of these per device
> max_zone_append_size but it didn't do much about it.

Exactly. We don't do anything with it, so it's completely unneeded. Also
as the max_zone_append_size is per device it doesn't make much sense to
track it globally. It is basically set but never read.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] btrfs: zoned: remove fs_info->max_zone_append_size
  2021-06-28 11:12   ` Johannes Thumshirn
@ 2021-06-28 11:42     ` Anand Jain
  0 siblings, 0 replies; 6+ messages in thread
From: Anand Jain @ 2021-06-28 11:42 UTC (permalink / raw)
  To: Johannes Thumshirn, David Sterba; +Cc: linux-btrfs, Naohiro Aota



On 28/6/21 7:12 pm, Johannes Thumshirn wrote:
> On 28/06/2021 12:39, Anand Jain wrote:
>> On 28/6/21 5:13 pm, Johannes Thumshirn wrote:
>>> Remove fs_info->max_zone_append_size, it doesn't serve any purpose.
>>>
>>
>>
>> Commit 862931c76327 (btrfs: introduce max_zone_append_size) add it.
>> The purpose of it is to limit all IO append size. So now, we shall
>> only track the max_zone_append_size in
>> device->zone_info->max_zone_append_size, which is per device.
>>
>> btrfs_check_zoned_mode() found the lowest of these per device
>> max_zone_append_size but it didn't do much about it.
> 
> Exactly. We don't do anything with it, so it's completely unneeded. Also
> as the max_zone_append_size is per device it doesn't make much sense to
> track it globally. It is basically set but never read.
> 

Oh. Ok. Looks good from this POV.

Reviewed-by: Anand Jain <anand.jain@oracle.com>

Thanks, Anand

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH RFC] btrfs: drop check for lowest max_zone_append_size in btrfs_check_zoned_mode
  2021-06-28  9:13 [PATCH] btrfs: zoned: remove fs_info->max_zone_append_size Johannes Thumshirn
  2021-06-28 10:38 ` Anand Jain
@ 2021-06-28 11:45 ` Anand Jain
  2021-06-28 14:30   ` Johannes Thumshirn
  1 sibling, 1 reply; 6+ messages in thread
From: Anand Jain @ 2021-06-28 11:45 UTC (permalink / raw)
  To: linux-btrfs; +Cc: Johannes.Thumshirn

Commit 862931c76327 (btrfs: introduce max_zone_append_size) add it.
btrfs_check_zoned_mode() found the lowest of these per device
max_zone_append_size but it does not use it. So drop such a check.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
---
RFC because I am not sure if this check is preparatory for something
WIP.


 fs/btrfs/zoned.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/fs/btrfs/zoned.c b/fs/btrfs/zoned.c
index fa481d1ce524..76754e441e20 100644
--- a/fs/btrfs/zoned.c
+++ b/fs/btrfs/zoned.c
@@ -529,7 +529,6 @@ int btrfs_check_zoned_mode(struct btrfs_fs_info *fs_info)
 	u64 zoned_devices = 0;
 	u64 nr_devices = 0;
 	u64 zone_size = 0;
-	u64 max_zone_append_size = 0;
 	const bool incompat_zoned = btrfs_fs_incompat(fs_info, ZONED);
 	int ret = 0;
 
@@ -565,11 +564,6 @@ int btrfs_check_zoned_mode(struct btrfs_fs_info *fs_info)
 				ret = -EINVAL;
 				goto out;
 			}
-			if (!max_zone_append_size ||
-			    (zone_info->max_zone_append_size &&
-			     zone_info->max_zone_append_size < max_zone_append_size))
-				max_zone_append_size =
-					zone_info->max_zone_append_size;
 		}
 		nr_devices++;
 	}
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH RFC] btrfs: drop check for lowest max_zone_append_size in btrfs_check_zoned_mode
  2021-06-28 11:45 ` [PATCH RFC] btrfs: drop check for lowest max_zone_append_size in btrfs_check_zoned_mode Anand Jain
@ 2021-06-28 14:30   ` Johannes Thumshirn
  0 siblings, 0 replies; 6+ messages in thread
From: Johannes Thumshirn @ 2021-06-28 14:30 UTC (permalink / raw)
  To: Anand Jain, linux-btrfs

On 28/06/2021 13:45, Anand Jain wrote:
> Commit 862931c76327 (btrfs: introduce max_zone_append_size) add it.
> btrfs_check_zoned_mode() found the lowest of these per device
> max_zone_append_size but it does not use it. So drop such a check.
> 
> Signed-off-by: Anand Jain <anand.jain@oracle.com>
> ---
> RFC because I am not sure if this check is preparatory for something
> WIP.
> 

Oops that should've probably be folded into the patch I've sent.

My bad, I'll send a v2 layer today.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-06-28 14:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-28  9:13 [PATCH] btrfs: zoned: remove fs_info->max_zone_append_size Johannes Thumshirn
2021-06-28 10:38 ` Anand Jain
2021-06-28 11:12   ` Johannes Thumshirn
2021-06-28 11:42     ` Anand Jain
2021-06-28 11:45 ` [PATCH RFC] btrfs: drop check for lowest max_zone_append_size in btrfs_check_zoned_mode Anand Jain
2021-06-28 14:30   ` Johannes Thumshirn

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.