Because when sync(1) does IO on it's own, it competes for the device with
the flusher thread running in parallel thus resulting in more seeks.
...
So let me compare:
What kupdate writeback does:
queue inodes older than dirty_expire_centisecs
while some inode in the queue
write MAX_WRITEBACK_PAGES from each inode queued
break if nr_to_write <= 0
What any other WB_SYNC_NONE writeback (let me call it "normal WB_SYNC_NONE
writeback") does:
queue all dirty inodes
while some inode in the queue
write MAX_WRITEBACK_PAGES from each inode queued
break if nr_to_write <= 0
There only one kind of WB_SYNC_ALL writeback - the one which writes
everything.
So after WB_SYNC_ALL writeback (provided all livelocks are fixed ;)
obviously no old data should be unwritten in memory. Normal WB_SYNC_NONE
writeback differs from a kupdate one *only* in the fact that we queue all
inodes instead of only the old ones. We start writing old inodes first and
go inode by inode writing MAX_WRITEBACK_PAGES from each. Now because the
queue can be longer for normal WB_SYNC_NONE writeback, it can take longer
before we return to the old inodes. So if normal writeback interrupts
kupdate one, it can take longer before all data of old inodes get to disk.
But we always get the old data to disk - essentially at the same time at
which kupdate writeback would get them to disk if dirty_expire_centisecs
was 0.
Is this enough? Do you want any of this in the changelog?
Thanks for the inquiry btw. It made me cleanup my thoughts on the subject ;)
Honza
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
--