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

Function callout_cc_add

freebsd/kern/kern_timeout.c:565–603  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

563}
564
565static void
566callout_cc_add(struct callout *c, struct callout_cpu *cc,
567 sbintime_t sbt, sbintime_t precision, void (*func)(void *),
568 void *arg, int cpu, int flags)
569{
570 int bucket;
571
572 CC_LOCK_ASSERT(cc);
573 if (sbt < cc->cc_lastscan)
574 sbt = cc->cc_lastscan;
575 c->c_arg = arg;
576 c->c_iflags |= CALLOUT_PENDING;
577 c->c_iflags &= ~CALLOUT_PROCESSED;
578 c->c_flags |= CALLOUT_ACTIVE;
579 if (flags & C_DIRECT_EXEC)
580 c->c_iflags |= CALLOUT_DIRECT;
581 c->c_func = func;
582 c->c_time = sbt;
583 c->c_precision = precision;
584 bucket = callout_get_bucket(c->c_time);
585 CTR3(KTR_CALLOUT, "precision set for %p: %d.%08x",
586 c, (int)(c->c_precision >> 32),
587 (u_int)(c->c_precision & 0xffffffff));
588 LIST_INSERT_HEAD(&cc->cc_callwheel[bucket], c, c_links.le);
589 if (cc->cc_bucket == bucket)
590 cc_exec_next(cc) = c;
591
592 /*
593 * Inform the eventtimers(4) subsystem there's a new callout
594 * that has been inserted, but only if really required.
595 */
596 if (SBT_MAX - c->c_time < c->c_precision)
597 c->c_precision = SBT_MAX - c->c_time;
598 sbt = c->c_time + c->c_precision;
599 if (sbt < cc->cc_firstevent) {
600 cc->cc_firstevent = sbt;
601 cpu_new_callout(cpu, sbt, c->c_time);
602 }
603}
604
605static void
606softclock_call_cc(struct callout *c, struct callout_cpu *cc,

Callers 2

softclock_call_ccFunction · 0.70
callout_reset_sbt_onFunction · 0.70

Calls 2

cpu_new_calloutFunction · 0.85
callout_get_bucketFunction · 0.70

Tested by

no test coverage detected