summaryrefslogtreecommitdiffstats
path: root/sys/sys/mbuf.h
diff options
context:
space:
mode:
authorglebius <glebius@FreeBSD.org>2014-07-11 19:40:50 +0000
committerglebius <glebius@FreeBSD.org>2014-07-11 19:40:50 +0000
commit1b591cdaa850f86c2091fced7ba790ac0bbef35a (patch)
treed39235ea546a9d1310ed21dec1dc4edd42980c35 /sys/sys/mbuf.h
parentd1d1e8d008a8740852b8d9f8e4db7db45c6e368c (diff)
downloadFreeBSD-src-1b591cdaa850f86c2091fced7ba790ac0bbef35a.zip
FreeBSD-src-1b591cdaa850f86c2091fced7ba790ac0bbef35a.tar.gz
Improve reference counting of EXT_SFBUF pages attached to mbufs.
o Do not use UMA refcount zone. The problem with this zone is that several refcounting words (16 on amd64) share the same cache line, and issueing atomic(9) updates on them creates cache line contention. Also, allocating and freeing them is extra CPU cycles. Instead, refcount the page directly via vm_page_wire() and the sfbuf via sf_buf_alloc(sf_buf_page(sf)) [1]. o Call refcounting/freeing function for EXT_SFBUF via direct function call, instead of function pointer. This removes barrier for CPU branch predictor. o Do not cleanup the mbuf to be freed in mb_free_ext(), merely to satisfy assertion in mb_dtor_mbuf(). Remove the assertion from mb_dtor_mbuf(). Use bcopy() instead of manual assignments to copy m_ext in mb_dupcl(). [1] This has some problems for now. Using sf_buf_alloc() merely to increase refcount is expensive, and is broken on sparc64. To be fixed. Sponsored by: Netflix Sponsored by: Nginx, Inc.
Diffstat (limited to 'sys/sys/mbuf.h')
-rw-r--r--sys/sys/mbuf.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/sys/mbuf.h b/sys/sys/mbuf.h
index b092c0c..83ad3c3 100644
--- a/sys/sys/mbuf.h
+++ b/sys/sys/mbuf.h
@@ -374,6 +374,12 @@ struct mbuf {
"\30EXT_FLAG_EXP4"
/*
+ * External reference/free functions.
+ */
+void sf_ext_ref(void *, void *);
+void sf_ext_free(void *, void *);
+
+/*
* Flags indicating checksum, segmentation and other offload work to be
* done, or already done, by hardware or lower layers. It is split into
* separate inbound and outbound flags.
OpenPOWER on IntegriCloud