mdoc(7) police: fix formatting errors in rev 1.27.
This commit is contained in:
parent
b7f97db312
commit
687a7e07cf
|
@ -169,20 +169,34 @@ maintained whether you use MAP_NOSYNC or not. This option is not portable
|
||||||
across UNIX platforms (yet), though some may implement the same behavior
|
across UNIX platforms (yet), though some may implement the same behavior
|
||||||
by default.
|
by default.
|
||||||
.Pp
|
.Pp
|
||||||
WARNING! Extending a file with ftruncate(), thus creating a big hole, and
|
WARNING!
|
||||||
then filling the hole by modifying a shared mmap() can lead to severe
|
Extending a file with
|
||||||
file fragmentation. In order to avoid such fragmentation you should
|
.Xr ftruncate 2 ,
|
||||||
always pre-allocate the file's backing store by write()ing zero's into the
|
thus creating a big hole, and then filling the hole by modifying a shared
|
||||||
newly extended area prior to modifying the area via your mmap().
|
.Fn mmap
|
||||||
The fragmentation problem is especially sensitive to MAP_NOSYNC pages,
|
can lead to severe file fragmentation.
|
||||||
because pages may be flushed to disk in a totally random order.
|
In order to avoid such fragmentation you should always pre-allocate the
|
||||||
|
file's backing store by
|
||||||
|
.Fn write Ns ing
|
||||||
|
zero's into the newly extended area prior to modifying the area via your
|
||||||
|
.Fn mmap .
|
||||||
|
The fragmentation problem is especially sensitive to
|
||||||
|
.Dv MAP_NOSYNC
|
||||||
|
pages, because pages may be flushed to disk in a totally random order.
|
||||||
.Pp
|
.Pp
|
||||||
The same applies when using MAP_NOSYNC to implement a file-based shared
|
The same applies when using
|
||||||
memory store. It is recommended that you create the backing store by
|
.Dv MAP_NOSYNC
|
||||||
write()ing zero's to the backing file rather then ftruncate()ing it. You
|
to implement a file-based shared memory store.
|
||||||
can test file fragmentation by observing the KB/t (kilobytes per transfer)
|
It is recommended that you create the backing store by
|
||||||
results from an 'iostat 1' while reading a large file sequentially, e.g.
|
.Fn write Ns ing
|
||||||
using 'dd if=filename of=/dev/null bs=32k'.
|
zero's to the backing file rather then
|
||||||
|
.Fn ftruncate Ns ing
|
||||||
|
it.
|
||||||
|
You can test file fragmentation by observing the KB/t (kilobytes per
|
||||||
|
transfer) results from an
|
||||||
|
.Dq Li iostat 1
|
||||||
|
while reading a large file sequentially, e.g. using
|
||||||
|
.Dq Li dd if=filename of=/dev/null bs=32k .
|
||||||
.Pp
|
.Pp
|
||||||
The
|
The
|
||||||
.Xr fsync 2
|
.Xr fsync 2
|
||||||
|
|
Loading…
Reference in New Issue