summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>2000-12-04 08:11:50 +0000
committerru <ru@FreeBSD.org>2000-12-04 08:11:50 +0000
commit644a5df9448046fccace90b55aa19c715d75e297 (patch)
treed865fd3fa291c23f7354b1dbff96a9d6601c2b80 /lib
parentf081127113115e7eb8f1ed5ab3ff8abd00876e80 (diff)
downloadFreeBSD-src-644a5df9448046fccace90b55aa19c715d75e297.zip
FreeBSD-src-644a5df9448046fccace90b55aa19c715d75e297.tar.gz
mdoc(7) police: fix formatting errors in rev 1.27.
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/sys/mmap.240
1 files changed, 27 insertions, 13 deletions
diff --git a/lib/libc/sys/mmap.2 b/lib/libc/sys/mmap.2
index 30c8960..7dc5520 100644
--- a/lib/libc/sys/mmap.2
+++ b/lib/libc/sys/mmap.2
@@ -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
by default.
.Pp
-WARNING! Extending a file with ftruncate(), thus creating a big hole, and
-then filling the hole by modifying a shared mmap() can lead to severe
-file fragmentation. In order to avoid such fragmentation you should
-always pre-allocate the file's backing store by write()ing zero's into the
-newly extended area prior to modifying the area via your mmap().
-The fragmentation problem is especially sensitive to MAP_NOSYNC pages,
-because pages may be flushed to disk in a totally random order.
+WARNING!
+Extending a file with
+.Xr ftruncate 2 ,
+thus creating a big hole, and then filling the hole by modifying a shared
+.Fn mmap
+can lead to severe file fragmentation.
+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
-The same applies when using MAP_NOSYNC to implement a file-based shared
-memory store. It is recommended that you create the backing store by
-write()ing zero's to the backing file rather then ftruncate()ing it. You
-can test file fragmentation by observing the KB/t (kilobytes per transfer)
-results from an 'iostat 1' while reading a large file sequentially, e.g.
-using 'dd if=filename of=/dev/null bs=32k'.
+The same applies when using
+.Dv MAP_NOSYNC
+to implement a file-based shared memory store.
+It is recommended that you create the backing store by
+.Fn write Ns ing
+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
The
.Xr fsync 2
OpenPOWER on IntegriCloud