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@
-/* $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 $ */
/*
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);