From owner-freebsd-current@FreeBSD.ORG Wed Oct 24 14:26:59 2012 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7187CBD4 for ; Wed, 24 Oct 2012 14:26:59 +0000 (UTC) (envelope-from freebsd-current@m.gmane.org) Received: from plane.gmane.org (plane.gmane.org [80.91.229.3]) by mx1.freebsd.org (Postfix) with ESMTP id 250418FC08 for ; Wed, 24 Oct 2012 14:26:58 +0000 (UTC) Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1TR1vB-0008IO-VP for freebsd-current@freebsd.org; Wed, 24 Oct 2012 16:27:01 +0200 Received: from broadband-77-37-234-86.nationalcablenetworks.ru ([77.37.234.86]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 24 Oct 2012 16:27:01 +0200 Received: from vadim_nuclight by broadband-77-37-234-86.nationalcablenetworks.ru with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 24 Oct 2012 16:27:01 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-current@freebsd.org From: Vadim Goncharov Subject: maxusers (thus mbuf etc.) autotuning capped at 384 Date: Wed, 24 Oct 2012 14:26:43 +0000 (UTC) Organization: Nuclear Lightning @ Moscow, Home Lines: 37 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: broadband-77-37-234-86.nationalcablenetworks.ru X-Comment-To: All User-Agent: slrn/0.9.9p1 (FreeBSD) Cc: freebsd-net@freebsd.org X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: vadim_nuclight@mail.ru List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Oct 2012 14:26:59 -0000 Hi, We have 'maxusers' tunable which affects many other tunables, e.g. number of network mbuf/clusters which is often too low on current machines. There is code in sys/kern/subr_param.c: if (maxusers == 0) { maxusers = physpages / (2 * 1024 * 1024 / PAGE_SIZE); if (maxusers < 32) maxusers = 32; if (maxusers > 384) maxusers = 384; } It was capped to 384 for i386 KVM size limits in r89769, so that amd64, not constrained to 1Gb KVA, suffers from this. I suspect that 384 may be wrong even for i386 today, but let's be conservative and limit maxusers to 384 per 1 Gb of KVM, like this: #define _MAX_MAXUSERS (((VM_MAX_KERNEL_ADDRESS - \ KERNBASE) / (8 * 1024 * 1024)) * 3) if (maxusers == 0) { maxusers = physpages / (2 * 1024 * 1024 / PAGE_SIZE); if (maxusers < 32) maxusers = 32; if (maxusers > _MAX_MAXUSERS) maxusers = _MAX_MAXUSERS; } #undef _MAX_MAXUSERS Any better ideas? -- WBR, Vadim Goncharov. ICQ#166852181 mailto:vadim_nuclight@mail.ru [Anti-Greenpeace][Sober FreeBSD zealot][http://nuclight.livejournal.com]