summaryrefslogtreecommitdiffstats
path: root/sys/vm
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2013-11-27 20:16:18 +0000
committermav <mav@FreeBSD.org>2013-11-27 20:16:18 +0000
commit8937d14f8f08cb99fc65e604e0f8272b0a714166 (patch)
tree1e035796da57fb3f421cf30a5c927dae662c59a3 /sys/vm
parent8773f9e310419dfb13c5aa9fad0765dfea5ab83a (diff)
downloadFreeBSD-src-8937d14f8f08cb99fc65e604e0f8272b0a714166.zip
FreeBSD-src-8937d14f8f08cb99fc65e604e0f8272b0a714166.tar.gz
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.
Diffstat (limited to 'sys/vm')
-rw-r--r--sys/vm/uma_core.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/sys/vm/uma_core.c b/sys/vm/uma_core.c
index dbb37c5..322801e 100644
--- a/sys/vm/uma_core.c
+++ b/sys/vm/uma_core.c
@@ -2509,7 +2509,7 @@ zone_alloc_bucket(uma_zone_t zone, void *udata, int flags)
/* 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 *udata, int flags)
}
}
-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);
}
OpenPOWER on IntegriCloud