From owner-freebsd-current@FreeBSD.ORG Wed Jun 10 18:58:29 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 5DD3B106564A; Wed, 10 Jun 2009 18:58:29 +0000 (UTC) (envelope-from matthew.fleming@isilon.com) Received: from seaxch09.isilon.com (seaxch09.isilon.com [74.85.160.25]) by mx1.freebsd.org (Postfix) with ESMTP id 3B7BB8FC1E; Wed, 10 Jun 2009 18:58:29 +0000 (UTC) (envelope-from matthew.fleming@isilon.com) X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Date: Tue, 9 Jun 2009 09:45:49 -0700 Message-ID: <06D5F9F6F655AD4C92E28B662F7F853E02CC8A29@seaxch09.desktop.isilon.com> In-Reply-To: <20090609163005.GD75569@deviant.kiev.zoral.com.ua> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: panic: knlist not locked, but should be Thread-Index: AcnpH7C6SYxr8U7sQy2GgnHJMBNdeQAAKEcA References: <20090609110540.GA1290@darklight.homeunix.org><200906090937.37562.jhb@freebsd.org><20090609135145.GB1290@darklight.homeunix.org><200906091059.15278.jhb@freebsd.org> <20090609163005.GD75569@deviant.kiev.zoral.com.ua> From: "Matthew Fleming" To: "Kostik Belousov" , "John Baldwin" X-Mailman-Approved-At: Wed, 10 Jun 2009 19:14:38 +0000 Cc: Yuri Pankov , 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: Wed, 10 Jun 2009 18:58:29 -0000 > This appears to be an interaction with the recent changes to use=20 > shared vnode locks for writes on ZFS. Hmm, I think it may be ok to=20 > use a shared vnode lock for kevents on vnodes though. The vnode=20 > interlock should be sufficient locking for what little work the kevent > filters do. As a quick hack for now the MNT_SHARED_WRITES() stuff=20 > could avoid using shared locks 'if (!VN_KNLIST_EMPTY(vp))', but I=20 > think the longer term fix is to not use the vnode locks for vnode kevents, but use the interlock instead. I tried (briefly) using the interlock since Isilon's vnode lock is cluster wide (in our 6.1 based code we got away with using Giant). This got me a LOR report on the interlock: /* * kqueue/VFS interaction */ { "kqueue", &lock_class_mtx_sleep }, { "struct mount mtx", &lock_class_mtx_sleep }, { "vnode interlock", &lock_class_mtx_sleep }, { NULL, NULL }, since knote() will take first the list->kl_lock and then the kqueue lock. I didn't spend any time on it, and switched to using the vnode v_lock for my purposes. But someone added that lock ordering (r166421) for a reason. Cheers, matthew