All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexey Dobriyan <adobriyan@gmail.com>
To: "Elliott, Robert (Servers)" <elliott@hpe.com>
Cc: "axboe@kernel.dk" <axboe@kernel.dk>,
	"fio@vger.kernel.org" <fio@vger.kernel.org>
Subject: Re: [PATCH] fio: add for_each_rw_ddir() macro
Date: Thu, 13 Aug 2020 13:36:24 +0300	[thread overview]
Message-ID: <20200813103624.GA5475@localhost.localdomain> (raw)
In-Reply-To: <TU4PR8401MB10556465AD0CE9AF3A1E4B30AB420@TU4PR8401MB1055.NAMPRD84.PROD.OUTLOOK.COM>

On Wed, Aug 12, 2020 at 10:01:56PM +0000, Elliott, Robert (Servers) wrote:
> > -----Original Message-----
> > From: fio-owner@vger.kernel.org <fio-owner@vger.kernel.org> On Behalf
> > Of Alexey Dobriyan
> > Sent: Wednesday, August 12, 2020 10:26 AM
> > To: axboe@kernel.dk
> > Cc: fio@vger.kernel.org
> > Subject: [PATCH] fio: add for_each_rw_ddir() macro
> > 
> > Make it slightly easier to add DDIR_APPEND as fully fledged I/O type.

> >  	/*
> >  	 * For random IO, allow blockalign offset other than min_bs.
> >  	 */
> > -	if (!o->ba[DDIR_READ] || !td_random(td))
> > -		o->ba[DDIR_READ] = o->min_bs[DDIR_READ];
> > -	if (!o->ba[DDIR_WRITE] || !td_random(td))
> > -		o->ba[DDIR_WRITE] = o->min_bs[DDIR_WRITE];
> > -	if (!o->ba[DDIR_TRIM] || !td_random(td))
> > -		o->ba[DDIR_TRIM] = o->min_bs[DDIR_TRIM];
> > +	for_each_rw_ddir(ddir) {
> > +		if (!o->ba[ddir] || !td_random(td))
> > +			o->ba[ddir] = o->min_bs[ddir];
> > +	}
> > 
> >  	if ((o->ba[DDIR_READ] != o->min_bs[DDIR_READ] ||
> >  	    o->ba[DDIR_WRITE] != o->min_bs[DDIR_WRITE] ||
> 
> continues as:
>             o->ba[DDIR_TRIM] != o->min_bs[DDIR_TRIM]) &&
>             !o->norandommap) {
> 
> which should be updated too.

Actually it should not. This error message doesn't make sense for Append:

        if ((o->ba[DDIR_READ] != o->min_bs[DDIR_READ] ||
            o->ba[DDIR_WRITE] != o->min_bs[DDIR_WRITE] ||
            o->ba[DDIR_TRIM] != o->min_bs[DDIR_TRIM]) &&
            !o->norandommap) {
                log_err("fio: Any use of blockalign= turns off randommap\n");
                o->norandommap = 1;
                ret |= warnings_fatal;
        }

ba= should be ignored for Append (maybe with a non-fatal warning message).

> > @@ -765,14 +757,12 @@ static int fixup_options(struct thread_data
> > *td)
> >  		log_err("fio: rate and rate_iops are mutually
> > exclusive\n");
> >  		ret |= 1;
> >  	}
> > -	if ((o->rate[DDIR_READ] && (o->rate[DDIR_READ] < o->ratemin[DDIR_READ])) ||
> > -	    (o->rate[DDIR_WRITE] && (o->rate[DDIR_WRITE] < o->ratemin[DDIR_WRITE])) ||
> > -	    (o->rate[DDIR_TRIM] && (o->rate[DDIR_TRIM] < o->ratemin[DDIR_TRIM])) ||
> > -	    (o->rate_iops[DDIR_READ] && (o->rate_iops[DDIR_READ] < o->rate_iops_min[DDIR_READ])) ||
> > -	    (o->rate_iops[DDIR_WRITE] && (o->rate_iops[DDIR_WRITE] < o->rate_iops_min[DDIR_WRITE])) ||
> > -	    (o->rate_iops[DDIR_TRIM] && (o->rate_iops[DDIR_TRIM] < o->rate_iops_min[DDIR_TRIM]))) {
> > -		log_err("fio: minimum rate exceeds rate\n");
> > -		ret |= 1;
> > +	for_each_rw_ddir(ddir) {
> > +		if ((o->rate[ddir] && (o->rate[ddir] < o->ratemin[ddir])) ||
> > +		    (o->rate_iops[ddir] && (o->rate_iops[ddir] < o->rate_iops_min[ddir]))) {
> > +			log_err("fio: minimum rate exceeds rate\n");
> > +			ret |= 1;
> > +		}
> >  	}
> 
> That changes the behavior slightly - you can now get up to three of
> those messages. Printing the value of ddir would help identify the
> problem(s) and be more informative than the current single message.

OK.


  reply	other threads:[~2020-08-13 10:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-12 15:26 [PATCH] fio: add for_each_rw_ddir() macro Alexey Dobriyan
2020-08-12 22:01 ` Elliott, Robert (Servers)
2020-08-13 10:36   ` Alexey Dobriyan [this message]
2020-08-13 16:33   ` [PATCH v2] " Alexey Dobriyan
2020-08-17  4:01     ` Jens Axboe

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=20200813103624.GA5475@localhost.localdomain \
    --to=adobriyan@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=elliott@hpe.com \
    --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 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.