call_rcu()函数解析
来源:百度文库 编辑:神马文学网 时间:2024/06/13 07:34:22
113 DECLARE_PER_CPU(struct rcu_data, rcu_data);
114 DECLARE_PER_CPU(struct rcu_data, rcu_bh_data);
该结构在SMP定义每个CPU私有数据,
#define DECLARE_PER_CPU(type, name) extern __typeof__(type) per_cpu__##name
其中__typeof__(type)是取type的类型。你上面的定义:
DECLARE_PER_CPU(struct rcu_data, rcu_data);
实际上相当于:
extern struct rcu_data per_cpu__rcu_data;
通过 struct rcu_head
{
struct rcu_head *next;
void (*func)(struct rcu_head *head);
};
该结构构成每个CPU私有数据回调函数链表。具体调用过程通过call_rcu()函数实现的。
定义在linux/kernel/rcupdate.c定义:
117void fastcall call_rcu(struct rcu_head *head,
118 void (*func)(struct rcu_head *rcu))
119{
120 unsigned long flags;
121 struct rcu_data *rdp;
122
123 head->func = func;
124 head->next = NULL;
125 local_irq_save(flags);
126 rdp = &__get_cpu_var(rcu_data);
127 *rdp->nxttail = head;
128 rdp->nxttail = &head->next;
129 if (unlikely(++rdp->qlen > qhimark)) {
130 rdp->blimit = INT_MAX;
131 force_quiescent_state(rdp, &rcu_ctrlblk);
132 }
133 local_irq_restore(flags);
134}
114 DECLARE_PER_CPU(struct rcu_data, rcu_bh_data);
该结构在SMP定义每个CPU私有数据,
#define DECLARE_PER_CPU(type, name) extern __typeof__(type) per_cpu__##name
其中__typeof__(type)是取type的类型。你上面的定义:
DECLARE_PER_CPU(struct rcu_data, rcu_data);
实际上相当于:
extern struct rcu_data per_cpu__rcu_data;
通过 struct rcu_head
{
struct rcu_head *next;
void (*func)(struct rcu_head *head);
};
该结构构成每个CPU私有数据回调函数链表。具体调用过程通过call_rcu()函数实现的。
定义在linux/kernel/rcupdate.c定义:
117void fastcall call_rcu(struct rcu_head *head,
118 void (*func)(struct rcu_head *rcu))
119{
120 unsigned long flags;
121 struct rcu_data *rdp;
122
123 head->func = func;
124 head->next = NULL;
125 local_irq_save(flags);
126 rdp = &__get_cpu_var(rcu_data);
127 *rdp->nxttail = head;
128 rdp->nxttail = &head->next;
129 if (unlikely(++rdp->qlen > qhimark)) {
130 rdp->blimit = INT_MAX;
131 force_quiescent_state(rdp, &rcu_ctrlblk);
132 }
133 local_irq_restore(flags);
134}
call_rcu()函数解析
函数指针解析
wordpress模板各文件函数解析
函数指针 (*(void (*)( ) )0)( ) 解析|函数,函数指针,C编程-中国源...
VB.NET Mid函数相关应用方法解析
VB.NET Mid函数相关应用方法解析
夢開始的地方 ? Blog Archive ? wordpress模板各文件函数解析
财务函数FV函数
fopen函数
pack()函数
hash函数
函数指针
查看函数
函数指针
DateDiff 函数
函数:readdir()
未来函数
VB函数
一次函数
select函数
Excel函数
MsgBox函数
printk()函数
函数速查表