fio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] v2: ZBD fix with random zone index logic and missing documentation
       [not found] <CGME20210804092848epcas5p43713e1728116d2ea38c910a2b8991c42@epcas5p4.samsung.com>
@ 2021-08-04  9:24 ` Ankit Kumar
       [not found]   ` <CGME20210804092852epcas5p2bf4990e1b1b9a2e9d02c8520b3998818@epcas5p2.samsung.com>
                     ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Ankit Kumar @ 2021-08-04  9:24 UTC (permalink / raw)
  To: axboe; +Cc: fio, krish.reddy, prakash.v, Ankit Kumar

v1 -> v2

 - Addressed the commit message review comments for both the patches

Ankit Kumar (2):
  HOWTO: Add missing documentation for job_max_open_zones
  zbd: Improve random zone index generation logic

 HOWTO | 5 +++++
 zbd.c | 5 +++--
 2 files changed, 8 insertions(+), 2 deletions(-)

-- 
2.30.0-rc0



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

* [PATCH 1/2] HOWTO: Add missing documentation for job_max_open_zones
       [not found]   ` <CGME20210804092852epcas5p2bf4990e1b1b9a2e9d02c8520b3998818@epcas5p2.samsung.com>
@ 2021-08-04  9:24     ` Ankit Kumar
  0 siblings, 0 replies; 9+ messages in thread
From: Ankit Kumar @ 2021-08-04  9:24 UTC (permalink / raw)
  To: axboe; +Cc: fio, krish.reddy, prakash.v, Ankit Kumar

---
 HOWTO | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/HOWTO b/HOWTO
index 59c7f1ff..d4e620de 100644
--- a/HOWTO
+++ b/HOWTO
@@ -1055,6 +1055,11 @@ Target file/device
 	number of open zones is defined as the number of zones to which write
 	commands are issued.
 
+.. option:: job_max_open_zones=int
+
+	Limit on the number of simultaneously opened zones per single
+	thread/process.
+
 .. option:: zone_reset_threshold=float
 
 	A number between zero and one that indicates the ratio of logical
-- 
2.30.0-rc0



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

* [PATCH 2/2] zbd: Improve random zone index generation logic
       [not found]   ` <CGME20210804092859epcas5p1085bcaafa631e16cc3ad4325b883172e@epcas5p1.samsung.com>
@ 2021-08-04  9:24     ` Ankit Kumar
  0 siblings, 0 replies; 9+ messages in thread
From: Ankit Kumar @ 2021-08-04  9:24 UTC (permalink / raw)
  To: axboe; +Cc: fio, krish.reddy, prakash.v, Ankit Kumar

Existing random zone index generation logic is dependent on the file size.
For smaller I/O sizes the random zone index always return a particular
section of open zones. As this index is used to return one of the open zones,
it was observed that after one of the max_open_zones / job_max_open_zones limit
is reached all further I/O's are redirected to only a few open zones till they
are full.

This patch modifies the random zone index genration logic so that it is uniform
across all the open zones.

It reverts part of the commit 6463db6c1
('fio: fix interaction between offset/size limited threads and
"max_open_zones"')
---
 zbd.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/zbd.c b/zbd.c
index 04c68dea..43f12b45 100644
--- a/zbd.c
+++ b/zbd.c
@@ -1184,11 +1184,12 @@ out:
 	return res;
 }
 
