fio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Niklas Cassel <Niklas.Cassel@wdc.com>
To: Shinichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Cc: "fio@vger.kernel.org" <fio@vger.kernel.org>,
	Jens Axboe <axboe@kernel.dk>, Vincent Fu <vincentfu@gmail.com>,
	Damien Le Moal <damien.lemoal@opensource.wdc.com>,
	Dmitry Fomichev <Dmitry.Fomichev@wdc.com>
Subject: Re: [PATCH v2 2/8] zbd: remove CHECK_SWD feature
Date: Tue, 7 Feb 2023 14:05:53 +0000	[thread overview]
Message-ID: <Y+JavajCv6AZpHF9@x1-carbon> (raw)
In-Reply-To: <20230207063739.1661191-3-shinichiro.kawasaki@wdc.com>

On Tue, Feb 07, 2023 at 03:37:33PM +0900, Shin'ichiro Kawasaki wrote:
> The 'sectors with data' accounting had been used for CHECK_SWD debug
> feature. It compared expected written data size and actually written
> data size for zonemode=zbd. However, this feature has been disabled for
> a while and not actively used. Also, the sector with data accounting has
> two issues. The first issue is wrong accounting for multiple jobs with
> different write ranges. The second issue is job start up failure due to
> zone lock contention.
> 
> Avoid using the accounting by removing the CHECK_SWD feature and related
> code. Also rename the function zbd_process_swd() to zbd_set_swd() to
> clarify that it no longer works for CHECK_SWD.
> 
> Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
> ---
>  zbd.c | 38 +++-----------------------------------
>  1 file changed, 3 insertions(+), 35 deletions(-)
> 
> diff --git a/zbd.c b/zbd.c
> index f5e76c40..b6cf2a93 100644
> --- a/zbd.c
> +++ b/zbd.c
> @@ -1190,14 +1190,7 @@ static bool zbd_dec_and_reset_write_cnt(const struct thread_data *td,
>  	return write_cnt == 0;
>  }
>  
> -enum swd_action {
> -	CHECK_SWD,
> -	SET_SWD,
> -};
> -
> -/* Calculate the number of sectors with data (swd) and perform action 'a' */
> -static uint64_t zbd_process_swd(struct thread_data *td,
> -				const struct fio_file *f, enum swd_action a)
> +static uint64_t zbd_set_swd(struct thread_data *td, const struct fio_file *f)
>  {
>  	struct fio_zone_info *zb, *ze, *z;
>  	uint64_t wp_swd = 0;
> @@ -1212,14 +1205,7 @@ static uint64_t zbd_process_swd(struct thread_data *td,
>  	}
>  
>  	pthread_mutex_lock(&f->zbd_info->mutex);
> -	switch (a) {
> -	case CHECK_SWD:
> -		assert(f->zbd_info->wp_sectors_with_data == wp_swd);
> -		break;
> -	case SET_SWD:
> -		f->zbd_info->wp_sectors_with_data = wp_swd;
> -		break;
> -	}
> +	f->zbd_info->wp_sectors_with_data = wp_swd;
>  	pthread_mutex_unlock(&f->zbd_info->mutex);
>  
>  	for (z = zb; z < ze; z++)
> @@ -1229,21 +1215,6 @@ static uint64_t zbd_process_swd(struct thread_data *td,
>  	return wp_swd;
>  }
>  
> -/*
> - * The swd check is useful for debugging but takes too much time to leave
> - * it enabled all the time. Hence it is disabled by default.
> - */
> -static const bool enable_check_swd = false;
> -
> -/* Check whether the values of zbd_info.*sectors_with_data are correct. */
> -static void zbd_check_swd(struct thread_data *td, const struct fio_file *f)
> -{
> -	if (!enable_check_swd)
> -		return;
> -
> -	zbd_process_swd(td, f, CHECK_SWD);
> -}
> -
>  void zbd_file_reset(struct thread_data *td, struct fio_file *f)
>  {
>  	struct fio_zone_info *zb, *ze;
> @@ -1255,7 +1226,7 @@ void zbd_file_reset(struct thread_data *td, struct fio_file *f)
>  
>  	zb = zbd_get_zone(f, f->min_zone);
>  	ze = zbd_get_zone(f, f->max_zone);
> -	swd = zbd_process_swd(td, f, SET_SWD);
> +	swd = zbd_set_swd(td, f);
>  
>  	dprint(FD_ZBD, "%s(%s): swd = %" PRIu64 "\n",
>  	       __func__, f->file_name, swd);
> @@ -1677,7 +1648,6 @@ static void zbd_put_io(struct thread_data *td, const struct io_u *io_u)
>  	zbd_end_zone_io(td, io_u, z);
>  
>  	zone_unlock(z);
> -	zbd_check_swd(td, f);
>  }
>  
>  /*
> @@ -1866,8 +1836,6 @@ enum io_u_action zbd_adjust_block(struct thread_data *td, struct io_u *io_u)
>  	    io_u->ddir == DDIR_READ && td->o.read_beyond_wp)
>  		return io_u_accept;
>  
> -	zbd_check_swd(td, f);
> -
>  	zone_lock(td, f, zb);
>  
>  	switch (io_u->ddir) {
> -- 
> 2.38.1
> 

Reviewed-by: Niklas Cassel <niklas.cassel@wdc.com>

  reply	other threads:[~2023-02-07 14:06 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-07  6:37 [PATCH v2 0/8] zbd: fix 'sectors with data' and zone_reset_threshold accounting issues Shin'ichiro Kawasaki
2023-02-07  6:37 ` [PATCH v2 1/8] zbd: refer file->last_start[] instead of sectors with data accounting Shin'ichiro Kawasaki
2023-02-07 14:05   ` Niklas Cassel
2023-02-07  6:37 ` [PATCH v2 2/8] zbd: remove CHECK_SWD feature Shin'ichiro Kawasaki
2023-02-07 14:05   ` Niklas Cassel [this message]
2023-02-07  6:37 ` [PATCH v2 3/8] zbd: rename the accounting 'sectors with data' to 'valid data bytes' Shin'ichiro Kawasaki
2023-02-07 14:06   ` Niklas Cassel
2023-02-07  6:37 ` [PATCH v2 4/8] doc: fix unit of zone_reset_threshold and relation to other option Shin'ichiro Kawasaki
2023-02-07 14:06   ` Niklas Cassel
2023-02-07  6:37 ` [PATCH v2 5/8] zbd: account valid data bytes only for zone_reset_threshold option Shin'ichiro Kawasaki
2023-02-07 14:06   ` Niklas Cassel
2023-02-07  6:37 ` [PATCH v2 6/8] zbd: check write ranges " Shin'ichiro Kawasaki
2023-02-07 14:06   ` Niklas Cassel
2023-02-08  4:59     ` Shinichiro Kawasaki
2023-02-07  6:37 ` [PATCH v2 7/8] zbd: initialize valid data bytes accounting at file set up Shin'ichiro Kawasaki
2023-02-07 14:06   ` Niklas Cassel
2023-02-08  5:03     ` Shinichiro Kawasaki
2023-02-08  8:30       ` Niklas Cassel
2023-02-07  6:37 ` [PATCH v2 8/8] t/zbd: add test cases for zone_reset_threshold option Shin'ichiro Kawasaki
2023-02-07 14:06   ` Niklas Cassel

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=Y+JavajCv6AZpHF9@x1-carbon \
    --to=niklas.cassel@wdc.com \
    --cc=Dmitry.Fomichev@wdc.com \
    --cc=axboe@kernel.dk \
    --cc=damien.lemoal@opensource.wdc.com \
    --cc=fio@vger.kernel.org \
    --cc=shinichiro.kawasaki@wdc.com \
    --cc=vincentfu@gmail.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;
as well as URLs for NNTP newsgroup(s).