From owner-cvs-src@FreeBSD.ORG Tue Nov 27 03:13:15 2007 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 7AC3D16A417; Tue, 27 Nov 2007 03:13:15 +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 688A313C458; Tue, 27 Nov 2007 03:13:15 +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 lAR3DFd9077960; Tue, 27 Nov 2007 03:13:15 GMT (envelope-from jasone@repoman.freebsd.org) Received: (from jasone@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id lAR3DFCj077959; Tue, 27 Nov 2007 03:13:15 GMT (envelope-from jasone) Message-Id: <200711270313.lAR3DFCj077959@repoman.freebsd.org> From: Jason Evans Date: Tue, 27 Nov 2007 03:13:15 +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-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, 27 Nov 2007 03:13:15 -0000 jasone 2007-11-27 03:13:15 UTC FreeBSD src repository Modified files: lib/libc/stdlib malloc.c Log: Implement lazy deallocation of small objects. For each arena, maintain a vector of slots for lazily freed objects. For each deallocation, before doing the hard work of locking the arena and deallocating, try several times to randomly insert the object into the vector using atomic operations. This approach is particularly effective at reducing contention for multi-threaded applications that use the producer-consumer model, wherein one producer thread allocates objects, then multiple consumer threads deallocate those objects. Revision Changes Path 1.150 +218 -0 src/lib/libc/stdlib/malloc.c