Joerg Schilling wrote:
Rob Bogus <rob23@tmr.com> wrote:I'm attaching a tiny program to show that isn't the case. It's for zeroing out large files. If you have a disk intensive application you might run this to zero out say 50GB or so, and compare the impact on the application with dd of /dev/zero using 1024k buffer size. The program has compiled on rh7.2 thru FC4, SuSE, ubuntu, etc, no kernel headers or GNU needed, you want the POSIX behaviour, or at least I do.Your program is not POSIX as it uses O_DIRECT and posix_memalign() (the first is no POSIX at all, the latter is optional.....). I made no claim that it was POSIX, but you have a point, the intended use is Linux. By not buffering the output of mkisofs, for example, buffer space is available for reading. This makes a small improvement on a large memory, much more as the memory is smaller and read ahead could be impacted by buffering writes.But now I see where you like to use O_DIRECT. If you use O_DIRECT for writing, it makes sense and in the same case it makes sense to use directio(fd, DIRECTIO_ON); on Solaris. I haven't tested there, and I bet you have not tested in small memory (I use 160MB for test).Although on Solaris, it only saves System CPU time and I cannot see an wall clock improvement. Whether this makes sense with the _output_ file from star or mkisofs needs to be tested..... I had not tried with the output of star, that's an interesting suggestion. -- bill davidsen <davidsen@tmr.com> CTO TMR Associates, Inc Doing interesting things with small computers since 1979 |