summaryrefslogtreecommitdiffstats
path: root/sys/sys/mbuf.h
diff options
context:
space:
mode:
authorglebius <glebius@FreeBSD.org>2016-01-08 20:34:57 +0000
committerglebius <glebius@FreeBSD.org>2016-01-08 20:34:57 +0000
commitaaa09777e1d9fde5591814af536025be01a0182f (patch)
treeffa24924b5fa8fa8a6a9433a56b73c595e5d33b6 /sys/sys/mbuf.h
parentad8ebc35bb92f3a458fcde1049b19656ef5e614d (diff)
downloadFreeBSD-src-aaa09777e1d9fde5591814af536025be01a0182f.zip
FreeBSD-src-aaa09777e1d9fde5591814af536025be01a0182f.tar.gz
New sendfile(2) syscall. A joint effort of NGINX and Netflix from 2013 and
up to now. The new sendfile is the code that Netflix uses to send their multiple tens of gigabits of data per second. The new implementation features asynchronous I/O, when I/O operations are launched, but not awaited to be complete. An explanation of why such behavior is beneficial compared to old one is going to be too long for a commit message, so we will skip it here. Additional features of new syscall are extra flags, which provide an application more control over data sent. The SF_NOCACHE flag tells kernel that data shouldn't be cached after it was sent. The SF_READAHEAD() macro allows to specify readahead size in pages. The new syscalls is a drop in replacement. No modifications are required to applications. One can take nginx binary for stable/10 and run it successfully on head. Although SF_NODISKIO lost its original sense, as now sendfile doesn't block, and now means something completely different (tm), using the new sendfile the old way is absolutely safe. Celebrates: Netflix global launch! Sponsored by: Nginx, Inc. Sponsored by: Netflix Relnotes: yes
Diffstat (limited to 'sys/sys/mbuf.h')
-rw-r--r--sys/sys/mbuf.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/sys/mbuf.h b/sys/sys/mbuf.h
index 8509a6c..91dd895 100644
--- a/sys/sys/mbuf.h
+++ b/sys/sys/mbuf.h
@@ -343,12 +343,13 @@ struct mbuf {
* External mbuf storage buffer types.
*/
#define EXT_CLUSTER 1 /* mbuf cluster */
-#define EXT_SFBUF 2 /* sendfile(2)'s sf_bufs */
+#define EXT_SFBUF 2 /* sendfile(2)'s sf_buf */
#define EXT_JUMBOP 3 /* jumbo cluster page sized */
#define EXT_JUMBO9 4 /* jumbo cluster 9216 bytes */
#define EXT_JUMBO16 5 /* jumbo cluster 16184 bytes */
#define EXT_PACKET 6 /* mbuf+cluster from packet zone */
#define EXT_MBUF 7 /* external mbuf reference (M_IOVEC) */
+#define EXT_SFBUF_NOCACHE 8 /* sendfile(2)'s sf_buf not to be cached */
#define EXT_VENDOR1 224 /* for vendor-internal use */
#define EXT_VENDOR2 225 /* for vendor-internal use */
@@ -397,6 +398,7 @@ struct mbuf {
*/
void sf_ext_ref(void *, void *);
void sf_ext_free(void *, void *);
+void sf_ext_free_nocache(void *, void *);
/*
* Flags indicating checksum, segmentation and other offload work to be
OpenPOWER on IntegriCloud