diff options
author | glebius <glebius@FreeBSD.org> | 2014-07-11 19:40:50 +0000 |
---|---|---|
committer | glebius <glebius@FreeBSD.org> | 2014-07-11 19:40:50 +0000 |
commit | 1b591cdaa850f86c2091fced7ba790ac0bbef35a (patch) | |
tree | d39235ea546a9d1310ed21dec1dc4edd42980c35 /sys/sys/sf_buf.h | |
parent | d1d1e8d008a8740852b8d9f8e4db7db45c6e368c (diff) | |
download | FreeBSD-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/sf_buf.h')
-rw-r--r-- | sys/sys/sf_buf.h | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/sys/sys/sf_buf.h b/sys/sys/sf_buf.h index 58e3bcb..07871dd 100644 --- a/sys/sys/sf_buf.h +++ b/sys/sys/sf_buf.h @@ -52,7 +52,6 @@ struct sfstat { /* sendfile statistics */ #include <machine/sf_buf.h> #include <sys/systm.h> #include <sys/counter.h> -struct mbuf; /* for sf_buf_mext() */ extern counter_u64_t sfstat[sizeof(struct sfstat) / sizeof(uint64_t)]; #define SFSTAT_ADD(name, val) \ @@ -60,7 +59,4 @@ extern counter_u64_t sfstat[sizeof(struct sfstat) / sizeof(uint64_t)]; (val)) #define SFSTAT_INC(name) SFSTAT_ADD(name, 1) #endif /* _KERNEL */ - -void sf_buf_mext(struct mbuf *mb, void *addr, void *args); - #endif /* !_SYS_SF_BUF_H_ */ |