Author neologix
Recipients mrjbq7, neologix, pitrou, sbt
Date 2013-03-27.20:14:08
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <CAH_1eM00uP2kpsHsTgiivwUF7=MHdZmL_EnyoG+Ni_0dPbGxCg@mail.gmail.com>
In-reply-to <515350A0.4020601@gmail.com>
Content
> Apart from creating, unlinking and resizing the file I don't think there
> should be any disk I/O.
>
> On Linux disk I/O only occurs when fsync() or close() are called.

What?
Writeback occurs depending on the memory pressure, percentage of used
pages, page modification time, etc. Try writing a large file without
closing it, you'll see that there's disk activity (or use
iostat/vmstat).

> FreeBSD has a MAP_NOSYNC flag which gives Linux behaviour (otherwise
> dirty pages are flushed every 30-60).

It's the same on Linux, depending on your mount options, data will be
committed to disk every 5 seconds or so, when the journal is
committed.

> Once the file has been unlink()ed then any sensible operating system
> should realize it does not need to sync the file.

Why?
Even if you delete the file right after open, if you write data to it,
when the amount of data written fills your caches, the data has to go
somewhere, even if only to make it available to the current process
upon read()...
History
Date User Action Args
2013-03-27 20:14:08neologixsetrecipients: + neologix, pitrou, mrjbq7, sbt
2013-03-27 20:14:08neologixlinkissue17560 messages
2013-03-27 20:14:08neologixcreate