From owner-svn-src-all@FreeBSD.ORG Tue Nov 19 10:17:10 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D22B7BBD; Tue, 19 Nov 2013 10:17:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C17EA2303; Tue, 19 Nov 2013 10:17:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAJAHAYf052383; Tue, 19 Nov 2013 10:17:10 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAJAHArf052382; Tue, 19 Nov 2013 10:17:10 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201311191017.rAJAHArf052382@svn.freebsd.org> From: Alexander Motin Date: Tue, 19 Nov 2013 10:17:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r258338 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Nov 2013 10:17:10 -0000 Author: mav Date: Tue Nov 19 10:17:10 2013 New Revision: 258338 URL: http://svnweb.freebsd.org/changeset/base/258338 Log: Grow UMA zone bucket size also on lock congestion during item free. Lock congestion is the same, whether it happens on alloc or free, so handle it equally. Now that we have back pressure, there is no problem to grow buckets a bit faster. Any way growth is much slower then in 9.x. Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Tue Nov 19 10:10:44 2013 (r258337) +++ head/sys/vm/uma_core.c Tue Nov 19 10:17:10 2013 (r258338) @@ -2529,6 +2529,7 @@ uma_zfree_arg(uma_zone_t zone, void *ite { uma_cache_t cache; uma_bucket_t bucket; + int lockfail; int cpu; #ifdef UMA_DEBUG_ALLOC_1 @@ -2613,7 +2614,12 @@ zfree_start: if (zone->uz_count == 0 || bucketdisable) goto zfree_item; - ZONE_LOCK(zone); + lockfail = 0; + if (ZONE_TRYLOCK(zone) == 0) { + /* Record contention to size the buckets. */ + ZONE_LOCK(zone); + lockfail = 1; + } critical_enter(); cpu = curcpu; cache = &zone->uz_cpu[cpu]; @@ -2647,7 +2653,12 @@ zfree_start: /* We are no longer associated with this CPU. */ critical_exit(); - /* And the zone.. */ + /* + * We bump the uz count when the cache size is insufficient to + * handle the working set. + */ + if (lockfail && zone->uz_count < BUCKET_MAX) + zone->uz_count++; ZONE_UNLOCK(zone); #ifdef UMA_DEBUG_ALLOC