From owner-freebsd-current@FreeBSD.ORG Wed Jul 9 11:41:46 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B95D137B401 for ; Wed, 9 Jul 2003 11:41:46 -0700 (PDT) Received: from gw.catspoiler.org (217-ip-163.nccn.net [209.79.217.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8E10643FB1 for ; Wed, 9 Jul 2003 11:41:45 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Received: from FreeBSD.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.12.9/8.12.9) with ESMTP id h69IfYM7013486 for ; Wed, 9 Jul 2003 11:41:38 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Message-Id: <200307091841.h69IfYM7013486@gw.catspoiler.org> Date: Wed, 9 Jul 2003 11:41:34 -0700 (PDT) From: Don Lewis To: current@FreeBSD.org MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii Subject: CFR: patch to support creation of multiple mutex pools X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 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, 09 Jul 2003 18:41:47 -0000 The patch below enhances the mutex pool code to support the creation and use of multiple mutex pools. It creates one pool of sleep mutexes with the MTX_NOWITNESS flag for use in building higher level (sx and lockmgr) locks. It also creates another pool without MTX_NOWITNESS for general purpose use. It can also be used to create pools of spin mutexes. The users of the existing MTX_NOWITNESS pool are modified to use the appropriate pool. If this had been implemented earlier, it would have allowed witness to catch the Giant vs. FILE_LOCK() lock order reversal that I recently tracked down and fixed. I've tested this only on i386, but it also passes the "make universe" test.