* Add vm.cache_vmspaces boot-time tunable, defaulting to 32 objects.
This controls how many free vmspace+pmap structures can be maintained
in the objcache.
* Change the sysref API a bit. mag_capacity becomes nom_cache.
Related-to: IRC conversion thesjg & vsrinivas
KKASSERT(srclass->mtype != NULL);
srclass->oc = objcache_create_mbacked(
srclass->mtype, srclass->objsize,
- NULL, srclass->mag_capacity,
+ NULL, srclass->nom_cache,
sysref_ctor, sysref_dtor, srclass);
}
.proto = SYSREF_PROTO_VNODE,
.offset = offsetof(struct vnode, v_sysref),
.objsize = sizeof(struct vnode),
- .mag_capacity = 256,
+ .nom_cache = 256,
.flags = SRC_MANAGEDINIT,
.ctor = vnode_ctor,
.dtor = vnode_dtor,
int proto; /* RPC protocol id */
int offset; /* offset of sysref in resource */
int objsize; /* size of the resource structure */
- int mag_capacity; /* magazine capacity init (def 64) */
+ int nom_cache; /* nominal objects to cache */
int flags;
struct objcache *oc; /* object cache */
objcache_ctor_fn *ctor; /* objcache ctor chaining */
.proto = SYSREF_PROTO_DEV,
.offset = offsetof(struct cdev, si_sysref),
.objsize = sizeof(struct cdev),
- .mag_capacity = 32,
+ .nom_cache = 32,
.flags = 0,
.ops = {
.terminate = (sysref_terminate_func_t)devfs_cdev_terminate,
.proto = SYSREF_PROTO_VMSPACE,
.offset = offsetof(struct vmspace, vm_sysref),
.objsize = sizeof(struct vmspace),
- .mag_capacity = 32,
+ .nom_cache = 32,
.flags = SRC_MANAGEDINIT,
.dtor = vmspace_dtor,
.ops = {
map->timestamp = 0;
map->flags = 0;
lockinit(&map->lock, "thrd_sleep", 0, 0);
+ TUNABLE_INT("vm.cache_vmspaces", &vmspace_sysref_class.nom_cache);
}
/*