From: kettenis Date: Sun, 18 Feb 2018 19:11:27 +0000 (+0000) Subject: Revert previous. It triggers mbuf pool exhaustion on arm64. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=c4ed6eca6fbf5440681751930766ba9705ec34f4;p=openbsd Revert previous. It triggers mbuf pool exhaustion on arm64. Requested by claudio@ --- diff --git a/sys/kern/uipc_socket2.c b/sys/kern/uipc_socket2.c index d795315c724..d90d9c906ce 100644 --- a/sys/kern/uipc_socket2.c +++ b/sys/kern/uipc_socket2.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uipc_socket2.c,v 1.90 2018/02/10 06:00:06 claudio Exp $ */ +/* $OpenBSD: uipc_socket2.c,v 1.91 2018/02/18 19:11:27 kettenis Exp $ */ /* $NetBSD: uipc_socket2.c,v 1.11 1996/02/04 02:17:55 christos Exp $ */ /* @@ -464,7 +464,8 @@ 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, cc * 8); + sb->sb_mbmax = max(3 * MAXMCLBYTES, + min(cc * 2, sb_max + (sb_max / MCLBYTES) * MSIZE)); if (sb->sb_lowat > sb->sb_hiwat) sb->sb_lowat = sb->sb_hiwat; return (0);