治肾虚不含糖,专注内核性能优化二十年。 https://github.com/KnightKu
发布时间:2014-02-18 14:31:49
Even a casual reader of the kernel source code is likely to run intoinvocations of the ACCESS_ONCE() macro eventually; there are wellover 200 of them in the current source tree. Many such readers probably donot stop to understand just what that macro means; a recent discussion onthe mailing lis.........【阅读全文】
发布时间:2014-02-18 14:31:00
Spinlock的目的是用来同步SMP中会被多个CPU同时存取的变量。在Linux中,普通的spinlock由于不带额外的语义,是用起来反而要非常小心。在Linux kernel中执行的代码大体分normal和interrupt context两种。tasklet/softirq可以归为normal因为他们可以进入等待;nested interrupt是interru.........【阅读全文】
发布时间:2014-02-18 14:29:23
Linux内核里的等待队列机制在做驱动开发时用的非常多,多用来实现阻塞式访问,下面简单总结了等待队列的四种用法,希望对读者有所帮助。1. 睡眠等待某个条件发生(条件为假时睡眠): 睡眠方式:wait_event, wait_event_interruptible &nb.........【阅读全文】