您的位置:首页 > 运维架构 > Linux

linux rcu 理解

2015-10-02 21:34 1201 查看
kernel/rcutree.c

rcu_check_callbacks ->

s3c2410_timer_interrupt -》 timer_tick -》update_process_times -》 rcu_check_callbacks ->

__rcu_pending-> print_other_cpu_stall

在时钟中断中进行检查

INFO: RCU detected CPU stalls:

使用注意方式:

RCU 保护的代码里面不能进入睡眠状态

受访问的资源必须通过指针访问

RCU 使用方式:

1. 读操作时 引用指针必须使用rcu_dereference(ptr)

2. 受访问的资源必须通过指针访问

3. 修改ptr 指向的对象时 必须调用 rcu_assign_pointer

参考资料:

linux内核 RCU机制详解 讲到 rcu 调用使用方法。

/article/9536938.html
https://www.kernel.org/doc/Documentation/RCU/stallwarn.txt
Linux RCU机制详解
http://blog.chinaunix.net/uid-24517893-id-2381246.html
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: