From owner-freebsd-arch@FreeBSD.ORG Wed Oct 10 01:40:37 2007 Return-Path: Delivered-To: arch@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1114F16A419 for ; Wed, 10 Oct 2007 01:40:37 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id EA78213C455; Wed, 10 Oct 2007 01:40:36 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from [127.0.0.1] (root@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.1/8.14.1) with ESMTP id l9A1eYYp051139; Wed, 10 Oct 2007 01:40:35 GMT (envelope-from davidxu@freebsd.org) Message-ID: <470C2DC5.3040601@freebsd.org> Date: Wed, 10 Oct 2007 09:41:25 +0800 From: David Xu User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.13) Gecko/20070516 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Jeff Roberson References: <20071008142928.Y912@10.0.0.1> In-Reply-To: <20071008142928.Y912@10.0.0.1> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Cc: arch@FreeBSD.org Subject: Re: Abolishing sleeps in issignal() 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: Wed, 10 Oct 2007 01:40:37 -0000 I think the performance problem here is that while sleep queue lock is already hash scaled, but interruptable msleep still has to pass through a single lock, the process lock, this is a serious serialization problem on SMP machine, especially when machine has 4 or more cores. Also in most most runtime, process has few signals and job controls, process lock and unlock should be avoided by checking a thread self's flag instead, which uses thread lock. I had ever worked out a patch to avoid the lock contention: http://people.freebsd.org/~davidxu/patch/PCATCH_optimize.patch mysql benchmark shows that on dual PIII machine it can improve performance about 1 or 2 percentage, I had not tested it on 4 core machine. Regards, David Xu