From owner-cvs-src@FreeBSD.ORG Tue Aug 19 18:51:13 2008 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8D9981065671; Tue, 19 Aug 2008 18:51:13 +0000 (UTC) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (alchemy.franken.de [194.94.249.214]) by mx1.freebsd.org (Postfix) with ESMTP id 32F458FC18; Tue, 19 Aug 2008 18:51:12 +0000 (UTC) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (localhost [127.0.0.1]) by alchemy.franken.de (8.14.3/8.14.3/ALCHEMY.FRANKEN.DE) with ESMTP id m7JIFpWj036727; Tue, 19 Aug 2008 20:15:51 +0200 (CEST) (envelope-from marius@alchemy.franken.de) Received: (from marius@localhost) by alchemy.franken.de (8.14.3/8.14.3/Submit) id m7JIFpbn036726; Tue, 19 Aug 2008 20:15:51 +0200 (CEST) (envelope-from marius) Date: Tue, 19 Aug 2008 20:15:51 +0200 From: Marius Strobl To: Attilio Rao Message-ID: <20080819181551.GA18140@alchemy.franken.de> References: <200808131825.m7DIP0wi084783@repoman.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200808131825.m7DIP0wi084783@repoman.freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: cvs-src@freebsd.org, src-committers@freebsd.org, cvs-all@freebsd.org Subject: Re: cvs commit: src/sys/kern kern_thread.c subr_witness.c src/sys/sys lock.h X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Aug 2008 18:51:13 -0000 On Wed, Aug 13, 2008 at 06:24:22PM +0000, Attilio Rao wrote: > attilio 2008-08-13 18:24:22 UTC > > FreeBSD src repository > > Modified files: > sys/kern kern_thread.c subr_witness.c > sys/sys lock.h > Log: > SVN rev 181695 on 2008-08-13 18:24:22Z by attilio > > Introduce some WITNESS improvements: > - Speedup the lock orderings lookup modifying the witness graph from a > linked tree to a matrix. A table lookup caches the lock orderings in > order to make a O(1) access for them. Any witness object has an unique > index withing this lookup cache table. > - Reduce the lock contention on w_mtx acquiring it only when the LOR > actually happens and not in a sane case. In order to do this don't totally > flush lock lists (per-CPU spinlocks list and per-thread sleeplocks list) > but check for ll_count anytime we need to have to verify allocations sanity. > - Introduce the function witness_thread_exit() in the witness namespace which > should verify a thread doesn't hold any witness occurrence why exiting. > - Rename the sysctl debug.witness.graphs into debug.witness.fullgraph and > add debug.witness.badstacks which prints out stacks for LOR revealed. > This is implemented using the stack(9) support, which makes WITNESS to be > dependent by the STACK option or by the DDB (including STACK) option. > - Fix style(9) for src/sys/kern/subr_witness.c > > The hash table approach has been developed by Ilya Maykov on the behalf of > Isilon Systems which kindly released the patch. > Jeff Roberson, ported the patch to -CURRENT and fixed w_mtx contention, on the > behalf of Nokia. > > Submitted by: Ilya Maykov (Isilon Systems), jeff > Sponsored by: Nokia > > Revision Changes Path > 1.276 +5 -0 src/sys/kern/kern_thread.c > 1.251 +1061 -491 src/sys/kern/subr_witness.c > 1.74 +1 -0 src/sys/sys/lock.h Hi Attilio, this broke witness(4) on sparc64 (and probably all other platforms with strict alignment requirement): OK boot /boot/kernel/test2 /boot/kernel/test2 data=0x7cdb48+0x215c68 syms=[0x8+0x8a2b8+0x8+0x7a932] nothing to autoload yet. jumping to kernel entry at 0xc0078000. GDB: no debug ports present KDB: debugger backends: ddb KDB: current backend: ddb Copyright (c) 1992-2008 The FreeBSD Project. Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD is a registered trademark of The FreeBSD Foundation. FreeBSD 8.0-CURRENT #1: Tue Aug 19 19:49:27 CEST 2008 marius@alchemy.franken.de:/usr/home/marius/co/build/ref/sparc64/usr/home/mar WARNING: WITNESS option enabled, expect reduced performance. panic: trap: memory address not aligned cpuid = 0 KDB: enter: panic [thread pid 0 tid 0 ] Stopped at 0xc0300d80: ta %xcc, 1 db> bt Tracing pid 0 tid 0 td 0xc07e9a80 (null)() at 0xc02c9208 (null)() at 0xc05e31d0 (null)() at 0xc0078ff8 (null)() at 0xc05df924 (null)() at 0xc05dfa70 (null)() at 0xc031ac98 (null)() at 0xc02b994c (null)() at 0xc0554f84 (null)() at 0xc02b4c68 (null)() at 0xc02b866c (null)() at 0xc02b86c0 (null)() at 0xc0281c8c (null)() at 0xc0078030 db> Could you please fix this? Marius