Flexible I/O Tester development
 help / color / mirror / Atom feed
From: Ankit Kumar <ankit.kumar@samsung.com>
To: axboe@kernel.dk
Cc: fio@vger.kernel.org, krish.reddy@samsung.com,
	prakash.v@samsung.com, Ankit Kumar <ankit.kumar@samsung.com>
Subject: [PATCH 2/2] zbd: Improve random zone index generation logic
Date: Wed,  4 Aug 2021 14:54:50 +0530	[thread overview]
Message-ID: <20210804092450.28782-3-ankit.kumar@samsung.com> (raw)
In-Reply-To: <20210804092450.28782-1-ankit.kumar@samsung.com>

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



  parent reply	other threads:[~2021-08-04  9:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [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
2021-08-04  9:24   ` [PATCH 1/2] HOWTO: Add missing documentation for job_max_open_zones Ankit Kumar
2021-08-04  9:24   ` Ankit Kumar [this message]
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
     [not found] <CGME20210804112710epcas5p4d9ef2bfa2d2327b6e4ae27e1cad3aba6@epcas5p4.samsung.com>
2021-08-04 11:23 ` [PATCH 0/2] v3: " Ankit Kumar
2021-08-04 11:23   ` [PATCH 2/2] zbd: Improve random zone index generation logic Ankit Kumar
2021-08-04 12:04     ` Shinichiro Kawasaki
     [not found] <CGME20210803111246epcas5p196f2a90009a00f639bbe5054570ac5a2@epcas5p1.samsung.com>
2021-08-03 10:28 ` [PATCH 0/2] ZBD fix with random zone index logic and missing documentation Ankit Kumar
2021-08-03 10:28   ` [PATCH 2/2] zbd: Improve random zone index generation logic Ankit Kumar
2021-08-04  5:59     ` Shinichiro Kawasaki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210804092450.28782-3-ankit.kumar@samsung.com \
    --to=ankit.kumar@samsung.com \
    --cc=axboe@kernel.dk \
    --cc=fio@vger.kernel.org \
    --cc=krish.reddy@samsung.com \
    --cc=prakash.v@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox