From owner-svn-src-head@FreeBSD.ORG Tue Jan 21 17:26:26 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 07790537; Tue, 21 Jan 2014 17:26:26 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CEF3713D3; Tue, 21 Jan 2014 17:26:25 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id BBCCBB96B; Tue, 21 Jan 2014 12:26:24 -0500 (EST) From: John Baldwin To: Rui Paulo Subject: Re: svn commit: r260898 - head/sys/kern Date: Tue, 21 Jan 2014 11:24:33 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20130906; KDE/4.5.5; amd64; ; ) References: <201401200159.s0K1xa5X012123@svn.freebsd.org> <1536225.gsjt6oXMt2@pippin.baldwin.cx> <71438498-A67C-4C7D-8C8B-4A9C199AC1B1@felyko.com> In-Reply-To: <71438498-A67C-4C7D-8C8B-4A9C199AC1B1@felyko.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="windows-1252" Content-Transfer-Encoding: quoted-printable Message-Id: <201401211124.33327.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 21 Jan 2014 12:26:24 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Neel Natu X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jan 2014 17:26:26 -0000 On Monday, January 20, 2014 4:21:13 pm Rui Paulo wrote: > On 20 Jan 2014, at 08:32, John Baldwin wrote: >=20 > > On Sunday 19 January 2014 18:18:03 Rui Paulo wrote: > >> On 19 Jan 2014, at 17:59, Neel Natu wrote: > >>> Author: neel > >>> Date: Mon Jan 20 01:59:35 2014 > >>> New Revision: 260898 > >>> URL: http://svnweb.freebsd.org/changeset/base/260898 > >>>=20 > >>> Log: > >>> Bump up WITNESS_COUNT from 1024 to 1536 so there are sufficient entri= es > >>> for > >>> WITNESS to actually work. > >>=20 > >> This value should be automatically tuned... > >=20 > > How do you propose to do so? This is the count of locks initialized be= fore=20 > > witness' own SYSINIT is executed and the array it sizes is allocated=20 > > statically at compile time. >=20 > Witness is never used (witness_cold) until witness_initialise() is called= , right? Yes, but we'd like to make sure that any locks initialized before then are tracked by witness after that point. > > This used to not be a static array, but an > > intrusive list embedded in locks themselves, but we decided to shave a > > pointer off of each lock that was only used for that and to use a stati= cally=20 > > sized table instead. >=20 > Why don=92t we start with a static value (say 1024) and then reinitialise= and > copy array if it doesn=92t fit instead of crashing the kernel? Where do we get the memory for the new array? If we could malloc it, we wouldn't have a static one. If we could malloc, we would also call witness_initialize() (that is what it is waiting for, the chance to call malloc() for 'struct witness' objects). Hmm, looking at the witness code though, this doesn't result in panics (the one that was bumped here). The pending list panics if it is exhausted, but if WITNESS_COUNT is exhausted witness just turns itself off. We could make the pending list also just turn witness off rather than panic'ing if the pending list panic issue is a dire one. =2D-=20 John Baldwin