From owner-cvs-all@FreeBSD.ORG Tue Nov 27 03:17:30 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 7A85616A417; Tue, 27 Nov 2007 03:17:30 +0000 (UTC) (envelope-from jasone@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 68A9C13C46B; Tue, 27 Nov 2007 03:17:30 +0000 (UTC) (envelope-from jasone@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id lAR3HUMc078210; Tue, 27 Nov 2007 03:17:30 GMT (envelope-from jasone@repoman.freebsd.org) Received: (from jasone@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id lAR3HUAj078209; Tue, 27 Nov 2007 03:17:30 GMT (envelope-from jasone) Message-Id: <200711270317.lAR3HUAj078209@repoman.freebsd.org> From: Jason Evans Date: Tue, 27 Nov 2007 03:17:30 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Cc: Subject: cvs commit: src/lib/libc/stdlib malloc.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list 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:17:30 -0000 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.) Revision Changes Path 1.151 +297 -58 src/lib/libc/stdlib/malloc.c