Add the flag ZONE_NOBUCKETCACHE. This flag instructions UMA not to keep

a cache of fully populated buckets.  This will be used in a follow-on
commit.

The flag idea was originally from markj.

Reviewed by:	markj, kib
Tested by:	pho
Sponsored by:	Netflix, Dell/EMC Isilon
This commit is contained in:
jeff 2018-04-01 04:47:05 +00:00
parent ba3a187358
commit c9b029efcd
2 changed files with 11 additions and 1 deletions

View File

@ -286,6 +286,10 @@ uma_zone_t uma_zcache_create(char *name, int size, uma_ctor ctor, uma_dtor dtor,
* NUMA aware Zone. Implements a best
* effort first-touch policy.
*/
#define UMA_ZONE_NOBUCKETCACHE 0x20000 /*
* Don't cache full buckets. Limit
* UMA to per-cpu state.
*/
/*
* These flags are shared between the keg and zone. In zones wishing to add

View File

@ -2965,7 +2965,13 @@ uma_zfree_arg(uma_zone_t zone, void *item, void *udata)
/* ub_cnt is pointing to the last free item */
KASSERT(bucket->ub_cnt != 0,
("uma_zfree: Attempting to insert an empty bucket onto the full list.\n"));
LIST_INSERT_HEAD(&zdom->uzd_buckets, bucket, ub_link);
if ((zone->uz_flags & UMA_ZONE_NOBUCKETCACHE) != 0) {
ZONE_UNLOCK(zone);
bucket_drain(zone, bucket);
bucket_free(zone, bucket, udata);
goto zfree_restart;
} else
LIST_INSERT_HEAD(&zdom->uzd_buckets, bucket, ub_link);
}
/*