* using ioengine=sg
@ 2010-08-26 19:25 Chuck Tuffli
2010-08-27 7:03 ` Jens Axboe
0 siblings, 1 reply; 6+ messages in thread
From: Chuck Tuffli @ 2010-08-26 19:25 UTC (permalink / raw)
To: fio
Hi -
Reading the man page under ioengine, it mentions that sg will do
asynchronous IO if the target is the sg character device. So I'm
assuming that means a job file something like
> cat sgtest.fio
[global]
bs=512b
readwrite=read
ioengine=sg
size=1m
[/dev/sg2]
but when I run it,
> uname -srp
Linux 2.6.34-12-default x86_64
> ls -l /dev/sg2
crw-rw---- 1 root disk 21, 2 Aug 26 17:46 /dev/sg2
> ./fio --version
fio 1.43.1
> sudo ./fio sgtest.fio
/dev/sg2: (g=0): rw=read, bs=512-512/512-512, ioengine=sg, iodepth=1
Starting 1 process
fio: pid=3147, got signal=11
Run status group 0 (all jobs):
fio: file hash not empty on exit
Any idea what I'm doing wrong or might be missing on the system? Thanks!
---chuck
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: using ioengine=sg
2010-08-26 19:25 using ioengine=sg Chuck Tuffli
@ 2010-08-27 7:03 ` Jens Axboe
2010-08-27 15:40 ` Chuck Tuffli
0 siblings, 1 reply; 6+ messages in thread
From: Jens Axboe @ 2010-08-27 7:03 UTC (permalink / raw)
To: Chuck Tuffli; +Cc: fio
On 2010-08-26 21:25, Chuck Tuffli wrote:
> Hi -
>
> Reading the man page under ioengine, it mentions that sg will do
> asynchronous IO if the target is the sg character device. So I'm
> assuming that means a job file something like
>
>> cat sgtest.fio
> [global]
> bs=512b
> readwrite=read
> ioengine=sg
> size=1m
>
> [/dev/sg2]
>
> but when I run it,
>
>> uname -srp
> Linux 2.6.34-12-default x86_64
>> ls -l /dev/sg2
> crw-rw---- 1 root disk 21, 2 Aug 26 17:46 /dev/sg2
>> ./fio --version
> fio 1.43.1
>> sudo ./fio sgtest.fio
> /dev/sg2: (g=0): rw=read, bs=512-512/512-512, ioengine=sg, iodepth=1
> Starting 1 process
> fio: pid=3147, got signal=11
>
>
> Run status group 0 (all jobs):
> fio: file hash not empty on exit
>
> Any idea what I'm doing wrong or might be missing on the system? Thanks!
You are not doing anything wrong, it's a bug. This patch will fix
it.
diff --git a/engines/sg.c b/engines/sg.c
index 57c3834..bc82b09 100644
--- a/engines/sg.c
+++ b/engines/sg.c
@@ -274,17 +274,16 @@ static struct io_u *fio_sgio_event(struct thread_data *td, int event)
static int fio_sgio_get_bs(struct thread_data *td, unsigned int *bs)
{
struct sgio_data *sd = td->io_ops->data;
- struct io_u *io_u;
+ struct io_u io_u;
struct sg_io_hdr *hdr;
unsigned char buf[8];
int ret;
- io_u = __get_io_u(td);
- io_u->file = td->files[0];
- assert(io_u);
+ memset(&io_u, 0, sizeof(io_u));
+ io_u.file = td->files[0];
- hdr = &io_u->hdr;
- sgio_hdr_init(sd, hdr, io_u, 0);
+ hdr = &io_u.hdr;
+ sgio_hdr_init(sd, hdr, &io_u, 0);
memset(buf, 0, sizeof(buf));
hdr->cmdp[0] = 0x25;
@@ -292,14 +291,11 @@ static int fio_sgio_get_bs(struct thread_data *td, unsigned int *bs)
hdr->dxferp = buf;
hdr->dxfer_len = sizeof(buf);
- ret = fio_sgio_doio(td, io_u, 1);
- if (ret) {
- put_io_u(td, io_u);
+ ret = fio_sgio_doio(td, &io_u, 1);
+ if (ret)
return ret;
- }
*bs = (buf[4] << 24) | (buf[5] << 16) | (buf[6] << 8) | buf[7];
- put_io_u(td, io_u);
return 0;
}
--
Jens Axboe
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: using ioengine=sg
2010-08-27 7:03 ` Jens Axboe
@ 2010-08-27 15:40 ` Chuck Tuffli
2010-08-27 16:56 ` Jens Axboe
0 siblings, 1 reply; 6+ messages in thread
From: Chuck Tuffli @ 2010-08-27 15:40 UTC (permalink / raw)
To: Jens Axboe; +Cc: fio@vger.kernel.org
On Fri, Aug 27, 2010 at 12:03 AM, Jens Axboe <jaxboe@fusionio.com> wrote:
...
> You are not doing anything wrong, it's a bug. This patch will fix
> it.
Thanks for the patch. Now I see the following
> sudo ./fio sgtest.fio
/dev/sg2: (g=0): rw=read, bs=512-512/512-512, ioengine=sg, iodepth=1
Starting 1 process
Jobs: 1 (f=0): [R] [12900.0% done] [0K/0K /s] [0/0 iops] [eta
1158050441d:06h:58m:08s]
---chuck
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: using ioengine=sg
2010-08-27 15:40 ` Chuck Tuffli
@ 2010-08-27 16:56 ` Jens Axboe
2010-08-27 21:37 ` Chuck Tuffli
0 siblings, 1 reply; 6+ messages in thread
From: Jens Axboe @ 2010-08-27 16:56 UTC (permalink / raw)
To: Chuck Tuffli; +Cc: fio@vger.kernel.org
On 2010-08-27 17:40, Chuck Tuffli wrote:
> On Fri, Aug 27, 2010 at 12:03 AM, Jens Axboe <jaxboe@fusionio.com> wrote:
> ...
>> You are not doing anything wrong, it's a bug. This patch will fix
>> it.
>
> Thanks for the patch. Now I see the following
>
>> sudo ./fio sgtest.fio
> /dev/sg2: (g=0): rw=read, bs=512-512/512-512, ioengine=sg, iodepth=1
> Starting 1 process
> Jobs: 1 (f=0): [R] [12900.0% done] [0K/0K /s] [0/0 iops] [eta
> 1158050441d:06h:58m:08s]
Works for me, exact same job file. Can you do an sg_inq /dev/sg2?
--
Jens Axboe
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: using ioengine=sg
2010-08-27 16:56 ` Jens Axboe
@ 2010-08-27 21:37 ` Chuck Tuffli
2010-08-28 6:53 ` Jens Axboe
0 siblings, 1 reply; 6+ messages in thread
From: Chuck Tuffli @ 2010-08-27 21:37 UTC (permalink / raw)
To: Jens Axboe; +Cc: fio@vger.kernel.org
On Fri, Aug 27, 2010 at 9:56 AM, Jens Axboe <jaxboe@fusionio.com>
...
> Works for me, exact same job file. Can you do an sg_inq /dev/sg2?
Ugh, inquiries failed to that device but not others. Something went
wrong with the LLDD, but a reboot cleared everything up. BTW, the
patch really helped with the performance I'm seeing. Thanks again!
---chuck
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: using ioengine=sg
2010-08-27 21:37 ` Chuck Tuffli
@ 2010-08-28 6:53 ` Jens Axboe
0 siblings, 0 replies; 6+ messages in thread
From: Jens Axboe @ 2010-08-28 6:53 UTC (permalink / raw)
To: Chuck Tuffli; +Cc: fio@vger.kernel.org
On 08/27/2010 11:37 PM, Chuck Tuffli wrote:
> On Fri, Aug 27, 2010 at 9:56 AM, Jens Axboe <jaxboe@fusionio.com>
> ...
>> Works for me, exact same job file. Can you do an sg_inq /dev/sg2?
>
> Ugh, inquiries failed to that device but not others. Something went
> wrong with the LLDD, but a reboot cleared everything up. BTW, the
> patch really helped with the performance I'm seeing. Thanks again!
Great, I was starting to worry there was more than one bug there :-)
--
Jens Axboe
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2010-08-28 6:53 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-26 19:25 using ioengine=sg Chuck Tuffli
2010-08-27 7:03 ` Jens Axboe
2010-08-27 15:40 ` Chuck Tuffli
2010-08-27 16:56 ` Jens Axboe
2010-08-27 21:37 ` Chuck Tuffli
2010-08-28 6:53 ` Jens Axboe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox