summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorclaudio <claudio@openbsd.org>2018-02-10 06:00:06 +0000
committerclaudio <claudio@openbsd.org>2018-02-10 06:00:06 +0000
commit240bc6d435227960668808f8c4c8a50adb3809db (patch)
treef1d1fb46f0ed2b42779c4f245e0712f7309a0ad9
parentinstaller bits for RFC 7217 support (diff)
downloadwireguard-openbsd-240bc6d435227960668808f8c4c8a50adb3809db.tar.xz
wireguard-openbsd-240bc6d435227960668808f8c4c8a50adb3809db.zip
mbufs and mbuf clusters are now backed by large pools. Because of this
we can relax the oversubscribe limit of socketbuffers a fair bit. Instead of maxing out as sb_max * 1.125 or 2 * sb_hiwat the maximum is increased to 8 * sb_hiwat -- which seems to be a good compromise between memory waste and better socket buffer usage. OK deraadt@
-rw-r--r--sys/kern/uipc_socket2.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/kern/uipc_socket2.c b/sys/kern/uipc_socket2.c
index a7c6ba1f576..d795315c724 100644
--- a/sys/kern/uipc_socket2.c
+++ b/sys/kern/uipc_socket2.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uipc_socket2.c,v 1.89 2017/12/30 20:47:00 guenther Exp $ */
+/* $OpenBSD: uipc_socket2.c,v 1.90 2018/02/10 06:00:06 claudio Exp $ */
/* $NetBSD: uipc_socket2.c,v 1.11 1996/02/04 02:17:55 christos Exp $ */
/*
@@ -464,8 +464,7 @@ sbreserve(struct socket *so, struct sockbuf *sb, u_long cc)
if (cc == 0 || cc > sb_max)
return (1);
sb->sb_hiwat = cc;
- sb->sb_mbmax = max(3 * MAXMCLBYTES,
- min(cc * 2, sb_max + (sb_max / MCLBYTES) * MSIZE));
+ sb->sb_mbmax = max(3 * MAXMCLBYTES, cc * 8);
if (sb->sb_lowat > sb->sb_hiwat)
sb->sb_lowat = sb->sb_hiwat;
return (0);