Lines Matching refs:threshold
153 threshold_t threshold; /* longterm timer threshold */ member
1273 if (call == tlp->threshold.call) { in timer_longterm_dequeued_locked()
1274 tlp->threshold.call = NULL; in timer_longterm_dequeued_locked()
1296 longterm_threshold = now + tlp->threshold.interval; in timer_longterm_enqueue_unlocked()
1305 (tlp->threshold.interval == TIMER_LONGTERM_NONE) || in timer_longterm_enqueue_unlocked()
1335 if (deadline < tlp->threshold.deadline && in timer_longterm_enqueue_unlocked()
1336 deadline < tlp->threshold.preempted) { in timer_longterm_enqueue_unlocked()
1337 tlp->threshold.preempted = deadline; in timer_longterm_enqueue_unlocked()
1338 tlp->threshold.call = call; in timer_longterm_enqueue_unlocked()
1378 uint64_t threshold = TIMER_LONGTERM_NONE; in timer_longterm_scan() local
1386 if (tlp->threshold.interval != TIMER_LONGTERM_NONE) { in timer_longterm_scan()
1387 threshold = time_start + tlp->threshold.interval; in timer_longterm_scan()
1390 tlp->threshold.deadline = TIMER_LONGTERM_NONE; in timer_longterm_scan()
1391 tlp->threshold.call = NULL; in timer_longterm_scan()
1415 if (deadline < threshold) { in timer_longterm_scan()
1427 threshold, in timer_longterm_scan()
1448 if (deadline < tlp->threshold.deadline) { in timer_longterm_scan()
1449 tlp->threshold.deadline = deadline; in timer_longterm_scan()
1450 tlp->threshold.call = call; in timer_longterm_scan()
1457 tlp->threshold.deadline = TIMER_LONGTERM_SCAN_AGAIN; in timer_longterm_scan()
1484 tlp->threshold.deadline, in timer_longterm_update_locked()
1485 tlp->threshold.preempted, in timer_longterm_update_locked()
1489 if (tlp->threshold.preempted != TIMER_LONGTERM_NONE) { in timer_longterm_update_locked()
1490 tlp->threshold.preempts++; in timer_longterm_update_locked()
1491 tlp->threshold.deadline = tlp->threshold.preempted; in timer_longterm_update_locked()
1492 tlp->threshold.preempted = TIMER_LONGTERM_NONE; in timer_longterm_update_locked()
1499 tlp->threshold.scans++; in timer_longterm_update_locked()
1505 if (tlp->scan_time > tlp->threshold.deadline_set) { in timer_longterm_update_locked()
1506 latency = tlp->scan_time - tlp->threshold.deadline_set; in timer_longterm_update_locked()
1510 if (latency < tlp->threshold.interval) { in timer_longterm_update_locked()
1511 tlp->threshold.latency_min = in timer_longterm_update_locked()
1512 MIN(tlp->threshold.latency_min, latency); in timer_longterm_update_locked()
1513 tlp->threshold.latency_max = in timer_longterm_update_locked()
1514 MAX(tlp->threshold.latency_max, latency); in timer_longterm_update_locked()
1515 tlp->threshold.latency = in timer_longterm_update_locked()
1516 (tlp->threshold.latency * 99 + latency) / 100; in timer_longterm_update_locked()
1522 tlp->threshold.deadline_set = tlp->threshold.deadline; in timer_longterm_update_locked()
1524 if (tlp->threshold.deadline != TIMER_LONGTERM_NONE && in timer_longterm_update_locked()
1525 tlp->threshold.deadline != TIMER_LONGTERM_SCAN_AGAIN) { in timer_longterm_update_locked()
1526 tlp->threshold.deadline_set -= tlp->threshold.margin; in timer_longterm_update_locked()
1527 tlp->threshold.deadline_set -= tlp->threshold.latency; in timer_longterm_update_locked()
1532 if (tlp->threshold.deadline_set < scan_clamp) { in timer_longterm_update_locked()
1533 tlp->threshold.deadline_set = scan_clamp; in timer_longterm_update_locked()
1539 tlp->threshold.deadline, in timer_longterm_update_locked()
1540 tlp->threshold.scans, in timer_longterm_update_locked()
1557 if (tlp->threshold.deadline != TIMER_LONGTERM_NONE) { in timer_longterm_update()
1559 &tlp->threshold.timer, in timer_longterm_update()
1560 tlp->threshold.deadline_set, in timer_longterm_update()
1581 tlp->threshold.interval = serverperfmode ? TIMER_LONGTERM_NONE in timer_longterm_init()
1584 tlp->threshold.interval = (longterm == 0) ? in timer_longterm_init()
1588 if (tlp->threshold.interval != TIMER_LONGTERM_NONE) { in timer_longterm_init()
1590 tlp->threshold.interval / NSEC_PER_MSEC); in timer_longterm_init()
1592 tlp->threshold.interval / NSEC_PER_MSEC); in timer_longterm_init()
1593 nanoseconds_to_absolutetime(tlp->threshold.interval, in timer_longterm_init()
1594 &tlp->threshold.interval); in timer_longterm_init()
1595 tlp->threshold.margin = tlp->threshold.interval / 10; in timer_longterm_init()
1596 tlp->threshold.latency_min = EndOfAllTime; in timer_longterm_init()
1597 tlp->threshold.latency_max = 0; in timer_longterm_init()
1600 tlp->threshold.preempted = TIMER_LONGTERM_NONE; in timer_longterm_init()
1601 tlp->threshold.deadline = TIMER_LONGTERM_NONE; in timer_longterm_init()
1605 timer_call_setup(&tlp->threshold.timer, in timer_longterm_init()
1625 return (tlp->threshold.interval == TIMER_LONGTERM_NONE) ? in timer_sysctl_get()
1626 0 : tlp->threshold.interval / NSEC_PER_MSEC; in timer_sysctl_get()
1636 return tlp->threshold.scans; in timer_sysctl_get()
1638 return tlp->threshold.preempts; in timer_sysctl_get()
1640 return tlp->threshold.latency; in timer_sysctl_get()
1642 return tlp->threshold.latency_min; in timer_sysctl_get()
1644 return tlp->threshold.latency_max; in timer_sysctl_get()
1674 uint64_t threshold; in timer_master_scan() local
1678 if (tlp->threshold.interval != TIMER_LONGTERM_NONE) { in timer_master_scan()
1679 threshold = now + tlp->threshold.interval; in timer_master_scan()
1681 threshold = TIMER_LONGTERM_NONE; in timer_master_scan()
1697 if (deadline > threshold) { in timer_master_scan()
1701 if (deadline < tlp->threshold.deadline) { in timer_master_scan()
1702 tlp->threshold.deadline = deadline; in timer_master_scan()
1703 tlp->threshold.call = call; in timer_master_scan()
1721 timer_call_cancel(&tlp->threshold.timer); in timer_sysctl_set_threshold()
1727 tlp->threshold.interval = TIMER_LONGTERM_NONE; in timer_sysctl_set_threshold()
1729 timer_call_cancel(&tlp->threshold.timer); in timer_sysctl_set_threshold()
1731 uint64_t old_interval = tlp->threshold.interval; in timer_sysctl_set_threshold()
1732 tlp->threshold.interval = value * NSEC_PER_MSEC; in timer_sysctl_set_threshold()
1733 nanoseconds_to_absolutetime(tlp->threshold.interval, in timer_sysctl_set_threshold()
1734 &tlp->threshold.interval); in timer_sysctl_set_threshold()
1735 tlp->threshold.margin = tlp->threshold.interval / 10; in timer_sysctl_set_threshold()
1739 threshold_increase = (tlp->threshold.interval > old_interval); in timer_sysctl_set_threshold()
1757 tlp->threshold.deadline_set = tlp->threshold.deadline; in timer_sysctl_set_threshold()
1758 if (tlp->threshold.deadline != TIMER_LONGTERM_NONE) { in timer_sysctl_set_threshold()
1759 tlp->threshold.deadline_set -= tlp->threshold.margin; in timer_sysctl_set_threshold()
1760 tlp->threshold.deadline_set -= tlp->threshold.latency; in timer_sysctl_set_threshold()
1762 &tlp->threshold.timer, in timer_sysctl_set_threshold()
1763 tlp->threshold.deadline_set, in timer_sysctl_set_threshold()
1772 tlp->threshold.scans = 0; in timer_sysctl_set_threshold()
1773 tlp->threshold.preempts = 0; in timer_sysctl_set_threshold()
1774 tlp->threshold.latency = 0; in timer_sysctl_set_threshold()
1775 tlp->threshold.latency_min = EndOfAllTime; in timer_sysctl_set_threshold()
1776 tlp->threshold.latency_max = 0; in timer_sysctl_set_threshold()