From owner-freebsd-performance@FreeBSD.ORG Fri Feb 1 21:40:29 2008 Return-Path: Delivered-To: freebsd-performance@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9392E16A417 for ; Fri, 1 Feb 2008 21:40:29 +0000 (UTC) (envelope-from freebsd@sopwith.solgatos.com) Received: from schitzo.solgatos.com (pool-96-225-216-68.ptldor.fios.verizon.net [96.225.216.68]) by mx1.freebsd.org (Postfix) with ESMTP id 5ECF513C442 for ; Fri, 1 Feb 2008 21:40:29 +0000 (UTC) (envelope-from freebsd@sopwith.solgatos.com) Received: from schitzo.solgatos.com (localhost.home.localnet [127.0.0.1]) by schitzo.solgatos.com (8.14.1/8.13.8) with ESMTP id m11LeSAs013959; Fri, 1 Feb 2008 13:40:28 -0800 Received: from sopwith.solgatos.com (uucp@localhost) by schitzo.solgatos.com (8.14.1/8.13.4/Submit) with UUCP id m11LeSC1013956; Fri, 1 Feb 2008 13:40:28 -0800 Received: from localhost by sopwith.solgatos.com (8.8.8/6.24) id VAA00426; Fri, 1 Feb 2008 21:39:15 GMT Message-Id: <200802012139.VAA00426@sopwith.solgatos.com> To: "Steven Hartland" In-reply-to: Your message of "Fri, 01 Feb 2008 13:57:09 GMT." <018701c864da$57020f20$b6db87d4@multiplay.co.uk> Date: Fri, 01 Feb 2008 13:39:15 +0000 From: Dieter Cc: freebsd-performance@freebsd.org Subject: Re: newfs locks entire machine for 20seconds X-BeenThere: freebsd-performance@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Performance/tuning List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Feb 2008 21:40:29 -0000 > >> Wait - if it returns EAGAIN for a while, then look at that code above. > >> It will hold the sysctl lock for some indefinite amount of time. Maybe > >> it should look like this instead: > >> > >> > >> do { > >> SYSCTL_LOCK(); > >> req.oldidx = 0; > >> req.newidx = 0; > >> error = sysctl_root(0, name, namelen, &req); > >> SYSCTL_UNLOCK(); > >> } while (error == EAGAIN); > >> > >> if (req.lock == REQ_WIRED && req.validlen > 0) > >> vsunlock(req.oldptr, req.validlen); > >> > > > > Tried no difference unfortunately, possibly its give the closeness > > of the lock unlock its just reacquiring the lock straight after releasing > > it hence not giving the other thread chance to run / obtain the lock? > > In an attempt to prove this is in fact the issue I've tried with the > locking around this code removed, yes dangerous but just as a test :) > It does indeed prevent the extended lockup so this is the right area. Would adding a call to cpu_switch() be appropriate here?