Linux?????????-?????
???????????? ???????[ 2014/8/22 10:35:06 ] ?????????????? Linux ???????
?????????—????????????????????????—?????????????????????????????????????????????????????????????????????????????????á????????????????????????У??????????????????????????????????????????????????????????????????????????????????д?????????????
?????????????????????????????????????????ū???linux2.6?????????????????????????????
??????start_kernel(void)-->init_timers(void)
void __init init_timers(void)
{
int err = timer_cpu_notify(&timers_nb?? (unsigned long)CPU_UP_PREPARE??
(void *)(long)smp_processor_id());
init_timer_stats();
BUG_ON(err == NOTIFY_BAD);
register_cpu_notifier(&timers_nb);
open_softirq(TIMER_SOFTIRQ?? run_timer_softirq);
}
??timer_cpu_notify(&timers_nb??(unsigned long)CPU_UP_PREPARE??
(void*)(long)smp_processor_id());
?????????
????init_timers_cpu(cpu) //???????cpu?е?timers
?????????????????????
spin_lock_init(&base->lock);
for (j = 0; j < TVN_SIZE; j++) {
INIT_LIST_HEAD(base->tv5.vec + j);
INIT_LIST_HEAD(base->tv4.vec + j);
INIT_LIST_HEAD(base->tv3.vec + j);
INIT_LIST_HEAD(base->tv2.vec + j);
}
for (j = 0; j < TVR_SIZE; j++)
INIT_LIST_HEAD(base->tv1.vec + j);
base->timer_jiffies = jiffies;
base->next_timer = base->timer_jiffies;
??????δ??????????base??base????????structtvec_base *base;
???????tvec_base????????????????????????cpu??????????????????cpu?д??????????????????????????????????????cpu??????????????????
struct tvec_base {
spinlock_t lock;
struct timer_list *running_timer;
unsigned long timer_jiffies;
unsigned long next_timer;
struct tvec_root tv1;
struct tvec tv2;
struct tvec tv3;
struct tvec tv4;
struct tvec tv5;
} ____cacheline_aligned;
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11