From owner-p4-projects@FreeBSD.ORG Mon Nov 15 18:53:16 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id E990416A4D1; Mon, 15 Nov 2004 18:53:15 +0000 (GMT) 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 AD19616A4CE for ; Mon, 15 Nov 2004 18:53:15 +0000 (GMT) Received: from mail1.speakeasy.net (mail1.speakeasy.net [216.254.0.201]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6D88B43D45 for ; Mon, 15 Nov 2004 18:53:15 +0000 (GMT) (envelope-from jhb@FreeBSD.org) Received: (qmail 12619 invoked from network); 15 Nov 2004 18:53:15 -0000 Received: from dsl027-160-063.atl1.dsl.speakeasy.net (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) encrypted SMTP for ; 15 Nov 2004 18:53:12 -0000 Received: from [10.50.41.235] (gw1.twc.weather.com [216.133.140.1]) (authenticated bits=0) by server.baldwin.cx (8.12.11/8.12.11) with ESMTP id iAFIqEli075648; Mon, 15 Nov 2004 13:52:59 -0500 (EST) (envelope-from jhb@FreeBSD.org) From: John Baldwin To: David Xu Date: Mon, 15 Nov 2004 13:18:49 -0500 User-Agent: KMail/1.6.2 References: <200411140513.iAE5DOTv056478@repoman.freebsd.org> In-Reply-To: <200411140513.iAE5DOTv056478@repoman.freebsd.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200411151318.49415.jhb@FreeBSD.org> X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on server.baldwin.cx cc: Perforce Change Reviews Subject: Re: PERFORCE change 65074 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Nov 2004 18:53:16 -0000 On Sunday 14 November 2004 12:13 am, David Xu wrote: > http://perforce.freebsd.org/chv.cgi?CH=65074 > > Change 65074 by davidxu@davidxu_alona on 2004/11/14 05:12:40 > > 1. Fix a race between signal and umtx_unlock. a waiter > may be resumed by signal and left or exited, heavily > loaded test causes kernel to crash. > 2. Use distributed queue locks instead of single giant > lock. > > Affected files ... > > .. //depot/projects/davidxu_ksedbg/src/sys/kern/kern_umtx.c#4 edit > > Differences ... > > ==== //depot/projects/davidxu_ksedbg/src/sys/kern/kern_umtx.c#4 (text+ko) > ==== > > @@ -49,25 +49,48 @@ > pid_t uq_pid; /* Pid key component. */ > }; > > #define UMTX_QUEUES 128 > #define UMTX_HASH(pid, umtx) \ > - (((uintptr_t)pid + ((uintptr_t)umtx & ~65535)) % UMTX_QUEUES) > + ((((uintptr_t)pid << 16) + ((uintptr_t)umtx & 65535)) % UMTX_QUEUES) I'm curious why you changed the hash macro here? Low order bits of pointers tend to be zero due to alignment, so I think this will result in fewer "useful" bits and more collisions and longer chains. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org