全部博文(32)
分类: LINUX
2011-07-06 23:03:23
wangjianchangdx2011-07-10 02:09:04
/*
* Note a quiescent state. Because we do not need to know
* how many quiescent states passed, just if there was at least
* one since the start of the grace period, this just sets a flag.
*/
void rcu_sched_qs(int cpu){}
do not need to know or do not know or cannot know, IMO, it can be get in other means[implements], but it's has more overhead.
wangjianchangdx2011-07-10 00:28:14
先看rcutiny吧,这个里面想必只保留了rcu的核心机制
在schedule函数中,调用了rcu_note_context_switch()在进程切换时,通知RCU
RCU必然有一种机制,来标示RCU的全局状态,这个全局标志,每个cpu进程切换时亦即在rcu_note_context_switch()中,修改全局标志,但最后的标志即所有的CPU都已经进行过进程上下文切换该如何确定呢?NR_CPUS?
wangjianchangdx2011-07-08 00:39:25
DEFINE_PER_CPU(struct rcu_data, rcu_sched_data);
DEFINE_PER_CPU(struct rcu_data, rcu_bh_data);
这里并不是直接分配一个NR_CPUS大小的数组,这是我的误解,其背后机制有待研究
使用DEFINE_PER_CPU声明的变量在链接时,会被放在.init.percpu section,
在系统启动时,调用setup_per_cpu_areas()重新为每个CPU分配一个.init.percpu section以供使用,内存分配的方式是为访问高度优化的(使用到了GDT等)