From owner-p4-projects@FreeBSD.ORG Mon Feb 6 21:40:29 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 896E416A428; Mon, 6 Feb 2006 21:40:28 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0BE1B16A420 for ; Mon, 6 Feb 2006 21:40:28 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id CE56643D45 for ; Mon, 6 Feb 2006 21:40:27 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k16LeRgn097392 for ; Mon, 6 Feb 2006 21:40:27 GMT (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k16LeRix097389 for perforce@freebsd.org; Mon, 6 Feb 2006 21:40:27 GMT (envelope-from jhb@freebsd.org) Date: Mon, 6 Feb 2006 21:40:27 GMT Message-Id: <200602062140.k16LeRix097389@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin To: Perforce Change Reviews Cc: Subject: PERFORCE change 91260 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2006 21:40:29 -0000 http://perforce.freebsd.org/chv.cgi?CH=91260 Change 91260 by jhb@jhb_slimer on 2006/02/06 21:40:00 Save this here until someone tests it. Change the hptmv driver to use a regular mutex since it doesn't use an INTR_FAST handler, thus using a spin mutex just adds extra cost with no benefit. Affected files ... .. //depot/projects/smpng/sys/dev/hptmv/entry.c#9 edit Differences ... ==== //depot/projects/smpng/sys/dev/hptmv/entry.c#9 (text+ko) ==== @@ -167,12 +167,12 @@ { intrmask_t spl = 0; - mtx_lock_spin(&driver_lock); + mtx_lock(&driver_lock); return spl; } void unlock_driver(intrmask_t spl) { - mtx_unlock_spin(&driver_lock); + mtx_unlock(&driver_lock); } #else static int driver_locked = 0; @@ -1169,9 +1169,10 @@ #if __FreeBSD_version >= 500000 static void hpt_init(void *dummy) { - mtx_init(&driver_lock, "hptlock", NULL, MTX_SPIN); + mtx_init(&driver_lock, "hptlock", NULL, MTX_DEF); } SYSINIT(hptinit, SI_SUB_CONFIGURE, SI_ORDER_FIRST, hpt_init, NULL); +SYSUNINIT(hptinit, SI_SUB_CONFIGURE, SI_ORDER_FIRST, mtx_destroy, &driver_lock); #endif static int num_adapters = 0;