-/* Anything goes as long as it is not a constant. */
+/* Return random zone index for one of the open zones. */
 static uint32_t pick_random_zone_idx(const struct fio_file *f,
 				     const struct io_u *io_u)
 {
-	return io_u->offset * f->zbd_info->num_open_zones / f->real_file_size;
+	return (io_u->offset - f->file_offset) * f->zbd_info->num_open_zones /
+		f->io_size;
 }
 
 /*
-- 
2.30.0-rc0



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

* Re: [PATCH 0/2] v2: ZBD fix with random zone index logic and missing documentation
  2021-08-04  9:24 ` [PATCH 0/2] v2: ZBD fix with random zone index logic and missing documentation Ankit Kumar
       [not found]   ` <CGME20210804092852epcas5p2bf4990e1b1b9a2e9d02c8520b3998818@epcas5p2.samsung.com>
       [not found]   ` <CGME20210804092859epcas5p1085bcaafa631e16cc3ad4325b883172e@epcas5p1.samsung.com>
@ 2021-08-04 11:07   ` Shinichiro Kawasaki
  2021-08-04 13:25     ` Jens Axboe
  2 siblings, 1 reply; 9+ messages in thread
From: Shinichiro Kawasaki @ 2021-08-04 11:07 UTC (permalink / raw)
  To: Ankit Kumar; +Cc: axboe, fio, krish.reddy, prakash.v

On Aug 04, 2021 / 14:54, Ankit Kumar wrote:
> v1 -> v2
> 
>  - Addressed the commit message review comments for both the patches
> 
> Ankit Kumar (2):
>   HOWTO: Add missing documentation for job_max_open_zones
>   zbd: Improve random zone index generation logic

Ankit, when I commented the v1 patches, I overlooked that your commit messages
do not include your Signed-off-by tags. Many of the fio commits have the tags.
To clarify who contributed, I suggest to add it to the two patches.

-- 
Best Regards,
Shin'ichiro Kawasaki

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

* Re: [PATCH 0/2] v2: ZBD fix with random zone index logic and missing documentation
  2021-08-04 11:07   ` [PATCH 0/2] v2: ZBD fix with random zone index logic and missing documentation Shinichiro Kawasaki
@ 2021-08-04 13:25     ` Jens Axboe
  0 siblings, 0 replies; 9+ messages in thread
From: Jens Axboe @ 2021-08-04 13:25 UTC (permalink / raw)
  To: Shinichiro Kawasaki, Ankit Kumar; +Cc: fio, krish.reddy, prakash.v

On 8/4/21 5:07 AM, Shinichiro Kawasaki wrote:
> On Aug 04, 2021 / 14:54, Ankit Kumar wrote:
>> v1 -> v2
>>
>>  - Addressed the commit message review comments for both the patches
>>
>> Ankit Kumar (2):
>>   HOWTO: Add missing documentation for job_max_open_zones
>>   zbd: Improve random zone index generation logic
> 
> Ankit, when I commented the v1 patches, I overlooked that your commit messages
> do not include your Signed-off-by tags. Many of the fio commits have the tags.
> To clarify who contributed, I suggest to add it to the two patches.

Indeed, please always add those.

-- 
Jens Axboe



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

* Re: [PATCH 2/2] zbd: Improve random zone index generation logic
  2021-08-04 11:23   ` [PATCH 2/2] zbd: Improve random zone index generation logic Ankit Kumar
@ 2021-08-04 12:04     ` Shinichiro Kawasaki
  0 siblings, 0 replies; 9+ messages in thread
From: Shinichiro Kawasaki @ 2021-08-04 12:04 UTC (permalink / raw)
  To: Ankit Kumar; +Cc: axboe, fio, krish.reddy, prakash.v

On Aug 04, 2021 / 16:53, Ankit Kumar wrote:
> Existing random zone index generation logic is dependent on the file size.
> For smaller I/O sizes the random zone index always return a particular
> section of open zones. As this index is used to return one of the open zones,
> it was observed that after one of the max_open_zones / job_max_open_zones limit
> is reached all further I/O's are redirected to only a few open zones till they
> are full.
> 
> This patch modifies the random zone index genration logic so that it is uniform
> across all the open zones.
> 
> It reverts part of the commit 6463db6c1
> ('fio: fix interaction between offset/size limited threads and
> "max_open_zones"')
> 
> Signed-off-by: Ankit Kumar <ankit.kumar@samsung.com>

Looks good to me. Also, I confirmed that this patch improves the randomness of
open zone selection, and it preserves the intent of the commit 6463db6c1.

Tested-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Reviewed-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>

-- 
Best Regards,
Shin'ichiro Kawasaki

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

* [PATCH 2/2] zbd: Improve random zone index generation logic
       [not found] ` <CGME20210804112710epcas5p4d9ef2bfa2d2327b6e4ae27e1cad3aba6@epcas5p4.samsung.com>
@ 2021-08-04 11:23   ` Ankit Kumar
  2021-08-04 12:04     ` Shinichiro Kawasaki
  0 siblings, 1 reply; 9+ messages in thread
From: Ankit Kumar @ 2021-08-04 11:23 UTC (permalink / raw)
  To: axboe; +Cc: fio, krish.reddy, prakash.v, Ankit Kumar

Existing random zone index generation logic is dependent on the file size.
For smaller I/O sizes the random zone index always return a particular
section of open zones. As this index is used to return one of the open zones,
it was observed that after one of the max_open_zones / job_max_open_zones limit
is reached all further I/O's are redirected to only a few open zones till they
are full.

This patch modifies the random zone index genration logic so that it is uniform
across all the open zones.

It reverts part of the commit 6463db6c1
('fio: fix interaction between offset/size limited threads and
"max_open_zones"')

Signed-off-by: Ankit Kumar <ankit.kumar@samsung.com>
---
 zbd.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/zbd.c b/zbd.c
index 04c68dea..43f12b45 100644
--- a/zbd.c
+++ b/zbd.c
@@ -1184,11 +1184,12 @@ out:
 	return res;
 }
 
-/* Anything goes as long as it is not a constant. */
+/* Return random zone index for one of the open zones. */
 static uint32_t pick_random_zone_idx(const struct fio_file *f,
 				     const struct io_u *io_u)
 {
-	return io_u->offset * f->zbd_info->num_open_zones / f->real_file_size;
+	return (io_u->offset - f->file_offset) * f->zbd_info->num_open_zones /
+		f->io_size;
 }
 
 /*
-- 
2.30.0-rc0



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

* Re: [PATCH 2/2] zbd: Improve random zone index generation logic.
  2021-08-03 10:28   ` [PATCH 2/2] zbd: Improve random zone index generation logic Ankit Kumar
@ 2021-08-04  5:59     ` Shinichiro Kawasaki
  0 siblings, 0 replies; 9+ messages in thread
From: Shinichiro Kawasaki @ 2021-08-04  5:59 UTC (permalink / raw)
  To: Ankit Kumar; +Cc: axboe, fio, krish.reddy, prakash.v

On Aug 03, 2021 / 15:58, Ankit Kumar wrote:
> Existing random zone index generation logic is dependent on the file size.
> For smaller I/O sizes the random zone index always return a particular
> section of open zones. As this index is used to return one of the open zones,
> it was observed that after one of the max_open_zones / job_max_open_zones limit
> is reached all further I/O's are redirected to only a few open zones till they
> are full.
> 
> This patch modifies the random zone index genration logic so that it is uniform
> across all the open zones.
> ---
>  zbd.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/zbd.c b/zbd.c
> index 04c68de..43f12b4 100644
> --- a/zbd.c
> +++ b/zbd.c
> @@ -1184,11 +1184,12 @@ out:
>  	return res;
>  }
>  
> -/* Anything goes as long as it is not a constant. */
> +/* Return random zone index for one of the open zones. */
>  static uint32_t pick_random_zone_idx(const struct fio_file *f,
>  				     const struct io_u *io_u)
>  {
> -	return io_u->offset * f->zbd_info->num_open_zones / f->real_file_size;
> +	return (io_u->offset - f->file_offset) * f->zbd_info->num_open_zones /
> +		f->io_size;
>  }

