diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2018-02-10 06:00:07 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2018-02-10 06:00:07 +0000 |
commit | 204d9fc305dc4d345fecf6c0e8f4bee935dedb03 (patch) | |
tree | ba1fdcf80cf4e1fb91d8a88d66587e3d196be3fe /sys/kern/uipc_socket2.c | |
parent | fb5d610df4cdbcfb21380f737eb84f8e91fe2cc9 (diff) |
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@
Diffstat (limited to 'sys/kern/uipc_socket2.c')
-rw-r--r-- | sys/kern/uipc_socket2.c | 5 |
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); |