From owner-freebsd-current Mon Jul 30 9:28:14 2001 Delivered-To: freebsd-current@freebsd.org Received: from mail.wrs.com (unknown-1-11.windriver.com [147.11.1.11]) by hub.freebsd.org (Postfix) with ESMTP id B8DBE37B401 for ; Mon, 30 Jul 2001 09:28:09 -0700 (PDT) (envelope-from jhb@FreeBSD.org) Received: from laptop.baldwin.cx (john@[147.11.46.217]) by mail.wrs.com (8.9.3/8.9.1) with ESMTP id JAA29580; Mon, 30 Jul 2001 09:28:03 -0700 (PDT) Message-ID: X-Mailer: XFMail 1.4.0 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <200107270107.SAA16462@windsor.research.att.com> Date: Mon, 30 Jul 2001 09:28:03 -0700 (PDT) From: John Baldwin To: Bill Fenner Subject: RE: Lock order reversals that aren't problematic Cc: current@FreeBSD.org Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On 27-Jul-01 Bill Fenner wrote: > > I'm curious what the long-term plan is for witness(4). For > example, it complains about BPF and device locks being reversed > when BPF takes the device out of promiscuous mode -- > > lock order reversal > 1st 0xc04c1560 bpf global lock @ /usr/src/sys/net/bpf.c:365 > 2nd 0xc1302b88 dc1 @ /usr/src/sys/pci/if_dc.c:3251 > > This is because when traffic is being handed to bpf from the > device, the device is locked so witness first sees dc1's > lock and then bpf's. The lock reversal occurs when the socket > is closed; bpfclose() calls bpf_detachd() which calls ifpromisc() > which calls into the device, which obtains its lock, but bpf > is already locked.. > > It's hard to add this case to the blessed_list, since it > can be any ethernet driver paired with bpf. > > Basically, I'm curious if this is a problem that needs to > be solved (i.e. the eventual goal is for witness to never > print any notices) or if this is expected behavior (i.e. > witness is expected to say things and it's up to the developer > to determine if a given thing that witness says is a problem). This is a problem that needs to be solved, since you a lock order reversal means that you can get in a deadlock, which is a Bad Thing (tm). However, the networking stack is being redone, which will involve redoing the network driver locks, so basically the network driver locks are on hold until the stack itself is done. -- John Baldwin -- http://www.FreeBSD.org/~jhb/ PGP Key: http://www.baldwin.cx/~john/pgpkey.asc "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message