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

Lines Matching refs:call

106 	timer_call_t	call;		/* first/soonest longterm timer call */
142 timer_call_t call,
147 timer_call_t call);
157 static boolean_t timer_call_enter_internal(timer_call_t call, timer_call_param_t param1, uint64_t deadline, uint64_t leeway, uint32_t flags, boolean_t ratelimited);
161 timer_call_t call,
166 timer_call_t call);
191 timer_call_t call,
195 DBG("timer_call_setup(%p,%p,%p)\n", call, func, param0);
196 call_entry_setup(CE(call), func, param0);
197 simple_lock_init(&(call)->lock, 0);
198 call->async_dequeue = FALSE;
202 * Timer call entry locking model
205 * Timer call entries are linked on per-cpu timer queues which are protected
206 * by the queue lock and the call entry lock. The locking protocol is:
208 * 0) The canonical locking order is timer call entry followed by queue.
213 * After locking the queue, the call.async_dequeue flag must be checked:
219 * 2a) If a try-lock of a queued entry succeeds, the call can be operated on
237 * In the debug case, we assert that the timer call locking protocol
372 timer_call_t call,
376 call_entry_t entry = CE(call);
379 DBG("timer_call_enqueue_deadline_unlocked(%p,%p,)\n", call, queue);
381 simple_lock(&call->lock);
385 if (call->async_dequeue) {
390 call,
391 call->async_dequeue,
392 CE(call)->queue,
396 call->async_dequeue = FALSE;
399 timer_call_entry_dequeue(call);
405 timer_longterm_dequeued_locked(call);
414 timer_call_entry_enqueue_deadline(call, queue, deadline);
416 simple_unlock(&call->lock);
427 timer_call_t call)
429 call_entry_t entry = CE(call);
432 DBG("timer_call_dequeue_unlocked(%p)\n", call);
434 simple_lock(&call->lock);
439 call,
440 call->async_dequeue,
441 CE(call)->queue,
446 if (call->async_dequeue) {
451 call,
452 call->async_dequeue,
453 CE(call)->queue,
457 call->async_dequeue = FALSE;
460 timer_call_entry_dequeue(call);
463 timer_longterm_dequeued_locked(call);
466 simple_unlock(&call->lock);
472 timer_call_t call,
487 call->soft_deadline = deadline;
488 call->flags = flags;
494 call,
522 call->soft_deadline = deadline;
526 * this particular timer call requires rate-limiting
533 call->soft_deadline |= 1ULL;
535 call->soft_deadline &= ~0x1ULL;
538 call->ttd = call->soft_deadline - ctime;
541 DTRACE_TMR7(callout__create, timer_call_func_t, CE(call)->func,
542 timer_call_param_t, CE(call)->param0, uint32_t, call->flags,
543 (deadline - call->soft_deadline),
544 (call->ttd >> 32), (unsigned) (call->ttd & 0xFFFFFFFF), call);
548 queue = timer_longterm_enqueue_unlocked(call, ctime, deadline, &old_queue);
553 old_queue = timer_call_enqueue_deadline_unlocked(call, queue, deadline);
556 CE(call)->param1 = param1;
558 CE(call)->entry_time = ctime;
563 call,
564 (old_queue != NULL), call->soft_deadline, queue->count, 0);
573 * return boolean indicating whether the call was previously queued.
577 timer_call_t call,
581 return timer_call_enter_internal(call, NULL, deadline, 0, flags, FALSE);
586 timer_call_t call,
591 return timer_call_enter_internal(call, param1, deadline, 0, flags, FALSE);
596 timer_call_t call,
603 return timer_call_enter_internal(call, param1, deadline, leeway, flags, ratelimited);
608 timer_call_t call)
617 call,
618 CE(call)->deadline, call->soft_deadline, call->flags, 0);
620 old_queue = timer_call_dequeue_unlocked(call);
625 timer_queue_cancel(old_queue, CE(call)->deadline, CE(queue_first(&old_queue->head))->deadline);
629 timer_queue_cancel(old_queue, CE(call)->deadline, UINT64_MAX);
636 call,
638 CE(call)->deadline - mach_absolute_time(),
639 CE(call)->deadline - CE(call)->entry_time, 0);
643 DTRACE_TMR6(callout__cancel, timer_call_func_t, CE(call)->func,
644 timer_call_param_t, CE(call)->param0, uint32_t, call->flags, 0,
645 (call->ttd >> 32), (unsigned) (call->ttd & 0xFFFFFFFF));
656 timer_call_t call;
666 call = TIMER_CALL(queue_first(&queue->head));
667 if (!simple_lock_try(&call->lock)) {
674 timer_call_entry_dequeue_async(call);
678 call,
679 call->async_dequeue,
680 CE(call)->queue,
688 timer_call_entry_dequeue(call);
692 new_queue = timer_queue_assign(CE(call)->deadline);
695 call, new_queue, CE(call)->deadline);
698 simple_unlock(&call->lock);
712 timer_call_t call = NULL;
726 if (call == NULL)
727 call = TIMER_CALL(queue_first(&queue->head));
729 if (call->soft_deadline <= cur_deadline) {
733 TCOAL_DEBUG(0xDDDD0000, queue->earliest_soft_deadline, call->soft_deadline, 0, 0, 0);
736 call,
737 call->soft_deadline,
738 CE(call)->deadline,
739 CE(call)->entry_time, 0);
742 * this particular timer call is rate-limited
746 if ((call->soft_deadline & 0x1) &&
747 (CE(call)->deadline > cur_deadline)) {
752 if (!simple_lock_try(&call->lock)) {
755 timer_call_entry_dequeue_async(call);
756 call = NULL;
760 timer_call_entry_dequeue(call);
762 func = CE(call)->func;
763 param0 = CE(call)->param0;
764 param1 = CE(call)->param1;
766 simple_unlock(&call->lock);
771 call, VM_KERNEL_UNSLIDE(func), param0, param1, 0);
775 timer_call_param_t, param0, unsigned, call->flags,
776 0, (call->ttd >> 32),
777 (unsigned) (call->ttd & 0xFFFFFFFF), call);
783 *ttdp = call->ttd;
788 param0, param1, call);
793 call, VM_KERNEL_UNSLIDE(func), param0, param1, 0);
794 call = NULL;
800 int64_t skew = CE(call)->deadline - call->soft_deadline;
801 assert(CE(call)->deadline >= call->soft_deadline);
814 if (__probable(simple_lock_try(&call->lock))) {
815 timer_call_entry_dequeue(call);
816 timer_call_entry_enqueue_deadline(call, queue, call->soft_deadline);
817 simple_unlock(&call->lock);
818 call = NULL;
821 if (call) {
822 call = TIMER_CALL(queue_next(qe(call)));
823 if (queue_end(&queue->head, qe(call)))
831 call = TIMER_CALL(queue_first(&queue->head));
832 cur_deadline = CE(call)->deadline;
833 queue->earliest_soft_deadline = call->soft_deadline;
861 timer_call_t call;
888 * - the local queue contains no non-migrateable "local" call
907 call = TIMER_CALL(queue_first(&queue_from->head));
908 if (CE(call)->deadline < CE(head_to)->deadline) {
915 if (call->flags & TIMER_CALL_LOCAL) {
919 call = TIMER_CALL(queue_next(qe(call)));
920 } while (!queue_end(&queue_from->head, qe(call)));
924 call = TIMER_CALL(queue_first(&queue_from->head));
925 if (!simple_lock_try(&call->lock)) {
930 call,
931 CE(call)->queue,
932 call->lock.interlock.lock_data,
936 timer_call_entry_dequeue_async(call);
939 timer_call_entry_dequeue(call);
941 call, queue_to, CE(call)->deadline);
943 simple_unlock(&call->lock);
967 timer_call_t call;
981 call = TIMER_CALL(queue_first(&queue->head));
985 call->soft_deadline,
986 CE(call)->deadline,
987 CE(call)->entry_time,
988 CE(call)->func,
990 call = TIMER_CALL(queue_next(qe(call)));
991 } while (!queue_end(&queue->head, qe(call)));
1003 timer_longterm_dequeued_locked(timer_call_t call)
1008 if (call == tlp->threshold.call)
1009 tlp->threshold.call = NULL;
1013 * Place a timer call in the longterm list
1017 timer_longterm_enqueue_unlocked(timer_call_t call,
1034 if (__probable((call->flags & TIMER_CALL_LOCAL) != 0 ||
1042 *old_queue = timer_call_dequeue_unlocked(call);
1049 simple_lock(&call->lock);
1051 timer_call_entry_enqueue_tail(call, timer_longterm_queue);
1052 CE(call)->deadline = deadline;
1063 tlp->threshold.call = call;
1067 simple_unlock(&call->lock);
1096 timer_call_t call;
1110 tlp->threshold.call = NULL;
1120 call = TIMER_CALL(qe);
1121 deadline = call->soft_deadline;
1123 if (!simple_lock_try(&call->lock)) {
1128 call,
1129 CE(call)->queue,
1130 call->lock.interlock.lock_data,
1133 timer_call_entry_dequeue_async(call);
1145 call,
1153 call,
1154 CE(call)->deadline,
1155 CE(call)->entry_time,
1156 CE(call)->func,
1159 timer_call_entry_dequeue(call);
1161 call, timer_master_queue, CE(call)->deadline);
1163 * A side-effect of the following call is to update
1170 tlp->threshold.call = call;
1173 simple_unlock(&call->lock);
1363 timer_call_t call;
1378 call = TIMER_CALL(qe);
1379 deadline = CE(call)->deadline;
1381 if ((call->flags & TIMER_CALL_LOCAL) != 0)
1383 if (!simple_lock_try(&call->lock)) {
1385 timer_call_entry_dequeue_async(call);
1390 timer_call_entry_dequeue(call);
1391 timer_call_entry_enqueue_tail(call, timer_longterm_queue);
1394 tlp->threshold.call = call;
1397 simple_unlock(&call->lock);