From owner-cvs-all@FreeBSD.ORG Tue Nov 27 03:56:00 2007 Return-Path: Delivered-To: cvs-all@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3C6D816A469; Tue, 27 Nov 2007 03:56:00 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from tarsier.geekcn.org (tarsier.geekcn.org [210.51.165.229]) by mx1.freebsd.org (Postfix) with ESMTP id D402713C459; Tue, 27 Nov 2007 03:55:59 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from localhost (tarsier.geekcn.org [210.51.165.229]) by tarsier.geekcn.org (Postfix) with ESMTP id 13FBBEBA0FE; Tue, 27 Nov 2007 11:56:10 +0800 (CST) X-Virus-Scanned: amavisd-new at geekcn.org Received: from tarsier.geekcn.org ([210.51.165.229]) by localhost (mail.geekcn.org [210.51.165.229]) (amavisd-new, port 10024) with ESMTP id bmvAoxzsiXxY; Tue, 27 Nov 2007 11:56:02 +0800 (CST) Received: from charlie.delphij.net (c-67-161-39-180.hsd1.ca.comcast.net [67.161.39.180]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tarsier.geekcn.org (Postfix) with ESMTP id 30E76EB779C; Tue, 27 Nov 2007 11:55:59 +0800 (CST) DomainKey-Signature: a=rsa-sha1; s=default; d=delphij.net; c=nofws; q=dns; h=message-id:date:from:reply-to:organization:user-agent: mime-version:to:cc:subject:references:in-reply-to: x-enigmail-version:content-type:content-transfer-encoding; b=Fk4mf6XovEQB5lxoJDnQekD9D0wBL6ohUfQOifOchxu3yEr0KlUcoTBOs73bauiuP tW8DiJcqt4sWMabbotbJA== Message-ID: <474B9541.8040200@delphij.net> Date: Mon, 26 Nov 2007 19:55:45 -0800 From: Xin LI Organization: The FreeBSD Project User-Agent: Thunderbird 2.0.0.9 (X11/20071125) MIME-Version: 1.0 To: Jason Evans References: <200711270317.lAR3HUAj078209@repoman.freebsd.org> In-Reply-To: <200711270317.lAR3HUAj078209@repoman.freebsd.org> X-Enigmail-Version: 0.95.5 Content-Type: text/plain; charset=GB2312 Content-Transfer-Encoding: 7bit Cc: cvs-src@FreeBSD.ORG, src-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG Subject: Re: cvs commit: src/lib/libc/stdlib malloc.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: d@delphij.net List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2007 03:56:00 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Jason Evans wrote: > jasone 2007-11-27 03:17:30 UTC > > FreeBSD src repository > > Modified files: > lib/libc/stdlib malloc.c > Log: > Implement dynamic load balancing of thread-->arena mapping, based on lock > contention. The intent is to dynamically adjust to load imbalances, which > can cause severe contention. > > Use pthread mutexes where possible instead of libc "spinlocks" (they aren't > actually spin locks). Conceptually, this change is meant only to support > the dynamic load balancing code by enabling the use of spin locks, but it > has the added apparent benefit of substantially improving performance due to > reduced context switches when there is moderate arena lock contention. > > Proper tuning parameter configuration for this change is a finicky business, > and it is very much machine-dependent. One seemingly promising solution > would be to run a tuning program during operating system installation that > computes appropriate settings for load balancing. (The pthreads adaptive > spin locks should probably be similarly tuned.) What about using rc.d script to export these environment variables? It is not a big deal to do so (and has 0 side impact to previous releases), and works well for my experimental setup that was inspired by David Xu's yieldloops changeset. Cheers, - -- Xin LI http://www.delphij.net/ FreeBSD - The Power to Serve! -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iD8DBQFHS5VAhcUczkLqiksRAtvxAKCDePHcIcCRBT7X2xIxnBkO6EK2+QCfSRku 762vB1RFY0JdH5k5kbcu3Jo= =wB5F -----END PGP SIGNATURE-----