本文主要是介绍linux rcu 理解,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
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 调用使用方法。
http://blog.csdn.net/xabc3000/article/details/15335131
https://www.kernel.org/doc/Documentation/RCU/stallwarn.txt
Linux RCU机制详解
http://blog.chinaunix.net/uid-24517893-id-2381246.html
这篇关于linux rcu 理解的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!