From owner-freebsd-current@FreeBSD.ORG Wed Jan 30 15:12:03 2008 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0AF5C16A468 for ; Wed, 30 Jan 2008 15:12:03 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.158]) by mx1.freebsd.org (Postfix) with ESMTP id 7F42D13C45D for ; Wed, 30 Jan 2008 15:12:02 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: by fg-out-1718.google.com with SMTP id 16so290673fgg.35 for ; Wed, 30 Jan 2008 07:12:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; bh=DY7EICzrKL8O0ShPmJ+u595c709Uezpni7ucFzTdQlk=; b=r6tqBnw3jv1JBn/B/OmmHbMQTZxxYSF1xOQc2l8XqhYg5ZjMHMXXahffh00gV4GOPwIkT9UNnkPH7ECe8uqOJqkcr9a7mzngXu0Kbbs/YE/tSQ9hJR0RATNlBSfH/lrSMdx6N1IPAQlb/T1VjAV7+4XMUCRuEOnoi43Ypd0sgI8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=mR35MO13BBQrgmKB52Hd3Q9wfs2FfXY2+p3GvClSDDLGg+n1pKYsY6FQi6pYl/+HA+t+zMZ6g5t/p1Rojecj54t2n5fBpnYALjOiNCje7eNbMEvkNY24e6gLBKD8Hbb5LFWHEassCv+xJ3+Cn6paqx5TtLUZw3l0smbXKS0K3i4= Received: by 10.86.59.2 with SMTP id h2mr740830fga.78.1201705921101; Wed, 30 Jan 2008 07:12:01 -0800 (PST) Received: by 10.86.28.19 with HTTP; Wed, 30 Jan 2008 07:12:01 -0800 (PST) Message-ID: <3bbf2fe10801300712j2fa58aao163059ec9ed91882@mail.gmail.com> Date: Wed, 30 Jan 2008 16:12:01 +0100 From: "Attilio Rao" Sender: asmrookie@gmail.com To: "Yar Tikhiy" In-Reply-To: <3bbf2fe10801300707u3fd121c0k199605c2f0be6cbf@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <3bbf2fe10801250000k5852c2f2j5d1897c900096818@mail.gmail.com> <3bbf2fe10801260918k56c1a73hf28ff154eca0b74c@mail.gmail.com> <479BBDAA.6000008@FreeBSD.org> <3bbf2fe10801261657x7d7c9de4q71adeaf3a2dd8159@mail.gmail.com> <479C0B5B.9030709@FreeBSD.org> <3bbf2fe10801270642m5ec609d8xb29add77ced36d8a@mail.gmail.com> <479FA3E8.10606@FreeBSD.org> <3bbf2fe10801291411v302dd33at54ebe538397e8fac@mail.gmail.com> <20080130130820.GA88429@comp.chem.msu.su> <3bbf2fe10801300707u3fd121c0k199605c2f0be6cbf@mail.gmail.com> X-Google-Sender-Auth: ab3ea338f2aa82be Cc: Kostik Belousov , Doug Barton , freebsd-current@freebsd.org Subject: Re: panic: System call lstat returning with 1 locks held X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jan 2008 15:12:03 -0000 2008/1/30, Attilio Rao : > 2008/1/30, Yar Tikhiy : > > On Tue, Jan 29, 2008 at 11:11:13PM +0100, Attilio Rao wrote: > > > > > > I'm committing my WITNESS patch now to perforce so that other people > > > can hopefully stress-test it before to be committed. > > > > Do you think that that patch is applicable in my case? I.e., shall > > I use it to get more debug info on my panics? > > > > If so, where is the patched file in the depot? > > Sorry but I had to delay the operation so far. > In the end, a suitable patch is located here: > http://www.freebsd.org/~attilio/witness_lockmgr.diff > > I tried it and it alredy reported 4 LORs just when booting the kernel :) > So I would expect reasonably LOR cascades with this patch. > > If you all 3 (Scot, Yar and Doug) could try and test it I would > appreciate a lot. > > Thanks, > Attilio > > PS: This is the commit log to perforce: > Add WITNESS support to lockmgr. > A couple of notes: > - Two options have been added in order to serve WITNESS: > * LK_NOWITNESS which disables the support for the specified > lock > * LK_NODUP which disallows the usual DUPOK behaviour > assumed as the default with lockmgr > - In the case of lockmgr_disown() the lock is simply dropped. > This means that a printout won't show the lock held even if it > is basically held by LK_KERNPROC > - In the case of upgrade we can have 3 different cases: > * The shared lock is unheld but consequent acquisition > fails; in this case the lock is reported dropped > * We are the first upgrader so there is an effective > WITNESS_UPGRADE > * We are not the first upgrader so after the shared unlocking > we need to acquire the lock in exclusive mode; this will be > reported with 2 different WITNESS steps. > - In the case of LK_DRAIN the lock will be only checked about the > order but it won't be marked as acquired. This happens because a > drained lock is directly destroyed and not really released, so > witness_destroy() would badly panic in this case What I forgot to mention in this log is that the patch also fixes what seems a bug to me in the case a thread holds an exclusive lock and tries to acquire the same lock in a shared way. What happens in current CVS code is that the lock cames downgraded, but it seems to be handled badly so this patch should fix the behaviour. Attilio -- Peace can only be achieved by understanding - A. Einstein