Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F157679093
D27167.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D27167.diff
View Options
Index: head/sys/vm/uma.h
===================================================================
--- head/sys/vm/uma.h
+++ head/sys/vm/uma.h
@@ -250,7 +250,6 @@
#define UMA_ZONE_SECONDARY 0x0200 /* Zone is a Secondary Zone */
#define UMA_ZONE_NOBUCKET 0x0400 /* Do not use buckets. */
#define UMA_ZONE_MAXBUCKET 0x0800 /* Use largest buckets. */
-#define UMA_ZONE_MINBUCKET 0x1000 /* Use smallest buckets. */
#define UMA_ZONE_CACHESPREAD 0x2000 /*
* Spread memory start locations across
* all possible cache lines. May
Index: head/sys/vm/uma_core.c
===================================================================
--- head/sys/vm/uma_core.c
+++ head/sys/vm/uma_core.c
@@ -248,7 +248,6 @@
(((sizeof(void *) * (n)) - sizeof(struct uma_bucket)) / sizeof(void *))
#define BUCKET_MAX BUCKET_SIZE(256)
-#define BUCKET_MIN 2
struct uma_bucket_zone bucket_zones[] = {
/* Literal bucket sizes. */
@@ -507,7 +506,7 @@
}
if (((uintptr_t)udata & UMA_ZONE_VM) != 0)
flags |= M_NOVM;
- ubz = bucket_zone_lookup(zone->uz_bucket_size);
+ ubz = bucket_zone_lookup(atomic_load_16(&zone->uz_bucket_size));
if (ubz->ubz_zone == zone && (ubz + 1)->ubz_entries != 0)
ubz++;
bucket = uma_zalloc_arg(ubz->ubz_zone, udata, flags);
@@ -516,7 +515,8 @@
bzero(bucket->ub_bucket, sizeof(void *) * ubz->ubz_entries);
#endif
bucket->ub_cnt = 0;
- bucket->ub_entries = ubz->ubz_entries;
+ bucket->ub_entries = min(ubz->ubz_entries,
+ zone->uz_bucket_size_max);
bucket->ub_seq = SMR_SEQ_INVALID;
CTR3(KTR_UMA, "bucket_alloc: zone %s(%p) allocated bucket %p",
zone->uz_name, zone, bucket);
@@ -2724,8 +2724,6 @@
zone->uz_bucket_size_max = zone->uz_bucket_size = 0;
if ((arg->flags & UMA_ZONE_MAXBUCKET) != 0)
zone->uz_bucket_size = BUCKET_MAX;
- else if ((arg->flags & UMA_ZONE_MINBUCKET) != 0)
- zone->uz_bucket_size_max = zone->uz_bucket_size = BUCKET_MIN;
else if ((arg->flags & UMA_ZONE_NOBUCKET) != 0)
zone->uz_bucket_size = 0;
else
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, May 25, 12:30 AM (1 h, 41 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33491854
Default Alt Text
D27167.diff (1 KB)
Attached To
Mode
D27167: uma: Enforce the use of uz_bucket_size_max in the free path
Attached
Detach File
Event Timeline
Log In to Comment