From owner-freebsd-stable@FreeBSD.ORG Wed Dec 14 19:46:35 2011 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AC677106564A for ; Wed, 14 Dec 2011 19:46:35 +0000 (UTC) (envelope-from dan@dan.emsphone.com) Received: from email2.allantgroup.com (email2.emsphone.com [199.67.51.116]) by mx1.freebsd.org (Postfix) with ESMTP id 5711E8FC0A for ; Wed, 14 Dec 2011 19:46:35 +0000 (UTC) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by email2.allantgroup.com (8.14.4/8.14.4) with ESMTP id pBEJkVho094246 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 14 Dec 2011 13:46:32 -0600 (CST) (envelope-from dan@dan.emsphone.com) Received: from dan.emsphone.com (smmsp@localhost [127.0.0.1]) by dan.emsphone.com (8.14.5/8.14.5) with ESMTP id pBEJkVXG073800 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 14 Dec 2011 13:46:31 -0600 (CST) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.14.5/8.14.5/Submit) id pBEJkVZA073799; Wed, 14 Dec 2011 13:46:31 -0600 (CST) (envelope-from dan) Date: Wed, 14 Dec 2011 13:46:30 -0600 From: Dan Nelson To: Doug Barton Message-ID: <20111214194630.GI53453@dan.emsphone.com> References: <4EE29D3F.2030009@gridfury.com> <4EE7C920.3010109@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4EE7C920.3010109@FreeBSD.org> X-OS: FreeBSD 8.2-STABLE User-Agent: Mutt/1.5.21 (2010-09-15) X-Virus-Scanned: clamav-milter 0.97.2 at email2.allantgroup.com X-Virus-Status: Clean X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.6 (email2.allantgroup.com [199.67.51.78]); Wed, 14 Dec 2011 13:46:32 -0600 (CST) X-Scanned-By: MIMEDefang 2.68 on 199.67.51.78 Cc: freebsd-stable@freebsd.org Subject: Re: kernel: negative sbsize for uid = 0 X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Dec 2011 19:46:35 -0000 In the last episode (Dec 13), Doug Barton said: > I'm running 8.2-RELEASE-p4 i386 on some web servers that are generally > lightly-moderately loaded, but occasionally see some heavy spikes where > load average goes way up. When that is happening, but sometimes even when > it's not, I get hundreds of this message spewing into the logs: > > kernel: negative sbsize for uid = 0 > > I haven't found anything particularly useful by searching for that > message, the one reference was to mbufs, but that seems not to be the > problem. Here is the output of 'netstat -m' during one of the load > spikes: [...] > So is this message something to worry about? If so, how can I diagnose > what's happening, and how do I fix it? I've seen it ocassionally too. The error message is printed in /sys/kern/kern_resource.c when the ui_sbsize resource counter goes negative. There's probably insufficient locking somewhere in the functions that call chgsbsize. The increment/decrement is done atomically, but the data pointed to by the "hiwat" argument is read then updated later without an explicit lock, so if that value changes while the function is executing, it could cause problems. ui_sbsize is only used by the resource limiting code, though, so unless you're enforcing an sbsize rlimit, it should be harmless. -- Dan Nelson dnelson@allantgroup.com