diff options
author | alc <alc@FreeBSD.org> | 2003-11-17 18:22:24 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2003-11-17 18:22:24 +0000 |
commit | 3172dd04e4121272d5c2b16c9678d2b57052090c (patch) | |
tree | 6b87e128d7a6e13b1f766368c51171f53d4ae7c2 /sys/i386/include/sf_buf.h | |
parent | e89562677afe1d756d2179436ba4db8c23d787ab (diff) | |
download | FreeBSD-src-3172dd04e4121272d5c2b16c9678d2b57052090c.zip FreeBSD-src-3172dd04e4121272d5c2b16c9678d2b57052090c.tar.gz |
- Change the i386's sf_buf implementation so that it never allocates
more than one sf_buf for one vm_page. To accomplish this, we add
a global hash table mapping vm_pages to sf_bufs and a reference
count to each sf_buf. (This is similar to the patches for RELENG_4
at http://www.cs.princeton.edu/~yruan/debox/.)
For the uninitiated, an sf_buf is nothing more than a kernel virtual
address that is used for temporary virtual-to-physical mappings by
sendfile(2) and zero-copy sockets. As such, there is no reason for
one vm_page to have several sf_bufs mapping it. In fact, using more
than one sf_buf for a single vm_page increases the likelihood that
sendfile(2) blocks, hurting throughput.
(See http://www.cs.princeton.edu/~yruan/debox/.)
Diffstat (limited to 'sys/i386/include/sf_buf.h')
-rw-r--r-- | sys/i386/include/sf_buf.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/i386/include/sf_buf.h b/sys/i386/include/sf_buf.h index b6ee1cc..2784002 100644 --- a/sys/i386/include/sf_buf.h +++ b/sys/i386/include/sf_buf.h @@ -34,9 +34,10 @@ struct vm_page; struct sf_buf { - SLIST_ENTRY(sf_buf) free_list; /* list of free buffer slots */ + LIST_ENTRY(sf_buf) list_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 */ }; static __inline vm_offset_t |