On Fri, Mar 11, 2011 at 05:46:30PM +0100, Philippe De Muyter wrote: [...]
try_scatter_io: Unknown error 153651144
[...]
I had also suspected a clock going backwards, but that was not the problem.
I have found the problem. Reading your code, you use CLOCK_REALTIME.
From the man page : "CLOCK_REALTIME [...] represents seconds and
nanoseconds since the Epoch. When its time is changed, [...] timers for an absolute point in time are affected. [...] CLOCK_MONOTONIC: Clock that [...] represents monotonic time since some unspecified starting point."
I knew I had no ntp client running, but I wrote the small program below :
#define _POSIX_C_SOURCE 199309L
#include <time.h> #include <stdio.h>
main(int argc, char **argv) { struct timespec ts0, tsi, tsj; int duration = 3600;
if (argc >= 2) sscanf(argv[1], "%d", &duration); printf("running for %d seconds\n", duration);
clock_gettime(CLOCK_REALTIME, &ts0);
clock_gettime(CLOCK_REALTIME, &tsi); do { clock_gettime(CLOCK_REALTIME, &tsj); if (tsj.tv_sec < tsi.tv_sec || tsj.tv_sec == tsi.tv_sec && tsj.tv_nsec < tsi.tv_nsec) printf("clock goes backward : %d.%09u %d.%09u\n", tsi.tv_sec, tsi.tv_nsec, tsj.tv_sec, tsj.tv_nsec); tsi = tsj; } while (tsi.tv_sec < ts0.tv_sec + duration); }
First time, I had let it run for 10 minutes, and nothing happened, hence what I wrote before : "that was not the problem".
I then let it run longer (1 hour), and I got : tmp179:~ # ./check_clock_realtime clock goes backward : 1299957301.487201455 1299957301.315750417 clock goes backward : 1299958201.663430282 1299958201.492589443 clock goes backward : 1299959101.669746997 1299959101.498847436 clock goes backward : 1299960001.670239257 1299960001.499414368 tmp179:~ #
So every 15 minutes, there is a little backwards step. This is with a newly installed opensuse 11.4 (RC1).
I finally found the culprit there : tmp179:~ # cat /etc/cron.d/novell.ntp-synchronize -*/15 * * * * root /etc/init.d/ntp ntptimeset &>/dev/null tmp179:~ #
I have modified your source to use CLOCK_MONOTONIC instead of CLOCK_REALTIME, and with the command : ./flashbench -s --scatter-span=3 --scatter-order=14 --blocksize=8192 --count=50 /dev/sdb -o /tmp/output.plot I got the attached result. What do you think of it ?
Philippe