diff options
author | jhb <jhb@FreeBSD.org> | 2012-06-19 18:42:24 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2012-06-19 18:42:24 +0000 |
commit | 571562fffb435a478f0591879dd19fe9227cb52e (patch) | |
tree | 141cada499e4a3898e0f0daa125723e411568387 /lib/libc | |
parent | e551b0ecfb98653b427343a9dc4e018566a78913 (diff) | |
download | FreeBSD-src-571562fffb435a478f0591879dd19fe9227cb52e.zip FreeBSD-src-571562fffb435a478f0591879dd19fe9227cb52e.tar.gz |
Further refine the implementation of POSIX_FADV_NOREUSE.
First, extend the changes in r230782 to better handle the common case
of using NOREUSE with sequential reads. A NOREUSE file descriptor
will now track the last implicit DONTNEED request it made as a result
of a NOREUSE read. If a subsequent NOREUSE read is adjacent to the
previous range, it will apply the DONTNEED request to the entire range
of both the previous read and the current read. The effect is that
each read of a file accessed sequentially will apply the DONTNEED
request to the entire range that has been read. This allows NOREUSE
to properly handle misaligned reads by flushing each buffer to cache
once it has been completely read.
Second, apply the same changes made to read(2) by r230782 and this
change to writes. This provides much better performance in the
sequential write case as it allows writes to still be clustered. It
also provides much better performance for misaligned writes. It does
mean that NOREUSE will be generally ineffective for non-sequential
writes as the current implementation relies on a future NOREUSE
write's implicit DONTNEED request to flush the dirty buffer from the
current write.
MFC after: 2 weeks
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/sys/posix_fadvise.2 | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/libc/sys/posix_fadvise.2 b/lib/libc/sys/posix_fadvise.2 index 37453ff..f303f42 100644 --- a/lib/libc/sys/posix_fadvise.2 +++ b/lib/libc/sys/posix_fadvise.2 @@ -28,7 +28,7 @@ .\" @(#)madvise.2 8.1 (Berkeley) 6/9/93 .\" $FreeBSD$ .\" -.Dd February 25, 2012 +.Dd June 19, 2012 .Dt POSIX_FADVISE 2 .Os .Sh NAME @@ -84,10 +84,9 @@ specified range and future access to this data may require a read operation. .It Dv POSIX_FADV_NOREUSE Tells the system that the specified data will only be accessed once and then not reused. -Accesses to data within the specified range are treated as if the file -descriptor has the -.Dv O_DIRECT -flag enabled. +The system may decrease the in-memory priority of data once it has been +read or written. +Future access to this data may require a read operation. .El .Sh RETURN VALUES .Rv -std posix_fadvise |