Add a UMA zone flag to disable the use of buckets.
This allows the creation of zones which don't do any caching in front of the keg. If the zone is a cache zone, this means that UMA will not attempt any memory allocations when allocating an item from the backend. This is intended for use after a panic by netdump, but likely has other applications. Reviewed by: kib MFC after: 2 weeks Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D15184
This commit is contained in:
parent
7875017ca9
commit
7e28037a09
@ -265,8 +265,8 @@ uma_zone_t uma_zcache_create(char *name, int size, uma_ctor ctor, uma_dtor dtor,
|
|||||||
* information in the vm_page.
|
* information in the vm_page.
|
||||||
*/
|
*/
|
||||||
#define UMA_ZONE_SECONDARY 0x0200 /* Zone is a Secondary Zone */
|
#define UMA_ZONE_SECONDARY 0x0200 /* Zone is a Secondary Zone */
|
||||||
/* 0x0400 Unused */
|
#define UMA_ZONE_NOBUCKET 0x0400 /* Do not use buckets. */
|
||||||
#define UMA_ZONE_MAXBUCKET 0x0800 /* Use largest buckets */
|
#define UMA_ZONE_MAXBUCKET 0x0800 /* Use largest buckets. */
|
||||||
#define UMA_ZONE_CACHESPREAD 0x1000 /*
|
#define UMA_ZONE_CACHESPREAD 0x1000 /*
|
||||||
* Spread memory start locations across
|
* Spread memory start locations across
|
||||||
* all possible cache lines. May
|
* all possible cache lines. May
|
||||||
|
@ -1681,10 +1681,15 @@ zone_ctor(void *mem, int size, void *udata, int flags)
|
|||||||
}
|
}
|
||||||
|
|
||||||
out:
|
out:
|
||||||
if ((arg->flags & UMA_ZONE_MAXBUCKET) == 0)
|
KASSERT((arg->flags & (UMA_ZONE_MAXBUCKET | UMA_ZONE_NOBUCKET)) !=
|
||||||
zone->uz_count = bucket_select(zone->uz_size);
|
(UMA_ZONE_MAXBUCKET | UMA_ZONE_NOBUCKET),
|
||||||
else
|
("Invalid zone flag combination"));
|
||||||
|
if ((arg->flags & UMA_ZONE_MAXBUCKET) != 0)
|
||||||
zone->uz_count = BUCKET_MAX;
|
zone->uz_count = BUCKET_MAX;
|
||||||
|
else if ((arg->flags & UMA_ZONE_NOBUCKET) != 0)
|
||||||
|
zone->uz_count = 0;
|
||||||
|
else
|
||||||
|
zone->uz_count = bucket_select(zone->uz_size);
|
||||||
zone->uz_count_min = zone->uz_count;
|
zone->uz_count_min = zone->uz_count;
|
||||||
|
|
||||||
return (0);
|
return (0);
|
||||||
|
Loading…
Reference in New Issue
Block a user