Flash page cache in linux page

There is a page cache before writing data to disk.

So, if I have two operations.

write(fileA)
write(fileB)

Then, if the system suddenly shuts down. We do not initiate a call to the sync () call.

I want to know if it is possible that the data that we wrote to fileB went into the drive and the data that we wrote to fileA were not connected to the disk?

+4
source share
2 answers

I believe that file B can be written to disk before file A, because the records will be associated with block I / O and can be reordered at the block device level by the I / O scheduler in an attempt to minimize disk search.

- () . : http://lxr.free-electrons.com/source/Documentation/block/biodoc.txt#L885

+4

, sync() fsync() write(), , .

flush ( pdflush) . shutdown , / . , , , / , , .

sync() , . , ( ) sysctl . , :

vm.dirty_expire_centisecs - ( 1/100 )

vm.dirty_writeback_centisecs - ​​ BDI-flush thread

vm.dirty_background_ratio - , ,

vm.dirty_ratio - , , ,

0

All Articles