From owner-freebsd-stable@FreeBSD.ORG Sat Apr 25 19:16:58 2009 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A10241065670; Sat, 25 Apr 2009 19:16:58 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 7B4528FC19; Sat, 25 Apr 2009 19:16:58 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id E413946B2C; Sat, 25 Apr 2009 15:16:57 -0400 (EDT) Date: Sat, 25 Apr 2009 20:16:57 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Ruslan Ermilov In-Reply-To: <20090421153112.GA47589@edoofus.dev.vega.ru> Message-ID: References: <200904210524.n3L5O9YS086865@lava.sentex.ca> <200904211111.57295.jhb@freebsd.org> <200904211519.n3LFJFsk090691@lava.sentex.ca> <20090421153112.GA47589@edoofus.dev.vega.ru> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-stable@freebsd.org, John Baldwin Subject: Re: RELENG_7 crash X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Apr 2009 19:16:58 -0000 On Tue, 21 Apr 2009, Ruslan Ermilov wrote: >> Is it possible I am running into some of the interface lock fixes rwatson >> has been working on ? This box has a lot of ng interfaces which come and >> go. Perhaps snmp asking about an interface that just went away caused the >> panic ? I disabled bsnmp since the reboot and the box has been up for 10hrs >> so far. >> > It's a documented bug: Just to follow up on this thread: I've committed a work-around to 7-STABLE as well as the 7.2 release engineering branch. The on-going ifnet reference-counting/address list locking/etc work in 8-CURRENT is the long-term solution, and I will MFC it after 7.2 is out the door and it's settled some, but with any luck the work-around will prevent instant panics in the described scenario. Robert N M Watson Computer Laboratory University of Cambridge > > : revision 1.281 > : date: 2008/06/26 23:05:28; author: rwatson; state: Exp; lines: +69 -12 > : SVN rev 180042 on 2008-06-26 23:05:28Z by rwatson > : > : Introduce locking around use of ifindex_table, whose use was previously > : unsynchronized. While races were extremely rare, we've now had a > : couple of reports of panics in environments involving large numbers of > : IPSEC tunnels being added very quickly on an active system. > : > : - Add accessor functions ifnet_byindex(), ifaddr_byindex(), > : ifdev_byindex() to replace existing accessor macros. These functions > : now acquire the ifnet lock before derefencing the table. > : - Add IFNET_WLOCK_ASSERT(). > : - Add static accessor functions ifnet_setbyindex(), ifdev_setbyindex(), > : which set values in the table either asserting of acquiring the ifnet > : lock. > : - Use accessor functions throughout if.c to modify and read > : ifindex_table. > : - Rework ifnet attach/detach to lock around ifindex_table modification. > : > : Note that these changes simply close races around use of ifindex_table, > : and make no attempt to solve the probem of disappearing ifnets. Further > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > : refinement of this work, including with respect to ifindex_table > : resizing, is still required. > : > : In a future change, the ifnet lock should be converted from a mutex to an > : rwlock in order to reduce contention. > : > : Reviewed and tested by: brooks > > > Cheers, > -- > Ruslan Ermilov > ru@FreeBSD.org > FreeBSD committer >