From owner-svn-src-all@FreeBSD.ORG Wed Jun 10 21:45:08 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2CF001065670; Wed, 10 Jun 2009 21:45:08 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.cksoft.de (mail.cksoft.de [195.88.108.3]) by mx1.freebsd.org (Postfix) with ESMTP id AF19A8FC1E; Wed, 10 Jun 2009 21:45:07 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from localhost (amavis.fra.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id D6C4341C730; Wed, 10 Jun 2009 23:45:06 +0200 (CEST) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([195.88.108.3]) by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id ZEsW15nE9rxG; Wed, 10 Jun 2009 23:45:06 +0200 (CEST) Received: by mail.cksoft.de (Postfix, from userid 66) id 086B641C6EA; Wed, 10 Jun 2009 23:45:06 +0200 (CEST) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id 920954448E6; Wed, 10 Jun 2009 21:42:19 +0000 (UTC) Date: Wed, 10 Jun 2009 21:42:19 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: Konstantin Belousov In-Reply-To: <200906102059.n5AKxXx0025758@svn.freebsd.org> Message-ID: <20090610214134.R22887@maildrop.int.zabbadoz.net> References: <200906102059.n5AKxXx0025758@svn.freebsd.org> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r193951 - in head/sys: cam/scsi i386/acpica kern net security/audit sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Jun 2009 21:45:08 -0000 On Wed, 10 Jun 2009, Konstantin Belousov wrote: > Author: kib > Date: Wed Jun 10 20:59:32 2009 > New Revision: 193951 > URL: http://svn.freebsd.org/changeset/base/193951 > > Log: > Adapt vfs kqfilter to the shared vnode lock used by zfs write vop. Use > vnode interlock to protect the knote fields [1]. The locking assumes > that shared vnode lock is held, thus we get exclusive access to knote > either by exclusive vnode lock protection, or by shared vnode lock + > vnode interlock. > > Do not use kl_locked() method to assert either lock ownership or the > fact that curthread does not own the lock. For shared locks, ownership > is not recorded, e.g. VOP_ISLOCKED can return LK_SHARED for the shared > lock not owned by curthread, causing false positives in kqueue subsystem > assertions about knlist lock. > > Remove kl_locked method from knlist lock vector, and add two separate > assertion methods kl_assert_locked and kl_assert_unlocked, that are > supposed to use proper asserts. Change knlist_init accordingly. > > Add convenience function knlist_init_mtx to reduce number of arguments > for typical knlist initialization. > > Submitted by: jhb [1] > Noted by: jhb [2] > Reviewed by: jhb > Tested by: rnoland > > Modified: > head/sys/cam/scsi/scsi_target.c > head/sys/i386/acpica/acpi_machdep.c > head/sys/kern/init_main.c > head/sys/kern/kern_event.c > head/sys/kern/kern_fork.c > head/sys/kern/sys_pipe.c > head/sys/kern/tty.c > head/sys/kern/tty_pts.c > head/sys/kern/uipc_mqueue.c > head/sys/kern/uipc_socket.c > head/sys/kern/vfs_aio.c > head/sys/kern/vfs_subr.c > head/sys/net/bpf.c > head/sys/net/if.c > head/sys/net/if_tap.c > head/sys/net/if_tun.c > head/sys/security/audit/audit_pipe.c > head/sys/sys/event.h This change, changes the size of struct vnet; all (network) modules need to be recompiled. > Modified: head/sys/sys/event.h > ============================================================================== > --- head/sys/sys/event.h Wed Jun 10 20:57:06 2009 (r193950) > +++ head/sys/sys/event.h Wed Jun 10 20:59:32 2009 (r193951) > @@ -124,7 +124,8 @@ struct knlist { > struct klist kl_list; > void (*kl_lock)(void *); /* lock function */ > void (*kl_unlock)(void *); > - int (*kl_locked)(void *); > + void (*kl_assert_locked)(void *); > + void (*kl_assert_unlocked)(void *); > void *kl_lockarg; /* argument passed to kl_lockf() */ > }; > > @@ -203,6 +204,7 @@ struct kevent_copyops { > struct thread; > struct proc; > struct knlist; > +struct mtx; > > extern void knote(struct knlist *list, long hint, int islocked); > extern void knote_fork(struct knlist *list, int pid); > @@ -212,7 +214,8 @@ extern void knlist_remove_inevent(struct > extern int knlist_empty(struct knlist *knl); > extern void knlist_init(struct knlist *knl, void *lock, > void (*kl_lock)(void *), void (*kl_unlock)(void *), > - int (*kl_locked)(void *)); > + void (*kl_assert_locked)(void *), void (*kl_assert_unlocked)(void *)); > +extern void knlist_init_mtx(struct knlist *knl, struct mtx *lock); > extern void knlist_destroy(struct knlist *knl); > extern void knlist_cleardel(struct knlist *knl, struct thread *td, > int islocked, int killkn); > -- Bjoern A. Zeeb The greatest risk is not taking one.