From: Jens Axboe <jaxboe@fusionio.com>
To: Vasilis Liaskovitis <vliaskov@gmail.com>
Cc: fio@vger.kernel.org
Subject: Re: reading tmpfs with splice ioengine
Date: Fri, 13 May 2011 21:19:18 +0200 [thread overview]
Message-ID: <4DCD8436.6080906@fusionio.com> (raw)
In-Reply-To: <BANLkTimcc9d-kfsgSqfsbSS=ffG5OMK_jA@mail.gmail.com>
On 2011-05-13 18:07, Vasilis Liaskovitis wrote:
> Hi,
>
> I am trying to use the splice ioengine to read/write from/to tmpfs (/dev/shm).
>
> Writing works fine e.g. with the following fio config:
> [sw]
> rw=write
> size=1g
> directory=/dev/shm
> iodepth=32
> direct=0
> blocksize=512k
> numjobs=1
> nrfiles=1
> ioengine=splice
> loops=1
> group_reporting
> create_on_open=1
> create_serialize=0
>
> But reading the same file afterwards with the splice ioengine fails:
> [sw]
> rw=read
> size=1g
> directory=/dev/shm
> iodepth=32
> direct=0
> blocksize=512k
> numjobs=1
> nrfiles=1
> ioengine=splice
> loops=1
> group_reporting
>
> root@server1:~/fio# ./fio /root/fior_splice.fio
> sw: (g=0): rw=read, bs=512K-512K/512K-512K, ioengine=splice, iodepth=32
> fio 1.53
> Starting 1 process
> fio: pid=17504, err=22/file:filesetup.c:502,
> func=open(/dev/shm/sw.1.0), error=Invalid argument
> Run status group 0 (all jobs):
>
> Is something misconfigured in the fio read config?
> The --debug=all output is:
It's a bug in fio. We used to set O_DIRECT just in case vmsplice could
map into user address space, which is why it fails (/dev/shm/ does not
do O_DIRECT). There's actually a way to set this correctly now, the
below patch will work for you.
I'll commit it now.
diff --git a/engines/splice.c b/engines/splice.c
index be16cbb..aa00234 100644
--- a/engines/splice.c
+++ b/engines/splice.c
@@ -284,7 +284,7 @@ static int fio_spliceio_init(struct thread_data *td)
* buffers. Just set ->odirect to force that.
*/
if (td_read(td))
- td->o.odirect = 1;
+ td->o.mem_align = 1;
td->io_ops->data = sd;
return 0;
--
Jens Axboe
prev parent reply other threads:[~2011-05-13 19:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-13 16:07 reading tmpfs with splice ioengine Vasilis Liaskovitis
2011-05-13 19:19 ` Jens Axboe [this message]
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=4DCD8436.6080906@fusionio.com \
--to=jaxboe@fusionio.com \
--cc=fio@vger.kernel.org \
--cc=vliaskov@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