Lines Matching refs:zone
811 zsd_zone_t *zone; in zsd_lookup_zone() local
813 for (zone = list_head(&ctl->zsctl_zones); zone != NULL; in zsd_lookup_zone()
814 zone = list_next(&ctl->zsctl_zones, zone)) { in zsd_lookup_zone()
815 if (strcmp(zone->zsz_name, zonename) == 0) { in zsd_lookup_zone()
817 zone->zsz_id = zoneid; in zsd_lookup_zone()
818 return (zone); in zsd_lookup_zone()
827 zsd_zone_t *zone; in zsd_lookup_zone_byid() local
829 for (zone = list_head(&ctl->zsctl_zones); zone != NULL; in zsd_lookup_zone_byid()
830 zone = list_next(&ctl->zsctl_zones, zone)) { in zsd_lookup_zone_byid()
831 if (zone->zsz_id == zoneid) in zsd_lookup_zone_byid()
832 return (zone); in zsd_lookup_zone_byid()
840 zsd_zone_t *zone; in zsd_allocate_zone() local
842 if ((zone = (zsd_zone_t *)calloc(1, sizeof (zsd_zone_t))) == NULL) in zsd_allocate_zone()
845 (void) strlcpy(zone->zsz_name, zonename, sizeof (zone->zsz_name)); in zsd_allocate_zone()
846 zone->zsz_id = zoneid; in zsd_allocate_zone()
847 zone->zsz_found = B_FALSE; in zsd_allocate_zone()
854 zone->zsz_start = g_now; in zsd_allocate_zone()
855 zone->zsz_hrstart = g_hrnow; in zsd_allocate_zone()
856 zone->zsz_deleted = B_TRUE; in zsd_allocate_zone()
858 zone->zsz_cpu_shares = ZS_LIMIT_NONE; in zsd_allocate_zone()
859 zone->zsz_cpu_cap = ZS_LIMIT_NONE; in zsd_allocate_zone()
860 zone->zsz_ram_cap = ZS_LIMIT_NONE; in zsd_allocate_zone()
861 zone->zsz_locked_cap = ZS_LIMIT_NONE; in zsd_allocate_zone()
862 zone->zsz_vm_cap = ZS_LIMIT_NONE; in zsd_allocate_zone()
864 zone->zsz_processes_cap = ZS_LIMIT_NONE; in zsd_allocate_zone()
865 zone->zsz_lwps_cap = ZS_LIMIT_NONE; in zsd_allocate_zone()
866 zone->zsz_shm_cap = ZS_LIMIT_NONE; in zsd_allocate_zone()
867 zone->zsz_shmids_cap = ZS_LIMIT_NONE; in zsd_allocate_zone()
868 zone->zsz_semids_cap = ZS_LIMIT_NONE; in zsd_allocate_zone()
869 zone->zsz_msgids_cap = ZS_LIMIT_NONE; in zsd_allocate_zone()
870 zone->zsz_lofi_cap = ZS_LIMIT_NONE; in zsd_allocate_zone()
874 return (zone); in zsd_allocate_zone()
880 zsd_zone_t *zone, *tmp; in zsd_lookup_insert_zone() local
882 if ((zone = zsd_lookup_zone(ctl, zonename, zoneid)) != NULL) in zsd_lookup_insert_zone()
883 return (zone); in zsd_lookup_insert_zone()
885 if ((zone = zsd_allocate_zone(ctl, zonename, zoneid)) == NULL) in zsd_lookup_insert_zone()
893 list_insert_before(&ctl->zsctl_zones, tmp, zone); in zsd_lookup_insert_zone()
894 return (zone); in zsd_lookup_insert_zone()
906 zsd_zone_t *zone; in zsd_mark_zones_start() local
908 for (zone = list_head(&ctl->zsctl_zones); zone != NULL; in zsd_mark_zones_start()
909 zone = list_next(&ctl->zsctl_zones, zone)) { in zsd_mark_zones_start()
910 zone->zsz_found = B_FALSE; in zsd_mark_zones_start()
988 zsd_zone_t *zone = usage->zsu_zone; in zsd_mark_pset_usage_found() local
1009 zone->zsz_empty = B_FALSE; in zsd_mark_pset_usage_found()
1013 if (zone->zsz_psetid == ZS_PSET_ERROR) in zsd_mark_pset_usage_found()
1014 zone->zsz_psetid = pset->zsp_id; in zsd_mark_pset_usage_found()
1015 else if (zone->zsz_psetid != pset->zsp_id) in zsd_mark_pset_usage_found()
1016 zone->zsz_psetid = ZS_PSET_MULTI; in zsd_mark_pset_usage_found()
1020 zone->zsz_scheds |= sched; in zsd_mark_pset_usage_found()
1038 zsd_zone_t *zone = usage->zsu_zone; in zsd_add_usage() local
1043 TIMESTRUC_ADD_TIMESTRUC(zone->zsz_cpu_usage, *delta); in zsd_add_usage()
1084 zsd_zone_t *zone; in zsd_mark_pset_usages_end() local
1116 zone = usage->zsu_zone; in zsd_mark_pset_usages_end()
1118 zone->zsz_cpu_shares != ZS_SHARES_UNLIMITED && in zsd_mark_pset_usages_end()
1119 zone->zsz_cpu_shares != 0) { in zsd_mark_pset_usages_end()
1120 zone = usage->zsu_zone; in zsd_mark_pset_usages_end()
1121 usage->zsu_cpu_shares = zone->zsz_cpu_shares; in zsd_mark_pset_usages_end()
1122 pset->zsp_cpu_shares += zone->zsz_cpu_shares; in zsd_mark_pset_usages_end()
1132 zsd_mark_zone_found(zsd_ctl_t *ctl, zsd_zone_t *zone, uint64_t cpu_shares, in zsd_mark_zone_found() argument
1143 assert(zone->zsz_found == B_FALSE); in zsd_mark_zone_found()
1149 zone->zsz_found = B_TRUE; in zsd_mark_zone_found()
1150 zone->zsz_empty = B_TRUE; in zsd_mark_zone_found()
1151 zone->zsz_deleted = B_FALSE; in zsd_mark_zone_found()
1157 if (zone->zsz_active == B_FALSE) in zsd_mark_zone_found()
1158 zone->zsz_new = B_TRUE; in zsd_mark_zone_found()
1160 zone->zsz_new = B_FALSE; in zsd_mark_zone_found()
1162 (void) strlcpy(zone->zsz_pool, poolname, sizeof (zone->zsz_pool)); in zsd_mark_zone_found()
1163 (void) strlcpy(zone->zsz_pset, psetname, sizeof (zone->zsz_pset)); in zsd_mark_zone_found()
1164 zone->zsz_default_sched = sched; in zsd_mark_zone_found()
1167 zone->zsz_scheds = 0; in zsd_mark_zone_found()
1170 zone->zsz_cpus_online = 0; in zsd_mark_zone_found()
1172 zone->zsz_cputype = cputype; in zsd_mark_zone_found()
1173 zone->zsz_iptype = iptype; in zsd_mark_zone_found()
1174 zone->zsz_psetid = ZS_PSET_ERROR; in zsd_mark_zone_found()
1175 zone->zsz_cpu_cap = cpu_cap; in zsd_mark_zone_found()
1176 zone->zsz_cpu_shares = cpu_shares; in zsd_mark_zone_found()
1177 zone->zsz_ram_cap = ram_cap; in zsd_mark_zone_found()
1178 zone->zsz_locked_cap = locked_cap; in zsd_mark_zone_found()
1179 zone->zsz_vm_cap = vm_cap; in zsd_mark_zone_found()
1180 zone->zsz_processes_cap = processes_cap; in zsd_mark_zone_found()
1181 zone->zsz_processes = processes; in zsd_mark_zone_found()
1182 zone->zsz_lwps_cap = lwps_cap; in zsd_mark_zone_found()
1183 zone->zsz_lwps = lwps; in zsd_mark_zone_found()
1184 zone->zsz_shm_cap = shm_cap; in zsd_mark_zone_found()
1185 zone->zsz_shm = shm; in zsd_mark_zone_found()
1186 zone->zsz_shmids_cap = shmids_cap; in zsd_mark_zone_found()
1187 zone->zsz_shmids = shmids; in zsd_mark_zone_found()
1188 zone->zsz_semids_cap = semids_cap; in zsd_mark_zone_found()
1189 zone->zsz_semids = semids; in zsd_mark_zone_found()
1190 zone->zsz_msgids_cap = msgids_cap; in zsd_mark_zone_found()
1191 zone->zsz_msgids = msgids; in zsd_mark_zone_found()
1192 zone->zsz_lofi_cap = lofi_cap; in zsd_mark_zone_found()
1193 zone->zsz_lofi = lofi; in zsd_mark_zone_found()
1202 zone->zsz_active = B_TRUE; in zsd_mark_zone_found()
1210 zsd_zone_t *zone, *tmp; in zsd_mark_zones_end() local
1216 zone = list_head(&ctl->zsctl_zones); in zsd_mark_zones_end()
1217 while (zone != NULL) { in zsd_mark_zones_end()
1218 if (zone->zsz_found == B_FALSE) { in zsd_mark_zones_end()
1219 zone->zsz_empty = B_TRUE; in zsd_mark_zones_end()
1220 if (zone->zsz_deleted == B_TRUE) { in zsd_mark_zones_end()
1225 tmp = zone; in zsd_mark_zones_end()
1226 zone = list_next(&ctl->zsctl_zones, zone); in zsd_mark_zones_end()
1232 zone->zsz_new = B_FALSE; in zsd_mark_zones_end()
1233 zone->zsz_deleted = B_TRUE; in zsd_mark_zones_end()
1234 zone->zsz_active = B_TRUE; in zsd_mark_zones_end()
1237 zone = list_next(&ctl->zsctl_zones, zone); in zsd_mark_zones_end()
1451 zsd_lookup_usage(zsd_pset_t *pset, zsd_zone_t *zone) in zsd_lookup_usage() argument
1457 if (usage->zsu_zone == zone) in zsd_lookup_usage()
1464 zsd_allocate_pset_usage(zsd_ctl_t *ctl, zsd_pset_t *pset, zsd_zone_t *zone) in zsd_allocate_pset_usage() argument
1473 usage->zsu_zone = zone; in zsd_allocate_pset_usage()
1474 usage->zsu_zoneid = zone->zsz_id; in zsd_allocate_pset_usage()
1498 zsd_lookup_insert_usage(zsd_ctl_t *ctl, zsd_pset_t *pset, zsd_zone_t *zone) in zsd_lookup_insert_usage() argument
1502 if ((usage = zsd_lookup_usage(pset, zone)) in zsd_lookup_insert_usage()
1506 if ((usage = zsd_allocate_pset_usage(ctl, pset, zone)) == NULL) in zsd_lookup_insert_usage()
1510 while (tmp != NULL && strcmp(zone->zsz_name, tmp->zsu_zone->zsz_name) in zsd_lookup_insert_usage()
2038 zsd_get_zone_pool_pset(zsd_ctl_t *ctl, zsd_zone_t *zone, in zsd_get_zone_pool_pset() argument
2054 ret = zone_getattr(zone->zsz_id, ZONE_ATTR_POOLID, in zsd_get_zone_pool_pset()
2199 zsd_get_zone_caps(zsd_ctl_t *ctl, zsd_zone_t *zone, uint64_t *cpu_shares, in zsd_get_zone_caps() argument
2239 ret = zone_getattr(zone->zsz_id, ZONE_ATTR_PHYS_MCAP, in zsd_get_zone_caps()
2245 ret = zone_getattr(zone->zsz_id, ZONE_ATTR_SCHED_CLASS, in zsd_get_zone_caps()
2273 if (zone->zsz_id != getzoneid()) { in zsd_get_zone_caps()
2274 if (zone_enter(zone->zsz_id) < 0) { in zsd_get_zone_caps()
2376 zsd_zone_t *zone; in zsd_refresh_zones() local
2433 zone = zsd_lookup_insert_zone(ctl, zonename, in zsd_refresh_zones()
2446 zsd_get_zone_pool_pset(ctl, zone, poolname, sizeof (poolname), in zsd_refresh_zones()
2449 if (zsd_get_zone_caps(ctl, zone, &cpu_shares, &cpu_cap, in zsd_refresh_zones()
2456 zsd_mark_zone_found(ctl, zone, cpu_shares, cpu_cap, ram_cap, in zsd_refresh_zones()
2624 zsd_zone_t *zone, *prev_zone; in zsd_refresh_procs() local
2691 zone = zsd_lookup_zone_byid(ctl, zoneid); in zsd_refresh_procs()
2692 if (zone == NULL) in zsd_refresh_procs()
2697 usage = zsd_lookup_insert_usage(ctl, pset, zone); in zsd_refresh_procs()
2718 prev_zone = zone; in zsd_refresh_procs()
2776 zone = NULL; in zsd_refresh_procs()
2871 zone = zsd_lookup_zone(ctl, in zsd_refresh_procs()
2924 if (zone == NULL) in zsd_refresh_procs()
2929 proc->zspr_zoneid = zone->zsz_id; in zsd_refresh_procs()
2955 } else if (pproc->zspr_zoneid == zone->zsz_id && in zsd_refresh_procs()
2977 usage = zsd_lookup_insert_usage(ctl, pset, zone); in zsd_refresh_procs()
3043 zone = zsd_lookup_zone_byid(ctl, in zsd_refresh_procs()
3045 if (zone == NULL) { in zsd_refresh_procs()
3062 usage = zsd_lookup_insert_usage(ctl, pset, zone); in zsd_refresh_procs()
3087 zone = zsd_lookup_zone_byid(ctl, proc->zspr_zoneid); in zsd_refresh_procs()
3088 if (zone == NULL) in zsd_refresh_procs()
3090 if (zone->zsz_psetid != ZS_PSET_ERROR && in zsd_refresh_procs()
3091 zone->zsz_psetid != ZS_PSET_MULTI) { in zsd_refresh_procs()
3092 prev_psetid = zone->zsz_psetid; in zsd_refresh_procs()
3095 pset = zsd_lookup_pset(ctl, zone->zsz_pset, -1); in zsd_refresh_procs()
3102 sched = zone->zsz_scheds; in zsd_refresh_procs()
3115 sched = zone->zsz_default_sched; in zsd_refresh_procs()
3118 usage = zsd_lookup_insert_usage(ctl, pset, zone); in zsd_refresh_procs()
3238 zsd_zone_t *zone; in zsd_refresh_memory() local
3428 zone = zsd_lookup_zone_byid(ctl, vmusage[i].vmu_id); in zsd_refresh_memory()
3429 if (zone != NULL) in zsd_refresh_memory()
3430 zone->zsz_usage_ram = vmusage[i].vmu_rss_all; in zsd_refresh_memory()
3449 for (zone = list_head(&ctl->zsctl_zones); zone != NULL; in zsd_refresh_memory()
3450 zone = list_next(&ctl->zsctl_zones, zone)) { in zsd_refresh_memory()
3453 if (zone->zsz_active == B_FALSE || in zsd_refresh_memory()
3454 zone->zsz_deleted == B_TRUE) { in zsd_refresh_memory()
3455 zone->zsz_usage_ram = 0; in zsd_refresh_memory()
3456 zone->zsz_usage_vm = 0; in zsd_refresh_memory()
3457 zone->zsz_usage_locked = 0; in zsd_refresh_memory()
3462 if (zone->zsz_usage_ram > phys_zones_credit) { in zsd_refresh_memory()
3463 zone->zsz_usage_ram -= phys_zones_credit; in zsd_refresh_memory()
3470 zone->zsz_usage_vm = 0; in zsd_refresh_memory()
3472 "swapresv_zone_%d", zone->zsz_id); in zsd_refresh_memory()
3475 zone->zsz_id, kstat_name); in zsd_refresh_memory()
3482 zone->zsz_usage_vm = knp->value.ui64; in zsd_refresh_memory()
3490 zone->zsz_usage_locked = 0; in zsd_refresh_memory()
3492 "lockedmem_zone_%d", zone->zsz_id); in zsd_refresh_memory()
3495 zone->zsz_id, kstat_name); in zsd_refresh_memory()
3502 zone->zsz_usage_locked = knp->value.ui64; in zsd_refresh_memory()
3508 if (zone->zsz_usage_locked > in zsd_refresh_memory()
3509 zone->zsz_usage_ram) in zsd_refresh_memory()
3510 zone->zsz_usage_locked = in zsd_refresh_memory()
3511 zone->zsz_usage_ram; in zsd_refresh_memory()
3513 zone->zsz_usage_locked; in zsd_refresh_memory()
3558 zsd_zone_t *zone; in zsd_refresh_cpu_stats() local
3623 zone = usage->zsu_zone; in zsd_refresh_cpu_stats()
3636 TIMESTRUC_ADD_NANOSEC(zone->zsz_share_time, in zsd_refresh_cpu_stats()
3640 TIMESTRUC_ADD_TIMESTRUC(zone->zsz_pset_time, delta); in zsd_refresh_cpu_stats()
3642 zone->zsz_cpus_online += pset->zsp_online; in zsd_refresh_cpu_stats()
3647 for (zone = list_head(&ctl->zsctl_zones); zone != NULL; in zsd_refresh_cpu_stats()
3648 zone = list_next(&ctl->zsctl_zones, zone)) { in zsd_refresh_cpu_stats()
3651 if (zone->zsz_cpu_cap != ZS_LIMIT_NONE) { in zsd_refresh_cpu_stats()
3655 elapsed *= zone->zsz_cpu_cap; in zsd_refresh_cpu_stats()
3657 TIMESTRUC_ADD_NANOSEC(zone->zsz_cap_time, elapsed); in zsd_refresh_cpu_stats()
3697 zs_zone_t *zone = NULL; in zsd_usage_cache_update() local
3777 zone = (zs_zone_t *)next; in zsd_usage_cache_update()
3779 list_link_init(&zone->zsz_next); in zsd_usage_cache_update()
3780 zone->zsz_system = NULL; in zsd_usage_cache_update()
3782 (void) strlcpy(zone->zsz_name, dzone->zsz_name, in zsd_usage_cache_update()
3783 sizeof (zone->zsz_name)); in zsd_usage_cache_update()
3784 (void) strlcpy(zone->zsz_pool, dzone->zsz_pool, in zsd_usage_cache_update()
3785 sizeof (zone->zsz_pool)); in zsd_usage_cache_update()
3786 (void) strlcpy(zone->zsz_pset, dzone->zsz_pset, in zsd_usage_cache_update()
3787 sizeof (zone->zsz_pset)); in zsd_usage_cache_update()
3788 zone->zsz_id = dzone->zsz_id; in zsd_usage_cache_update()
3789 zone->zsz_cputype = dzone->zsz_cputype; in zsd_usage_cache_update()
3790 zone->zsz_iptype = dzone->zsz_iptype; in zsd_usage_cache_update()
3791 zone->zsz_start = dzone->zsz_start; in zsd_usage_cache_update()
3792 zone->zsz_hrstart = dzone->zsz_hrstart; in zsd_usage_cache_update()
3793 zone->zsz_scheds = dzone->zsz_scheds; in zsd_usage_cache_update()
3794 zone->zsz_cpu_shares = dzone->zsz_cpu_shares; in zsd_usage_cache_update()
3795 zone->zsz_cpu_cap = dzone->zsz_cpu_cap; in zsd_usage_cache_update()
3796 zone->zsz_ram_cap = dzone->zsz_ram_cap; in zsd_usage_cache_update()
3797 zone->zsz_vm_cap = dzone->zsz_vm_cap; in zsd_usage_cache_update()
3798 zone->zsz_locked_cap = dzone->zsz_locked_cap; in zsd_usage_cache_update()
3799 zone->zsz_cpu_usage = dzone->zsz_cpu_usage; in zsd_usage_cache_update()
3800 zone->zsz_cpus_online = dzone->zsz_cpus_online; in zsd_usage_cache_update()
3801 zone->zsz_pset_time = dzone->zsz_pset_time; in zsd_usage_cache_update()
3802 zone->zsz_cap_time = dzone->zsz_cap_time; in zsd_usage_cache_update()
3803 zone->zsz_share_time = dzone->zsz_share_time; in zsd_usage_cache_update()
3804 zone->zsz_usage_ram = dzone->zsz_usage_ram; in zsd_usage_cache_update()
3805 zone->zsz_usage_locked = dzone->zsz_usage_locked; in zsd_usage_cache_update()
3806 zone->zsz_usage_vm = dzone->zsz_usage_vm; in zsd_usage_cache_update()
3808 zone->zsz_processes_cap = dzone->zsz_processes_cap; in zsd_usage_cache_update()
3809 zone->zsz_lwps_cap = dzone->zsz_lwps_cap; in zsd_usage_cache_update()
3810 zone->zsz_shm_cap = dzone->zsz_shm_cap; in zsd_usage_cache_update()
3811 zone->zsz_shmids_cap = dzone->zsz_shmids_cap; in zsd_usage_cache_update()
3812 zone->zsz_semids_cap = dzone->zsz_semids_cap; in zsd_usage_cache_update()
3813 zone->zsz_msgids_cap = dzone->zsz_msgids_cap; in zsd_usage_cache_update()
3814 zone->zsz_lofi_cap = dzone->zsz_lofi_cap; in zsd_usage_cache_update()
3816 zone->zsz_processes = dzone->zsz_processes; in zsd_usage_cache_update()
3817 zone->zsz_lwps = dzone->zsz_lwps; in zsd_usage_cache_update()
3818 zone->zsz_shm = dzone->zsz_shm; in zsd_usage_cache_update()
3819 zone->zsz_shmids = dzone->zsz_shmids; in zsd_usage_cache_update()
3820 zone->zsz_semids = dzone->zsz_semids; in zsd_usage_cache_update()
3821 zone->zsz_msgids = dzone->zsz_msgids; in zsd_usage_cache_update()
3822 zone->zsz_lofi = dzone->zsz_lofi; in zsd_usage_cache_update()
3915 zsd_zone_t *zone; in zsd_close() local
3936 while ((zone = list_head(&ctl->zsctl_zones)) != NULL) { in zsd_close()
3937 list_remove(&ctl->zsctl_zones, zone); in zsd_close()
3938 free(zone); in zsd_close()
4207 zs_zone_t *zone, *czone; in zsd_usage_filter() local
4251 zone = (zs_zone_t *)(start + size); in zsd_usage_filter()
4257 *zone = *czone; in zsd_usage_filter()
4264 sys->zss_ram_kern += (sys->zss_ram_zones - zone->zsz_usage_ram); in zsd_usage_filter()
4265 sys->zss_ram_zones = zone->zsz_usage_ram; in zsd_usage_filter()
4267 sys->zss_vm_kern += (sys->zss_vm_zones - zone->zsz_usage_vm); in zsd_usage_filter()
4268 sys->zss_vm_zones = zone->zsz_usage_vm; in zsd_usage_filter()
4271 zone->zsz_usage_locked); in zsd_usage_filter()
4272 sys->zss_locked_zones = zone->zsz_usage_locked; in zsd_usage_filter()
4274 TIMESTRUC_DELTA(delta, sys->zss_cpu_usage_zones, zone->zsz_cpu_usage); in zsd_usage_filter()
4276 sys->zss_cpu_usage_zones = zone->zsz_cpu_usage; in zsd_usage_filter()