* Software (low priority) clock interrupt. * Run periodic events from timeout queue. */
| 801 | * Run periodic events from timeout queue. |
| 802 | */ |
| 803 | void |
| 804 | softclock(void *arg) |
| 805 | { |
| 806 | struct callout_cpu *cc; |
| 807 | struct callout *c; |
| 808 | #ifdef CALLOUT_PROFILING |
| 809 | int depth = 0, gcalls = 0, lockcalls = 0, mpcalls = 0; |
| 810 | #endif |
| 811 | |
| 812 | cc = (struct callout_cpu *)arg; |
| 813 | CC_LOCK(cc); |
| 814 | while ((c = TAILQ_FIRST(&cc->cc_expireq)) != NULL) { |
| 815 | TAILQ_REMOVE(&cc->cc_expireq, c, c_links.tqe); |
| 816 | softclock_call_cc(c, cc, |
| 817 | #ifdef CALLOUT_PROFILING |
| 818 | &mpcalls, &lockcalls, &gcalls, |
| 819 | #endif |
| 820 | 0); |
| 821 | #ifdef CALLOUT_PROFILING |
| 822 | ++depth; |
| 823 | #endif |
| 824 | } |
| 825 | #ifdef CALLOUT_PROFILING |
| 826 | avg_depth += (depth * 1000 - avg_depth) >> 8; |
| 827 | avg_mpcalls += (mpcalls * 1000 - avg_mpcalls) >> 8; |
| 828 | avg_lockcalls += (lockcalls * 1000 - avg_lockcalls) >> 8; |
| 829 | avg_gcalls += (gcalls * 1000 - avg_gcalls) >> 8; |
| 830 | #endif |
| 831 | CC_UNLOCK(cc); |
| 832 | } |
| 833 | |
| 834 | void |
| 835 | callout_when(sbintime_t sbt, sbintime_t precision, int flags, |
nothing calls this directly
no test coverage detected