One nit I suggest is to remove the period in the commit message title. Other
than that, I confirmed the change is good. I confirmed that it improves the
randomness of the open zone choice. It reverts the part of the commit 6463db6c1
('fio: fix interaction between offset/size limited threads and
"max_open_zones"'), but I confirmed that still the intent of the commit
6463db6c1 is kept after applying this change.

Tested-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>

-- 
Best Regards,
Shin'ichiro Kawasaki

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

* [PATCH 2/2] zbd: Improve random zone index generation logic.
       [not found] ` <CGME20210803111246epcas5p196f2a90009a00f639bbe5054570ac5a2@epcas5p1.samsung.com>
@ 2021-08-03 10:28   ` Ankit Kumar
  2021-08-04  5:59     ` Shinichiro Kawasaki
  0 siblings, 1 reply; 9+ messages in thread
From: Ankit Kumar @ 2021-08-03 10:28 UTC (permalink / raw)
  To: axboe; +Cc: fio, krish.reddy, prakash.v, Ankit Kumar

Existing random zone index generation logic is dependent on the file size.
For smaller I/O sizes the random zone index always return a particular
section of open zones. As this index is used to return one of the open zones,
it was observed that after one of the max_open_zones / job_max_open_zones limit
is reached all further I/O's are redirected to only a few open zones till they
are full.

This patch modifies the random zone index genration logic so that it is uniform
across all the open zones.
---
 zbd.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/zbd.c b/zbd.c
index 04c68de..43f12b4 100644
--- a/zbd.c
+++ b/zbd.c
@@ -1184,11 +1184,12 @@ out:
 	return res;
 }
 
-/* Anything goes as long as it is not a constant. */
+/* Return random zone index for one of the open zones. */
 static uint32_t pick_random_zone_idx(const struct fio_file *f,
 				     const struct io_u *io_u)
 {
-	return io_u->offset * f->zbd_info->num_open_zones / f->real_file_size;
+	return (io_u->offset - f->file_offset) * f->zbd_info->num_open_zones /
+		f->io_size;
 }
 
 /*
-- 
1.8.3.1



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

end of thread, other threads:[~2021-08-04 13:25 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20210804092848epcas5p43713e1728116d2ea38c910a2b8991c42@epcas5p4.samsung.com>
2021-08-04  9:24 ` [PATCH 0/2] v2: ZBD fix with random zone index logic and missing documentation Ankit Kumar
     [not found]   ` <CGME20210804092852epcas5p2bf4990e1b1b9a2e9d02c8520b3998818@epcas5p2.samsung.com>
2021-08-04  9:24     ` [PATCH 1/2] HOWTO: Add missing documentation for job_max_open_zones Ankit Kumar
     [not found]   ` <CGME20210804092859epcas5p1085bcaafa631e16cc3ad4325b883172e@epcas5p1.samsung.com>
2021-08-04  9:24     ` [PATCH 2/2] zbd: Improve random zone index generation logic Ankit Kumar
2021-08-04 11:07   ` [PATCH 0/2] v2: ZBD fix with random zone index logic and missing documentation Shinichiro Kawasaki
2021-08-04 13:25     ` Jens Axboe
2021-08-04 11:23 [PATCH 0/2] v3: " Ankit Kumar
     [not found] ` <CGME20210804112710epcas5p4d9ef2bfa2d2327b6e4ae27e1cad3aba6@epcas5p4.samsung.com>
2021-08-04 11:23   ` [PATCH 2/2] zbd: Improve random zone index generation logic Ankit Kumar
2021-08-04 12:04     ` Shinichiro Kawasaki
  -- strict thread matches above, loose matches on Subject: below --
2021-08-03 10:28 [PATCH 0/2] ZBD fix with random zone index logic and missing documentation Ankit Kumar
     [not found] ` <CGME20210803111246epcas5p196f2a90009a00f639bbe5054570ac5a2@epcas5p1.samsung.com>
2021-08-03 10:28   ` [PATCH 2/2] zbd: Improve random zone index generation logic Ankit Kumar
2021-08-04  5:59     ` Shinichiro Kawasaki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).