| 778 | } |
| 779 | |
| 780 | static void |
| 781 | epoch_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 | |
| 822 | static int |
| 823 | in_epoch_verbose_preempt(epoch_t epoch, int dump_onfail) |
nothing calls this directly
no test coverage detected