MCPcopy Create free account
hub / github.com/F-Stack/f-stack / epoch_call_task

Function epoch_call_task

freebsd/kern/subr_epoch.c:780–820  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

778}
779
780static void
781epoch_call_task(void *arg __unused)
782{
783 ck_stack_entry_t *cursor, *head, *next;
784 ck_epoch_record_t *record;
785 epoch_record_t er;
786 epoch_t epoch;
787 ck_stack_t cb_stack;
788 int i, npending, total;
789
790 ck_stack_init(&cb_stack);
791 critical_enter();
792 epoch_enter(global_epoch);
793 for (total = i = 0; i != MAX_EPOCHS; i++) {
794 epoch = epoch_array + i;
795 if (__predict_false(
796 atomic_load_acq_int(&epoch->e_in_use) == 0))
797 continue;
798 er = epoch_currecord(epoch);
799 record = &er->er_record;
800 if ((npending = record->n_pending) == 0)
801 continue;
802 ck_epoch_poll_deferred(record, &cb_stack);
803 total += npending - record->n_pending;
804 }
805 epoch_exit(global_epoch);
806 *DPCPU_PTR(epoch_cb_count) -= total;
807 critical_exit();
808
809 counter_u64_add(epoch_call_count, total);
810 counter_u64_add(epoch_call_task_count, 1);
811
812 head = ck_stack_batch_pop_npsc(&cb_stack);
813 for (cursor = head; cursor != NULL; cursor = next) {
814 struct ck_epoch_entry *entry =
815 ck_epoch_entry_container(cursor);
816
817 next = CK_STACK_NEXT(cursor);
818 entry->function(entry);
819 }
820}
821
822static int
823in_epoch_verbose_preempt(epoch_t epoch, int dump_onfail)

Callers

nothing calls this directly

Calls 9

ck_stack_initFunction · 0.85
epoch_enterFunction · 0.85
epoch_currecordFunction · 0.85
epoch_exitFunction · 0.85
ck_stack_batch_pop_npscFunction · 0.85
critical_enterFunction · 0.50
ck_epoch_poll_deferredFunction · 0.50
critical_exitFunction · 0.50
counter_u64_addFunction · 0.50

Tested by

no test coverage detected