Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 Nov 2013 20:16:18 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r258691 - head/sys/vm
Message-ID:  <201311272016.rARKGIvv022039@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Wed Nov 27 20:16:18 2013
New Revision: 258691
URL: http://svnweb.freebsd.org/changeset/base/258691

Log:
  Don't count bucket allocation failures for UMA zones as their own failures.
  There are good reasons for this to happen, such as recursion prevention, etc.
  and they are not fatal since buckets are just an optimization mechanism.
  Real bucket allocation failures are any way counted by the bucket zones
  themselves, and we don't need double accounting there.

Modified:
  head/sys/vm/uma_core.c

Modified: head/sys/vm/uma_core.c
==============================================================================
--- head/sys/vm/uma_core.c	Wed Nov 27 19:55:42 2013	(r258690)
+++ head/sys/vm/uma_core.c	Wed Nov 27 20:16:18 2013	(r258691)
@@ -2509,7 +2509,7 @@ zone_alloc_bucket(uma_zone_t zone, void 
 	/* Don't wait for buckets, preserve caller's NOVM setting. */
 	bucket = bucket_alloc(zone, udata, M_NOWAIT | (flags & M_NOVM));
 	if (bucket == NULL)
-		goto out;
+		return (NULL);
 
 	max = MIN(bucket->ub_entries, zone->uz_count);
 	bucket->ub_cnt = zone->uz_import(zone->uz_arg, bucket->ub_bucket,
@@ -2540,10 +2540,8 @@ zone_alloc_bucket(uma_zone_t zone, void 
 		}
 	}
 
-out:
-	if (bucket == NULL || bucket->ub_cnt == 0) {
-		if (bucket != NULL)
-			bucket_free(zone, bucket, udata);
+	if (bucket->ub_cnt == 0) {
+		bucket_free(zone, bucket, udata);
 		atomic_add_long(&zone->uz_fails, 1);
 		return (NULL);
 	}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201311272016.rARKGIvv022039>