From owner-freebsd-arch@FreeBSD.ORG Tue Jul 17 12:21:41 2007 Return-Path: X-Original-To: arch@FreeBSD.org Delivered-To: freebsd-arch@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 40AED16A401; Tue, 17 Jul 2007 12:21:41 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [209.31.154.42]) by mx1.freebsd.org (Postfix) with ESMTP id EC8B513C471; Tue, 17 Jul 2007 12:21:40 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [209.31.154.41]) by cyrus.watson.org (Postfix) with ESMTP id E294E48B1F; Tue, 17 Jul 2007 08:21:36 -0400 (EDT) Date: Tue, 17 Jul 2007 13:21:36 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: current@FreeBSD.org, arch@FreeBSD.org Message-ID: <20070717131518.G1177@fledge.watson.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Subject: Reminder: NET_NEEDS_GIANT, debug.mpsafenet going away in 7.0 X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jul 2007 12:21:41 -0000 Dear all: This is a reminder e-mail that, in the very near future, Giant compatibility shims for network protocols will be removed. These shimmed allowed Giant to be re-enabeld over the network stack as a result of linking in a service that required Giant (now all removed), or by setting the debug.mpsafenet variable to 1. This means that the following will no longer be present: debug.mpsafenet sysctl debug_mpsafenet global variable NET_NEEDS_GIANT() NET_LOCK_GIANT(), NET_UNLOCK_GIANT(), NET_ASSERT_GIANT() NET_CALLOUT_MPSAFE All instances of NET_{LOCK,UNLOCK,ASSERT}_GIANT() will be removed as they will no be no-ops. The (unused) definition of NET_NEEDS_GIANT() will be removed. The debug.mpsafenet sysctl and debug_mpsafenet global variable will be removed. All instances of NET_CALLOUT_MPSAFE will be converted mechanically to CALLOUT_MPSAFE. The *only* remaining case I am aware of where removing debug.mpsafenet presents an issue is credential-related firewall rules (uid, gid, jail). I'm am currently in an active e-mail discussion with the various firewall maintainers about how to address this issue; as the implementations of these rules violate the global lock order, deadlocks occur if debug.mpsafenet isn't set to 1, which causes Giant to act as a guard lock preventing parallel lock acquisition in the firewall. Hopefully we will have this resolved, in some form, soon. I will remove the above in a series of commits; the only complicated bits are removing the NET_*_GIANT() calls from the socket system call code, where they made things quite a bit more complex than desirable due to additional error handling and unwinding, and in the Cronyx drivers, which interact with debug_mpsafenet in unusual ways (disabling their own locking when Giant is present). Otherwise, this is a fairly low-risk change in practice, since 99% of FreeBSD users have been running without Giant over the network stack since 5.4 (or was it 5.3?). Robert N M Watson Computer Laboratory University of Cambridge