* RE: ioengine=sync issue on Windows
2014-03-12 16:33 ` Jens Axboe
@ 2014-03-12 17:48 ` Bruce Cran
2014-03-12 18:02 ` Bruce Cran
2014-04-02 3:11 ` Bruce Cran
2 siblings, 0 replies; 21+ messages in thread
From: Bruce Cran @ 2014-03-12 17:48 UTC (permalink / raw)
To: Jens Axboe, Sébastien Bouchex Bellomié,
fio@vger.kernel.org
It looks like it's trying to access %TEMP%\tmp for some reason.
--
Bruce
-----Original Message-----
From: Jens Axboe [mailto:axboe@kernel.dk]
Sent: Wednesday, March 12, 2014 10:34 AM
To: Sébastien Bouchex Bellomié; fio@vger.kernel.org; Bruce Cran
Subject: Re: ioengine=sync issue on Windows
On 03/12/2014 09:41 AM, Sébastien Bouchex Bellomié wrote:
> Hi,
>
> The "sync" engine does not seem to work correctly on Windows :
>
> My profile is :
>
> [global]
> thread
> ioengine=sync
>
> [random_read]
> rw=randread
> size=1024m
> directory=read
> bs=32k
>
> fio 2.1.6.1 output contains " err= 5 (file:backend.c:768, func=full resid, error=Input/output error)"
>
> [...]
> C:\Program Files\fio>fio.exe H:\fio\fio.win
> random_read: (g=0): rw=randread, bs=32K-32K/32K-32K/32K-32K,
> ioengine=sync, iodepth=1 fio-2.1.6-1-gd004a Starting 1 thread
> fio: pid=5144, err=5/file:backend.c:768, func=full resid,
> error=Input/output error
>
> random_read: (groupid=0, jobs=1): err= 5 (file:backend.c:768, func=full resid, error=Input/output error): pid=5144: Wed Mar 12 16:36:45 2014
> cpu : usr=0.00%, sys=0.00%, ctx=0, majf=0, minf=0
> IO depths : 1=100.0%, 2=0.0%, 4=0.0%, 8=0.0%, 16=0.0%, 32=0.0%, >=64=0.0%
> submit : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
> complete : 0=50.0%, 4=50.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
> issued : total=r=2/w=0/d=0, short=r=1/w=0/d=0
> latency : target=0, window=0, percentile=100.00%, depth=1
>
> Run status group 0 (all jobs):
> [...]
Bruce, do you know why that is?
--
Jens Axboe
This e-mail (and any attachments) is confidential and may be privileged. Any unauthorized use, copying, disclosure or dissemination of this communication is prohibited. If you are not the intended recipient, please notify the sender immediately and delete all copies of the message and its attachments.
^ permalink raw reply [flat|nested] 21+ messages in thread
* RE: ioengine=sync issue on Windows
2014-03-12 16:33 ` Jens Axboe
2014-03-12 17:48 ` Bruce Cran
@ 2014-03-12 18:02 ` Bruce Cran
2014-03-12 19:11 ` Jens Axboe
2014-04-02 3:11 ` Bruce Cran
2 siblings, 1 reply; 21+ messages in thread
From: Bruce Cran @ 2014-03-12 18:02 UTC (permalink / raw)
To: Jens Axboe, Sébastien Bouchex Bellomié,
fio@vger.kernel.org
It turns out this is unrelated, but in stat.c the following change should probably be made:
-#define FIO_STATUS_FILE "/tmp/fio-dump-status"
+#define FIO_STATUS_FILE "fio-dump-status"
--
Bruce
-----Original Message-----
From: Bruce Cran
Sent: Wednesday, March 12, 2014 11:49 AM
To: 'Jens Axboe'; S�bastien Bouchex Bellomi�; fio@vger.kernel.org
Subject: RE: ioengine=sync issue on Windows
It looks like it's trying to access %TEMP%\tmp for some reason.
--
Bruce
-----Original Message-----
From: Jens Axboe [mailto:axboe@kernel.dk]
Sent: Wednesday, March 12, 2014 10:34 AM
To: S�bastien Bouchex Bellomi�; fio@vger.kernel.org; Bruce Cran
Subject: Re: ioengine=sync issue on Windows
On 03/12/2014 09:41 AM, S�bastien Bouchex Bellomi� wrote:
> Hi,
>
> The "sync" engine does not seem to work correctly on Windows :
>
> My profile is :
>
> [global]
> thread
> ioengine=sync
>
> [random_read]
> rw=randread
> size=1024m
> directory=read
> bs=32k
>
> fio 2.1.6.1 output contains " err= 5 (file:backend.c:768, func=full resid, error=Input/output error)"
>
> [...]
> C:\Program Files\fio>fio.exe H:\fio\fio.win
> random_read: (g=0): rw=randread, bs=32K-32K/32K-32K/32K-32K,
> ioengine=sync, iodepth=1 fio-2.1.6-1-gd004a Starting 1 thread
> fio: pid=5144, err=5/file:backend.c:768, func=full resid,
> error=Input/output error
>
> random_read: (groupid=0, jobs=1): err= 5 (file:backend.c:768, func=full resid, error=Input/output error): pid=5144: Wed Mar 12 16:36:45 2014
> cpu : usr=0.00%, sys=0.00%, ctx=0, majf=0, minf=0
> IO depths : 1=100.0%, 2=0.0%, 4=0.0%, 8=0.0%, 16=0.0%, 32=0.0%, >=64=0.0%
> submit : 0=0.0%, 4=100.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
> complete : 0=50.0%, 4=50.0%, 8=0.0%, 16=0.0%, 32=0.0%, 64=0.0%, >=64=0.0%
> issued : total=r=2/w=0/d=0, short=r=1/w=0/d=0
> latency : target=0, window=0, percentile=100.00%, depth=1
>
> Run status group 0 (all jobs):
> [...]
Bruce, do you know why that is?
--
Jens Axboe
This e-mail (and any attachments) is confidential and may be privileged. Any unauthorized use, copying, disclosure or dissemination of this communication is prohibited. If you are not the intended recipient, please notify the sender immediately and delete all copies of the message and its attachments.
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: ioengine=sync issue on Windows
2014-03-12 18:02 ` Bruce Cran
@ 2014-03-12 19:11 ` Jens Axboe
2014-03-12 19:24 ` Bruce Cran
0 siblings, 1 reply; 21+ messages in thread
From: Jens Axboe @ 2014-03-12 19:11 UTC (permalink / raw)
To: Bruce Cran, Sébastien Bouchex Bellomié,
fio@vger.kernel.org
On 03/12/2014 12:02 PM, Bruce Cran wrote:
> It turns out this is unrelated, but in stat.c the following change should probably be made:
>
> -#define FIO_STATUS_FILE "/tmp/fio-dump-status"
> +#define FIO_STATUS_FILE "fio-dump-status"
>
How about we make that use os_get_tmpdir() instead?
--
Jens Axboe
^ permalink raw reply [flat|nested] 21+ messages in thread
* RE: ioengine=sync issue on Windows
2014-03-12 19:11 ` Jens Axboe
@ 2014-03-12 19:24 ` Bruce Cran
2014-03-12 19:30 ` Jens Axboe
0 siblings, 1 reply; 21+ messages in thread
From: Bruce Cran @ 2014-03-12 19:24 UTC (permalink / raw)
To: Jens Axboe, Sébastien Bouchex Bellomié,
fio@vger.kernel.org
There's already code to use the environment variables TMP or TEMP, except it appends "tmp" to whatever it gets.
--
Bruce
-----Original Message-----
From: Jens Axboe [mailto:axboe@kernel.dk]
Sent: Wednesday, March 12, 2014 1:11 PM
To: Bruce Cran; Sébastien Bouchex Bellomié; fio@vger.kernel.org
Subject: Re: ioengine=sync issue on Windows
On 03/12/2014 12:02 PM, Bruce Cran wrote:
> It turns out this is unrelated, but in stat.c the following change should probably be made:
>
> -#define FIO_STATUS_FILE "/tmp/fio-dump-status"
> +#define FIO_STATUS_FILE "fio-dump-status"
>
How about we make that use os_get_tmpdir() instead?
--
Jens Axboe
This e-mail (and any attachments) is confidential and may be privileged. Any unauthorized use, copying, disclosure or dissemination of this communication is prohibited. If you are not the intended recipient, please notify the sender immediately and delete all copies of the message and its attachments.
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: ioengine=sync issue on Windows
2014-03-12 19:24 ` Bruce Cran
@ 2014-03-12 19:30 ` Jens Axboe
2014-03-12 19:36 ` Bruce Cran
0 siblings, 1 reply; 21+ messages in thread
From: Jens Axboe @ 2014-03-12 19:30 UTC (permalink / raw)
To: Bruce Cran, Sébastien Bouchex Bellomié,
fio@vger.kernel.org
[-- Attachment #1: Type: text/plain, Size: 234 bytes --]
On 03/12/2014 01:24 PM, Bruce Cran wrote:
> There's already code to use the environment variables TMP or TEMP, except it appends "tmp" to whatever it gets.
>
Yes, my point was to use it. Something like the attached.
--
Jens Axboe
[-- Attachment #2: fio-tmp.patch --]
[-- Type: text/x-patch, Size: 1625 bytes --]
diff --git a/os/os-windows.h b/os/os-windows.h
index 49f96068ff32..499e098f8b82 100644
--- a/os/os-windows.h
+++ b/os/os-windows.h
@@ -167,6 +167,8 @@ static inline void os_get_tmpdir(char *path, int len)
GetTempPath(len, path);
}
+#define FIO_HAVE_OS_GET_TMPDIR
+
static inline int gettid(void)
{
return GetCurrentThreadId();
diff --git a/stat.c b/stat.c
index e43db8f9d075..df3bd93d32e5 100644
--- a/stat.c
+++ b/stat.c
@@ -13,6 +13,7 @@
#include "json.h"
#include "lib/getrusage.h"
#include "idletime.h"
+#include "os/os.h"
static struct fio_mutex *stat_mutex;
@@ -1480,7 +1481,7 @@ void show_running_run_stats(void)
static int status_interval_init;
static struct timeval status_time;
-#define FIO_STATUS_FILE "/tmp/fio-dump-status"
+#define FIO_STATUS_FILE "fio-dump-status"
static int check_status_file(void)
{
@@ -1491,10 +1492,22 @@ static int check_status_file(void)
temp_dir = getenv("TMPDIR");
if (temp_dir == NULL)
temp_dir = getenv("TEMP");
- if (temp_dir == NULL)
+ if (temp_dir == NULL) {
+#ifdef FIO_HAVE_OS_GET_TMPDIR
+ temp_dir = NULL;
+ os_get_tmpdir(status_file_path, sizeof(status_file_path));
+#else
temp_dir = "/tmp";
+#endif
+ }
- snprintf(fio_status_file_path, sizeof(fio_status_file_path), "%s/%s", temp_dir, FIO_STATUS_FILE);
+ if (temp_dir)
+ snprintf(fio_status_file_path, sizeof(fio_status_file_path), "%s/%s", temp_dir, FIO_STATUS_FILE);
+ else {
+ size_t len = strlen(fio_status_file_path);
+
+ snprintf(fio_status_file_path + len, sizeof(fio_status_file_path) - len, "%s", FIO_STATUS_FILE);
+ }
if (stat(fio_status_file_path, &sb))
return 0;
^ permalink raw reply related [flat|nested] 21+ messages in thread* RE: ioengine=sync issue on Windows
2014-03-12 19:30 ` Jens Axboe
@ 2014-03-12 19:36 ` Bruce Cran
2014-03-12 19:38 ` Jens Axboe
0 siblings, 1 reply; 21+ messages in thread
From: Bruce Cran @ 2014-03-12 19:36 UTC (permalink / raw)
To: Jens Axboe, Sébastien Bouchex Bellomié,
fio@vger.kernel.org
Oh, I see - that works. Though the existing code also does with the removal of 'tmp' from FIO_STATUS_FILE - Windows defines both TMP and TEMP environment variables.
--
Bruce
-----Original Message-----
From: Jens Axboe [mailto:axboe@kernel.dk]
Sent: Wednesday, March 12, 2014 1:31 PM
To: Bruce Cran; Sébastien Bouchex Bellomié; fio@vger.kernel.org
Subject: Re: ioengine=sync issue on Windows
On 03/12/2014 01:24 PM, Bruce Cran wrote:
> There's already code to use the environment variables TMP or TEMP, except it appends "tmp" to whatever it gets.
>
Yes, my point was to use it. Something like the attached.
--
Jens Axboe
This e-mail (and any attachments) is confidential and may be privileged. Any unauthorized use, copying, disclosure or dissemination of this communication is prohibited. If you are not the intended recipient, please notify the sender immediately and delete all copies of the message and its attachments.
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: ioengine=sync issue on Windows
2014-03-12 19:36 ` Bruce Cran
@ 2014-03-12 19:38 ` Jens Axboe
2014-03-12 19:41 ` Jens Axboe
0 siblings, 1 reply; 21+ messages in thread
From: Jens Axboe @ 2014-03-12 19:38 UTC (permalink / raw)
To: Bruce Cran, Sébastien Bouchex Bellomié,
fio@vger.kernel.org
On 03/12/2014 01:36 PM, Bruce Cran wrote:
> Oh, I see - that works. Though the existing code also does with the removal of
> 'tmp' from FIO_STATUS_FILE - Windows defines both TMP and TEMP
environment variables.
So the getenv() works fine on Windows? If so, I can clean it up some more.
--
Jens Axboe
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: ioengine=sync issue on Windows
2014-03-12 19:38 ` Jens Axboe
@ 2014-03-12 19:41 ` Jens Axboe
2014-03-12 19:44 ` Bruce Cran
0 siblings, 1 reply; 21+ messages in thread
From: Jens Axboe @ 2014-03-12 19:41 UTC (permalink / raw)
To: Bruce Cran, Sébastien Bouchex Bellomié,
fio@vger.kernel.org
On 03/12/2014 01:38 PM, Jens Axboe wrote:
> On 03/12/2014 01:36 PM, Bruce Cran wrote:
>> Oh, I see - that works. Though the existing code also does with the
>> removal of
> > 'tmp' from FIO_STATUS_FILE - Windows defines both TMP and TEMP
> environment variables.
>
> So the getenv() works fine on Windows? If so, I can clean it up some more.
Queued this up:
http://git.kernel.dk/?p=fio.git;a=commit;h=dac45f23c3c7d146f7df82047ae7f25abf231ed3
--
Jens Axboe
^ permalink raw reply [flat|nested] 21+ messages in thread
* RE: ioengine=sync issue on Windows
2014-03-12 19:41 ` Jens Axboe
@ 2014-03-12 19:44 ` Bruce Cran
0 siblings, 0 replies; 21+ messages in thread
From: Bruce Cran @ 2014-03-12 19:44 UTC (permalink / raw)
To: Jens Axboe, Sébastien Bouchex Bellomié,
fio@vger.kernel.org
Perfect - thanks!
--
Bruce
-----Original Message-----
From: Jens Axboe [mailto:axboe@kernel.dk]
Sent: Wednesday, March 12, 2014 1:41 PM
To: Bruce Cran; Sébastien Bouchex Bellomié; fio@vger.kernel.org
Subject: Re: ioengine=sync issue on Windows
On 03/12/2014 01:38 PM, Jens Axboe wrote:
> On 03/12/2014 01:36 PM, Bruce Cran wrote:
>> Oh, I see - that works. Though the existing code also does with the
>> removal of
> > 'tmp' from FIO_STATUS_FILE - Windows defines both TMP and TEMP
> environment variables.
>
> So the getenv() works fine on Windows? If so, I can clean it up some more.
Queued this up:
http://git.kernel.dk/?p=fio.git;a=commit;h=dac45f23c3c7d146f7df82047ae7f25abf231ed3
--
Jens Axboe
This e-mail (and any attachments) is confidential and may be privileged. Any unauthorized use, copying, disclosure or dissemination of this communication is prohibited. If you are not the intended recipient, please notify the sender immediately and delete all copies of the message and its attachments.
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: ioengine=sync issue on Windows
2014-03-12 16:33 ` Jens Axboe
2014-03-12 17:48 ` Bruce Cran
2014-03-12 18:02 ` Bruce Cran
@ 2014-04-02 3:11 ` Bruce Cran
2014-04-03 22:42 ` Bruce Cran
2 siblings, 1 reply; 21+ messages in thread
From: Bruce Cran @ 2014-04-02 3:11 UTC (permalink / raw)
To: Jens Axboe, Sébastien Bouchex Bellomié,
fio@vger.kernel.org, bcran
On 3/12/2014 10:33 AM, Jens Axboe wrote:
> On 03/12/2014 09:41 AM, Sébastien Bouchex Bellomié wrote:
>>
>> fio: pid=5144, err=5/file:backend.c:768, func=full resid,
>> error=Input/output error
>>
>> random_read: (groupid=0, jobs=1): err= 5 (file:backend.c:768,
>> func=full resid, error=Input/output error): pid=5144: Wed Mar 12
>> 16:36:45 2014
> Bruce, do you know why that is?
>
It appears to be because after seeking, there's 92 bytes before a space
in the file (i.e. it's a sparse file), and instead of filling the buffer
with 0's read() is for some reason returning 0.
--
Bruce
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: ioengine=sync issue on Windows
2014-04-02 3:11 ` Bruce Cran
@ 2014-04-03 22:42 ` Bruce Cran
2014-04-04 1:57 ` Jens Axboe
0 siblings, 1 reply; 21+ messages in thread
From: Bruce Cran @ 2014-04-03 22:42 UTC (permalink / raw)
To: Jens Axboe, Sébastien Bouchex Bellomié,
fio@vger.kernel.org, bcran
On 4/1/2014 9:11 PM, Bruce Cran wrote:
>
> On 3/12/2014 10:33 AM, Jens Axboe wrote:
>> On 03/12/2014 09:41 AM, Sébastien Bouchex Bellomié wrote:
>>>
>>> fio: pid=5144, err=5/file:backend.c:768, func=full resid,
>>> error=Input/output error
>>>
>>> random_read: (groupid=0, jobs=1): err= 5 (file:backend.c:768,
>>> func=full resid, error=Input/output error): pid=5144: Wed Mar 12
>>> 16:36:45 2014
>> Bruce, do you know why that is?
>>
>
> It appears to be because after seeking, there's 92 bytes before a
> space in the file (i.e. it's a sparse file), and instead of filling
> the buffer with 0's read() is for some reason returning 0.
>
I was wrong. The problem has something to do with fil_io_buffer - and
in particular __fill_random_buf. The io error disappears if I change the
line:
*ptr = seed;
to
*ptr = 1;
Also, fio-2.0.15 works, while fio-2.1 doesn't.
--
Bruce
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: ioengine=sync issue on Windows
2014-04-03 22:42 ` Bruce Cran
@ 2014-04-04 1:57 ` Jens Axboe
2014-04-04 2:14 ` Bruce Cran
0 siblings, 1 reply; 21+ messages in thread
From: Jens Axboe @ 2014-04-04 1:57 UTC (permalink / raw)
To: Bruce Cran, Sébastien Bouchex Bellomié,
fio@vger.kernel.org, bcran
On 2014-04-03 16:42, Bruce Cran wrote:
>
> On 4/1/2014 9:11 PM, Bruce Cran wrote:
>>
>> On 3/12/2014 10:33 AM, Jens Axboe wrote:
>>> On 03/12/2014 09:41 AM, S�bastien Bouchex Bellomi� wrote:
>>>>
>>>> fio: pid=5144, err=5/file:backend.c:768, func=full resid,
>>>> error=Input/output error
>>>>
>>>> random_read: (groupid=0, jobs=1): err= 5 (file:backend.c:768,
>>>> func=full resid, error=Input/output error): pid=5144: Wed Mar 12
>>>> 16:36:45 2014
>>> Bruce, do you know why that is?
>>>
>>
>> It appears to be because after seeking, there's 92 bytes before a
>> space in the file (i.e. it's a sparse file), and instead of filling
>> the buffer with 0's read() is for some reason returning 0.
>>
>
> I was wrong. The problem has something to do with fil_io_buffer - and
> in particular __fill_random_buf. The io error disappears if I change the
> line:
>
> *ptr = seed;
> to
> *ptr = 1;
>
> Also, fio-2.0.15 works, while fio-2.1 doesn't.
That makes very little sense... How could the contents of the buffer
change the behavior?
Could you run a git bisect? Should be quick'n easy, if it's nicely
reproducible.
--
Jens Axboe
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: ioengine=sync issue on Windows
2014-04-04 1:57 ` Jens Axboe
@ 2014-04-04 2:14 ` Bruce Cran
2014-04-04 2:17 ` Jens Axboe
0 siblings, 1 reply; 21+ messages in thread
From: Bruce Cran @ 2014-04-04 2:14 UTC (permalink / raw)
To: Jens Axboe, Sébastien Bouchex Bellomié,
fio@vger.kernel.org, bcran
On 4/3/2014 7:57 PM, Jens Axboe wrote:
> On 2014-04-03 16:42, Bruce Cran wrote:
>>
>> Also, fio-2.0.15 works, while fio-2.1 doesn't.
>
> That makes very little sense... How could the contents of the buffer
> change the behavior?
>
> Could you run a git bisect? Should be quick'n easy, if it's nicely
> reproducible.
>
http://git.kernel.dk/?p=fio.git;a=commit;h=cc86c395fd9dd2002ec1edc0967b7c9453debdfb
is the changeset that breaks things - and I know it makes no sense.
--
Bruce
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: ioengine=sync issue on Windows
2014-04-04 2:14 ` Bruce Cran
@ 2014-04-04 2:17 ` Jens Axboe
2014-04-04 2:26 ` Bruce Cran
0 siblings, 1 reply; 21+ messages in thread
From: Jens Axboe @ 2014-04-04 2:17 UTC (permalink / raw)
To: Bruce Cran, Sébastien Bouchex Bellomié,
fio@vger.kernel.org, bcran
On 2014-04-03 20:14, Bruce Cran wrote:
>
> On 4/3/2014 7:57 PM, Jens Axboe wrote:
>> On 2014-04-03 16:42, Bruce Cran wrote:
>>>
>>> Also, fio-2.0.15 works, while fio-2.1 doesn't.
>>
>> That makes very little sense... How could the contents of the buffer
>> change the behavior?
>>
>> Could you run a git bisect? Should be quick'n easy, if it's nicely
>> reproducible.
>>
>
> http://git.kernel.dk/?p=fio.git;a=commit;h=cc86c395fd9dd2002ec1edc0967b7c9453debdfb
> is the changeset that breaks things - and I know it makes no sense.
That is pretty nutty. If you revert just the change to filesetup.c, does
that make it work again?
--
Jens Axboe
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: ioengine=sync issue on Windows
2014-04-04 2:17 ` Jens Axboe
@ 2014-04-04 2:26 ` Bruce Cran
2014-04-04 2:35 ` Jens Axboe
0 siblings, 1 reply; 21+ messages in thread
From: Bruce Cran @ 2014-04-04 2:26 UTC (permalink / raw)
To: Jens Axboe, Sébastien Bouchex Bellomié,
fio@vger.kernel.org, bcran
On 4/3/2014 8:17 PM, Jens Axboe wrote:
> On 2014-04-03 20:14, Bruce Cran wrote:
>>
>> http://git.kernel.dk/?p=fio.git;a=commit;h=cc86c395fd9dd2002ec1edc0967b7c9453debdfb
>>
>> is the changeset that breaks things - and I know it makes no sense.
>
> That is pretty nutty. If you revert just the change to filesetup.c,
> does that make it work again?
>
I've just re-tested it and yes, reverting the change to filesetup.c does
make it work again.
--
Bruce
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: ioengine=sync issue on Windows
2014-04-04 2:26 ` Bruce Cran
@ 2014-04-04 2:35 ` Jens Axboe
2014-04-04 3:12 ` Bruce Cran
0 siblings, 1 reply; 21+ messages in thread
From: Jens Axboe @ 2014-04-04 2:35 UTC (permalink / raw)
To: Bruce Cran, Sébastien Bouchex Bellomié,
fio@vger.kernel.org, bcran
On 2014-04-03 20:26, Bruce Cran wrote:
> On 4/3/2014 8:17 PM, Jens Axboe wrote:
>> On 2014-04-03 20:14, Bruce Cran wrote:
>>>
>>> http://git.kernel.dk/?p=fio.git;a=commit;h=cc86c395fd9dd2002ec1edc0967b7c9453debdfb
>>>
>>> is the changeset that breaks things - and I know it makes no sense.
>>
>> That is pretty nutty. If you revert just the change to filesetup.c,
>> does that make it work again?
>>
>
> I've just re-tested it and yes, reverting the change to filesetup.c does
> make it work again.
So next question... If you replace that fill_io_buffer() call with a
memset(b, 0, bs); does it then work?
--
Jens Axboe
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: ioengine=sync issue on Windows
2014-04-04 2:35 ` Jens Axboe
@ 2014-04-04 3:12 ` Bruce Cran
2014-04-04 3:28 ` Jens Axboe
0 siblings, 1 reply; 21+ messages in thread
From: Bruce Cran @ 2014-04-04 3:12 UTC (permalink / raw)
To: Jens Axboe, Sébastien Bouchex Bellomié,
fio@vger.kernel.org, bcran
On 4/3/2014 8:35 PM, Jens Axboe wrote:
> So next question... If you replace that fill_io_buffer() call with a
> memset(b, 0, bs); does it then work?
>
The io error goes away, but now it occasionally crashes:
(gdb) bt
#0 0x64942e9e in pthread_mutex_unlock () from /cygdrive/c/Users/bcran/workspace/fio/libwinpthread-1.dll
#1 0x0043997c in run_threads () at backend.c:1791
#2 0x00439d9f in fio_backend () at backend.c:1904
#3 0x0044c274 in main (argc=2, argv=0x821728, envp=0x821988) at fio.c:50
(gdb) info threads
Id Target Id Frame
3 Thread 7256.0x4618 fio_pin_memory (td=td@entry=0x2820000) at memory.c:27
2 Thread 7256.0xc8 0x7787bf3c in ?? ()
* 1 Thread 7256.0x5e04 0x64942e9e in pthread_mutex_unlock () from /cygdrive/c/Users/bcran/workspace/fio/libwinpthread-1.dll
(gdb) thread 3
(gdb) bt
#0 fio_pin_memory (td=td@entry=0x2820000) at memory.c:27
#1 0x00437076 in thread_main (data=0x2820000) at backend.c:1226
#2 0x64944ecb in pthread_create_wrapper () from /cygdrive/c/Users/bcran/workspace/fio/libwinpthread-1.dll
#3 0x752d0bc4 in wtoi64 () from /cygdrive/c/Windows/SysWOW64/msvcrt.dll
#4 0x752d0cec in msvcrt!_beginthreadex () from /cygdrive/c/Windows/SysWOW64/msvcrt.dll
#5 0x7699495d in KERNEL32!BaseThreadInitThunk () from /cygdrive/c/Windows/SysWOW64/KERNEL32.DLL
#6 0x778898ee in ?? ()
#7 0x778898c4 in ?? ()
#8 0x00000000 in ?? ()
--
Bruce
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: ioengine=sync issue on Windows
2014-04-04 3:12 ` Bruce Cran
@ 2014-04-04 3:28 ` Jens Axboe
2014-04-28 22:04 ` Bruce Cran
0 siblings, 1 reply; 21+ messages in thread
From: Jens Axboe @ 2014-04-04 3:28 UTC (permalink / raw)
To: Bruce Cran, Sébastien Bouchex Bellomié,
fio@vger.kernel.org, bcran
On 2014-04-03 21:12, Bruce Cran wrote:
> On 4/3/2014 8:35 PM, Jens Axboe wrote:
>> So next question... If you replace that fill_io_buffer() call with a
>> memset(b, 0, bs); does it then work?
>>
>
> The io error goes away, but now it occasionally crashes:
>
> (gdb) bt
>
> #0 0x64942e9e in pthread_mutex_unlock () from
> /cygdrive/c/Users/bcran/workspace/fio/libwinpthread-1.dll
> #1 0x0043997c in run_threads () at backend.c:1791
> #2 0x00439d9f in fio_backend () at backend.c:1904
> #3 0x0044c274 in main (argc=2, argv=0x821728, envp=0x821988) at fio.c:50
>
> (gdb) info threads
> Id Target Id Frame
> 3 Thread 7256.0x4618 fio_pin_memory (td=td@entry=0x2820000) at
> memory.c:27
> 2 Thread 7256.0xc8 0x7787bf3c in ?? ()
> * 1 Thread 7256.0x5e04 0x64942e9e in pthread_mutex_unlock () from
> /cygdrive/c/Users/bcran/workspace/fio/libwinpthread-1.dll
> (gdb) thread 3
> (gdb) bt
> #0 fio_pin_memory (td=td@entry=0x2820000) at memory.c:27
> #1 0x00437076 in thread_main (data=0x2820000) at backend.c:1226
> #2 0x64944ecb in pthread_create_wrapper () from
> /cygdrive/c/Users/bcran/workspace/fio/libwinpthread-1.dll
> #3 0x752d0bc4 in wtoi64 () from /cygdrive/c/Windows/SysWOW64/msvcrt.dll
> #4 0x752d0cec in msvcrt!_beginthreadex () from
> /cygdrive/c/Windows/SysWOW64/msvcrt.dll
> #5 0x7699495d in KERNEL32!BaseThreadInitThunk () from
> /cygdrive/c/Windows/SysWOW64/KERNEL32.DLL
> #6 0x778898ee in ?? ()
> #7 0x778898c4 in ?? ()
> #8 0x00000000 in ?? ()
This really sounds like an issue with write() on windows. The change
looks fine, and the fact that moving the memset around makes a
difference - well, that's just bizarre. Do you have time to dig into
this? Was read/write really completely reliable before this change?
What if we allocate a bigger buffer, does that change anything? Change
that malloc() to:
b = fio_memalign(4096, 2 * td->o.max_bs[DDIR_WRITE]);
(and the corresponding free to fio_memfree(b, 2 * td->o.max_bs[DDIR_WRITE])
--
Jens Axboe
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: ioengine=sync issue on Windows
2014-04-04 3:28 ` Jens Axboe
@ 2014-04-28 22:04 ` Bruce Cran
0 siblings, 0 replies; 21+ messages in thread
From: Bruce Cran @ 2014-04-28 22:04 UTC (permalink / raw)
To: Jens Axboe, Sébastien Bouchex Bellomié,
fio@vger.kernel.org, bcran
On 4/3/2014 9:28 PM, Jens Axboe wrote:
> This really sounds like an issue with write() on windows. The change
> looks fine, and the fact that moving the memset around makes a
> difference - well, that's just bizarre. Do you have time to dig into
> this? Was read/write really completely reliable before this change?
It turns out it was a problem with open() - you need to pass _O_BINARY
to avoid Windows trying to interpret file contents.
--
Bruce
^ permalink raw reply [flat|nested] 21+ messages in thread