From owner-freebsd-current@FreeBSD.ORG Tue Apr 3 22:01:46 2007 Return-Path: X-Original-To: current@FreeBSD.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2511516A402; Tue, 3 Apr 2007 22:01:46 +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 B869813C483; Tue, 3 Apr 2007 22:01:45 +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 3435147226; Tue, 3 Apr 2007 18:01:45 -0400 (EDT) Date: Tue, 3 Apr 2007 18:01:45 -0400 (EDT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: current@FreeBSD.org In-Reply-To: <20070401155910.O75869@fledge.watson.org> Message-ID: <20070403175953.A25236@fledge.watson.org> References: <20070401155910.O75869@fledge.watson.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: performance@FreeBSD.org, Andrzej Tobola Subject: Re: filedesc_sx patch (20070401a) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 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: Tue, 03 Apr 2007 22:01:46 -0000 On Sun, 1 Apr 2007, Robert Watson wrote: > The attached patch moves file descriptor locks from being a custom > mutex/sleep lock implemented using msleep() to an sx lock. With the new sx > lock optimizations in place, this is now sensible, avoiding both a custom > lock type and significantly improving performance. Kris has reported 2x-4x > improvement in transactions/sec with MySQL using this patch, as it greatly > reduces the cost of lock contention during file descriptor lookup for > threaded applications, and also moves to shared locking to avoid exclusive > acquisition for read-only operations (the vast majority in most workloads). > Patch is below, but you can also download from: > > http://www.watson.org/~robert/freebsd/netperf/20070401a-filedesc-sx.diff > > I'm currently waiting for the sx lock changes to settle for a few days > before committing, so will plan to commit this around Wednesday/Thursday of > this week (unless serious problems arise). Andrzej has pointed out that shortly after I posted the patch, it came into conflict with changes in VFS. I've updated the patch and posted it at: http://www.watson.org/~robert/freebsd/netperf/20070403-filedesc-sx.diff Thanks, Robert N M Watson Computer Laboratory University of Cambridge