From: Niklas Cassel <Niklas.Cassel@wdc.com>
To: Damien Le Moal <Damien.LeMoal@wdc.com>
Cc: "axboe@kernel.dk" <axboe@kernel.dk>,
"fio@vger.kernel.org" <fio@vger.kernel.org>
Subject: Re: [PATCH 3/4] zbd: remove zbd_zoned_model ZBD_IGNORE
Date: Mon, 7 Jun 2021 09:08:40 +0000 [thread overview]
Message-ID: <YL3iF4mMpbLstc9k@x1-carbon> (raw)
In-Reply-To: <DM6PR04MB7081011B97A6223675F4EFE7E73A9@DM6PR04MB7081.namprd04.prod.outlook.com>
On Sat, Jun 05, 2021 at 12:48:31AM +0000, Damien Le Moal wrote:
> On 2021/06/04 21:18, Niklas Cassel wrote:
> > From: Niklas Cassel <niklas.cassel@wdc.com>
> >
> > For a job with zonemode=zbd, we do not want any file to be ignored.
> > Each file's file type in that job should be supported by either zbd.c
> > or the ioengine. If not, we should return an error.
> > This way, ZBD_IGNORE becomes redundant and can be removed.
> >
> > By removing ZBD_IGNORE, we know that all files belonging to a job that
> > has zonemode=zbd set, will either be a zoned block device, or emulate
> > a zoned block device.
> >
> > This means that for jobs that have zonemode=zbd, f->zbd_info will always
> > be non-NULL. This will make the zbd code slightly easier to reason about
> > and to maintain.
> >
> > When removing zbd_zoned_model ZBD_IGNORE, define the new first enum value
> > as 0x1, so that we avoid potential ABI problems with existing binaries.
> >
> > Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
> > ---
> > engines/libzbc.c | 3 +--
> > engines/skeleton_external.c | 1 -
> > oslib/linux-blkzoned.c | 3 +--
> > zbd.c | 3 +--
> > zbd_types.h | 7 +++----
> > 5 files changed, 6 insertions(+), 11 deletions(-)
> >
> > diff --git a/engines/libzbc.c b/engines/libzbc.c
> > index 3dde93db..c3551bec 100644
> > --- a/engines/libzbc.c
> > +++ b/engines/libzbc.c
> > @@ -181,8 +181,7 @@ static int libzbc_get_zoned_model(struct thread_data *td, struct fio_file *f,
> > int ret;
> >
> > if (f->filetype != FIO_TYPE_BLOCK && f->filetype != FIO_TYPE_CHAR) {
> > - *model = ZBD_IGNORE;
> > - return 0;
> > + return -EINVAL;
> > }
>
> Please drop the curly brackets.
>
> >
> > ret = libzbc_open_dev(td, f, &ld);
> > diff --git a/engines/skeleton_external.c b/engines/skeleton_external.c
> > index c79b6f11..cff83a10 100644
> > --- a/engines/skeleton_external.c
> > +++ b/engines/skeleton_external.c
> > @@ -156,7 +156,6 @@ static int fio_skeleton_close(struct thread_data *td, struct fio_file *f)
> > /*
> > * Hook for getting the zoned model of a zoned block device for zonemode=zbd.
> > * The zoned model can be one of (see zbd_types.h):
> > - * - ZBD_IGNORE: skip regular files
> > * - ZBD_NONE: regular block device (zone emulation will be used)
> > * - ZBD_HOST_AWARE: host aware zoned block device
> > * - ZBD_HOST_MANAGED: host managed zoned block device
> > diff --git a/oslib/linux-blkzoned.c b/oslib/linux-blkzoned.c
> > index 6f89ec6f..8cb9c53a 100644
> > --- a/oslib/linux-blkzoned.c
> > +++ b/oslib/linux-blkzoned.c
> > @@ -141,8 +141,7 @@ int blkzoned_get_zoned_model(struct thread_data *td, struct fio_file *f,
> > char *model_str = NULL;
> >
> > if (f->filetype != FIO_TYPE_BLOCK) {
> > - *model = ZBD_IGNORE;
> > - return 0;
> > + return -EINVAL;
> > }
>
> Please drop the curly brackets.
>
> Also, missing in this patch: zbd_verify_sizes() has a "if (!f->zbd_info)" check
> which I think should be changed into an assert.
Hello Damien,
zbd_verify_sizes()
does a:
for_each_td() {
for_each_file() {
if (!f->zbd_info)
continue;
}
}
Considering that this is a for_each_td(), which will iterate over all
threads in the job file, I disagree with this comment.
A job file can have one job with
zonemode=zbd
and in the same job file, another job without zonemode=zbd, which targets
a completely different device, so I do think that we need to keep the
continue here.
Kind regards,
Niklas
next prev parent reply other threads:[~2021-06-07 9:08 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-04 12:18 [PATCH 0/4] improve zbd initialization Niklas Cassel
2021-06-04 12:18 ` [PATCH 1/4] zbd: disallow pipes for zonemode=zbd Niklas Cassel
2021-06-05 0:33 ` Damien Le Moal
2021-06-04 12:18 ` [PATCH 3/4] zbd: remove zbd_zoned_model ZBD_IGNORE Niklas Cassel
2021-06-05 0:42 ` Damien Le Moal
2021-06-05 0:47 ` Damien Le Moal
2021-06-05 0:48 ` Damien Le Moal
2021-06-07 9:08 ` Niklas Cassel [this message]
2021-06-07 9:18 ` Damien Le Moal
2021-06-04 12:18 ` [PATCH 2/4] zbd: allow zonemode=zbd with regular files by emulating zones Niklas Cassel
2021-06-05 0:40 ` Damien Le Moal
2021-06-04 12:18 ` [PATCH 4/4] zbd: change some f->zbd_info conditionals to asserts Niklas Cassel
2021-06-05 0:50 ` Damien Le Moal
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=YL3iF4mMpbLstc9k@x1-carbon \
--to=niklas.cassel@wdc.com \
--cc=Damien.LeMoal@wdc.com \
--cc=axboe@kernel.dk \
--cc=fio@vger.kernel.org \
/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