[rtems-libbsd commit] ZONE(9): Reduce BUCKET_MAX to 128
Sebastian Huber
sebh at rtems.org
Mon Oct 23 07:27:50 UTC 2017
Module: rtems-libbsd
Branch: master
Commit: be708ff182fdc0eea140d6892f0a714fe6faf00a
Changeset: http://git.rtems.org/rtems-libbsd/commit/?id=be708ff182fdc0eea140d6892f0a714fe6faf00a
Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
Date: Mon Nov 21 14:56:59 2016 +0100
ZONE(9): Reduce BUCKET_MAX to 128
Reduces the worst-case per-processor caches.
---
freebsd/sys/vm/uma_core.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/freebsd/sys/vm/uma_core.c b/freebsd/sys/vm/uma_core.c
index 840c876..7bfba2b 100644
--- a/freebsd/sys/vm/uma_core.c
+++ b/freebsd/sys/vm/uma_core.c
@@ -226,7 +226,11 @@ struct uma_bucket_zone {
#define BUCKET_SIZE(n) \
(((sizeof(void *) * (n)) - sizeof(struct uma_bucket)) / sizeof(void *))
+#ifndef __rtems__
#define BUCKET_MAX BUCKET_SIZE(256)
+#else /* __rtems__ */
+#define BUCKET_MAX BUCKET_SIZE(128)
+#endif /* __rtems__ */
struct uma_bucket_zone bucket_zones[] = {
{ NULL, "4 Bucket", BUCKET_SIZE(4), 4096 },
@@ -237,7 +241,9 @@ struct uma_bucket_zone bucket_zones[] = {
{ NULL, "32 Bucket", BUCKET_SIZE(32), 512 },
{ NULL, "64 Bucket", BUCKET_SIZE(64), 256 },
{ NULL, "128 Bucket", BUCKET_SIZE(128), 128 },
+#ifndef __rtems__
{ NULL, "256 Bucket", BUCKET_SIZE(256), 64 },
+#endif /* __rtems__ */
{ NULL, NULL, 0}
};
@@ -733,6 +739,7 @@ cache_drain(uma_zone_t zone)
ZONE_UNLOCK(zone);
}
+#ifndef __rtems__
static void
cache_shrink(uma_zone_t zone)
{
@@ -782,7 +789,6 @@ cache_drain_safe_cpu(uma_zone_t zone)
bucket_free(zone, b2, NULL);
}
-#ifndef __rtems__
/*
* Safely drain per-CPU caches of a zone(s) to alloc bucket.
* This is an expensive call because it needs to bind to all CPUs
More information about the vc
mailing list