From owner-freebsd-current@FreeBSD.ORG Tue Jun 9 15:01:39 2009 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 48EC71065731; Tue, 9 Jun 2009 15:01:39 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 195B28FC19; Tue, 9 Jun 2009 15:01:39 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 9E40B46B37; Tue, 9 Jun 2009 11:01:38 -0400 (EDT) Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.8]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 7BF1D8A06A; Tue, 9 Jun 2009 11:01:37 -0400 (EDT) From: John Baldwin To: Yuri Pankov Date: Tue, 9 Jun 2009 10:59:14 -0400 User-Agent: KMail/1.9.7 References: <20090609110540.GA1290@darklight.homeunix.org> <200906090937.37562.jhb@freebsd.org> <20090609135145.GB1290@darklight.homeunix.org> In-Reply-To: <20090609135145.GB1290@darklight.homeunix.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200906091059.15278.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Tue, 09 Jun 2009 11:01:37 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: freebsd-current@freebsd.org, Paul Saab Subject: Re: panic: knlist not locked, but should be 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: Tue, 09 Jun 2009 15:01:39 -0000 On Tuesday 09 June 2009 9:51:45 am Yuri Pankov wrote: > On Tue, Jun 09, 2009 at 09:37:37AM -0400, John Baldwin wrote: > > On Tuesday 09 June 2009 7:05:40 am Yuri Pankov wrote: > > > Hi, > > > > > > I'm getting the following panic when running Firefox+nspluginwrapper > > > (which crashes a lot, but paniced the box only two times, if it's even > > > related). -CURRENT/amd64 20080607. > > > > > > Unread portion of the kernel message buffer: > > > panic: knlist not locked, but should be > > > cpuid = 0 > > > KDB: stack backtrace: > > > db_trace_self_wrapper() at db_trace_self_wrapper+0x2a > > > panic() at panic+0x182 > > > knote() at knote+0xea > > > VOP_WRITE_APV() at VOP_WRITE_APV+0x152 > > > vn_rdwr() at vn_rdwr+0x21d > > > vn_rdwr_inchunks() at vn_rdwr_inchunks+0xc2 > > > elf32_coredump() at elf32_coredump+0x109 > > > sigexit() at sigexit+0x810 > > > postsig() at postsig+0x32f > > > ast() at ast+0x3ac > > > doreti_ast() at doreti_ast+0x1f > > > > Are you using ZFS? > > > > -- > > John Baldwin > > Yes, sorry for not mentioning it. This appears to be an interaction with the recent changes to use shared vnode locks for writes on ZFS. Hmm, I think it may be ok to use a shared vnode lock for kevents on vnodes though. The vnode interlock should be sufficient locking for what little work the kevent filters do. As a quick hack for now the MNT_SHARED_WRITES() stuff could avoid using shared locks 'if (!VN_KNLIST_EMPTY(vp))', but I think the longer term fix is to not use the vnode locks for vnode kevents, but use the interlock instead. -- John Baldwin