Flexible I/O Tester development
 help / color / mirror / Atom feed
From: "Georg Schönberger" <gschoenberger@thomas-krenn.com>
To: Jens Axboe <JAxboe@fusionio.com>,
	"fio@vger.kernel.org" <fio@vger.kernel.org>
Subject: Re: Tell fio to only lay out files
Date: Wed, 2 May 2012 05:51:33 -0600	[thread overview]
Message-ID: <4FA11FC5.4030202@thomas-krenn.com> (raw)
In-Reply-To: <4FA10E08.70009@fusionio.com>

Thanks for your fast patch, I really appreciate that :-)
The create_only option now helps me to start with a consistent cache
state for every test run.

Georg

Am 2012-05-02 12:35, schrieb Jens Axboe:
> On 05/02/2012 11:15 AM, Georg Schönberger wrote:
>> Hello Everyone,
>>
>> is it possible to tell fio to only lay out the data files and not carry
>> out any tests?
>> The thing is that I need to sync my Flashcache device after laying out
>> the files and before starting the read tests. Therefore it would be
>> helpful if I could do the following:
>> -Start fio and tell him to only lay out data files
>> -Sync my cache
>> -Start fio again with the previous layed out files and do the tests
> That's not a bad idea. The below patch will add a create_only option. If
> set, fio will exit after file creation is completed.
>
>> Another option would be the parameter "filename", which tells fio to use
>> that file. But what if I am using multiple processes, can I specify a
>> file on command line for each process?
> You could do that as well, but it requires you to know how fio names
> its files for the jobs. Which isn't tricky, it's basically:
>
>         name.threadno.fileno
>
> So if you have
>
> [foo]
> numjobs=4
>
> as the first entry, you'll have foo.0.[1-4] as the file names. But the
> setup only option is cleaner and then you don't have to document and
> stick to the file naming :-)
>
> diff --git a/filesetup.c b/filesetup.c
> index f3d3829..a1ad026 100644
> --- a/filesetup.c
> +++ b/filesetup.c
> @@ -665,7 +665,7 @@ int setup_files(struct thread_data *td)
>  	dprint(FD_FILE, "setup files\n");
>  
>  	if (td->o.read_iolog_file)
> -		return 0;
> +		goto done;
>  
>  	/*
>  	 * if ioengine defines a setup() method, it's responsible for
> @@ -816,6 +816,11 @@ int setup_files(struct thread_data *td)
>  	 */
>  	if (!td->o.read_iolog_file)
>  		td->total_io_size = td->o.size * td->o.loops;
> +
> +done:
> +	if (td->o.create_only)
> +		td->done = 1;
> +
>  	return 0;
>  err_offset:
>  	log_err("%s: you need to specify valid offset=\n", td->o.name);
> diff --git a/fio.h b/fio.h
> index 6da22f0..f2a5a1f 100644
> --- a/fio.h
> +++ b/fio.h
> @@ -125,6 +125,7 @@ struct thread_options {
>  	unsigned int create_serialize;
>  	unsigned int create_fsync;
>  	unsigned int create_on_open;
> +	unsigned int create_only;
>  	unsigned int end_fsync;
>  	unsigned int pre_read;
>  	unsigned int sync_io;
> diff --git a/options.c b/options.c
> index f8927ee..28a228c 100644
> --- a/options.c
> +++ b/options.c
> @@ -1885,6 +1885,13 @@ static struct fio_option options[FIO_MAX_OPTS] = {
>  		.def	= "0",
>  	},
>  	{
> +		.name	= "create_only",
> +		.type	= FIO_OPT_BOOL,
> +		.off1	= td_var_offset(create_only),
> +		.help	= "Only perform file creation phase",
> +		.def	= "0",
> +	},
> +	{
>  		.name	= "pre_read",
>  		.type	= FIO_OPT_BOOL,
>  		.off1	= td_var_offset(pre_read),
>


  reply	other threads:[~2012-05-02 11:51 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-02  9:15 Tell fio to only lay out files Georg Schönberger
2012-05-02 10:35 ` Jens Axboe
2012-05-02 11:51   ` Georg Schönberger [this message]
2012-05-02 11:55     ` Jens Axboe
2012-05-02 12:06       ` Georg Schönberger
2012-05-02 12:08         ` Jens Axboe
2012-05-02 12:12           ` Georg Schönberger
2012-05-02 12:15             ` Jens Axboe
2012-05-02 12:25               ` Georg Schönberger
2012-05-09 20:52                 ` Vikram Seth
2012-05-09 20:53                   ` Jens Axboe
2012-05-09 22:10                     ` Vikram Seth
2012-05-09 23:49                       ` 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=4FA11FC5.4030202@thomas-krenn.com \
    --to=gschoenberger@thomas-krenn.com \
    --cc=JAxboe@fusionio.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox