All of lore.kernel.org
 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 16:53:08 +0530	[thread overview]
Message-ID: <20210804112308.28062-3-ankit.kumar@samsung.com> (raw)
In-Reply-To: <20210804112308.28062-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"')

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



  parent reply	other threads:[~2021-08-04 11:23 UTC|newest]

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

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=20210804112308.28062-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 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.