Lines Matching defs:vmu_data

99  * copied into "vmu_data.vmu_cache_results".
104 * (vmu_data.vmu_all_vnodes_hash)
108 * (vmu_data.vmu_all_amps_hash)
125 * - The entire system (vmu_data.vmu_system).
257 typedef struct vmu_data {
258 kmutex_t vmu_lock; /* Protects vmu_data */
303 static vmu_data_t vmu_data;
332 bound->vmb_next = vmu_data.vmu_free_bounds;
336 vmu_data.vmu_free_bounds = bound;
355 obj->vmo_next = vmu_data.vmu_free_objects;
356 vmu_data.vmu_free_objects = obj;
374 entity->vme_next = vmu_data.vmu_free_entities;
375 vmu_data.vmu_free_entities = entity;
399 zone->vmz_next = vmu_data.vmu_free_zones;
400 vmu_data.vmu_free_zones = zone;
410 mutex_init(&vmu_data.vmu_lock, NULL, MUTEX_DEFAULT, NULL);
411 cv_init(&vmu_data.vmu_cv, NULL, CV_DEFAULT, NULL);
413 vmu_data.vmu_system = NULL;
414 vmu_data.vmu_zones_hash = NULL;
415 vmu_data.vmu_projects_col_hash = NULL;
416 vmu_data.vmu_rusers_col_hash = NULL;
417 vmu_data.vmu_eusers_col_hash = NULL;
419 vmu_data.vmu_free_bounds = NULL;
420 vmu_data.vmu_free_objects = NULL;
421 vmu_data.vmu_free_entities = NULL;
422 vmu_data.vmu_free_zones = NULL;
424 vmu_data.vmu_all_vnodes_hash = mod_hash_create_ptrhash(
427 vmu_data.vmu_all_amps_hash = mod_hash_create_ptrhash(
430 vmu_data.vmu_projects_col_hash = mod_hash_create_idhash(
433 vmu_data.vmu_rusers_col_hash = mod_hash_create_idhash(
436 vmu_data.vmu_eusers_col_hash = mod_hash_create_idhash(
439 vmu_data.vmu_zones_hash = mod_hash_create_idhash(
447 vmu_data.vmu_entities = NULL;
448 vmu_data.vmu_nentities = 0;
450 vmu_data.vmu_cache = NULL;
451 vmu_data.vmu_calc_thread = NULL;
452 vmu_data.vmu_calc_flags = 0;
453 vmu_data.vmu_pending_flags = 0;
454 vmu_data.vmu_pending_waiters = 0;
466 if (vmu_data.vmu_free_entities != NULL) {
467 entity = vmu_data.vmu_free_entities;
468 vmu_data.vmu_free_entities =
469 vmu_data.vmu_free_entities->vme_next;
493 entity->vme_next = vmu_data.vmu_entities;
494 vmu_data.vmu_entities = entity;
495 vmu_data.vmu_nentities++;
509 if (vmu_data.vmu_free_zones != NULL) {
510 zone = vmu_data.vmu_free_zones;
511 vmu_data.vmu_free_zones =
512 vmu_data.vmu_free_zones->vmz_next;
521 if ((vmu_data.vmu_calc_flags & (VMUSAGE_ZONE | VMUSAGE_ALL_ZONES)) != 0)
524 if ((vmu_data.vmu_calc_flags & (VMUSAGE_PROJECTS |
529 if ((vmu_data.vmu_calc_flags & (VMUSAGE_TASKS | VMUSAGE_ALL_TASKS))
534 if ((vmu_data.vmu_calc_flags & (VMUSAGE_RUSERS | VMUSAGE_ALL_RUSERS))
539 if ((vmu_data.vmu_calc_flags & (VMUSAGE_EUSERS | VMUSAGE_ALL_EUSERS))
555 if (vmu_data.vmu_free_objects != NULL) {
556 object = vmu_data.vmu_free_objects;
557 vmu_data.vmu_free_objects =
558 vmu_data.vmu_free_objects->vmo_next;
579 if (vmu_data.vmu_free_bounds != NULL) {
580 bound = vmu_data.vmu_free_bounds;
581 vmu_data.vmu_free_bounds =
582 vmu_data.vmu_free_bounds->vmb_next;
1146 vmu_data.vmu_all_vnodes_hash, (caddr_t)svd->vp,
1154 vmu_data.vmu_all_amps_hash, (caddr_t)svd->amp,
1166 vmu_data.vmu_all_amps_hash, (caddr_t)shmd->shm_amp,
1458 if ((vmu_data.vmu_system) != NULL) {
1459 tmp = vmu_data.vmu_system;
1463 if (vmu_data.vmu_calc_flags &
1468 ret = i_mod_hash_find_nosync(vmu_data.vmu_zones_hash,
1473 ret = i_mod_hash_insert_nosync(vmu_data.vmu_zones_hash,
1483 if (vmu_data.vmu_calc_flags &
1491 if (vmu_data.vmu_calc_flags &
1498 if (vmu_data.vmu_calc_flags &
1505 if (vmu_data.vmu_calc_flags &
1514 if (vmu_data.vmu_calc_flags & VMUSAGE_COL_PROJECTS) {
1515 tmp = vmu_find_insert_entity(vmu_data.vmu_projects_col_hash,
1520 if (vmu_data.vmu_calc_flags & VMUSAGE_COL_RUSERS) {
1521 tmp = vmu_find_insert_entity(vmu_data.vmu_rusers_col_hash,
1526 if (vmu_data.vmu_calc_flags & VMUSAGE_COL_EUSERS) {
1527 tmp = vmu_find_insert_entity(vmu_data.vmu_eusers_col_hash,
1550 if (vmu_data.vmu_system != NULL)
1551 vmu_free_entity(vmu_data.vmu_system);
1552 vmu_data.vmu_system = NULL;
1553 if (vmu_data.vmu_zones_hash != NULL)
1554 i_mod_hash_clear_nosync(vmu_data.vmu_zones_hash);
1555 if (vmu_data.vmu_projects_col_hash != NULL)
1556 i_mod_hash_clear_nosync(vmu_data.vmu_projects_col_hash);
1557 if (vmu_data.vmu_rusers_col_hash != NULL)
1558 i_mod_hash_clear_nosync(vmu_data.vmu_rusers_col_hash);
1559 if (vmu_data.vmu_eusers_col_hash != NULL)
1560 i_mod_hash_clear_nosync(vmu_data.vmu_eusers_col_hash);
1562 i_mod_hash_clear_nosync(vmu_data.vmu_all_vnodes_hash);
1563 i_mod_hash_clear_nosync(vmu_data.vmu_all_amps_hash);
1578 while (vmu_data.vmu_free_bounds != NULL) {
1579 tb = vmu_data.vmu_free_bounds;
1580 vmu_data.vmu_free_bounds = vmu_data.vmu_free_bounds->vmb_next;
1583 while (vmu_data.vmu_free_objects != NULL) {
1584 to = vmu_data.vmu_free_objects;
1585 vmu_data.vmu_free_objects =
1586 vmu_data.vmu_free_objects->vmo_next;
1589 while (vmu_data.vmu_free_entities != NULL) {
1590 te = vmu_data.vmu_free_entities;
1591 vmu_data.vmu_free_entities =
1592 vmu_data.vmu_free_entities->vme_next;
1601 while (vmu_data.vmu_free_zones != NULL) {
1602 tz = vmu_data.vmu_free_zones;
1603 vmu_data.vmu_free_zones =
1604 vmu_data.vmu_free_zones->vmz_next;
1636 if (vmu_data.vmu_calc_flags & VMUSAGE_SYSTEM)
1637 vmu_data.vmu_system = vmu_alloc_entity(0, VMUSAGE_SYSTEM,
1721 ASSERT(MUTEX_HELD(&vmu_data.vmu_lock));
1731 ASSERT(MUTEX_HELD(&vmu_data.vmu_lock));
1937 mutex_enter(&vmu_data.vmu_lock);
1941 if (vmu_data.vmu_cache != NULL) {
1945 if ((vmu_data.vmu_cache->vmc_timestamp +
1949 if ((vmu_data.vmu_cache->vmc_flags & flags) == flags &&
1951 cache = vmu_data.vmu_cache;
1953 mutex_exit(&vmu_data.vmu_lock);
1957 mutex_enter(&vmu_data.vmu_lock);
1959 if (vmu_data.vmu_pending_waiters > 0)
1960 cv_broadcast(&vmu_data.vmu_cv);
1961 mutex_exit(&vmu_data.vmu_lock);
1970 flags = vmu_data.vmu_cache->vmc_flags | flags;
1972 if (vmu_data.vmu_calc_thread == NULL) {
1976 vmu_data.vmu_calc_thread = curthread;
1977 vmu_data.vmu_calc_flags = flags;
1978 vmu_data.vmu_entities = NULL;
1979 vmu_data.vmu_nentities = 0;
1980 if (vmu_data.vmu_pending_waiters > 0)
1981 vmu_data.vmu_calc_flags |=
1982 vmu_data.vmu_pending_flags;
1984 vmu_data.vmu_pending_flags = 0;
1985 mutex_exit(&vmu_data.vmu_lock);
1987 mutex_enter(&vmu_data.vmu_lock);
1989 if (vmu_data.vmu_cache != NULL)
1990 vmu_cache_rele(vmu_data.vmu_cache);
1991 cache = vmu_data.vmu_cache =
1992 vmu_cache_alloc(vmu_data.vmu_nentities,
1993 vmu_data.vmu_calc_flags);
1996 for (entity = vmu_data.vmu_entities; entity != NULL;
2004 vmu_data.vmu_calc_flags = 0;
2005 vmu_data.vmu_calc_thread = NULL;
2007 if (vmu_data.vmu_pending_waiters > 0)
2008 cv_broadcast(&vmu_data.vmu_cv);
2010 mutex_exit(&vmu_data.vmu_lock);
2014 mutex_enter(&vmu_data.vmu_lock);
2016 mutex_exit(&vmu_data.vmu_lock);
2020 vmu_data.vmu_pending_flags |= flags;
2021 vmu_data.vmu_pending_waiters++;
2022 while (vmu_data.vmu_calc_thread != NULL) {
2023 if (cv_wait_sig(&vmu_data.vmu_cv,
2024 &vmu_data.vmu_lock) == 0) {
2025 vmu_data.vmu_pending_waiters--;
2026 mutex_exit(&vmu_data.vmu_lock);
2030 vmu_data.vmu_pending_waiters--;