* [PATCH] Allow sequential read to start anywhere in a zone (option offset), and have a span smaller than a zone (option size).
@ 2020-05-15 16:22 plabat
2020-05-18 0:15 ` Damien Le Moal
2020-05-18 22:56 ` Jens Axboe
0 siblings, 2 replies; 3+ messages in thread
From: plabat @ 2020-05-15 16:22 UTC (permalink / raw)
To: damien.lemoal; +Cc: axboe, fio, Pierre Labat
From: Pierre Labat <plabat@micron.com>
Allow sequential read to start anywhere in a zone (option
offset), and have a span smaller than a zone (option size).
A use case is a Key Value Store reading a set of keys or values
starting somewhere in a zone.
Signed-off-by: Pierre Labat <plabat@micron.com>
---
zbd.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/zbd.c b/zbd.c
index 8dc3c39..f1f7c5c 100644
--- a/zbd.c
+++ b/zbd.c
@@ -262,7 +262,8 @@ static bool zbd_verify_sizes(void)
zone_idx = zbd_zone_idx(f, f->file_offset);
z = &f->zbd_info->zone_info[zone_idx];
- if (f->file_offset != z->start) {
+ if ((f->file_offset != z->start) &&
+ (td->o.td_ddir != TD_DDIR_READ)) {
new_offset = (z+1)->start;
if (new_offset >= f->file_offset + f->io_size) {
log_info("%s: io_size must be at least one zone\n",
@@ -278,7 +279,8 @@ static bool zbd_verify_sizes(void)
zone_idx = zbd_zone_idx(f, f->file_offset + f->io_size);
z = &f->zbd_info->zone_info[zone_idx];
new_end = z->start;
- if (f->file_offset + f->io_size != new_end) {
+ if ((td->o.td_ddir != TD_DDIR_READ) &&
+ (f->file_offset + f->io_size != new_end)) {
if (new_end <= f->file_offset) {
log_info("%s: io_size must be at least one zone\n",
f->file_name);
--
2.9.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] Allow sequential read to start anywhere in a zone (option offset), and have a span smaller than a zone (option size).
2020-05-15 16:22 [PATCH] Allow sequential read to start anywhere in a zone (option offset), and have a span smaller than a zone (option size) plabat
@ 2020-05-18 0:15 ` Damien Le Moal
2020-05-18 22:56 ` Jens Axboe
1 sibling, 0 replies; 3+ messages in thread
From: Damien Le Moal @ 2020-05-18 0:15 UTC (permalink / raw)
To: plabat; +Cc: axboe, fio
On 2020/05/16 1:22, plabat@micron.com wrote:
> From: Pierre Labat <plabat@micron.com>
>
> Allow sequential read to start anywhere in a zone (option
> offset), and have a span smaller than a zone (option size).>
> A use case is a Key Value Store reading a set of keys or values
> starting somewhere in a zone.
>
> Signed-off-by: Pierre Labat <plabat@micron.com>
This looks OK to me.
Reviewed-by: Damien Le Moal <damien.lemoal@wdc.com>
> ---
> zbd.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/zbd.c b/zbd.c
> index 8dc3c39..f1f7c5c 100644
> --- a/zbd.c
> +++ b/zbd.c
> @@ -262,7 +262,8 @@ static bool zbd_verify_sizes(void)
>
> zone_idx = zbd_zone_idx(f, f->file_offset);
> z = &f->zbd_info->zone_info[zone_idx];
> - if (f->file_offset != z->start) {
> + if ((f->file_offset != z->start) &&
> + (td->o.td_ddir != TD_DDIR_READ)) {
> new_offset = (z+1)->start;
> if (new_offset >= f->file_offset + f->io_size) {
> log_info("%s: io_size must be at least one zone\n",
> @@ -278,7 +279,8 @@ static bool zbd_verify_sizes(void)
> zone_idx = zbd_zone_idx(f, f->file_offset + f->io_size);
> z = &f->zbd_info->zone_info[zone_idx];
> new_end = z->start;
> - if (f->file_offset + f->io_size != new_end) {
> + if ((td->o.td_ddir != TD_DDIR_READ) &&
> + (f->file_offset + f->io_size != new_end)) {
> if (new_end <= f->file_offset) {
> log_info("%s: io_size must be at least one zone\n",
> f->file_name);
>
--
Damien Le Moal
Western Digital Research
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Allow sequential read to start anywhere in a zone (option offset), and have a span smaller than a zone (option size).
2020-05-15 16:22 [PATCH] Allow sequential read to start anywhere in a zone (option offset), and have a span smaller than a zone (option size) plabat
2020-05-18 0:15 ` Damien Le Moal
@ 2020-05-18 22:56 ` Jens Axboe
1 sibling, 0 replies; 3+ messages in thread
From: Jens Axboe @ 2020-05-18 22:56 UTC (permalink / raw)
To: plabat, damien.lemoal; +Cc: fio
On 5/15/20 10:22 AM, plabat@micron.com wrote:
> From: Pierre Labat <plabat@micron.com>
>
> Allow sequential read to start anywhere in a zone (option
> offset), and have a span smaller than a zone (option size).
>
> A use case is a Key Value Store reading a set of keys or values
> starting somewhere in a zone.
Applied, but I modified your commit message a bit. Don't make the title
that long, and especially don't duplicate the title again just below it.
The first paragraph and your title are identical.
--
Jens Axboe
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-05-18 22:56 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-15 16:22 [PATCH] Allow sequential read to start anywhere in a zone (option offset), and have a span smaller than a zone (option size) plabat
2020-05-18 0:15 ` Damien Le Moal
2020-05-18 22:56 ` Jens Axboe
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.