• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.9.5/xnu-2422.115.4/osfmk/kern/

Lines Matching refs:threshold

90  * beyond the short-term, local timer queue threshold. The boot processor
92 * if and when that timer becomes due within the threshold.
108 timer_call_data_t timer; /* timer used by threshold management */
110 uint64_t scans; /* num threshold timer scans */
111 uint64_t preempts; /* num threshold reductions */
112 uint64_t latency; /* average threshold latency */
113 uint64_t latency_min; /* minimum threshold latency */
114 uint64_t latency_max; /* maximum threshold latency */
123 threshold_t threshold; /* longterm timer threshold */
1008 if (call == tlp->threshold.call)
1009 tlp->threshold.call = NULL;
1026 longterm_threshold = now + tlp->threshold.interval;
1035 (tlp->threshold.interval == TIMER_LONGTERM_NONE) ||
1057 * We'll need to update the currently set threshold timer
1060 if (deadline < tlp->threshold.deadline &&
1061 deadline < tlp->threshold.preempted) {
1062 tlp->threshold.preempted = deadline;
1063 tlp->threshold.call = call;
1080 * Scan for timers below the longterm threshold.
1086 * - if within the short-term threshold
1089 * - if sooner, deadline becomes the next threshold deadline.
1097 uint64_t threshold;
1104 if (tlp->threshold.interval != TIMER_LONGTERM_NONE)
1105 threshold = now + tlp->threshold.interval;
1107 threshold = TIMER_LONGTERM_NONE;
1109 tlp->threshold.deadline = TIMER_LONGTERM_NONE;
1110 tlp->threshold.call = NULL;
1136 if (deadline < threshold) {
1148 threshold,
1168 if (deadline < tlp->threshold.deadline) {
1169 tlp->threshold.deadline = deadline;
1170 tlp->threshold.call = call;
1195 tlp->threshold.deadline,
1196 tlp->threshold.preempted,
1200 if (tlp->threshold.preempted != TIMER_LONGTERM_NONE) {
1201 tlp->threshold.preempts++;
1202 tlp->threshold.deadline = tlp->threshold.preempted;
1203 tlp->threshold.preempted = TIMER_LONGTERM_NONE;
1210 tlp->threshold.scans++;
1214 * Clamp latency to 0 and ignore above threshold interval.
1216 if (tlp->scan_time > tlp->threshold.deadline_set)
1217 latency = tlp->scan_time - tlp->threshold.deadline_set;
1220 if (latency < tlp->threshold.interval) {
1221 tlp->threshold.latency_min =
1222 MIN(tlp->threshold.latency_min, latency);
1223 tlp->threshold.latency_max =
1224 MAX(tlp->threshold.latency_max, latency);
1225 tlp->threshold.latency =
1226 (tlp->threshold.latency*99 + latency) / 100;
1232 tlp->threshold.deadline_set = tlp->threshold.deadline;
1234 if (tlp->threshold.deadline != TIMER_LONGTERM_NONE) {
1235 tlp->threshold.deadline_set -= tlp->threshold.margin;
1236 tlp->threshold.deadline_set -= tlp->threshold.latency;
1242 tlp->threshold.deadline,
1243 tlp->threshold.scans,
1259 if (tlp->threshold.deadline != TIMER_LONGTERM_NONE)
1261 &tlp->threshold.timer,
1262 tlp->threshold.deadline_set,
1278 * Set the longterm timer threshold. Defaults to TIMER_LONGTERM_THRESHOLD
1282 tlp->threshold.interval = serverperfmode ? TIMER_LONGTERM_NONE
1285 tlp->threshold.interval = (longterm == 0) ?
1289 if (tlp->threshold.interval != TIMER_LONGTERM_NONE) {
1290 printf("Longterm timer threshold: %llu ms\n",
1291 tlp->threshold.interval / NSEC_PER_MSEC);
1292 kprintf("Longterm timer threshold: %llu ms\n",
1293 tlp->threshold.interval / NSEC_PER_MSEC);
1294 nanoseconds_to_absolutetime(tlp->threshold.interval,
1295 &tlp->threshold.interval);
1296 tlp->threshold.margin = tlp->threshold.interval / 10;
1297 tlp->threshold.latency_min = EndOfAllTime;
1298 tlp->threshold.latency_max = 0;
1301 tlp->threshold.preempted = TIMER_LONGTERM_NONE;
1302 tlp->threshold.deadline = TIMER_LONGTERM_NONE;
1311 timer_call_setup(&tlp->threshold.timer,
1329 return (tlp->threshold.interval == TIMER_LONGTERM_NONE) ?
1330 0 : tlp->threshold.interval / NSEC_PER_MSEC;
1340 return tlp->threshold.scans;
1342 return tlp->threshold.preempts;
1344 return tlp->threshold.latency;
1346 return tlp->threshold.latency_min;
1348 return tlp->threshold.latency_max;
1364 uint64_t threshold;
1368 if (tlp->threshold.interval != TIMER_LONGTERM_NONE)
1369 threshold = now + tlp->threshold.interval;
1371 threshold = TIMER_LONGTERM_NONE;
1388 if (deadline > threshold) {
1392 if (deadline < tlp->threshold.deadline) {
1393 tlp->threshold.deadline = deadline;
1394 tlp->threshold.call = call;
1411 timer_call_cancel(&tlp->threshold.timer);
1414 * Set the new threshold and note whther it's increasing.
1417 tlp->threshold.interval = TIMER_LONGTERM_NONE;
1419 timer_call_cancel(&tlp->threshold.timer);
1421 uint64_t old_interval = tlp->threshold.interval;
1422 tlp->threshold.interval = value * NSEC_PER_MSEC;
1423 nanoseconds_to_absolutetime(tlp->threshold.interval,
1424 &tlp->threshold.interval);
1425 tlp->threshold.margin = tlp->threshold.interval / 10;
1429 threshold_increase = (tlp->threshold.interval > old_interval);
1446 tlp->threshold.deadline_set = tlp->threshold.deadline;
1447 if (tlp->threshold.deadline != TIMER_LONGTERM_NONE) {
1448 tlp->threshold.deadline_set -= tlp->threshold.margin;
1449 tlp->threshold.deadline_set -= tlp->threshold.latency;
1451 &tlp->threshold.timer,
1452 tlp->threshold.deadline_set,
1460 tlp->threshold.scans = 0;
1461 tlp->threshold.preempts = 0;
1462 tlp->threshold.latency = 0;
1463 tlp->threshold.latency_min = EndOfAllTime;
1464 tlp->threshold.latency_max = 0;