From owner-freebsd-arch@FreeBSD.ORG Sat Jul 19 07:42:57 2008 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D7F71065674 for ; Sat, 19 Jul 2008 07:42:57 +0000 (UTC) (envelope-from julian@elischer.org) Received: from outQ.internet-mail-service.net (outq.internet-mail-service.net [216.240.47.240]) by mx1.freebsd.org (Postfix) with ESMTP id 200768FC18 for ; Sat, 19 Jul 2008 07:42:56 +0000 (UTC) (envelope-from julian@elischer.org) Received: from idiom.com (mx0.idiom.com [216.240.32.160]) by out.internet-mail-service.net (Postfix) with ESMTP id 6406F23EB; Sat, 19 Jul 2008 00:32:13 -0700 (PDT) Received: from julian-mac.elischer.org (localhost [127.0.0.1]) by idiom.com (Postfix) with ESMTP id D91AC2D604E; Sat, 19 Jul 2008 00:32:12 -0700 (PDT) Message-ID: <48819885.7040901@elischer.org> Date: Sat, 19 Jul 2008 00:32:21 -0700 From: Julian Elischer User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: Jeff Roberson References: <20080718163231.B954@desktop> In-Reply-To: <20080718163231.B954@desktop> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: attilio@freebsd.org, arch@freebsd.org, ivmaykov@gmail.com Subject: Re: witness performance improvements 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: Sat, 19 Jul 2008 07:42:57 -0000 Jeff Roberson wrote: > Hello, > > I have a patch that improves witness performance available at: > > http://people.freebsd.org/~jeff/witness.diff > > This improvement comes at the cost of some significant space overhead. > It changes the witness graph from a linked tree to a matrix based > approach. Relationships can be quickly resolved with a table lookup. > The table size is WITNESS_COUNT^2, or 1MB with the current count of 1024. > > This patch also makes struct witness objects persistent even after the > last lock using this name has been removed. This is helpful for short > lived objects which may be created frequently. > > To reduce lock contention on SMP witness_checkorder() now runs without > the w_mtx when there are no lock violations. I also cache a > lock_list_entry in each thread as allocating these requires the w_mtx. > The entry is disposed of at thread_exit(). > > There is also a new sysctl that produces dot output which graphs lock > order relationships with the graphviz program. > cool... got sample output? > Most of this work was done by Ilya Maykov while he was at Isilon > systems. The locking work and some cleanup/porting/refinement was done > by me on behalf of Nokia. > > The performance improvement can be significant. It is only on the order > of 10-20% for buildkernel but on a packet forwarding test at nokia it > sped things up by 5x putting a witness enabled kernel within about 50% > of the performance of a kernel without. I believe buildworld isn't > helped as much because forking and exiting a lot would then contend on > the witness lock. > > I'm mostly interested in hearing what people have to say about the space > bloat. I believe it is in a commit ready state. Since witness is not usually on production systems, I don't see a problem with giving it 1 MB. kjfnb7 > > Thanks, > Jeff > _______________________________________________ > freebsd-arch@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-arch > To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org"