32 extern int kernel_notifyfd;
34 static void notify_core(
int cfd, uint64_t *last_ts, uint64_t tsc,
40 if (delta == UINT64_MAX) {
44 if(tsc - *last_ts > delta) {
46 if (write(cfd, &val,
sizeof(uint64_t)) !=
sizeof(uint64_t)) {
47 perror(
"notify_core: write failed");
55 void notify_fastpath_core(
unsigned core)
57 notify_core(fp_state->kctx[core].evfd, &fp_state->kctx[core].last_ts,
61 void notify_app_core(
int appfd, uint64_t *last_ts)
63 notify_core(appfd, last_ts, util_rdtsc(), tas_info->
poll_cycle_app);
68 notify_core(ctx->evfd, &ctx->last_ts, tsc, tas_info->
poll_cycle_app);
71 void notify_slowpath_core(
void)
73 static uint64_t __thread last_ts = 0;
74 notify_core(kernel_notifyfd, &last_ts, util_rdtsc(),
86 nbs->can_block = nbs->second_bar = 0;
87 nbs->last_active_ts = tsc;
88 }
else if (nbs->second_bar) {
90 nbs->can_block = nbs->second_bar = 0;
91 nbs->last_active_ts = tsc;
93 }
else if (nbs->can_block &&
108 nbs->can_block = nbs->second_bar = 0;