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: Tue, 3 Aug 2021 15:58:36 +0530 [thread overview]
Message-ID: <1627986516-4814-3-git-send-email-ankit.kumar@samsung.com> (raw)
In-Reply-To: <1627986516-4814-1-git-send-email-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.
---
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
next prev parent reply other threads:[~2021-08-03 10:28 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20210803111208epcas5p2fec4fec945de52fb57986f2ef5e2bcfe@epcas5p2.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 1/2] Add missing documentation for job_max_open_zones Ankit Kumar
2021-08-04 5:52 ` Shinichiro Kawasaki
2021-08-03 10:28 ` Ankit Kumar [this message]
2021-08-04 5:59 ` [PATCH 2/2] zbd: Improve random zone index generation logic Shinichiro Kawasaki
[not found] <CGME20210804092859epcas5p1085bcaafa631e16cc3ad4325b883172e@epcas5p1.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 2/2] zbd: Improve random zone index generation logic Ankit Kumar
[not found] <CGME20210804112710epcas5p4d9ef2bfa2d2327b6e4ae27e1cad3aba6@epcas5p4.samsung.com>
2021-08-04 11:23 ` [PATCH 0/2] v3: ZBD fix with random zone index logic and missing documentation 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
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=1627986516-4814-3-git-send-email-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