An alternative to the application barrier() call
Posted Sep 14, 2009 22:16 UTC (Mon) by
anton (guest, #25547)
In reply to:
An alternative to the application barrier() call by dlang
Parent article:
POSIX v. reality: A position on O_PONIES
Fortunately writes on the file system level can be merged across file
system barriers, resulting in few barriers that have to be passed to
the block device level. So there is no need to pass a block device
barrier down for every file system barrier.
And since it is possible to implement these implicit barriers between each write efficiently (by merging writes), why burden
programmers with inserting explicit file system barriers? Look at how
long the Linux kernel hackers needed to use block device barriers in
the file system code. Do you really expect application developers to
do it at all? And if they did, how would they test it? This has the
same untestability properties as asking application programmers to use
fsync.
Concerning the risk-loving performance freaks, they will use the
latest and greatest file system by Ted T'so instead of one that offers
either implicit or explicit barriers, but of course they will not use
fsync() on that file system:-).
BTW, if you also implement block device writes by avoiding
overwriting live sectors and by using commit sectors, then you can
implement mergeable writes at the block device level, too (e.g., for
making them cheaper in an array). However, the file system will not
request a block device barrier often, so there is no need to go to such complexity
(unless you need it for other purposes, such as when your block device
is a flash device).
(
Log in to post comments)