summaryrefslogtreecommitdiffstats
path: root/sys/i386/include/sf_buf.h
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2003-12-07 22:49:25 +0000
committeralc <alc@FreeBSD.org>2003-12-07 22:49:25 +0000
commitd821fb3e556486be9a3ec49e1f2eb0ed7d5374bd (patch)
treeee6e54195f8ad195a8b729c8606f3056be6573dd /sys/i386/include/sf_buf.h
parent93908284d5a83d6f1a31b68846e0ce8ddcd252aa (diff)
downloadFreeBSD-src-d821fb3e556486be9a3ec49e1f2eb0ed7d5374bd.zip
FreeBSD-src-d821fb3e556486be9a3ec49e1f2eb0ed7d5374bd.tar.gz
Don't remove the virtual-to-physical mapping when an sf_buf is freed.
Instead, allow the mapping to persist, but add the sf_buf to a free list. If a later sendfile(2) or zero-copy send resends the same physical page, perhaps with the same or different contents, then the mapping overhead is avoided and the sf_buf is simply removed from the free list. In other words, the i386 sf_buf implementation now behaves as a cache of virtual-to-physical translations using an LRU replacement policy on inactive sf_bufs. This is similar in concept to a part of http://www.cs.princeton.edu/~yruan/debox/ patch, but much simpler in implementation. Note: none of this is required on alpha, amd64, or ia64. They now use their direct virtual-to-physical mapping to avoid any emphemeral mapping overheads in their sf_buf implementations.
Diffstat (limited to 'sys/i386/include/sf_buf.h')
-rw-r--r--sys/i386/include/sf_buf.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/i386/include/sf_buf.h b/sys/i386/include/sf_buf.h
index 2784002..7d438f0 100644
--- a/sys/i386/include/sf_buf.h
+++ b/sys/i386/include/sf_buf.h
@@ -35,6 +35,7 @@ struct vm_page;
struct sf_buf {
LIST_ENTRY(sf_buf) list_entry; /* list of buffers */
+ TAILQ_ENTRY(sf_buf) free_entry; /* list of buffers */
struct vm_page *m; /* currently mapped page */
vm_offset_t kva; /* va of mapping */
int ref_count; /* usage of this mapping */
OpenPOWER on IntegriCloud