svn commit: r260304 - stable/10/sys/vm

Alexander Motin mav at FreeBSD.org
Sat Jan 4 23:40:48 UTC 2014


Author: mav
Date: Sat Jan  4 23:40:47 2014
New Revision: 260304
URL: http://svnweb.freebsd.org/changeset/base/260304

Log:
  MFC r258691:
  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:
  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:39:39 2014	(r260303)
+++ stable/10/sys/vm/uma_core.c	Sat Jan  4 23:40:47 2014	(r260304)
@@ -2510,7 +2510,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,
@@ -2541,10 +2541,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);
 	}


More information about the svn-src-all mailing list