From owner-svn-src-stable@FreeBSD.ORG Sat Jan 4 23:38:07 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 748F7B62; Sat, 4 Jan 2014 23:38:07 +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 600B01B25; Sat, 4 Jan 2014 23:38:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s04Nc7XH060349; Sat, 4 Jan 2014 23:38:07 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id s04Nc7Nx060347; Sat, 4 Jan 2014 23:38:07 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201401042338.s04Nc7Nx060347@svn.freebsd.org> From: Alexander Motin Date: Sat, 4 Jan 2014 23:38:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r260302 - stable/10/sys/vm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Jan 2014 23:38:07 -0000 Author: mav Date: Sat Jan 4 23:38:06 2014 New Revision: 260302 URL: http://svnweb.freebsd.org/changeset/base/260302 Log: MFC r258338: 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: stable/10/sys/vm/uma_core.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/vm/uma_core.c ============================================================================== --- stable/10/sys/vm/uma_core.c Sat Jan 4 23:37:01 2014 (r260301) +++ stable/10/sys/vm/uma_core.c Sat Jan 4 23:38:06 2014 (r260302) @@ -2531,6 +2531,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 @@ -2615,7 +2616,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]; @@ -2649,7 +2655,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