Lines Matching defs:pool

26 #include <sys/pool.h>
52 * a common abstraction called a pool. Processor sets and other entities can
57 * to the same pool (pool_default), and processor sets can be managed through
85 * new pool, or (in case of an error) they will be all left bound to the
86 * old pool. Processes in a given task or a given project can only be bound to
88 * processes. Threads or LWPs of the same process do not have pool bindings,
89 * and are bound to the same resource sets associated with the resource pool
92 * The following picture shows one possible pool configuration with three
140 pool_t *pool_default; /* default pool which always exists */
148 static id_space_t *pool_ids; /* pool ID space */
156 static list_t pool_event_cb_list; /* pool event callbacks */
164 * Boot-time pool initialization.
172 * Initialize default pool.
193 * pset_*(), and /dev/pool ioctls). The pool "lock" may be held for long
249 * operations which modify pool or pset associations. They can be called
311 "pool.name", "pool_default");
312 (void) nvlist_add_string(pool_default->pool_props, "pool.comment", "");
313 (void) nvlist_add_byte(pool_default->pool_props, "pool.default", 1);
314 (void) nvlist_add_byte(pool_default->pool_props, "pool.active", 1);
316 "pool.importance", 1);
317 (void) nvlist_add_int64(pool_default->pool_props, "pool.sys_id",
355 pool_t *pool = pool_default;
359 for (pool = list_head(&pool_list); pool;
360 pool = list_next(&pool_list, pool)) {
361 if (nvlist_lookup_string(pool->pool_props,
362 "pool.name", &p) == 0 && strcmp(name, p) == 0)
363 return (pool);
371 pool_t *pool = pool_default;
374 for (pool = list_head(&pool_list); pool;
375 pool = list_next(&pool_list, pool)) {
376 if (pool->pool_id == poolid)
377 return (pool);
385 pool_t *pool = pool_default;
389 for (pool = list_head(&pool_list); pool != NULL;
390 pool = list_next(&pool_list, pool)) {
391 if (pool->pool_pset->pset_id == psetid)
392 return (pool);
398 * Create new pool, associate it with default resource sets, and give
404 pool_t *pool;
409 pool = kmem_zalloc(sizeof (pool_t), KM_SLEEP);
410 pool->pool_id = *poolid = id_alloc(pool_ids);
411 pool->pool_pset = pool_pset_default;
413 list_insert_tail(&pool_list, pool);
414 (void) nvlist_alloc(&pool->pool_props, NV_UNIQUE_NAME, KM_SLEEP);
415 (void) nvlist_add_int64(pool->pool_props, "pool.sys_id", pool->pool_id);
416 (void) nvlist_add_byte(pool->pool_props, "pool.default", 0);
420 (void) nvlist_add_string(pool->pool_props, "pool.name", pool_name);
431 * Update pool pointers for zones that are currently bound to pool "old"
432 * to be bound to pool "new".
448 * Destroy specified pool, and rebind all processes in it
449 * to the default pool.
454 pool_t *pool;
461 if ((pool = pool_lookup_pool_by_id(poolid)) == NULL)
467 dzarg.old = pool;
473 ASSERT(pool->pool_ref == 0);
474 (void) nvlist_free(pool->pool_props);
475 id_free(pool_ids, pool->pool_id);
476 pool->pool_pset->pset_npools--;
477 list_remove(&pool_list, pool);
480 kmem_free(pool, sizeof (pool_t));
486 * Create new pool or resource set.
519 * Destroy an existing pool or resource set.
585 * Associate pool with resource set.
610 * Disassociate resource set from pool.
649 pool_t *pool = pool_default;
653 for (pool = list_head(&pool_list); pool != NULL;
654 pool = list_next(&pool_list, pool)) {
655 if (pool->pool_pset->pset_id == psetid)
656 return (pool->pool_id);
698 pool_t *pool;
704 if ((pool = pool_lookup_pool_by_id(poolid)) == NULL)
716 return (pool_do_bind(pool, idtype, id, POOL_BIND_ALL));
720 * Query pool binding of the specifed process.
741 * In local zones, lie about pool bindings of processes from
745 pool_t *pool;
747 pool = zone_pool_get(curproc->p_zone);
748 *poolid = pool->pool_id;
796 pool_t *pool;
803 for (pool = list_head(&pool_list); pool;
804 pool = list_next(&pool_list, pool)) {
805 if (!INGLOBALZONE(curproc) && myzonepool != pool)
811 (void) ea_attach_item(eo_pool, &pool->pool_id, sizeof (id_t),
813 (void) ea_attach_item(eo_pool, &pool->pool_pset->pset_id,
815 (void) nvlist_pack(pool->pool_props, &buf, &bufsz,
826 * Pack the whole pool configuration in the specified buffer.
932 { "pool.sys_id", DATA_TYPE_UINT64, PP_READ },
933 { "pool.name", DATA_TYPE_STRING, PP_RDWR },
934 { "pool.default", DATA_TYPE_BYTE, PP_READ },
935 { "pool.active", DATA_TYPE_BYTE, PP_RDWR },
936 { "pool.importance", DATA_TYPE_INT64, PP_RDWR },
937 { "pool.comment", DATA_TYPE_STRING, PP_RDWR },
938 { "pool.scheduler", DATA_TYPE_STRING,
1004 pool_t *pool;
1008 if ((pool = pool_lookup_pool_by_id(poolid)) == NULL)
1010 ret = pool_propput_common(pool->pool_props, pair, pool_prop_pool);
1020 pool_t *pool;
1023 if ((pool = pool_lookup_pool_by_id(poolid)) == NULL)
1025 ret = pool_proprm_common(pool->pool_props, name, pool_prop_pool);
1195 * Return the scheduling class for this pool, or
1200 pool_get_class(pool_t *pool)
1207 if (nvlist_lookup_string(pool->pool_props, "pool.scheduler",
1238 * This process is in the pool barrier, so it can't possibly be
1240 * (for possible agent LWP which doesn't use pool barrier) as
1290 pool_get_name(pool_t *pool, char **name)
1294 (void) nvlist_lookup_string(pool->pool_props, "pool.name", name);
1305 * threads inside the pool barrier set, increment a counter by the
1318 * - int set_bind_start(procs, pool)
1321 * resource set associated with the given pool. If it can, take and hold
1326 * - void set_bind_abort(procs, pool)
1350 pool_do_bind(pool_t *pool, idtype_t idtype, id_t id, int flags)
1367 if ((cid = pool_get_class(pool)) == POOL_CLASS_INVAL)
1471 * If some threads in this process are inside the pool
1570 * the same task/project/pool/zone as the parent.
1600 * we're associating a pool with new resource set, destroying it,
1601 * or binding a zone to a pool.
1636 (rv = pset_bind_start(procs, pool)) != 0) {
1646 psetid_t psetid = pool->pool_pset->pset_id;
1673 * process if our target pool has it defined.
1688 if (p->p_pool != pool) {
1691 p->p_pool = pool;
1712 zone_pool_set(zone, pool);