Lines Matching defs:zone
43 * A CPU cap can be set on any project or any zone. Zone CPU cap limits the CPU
44 * usage for all projects running inside the zone. If the zone CPU cap is set
50 * below the cap level. Each zone and each project has its own wait queue.
57 * zone's CPU usage drops below the cap.
61 * CPU usage to its project. Usage from all projects belonging to a capped zone
62 * is aggregated to get the zone usage.
64 * When the current CPU usage is above the cap, a project or zone is considered
66 * zone is marked by setting TS_PROJWAITQ flag in thread's t_schedflag field and
87 * Zone CPU usage is the sum of usages for all projects within the zone. Zone
108 * capped_projects list if its zone has a cap.
122 * Set zone cap of the specified zone to the specified value. Setting the value
127 * Remove the association between the zone and its cap.
133 * Otherwise returns True if project or zone should be penalized because its
134 * project or zone is exceeding its cap. Also sets TS_PROJWAITQ or TS_ZONEWAITQ
140 * state on project or zone wait queues, as requested by TS_PROJWAITQ or
157 * between a thread and its project and, as a consequence, to its zone. The
158 * association can not break while thread lock is held, so the project or zone
172 * Changing zone caps also sets cpucaps_busy to avoid races when a zone cap is
173 * modified in parallel. This can be per-zone cap flag, but we don't keep any
414 * Enable cap for a zone
415 * It is safe to enable already enabled zone cap.
419 cap_zone_enable(zone_t *zone, hrtime_t value)
421 cpucap_t *cap = zone->zone_cpucap;
429 cap->cap_zone = zone;
434 if ((cap->cap_kstat = rctl_kstat_create_zone(zone, "cpucaps",
450 * Disable zone cap.
451 * It is safe to disable already disabled zone cap.
455 cap_zone_disable(zone_t *zone)
457 cpucap_t *cap = zone->zone_cpucap;
461 ASSERT(cap->cap_zone == zone);
512 * Add this cap project usage to its zone usage.
518 zone_t *zone = cap->cap_zone;
523 ASSERT(zone == cap->cap_project->kpj_zone);
533 * Add project's CPU usage to our zone's CPU usage.
535 if (ZONE_IS_CAPPED(zone)) {
536 cpucap_t *zcap = zone->zone_cpucap;
538 ASSERT(zcap->cap_zone == zone);
541 * If we haven't reset this zone's usage during this clock tick
543 * whether this is the first zone's project we see during this
570 * Also walk the list of zone caps checking whether any threads should
588 * The function is called for each project in a zone when the zone cap is
589 * modified. It enables project caps if zone cap is enabled and disables if the
590 * zone cap is disabled and project doesn't have its own cap.
629 * Remove all projects in this zone without caps
648 * Set zone cap to cap_val
649 * If cap_val is equal to NOCAP, disable zone cap.
651 * If this is the first time a cap is set on a zone, allocate cpucap structure
655 cpucaps_zone_set(zone_t *zone, rctl_qty_t cap_val)
668 * Nothing to do if trying to disable a cap on a zone when caps are off
669 * or a zone which does not have a cap yet.
671 if ((CPUCAPS_OFF() || !ZONE_IS_CAPPED(zone)) && (cap_val == NOCAP))
674 if (zone->zone_cpucap == NULL)
685 * Double-check whether zone->zone_cpucap is NULL, now with caps_lock
688 if (zone->zone_cpucap == NULL) {
689 zone->zone_cpucap = cap;
694 cap = zone->zone_cpucap;
714 * Remove cap for the zone
716 cap_zone_disable(zone);
720 * Disable caps for all project belonging to this zone
723 (void) project_walk_all(zone->zone_id,
731 * Set a cap on a zone which previously was not capped.
733 cap_zone_enable(zone, value);
738 * Enable cap for all projects belonging to this zone.
740 (void) project_walk_all(zone->zone_id,
776 * The zone is going away, so disable its cap.
779 cpucaps_zone_remove(zone_t *zone)
782 while (ZONE_IS_CAPPED(zone)) {
784 (void) cpucaps_zone_set(zone, NOCAP);
787 if (zone->zone_cpucap != NULL) {
788 cap_free(zone->zone_cpucap);
789 zone->zone_cpucap = NULL;
796 * its zone has a cap.
909 * capped zone, keep the cap and set the value to MAX_USAGE,
942 * Get current zone usage.
945 cpucaps_zone_get(zone_t *zone)
947 return (cap_get(zone->zone_cpucap));
1011 * Charge thread's project and return True if project or zone should be
1012 * penalized because its project or zone is exceeding its cap. Also sets
1027 zone_t *zone;
1055 zone = ttozone(t);
1056 if (!ZONE_IS_CAPPED(zone)) {
1060 cpucap_t *zone_cap = zone->zone_cpucap;
1081 * threads marked with TS_ZONEWAITQ are placed on their zone wait queue.