From 240bc6d435227960668808f8c4c8a50adb3809db Mon Sep 17 00:00:00 2001 From: claudio Date: Sat, 10 Feb 2018 06:00:06 +0000 Subject: [PATCH] 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@ --- sys/kern/uipc_socket2.c | 5 ++--- 1 file 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); -- 2.20.1