Re: [linux-audio-dev] Re: File writes with O_SYNC slow

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: Re: [linux-audio-dev] Re: File writes with O_SYNC slow
From: Stephen C. Tweedie (sct_AT_redhat.com)
Date: Thu Apr 20 2000 - 12:59:21 EEST


Hi,

On Thu, Apr 20, 2000 at 10:57:15AM +0200, Benno Senoner wrote:
>
> I tried all combinations using my hdtest.c which I posted yesterday.
>
> I tried O_SYNC and even O_DSYNC on the SGI (Origin 2k),
> (D_SYNC syncs only data blocks but not metadata blocks)

Not quite. O_DSYNC syncs metadata too. The only thing it skips is
inode timestamps.

There is an important difference between the two when you are overwriting
an existing allocated file. In that case, there are no metadata changes
except for timestamp updates, so O_DSYNC is very much faster. However,
if you are appending to a file, then some metadata updates (for file
mapping information and for the file size) are necessary for both
O_SYNC and O_DSYNC.
 
> write() + fsync()/fdatasync() on linux doesn't work well too since the kernel
> isn't able to optimize disk writing by using the elevator algorithm.

There are other problems with fsync/fdatasync in 2.2. In particular,
it is slow for larger files since it tries to scan all the mapping
information for the entire file.

I'll put together an old patch I did to make fsync/fdatasync and
O_DSYNC work much faster. It will be interesting to see if it makes
much difference, and it may be the stick we need to beat Linus into
believing that this change is really quite important.

--Stephen


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : Thu Apr 20 2000 - 13:41:12 EEST