Recently I realized my English is still far from good. So in order to improve my English, I must not only read in English, but also think and write in English. I know I'm gonna make a lot of mistake in using English, but everything has a process so I…
In 2.6.x, there are 3 mechanisms for implementing a bottom half: softirqs, tasklets and work queues. Here's the comparison: Softirqs: Softirqs are statically allocated at compile time. It is represented by the softirq_action structure, which is defin…
This chapter introduces some conception about kernel synchronization generally. Critical Regions: Code paths that access and manipulate shared data. Race Condition: Two threads of execution to be simultaneously executing within the same critical regi…
在Linux中,处理器所作的事可以归纳为3种情况: 1.In user-space, executing user code in a process; 2.In kernel-space, in process context, executing on behalf of a specific process; 3.In kernel-space, in interrupt context, not associated with a process, handling an interru…
这一章我们研究四种主要的数据结构: linked lists, queues, maps, binary trees. Linked Lists:(<linux/list.h>) 在linux中,并不是直接将某个结构体作为链表的节点,而是在该结构中插入一个链表的节点.借助container_of()这个宏,我们可以轻松的找到包含给定成员变量的父结构. Linux kernel中一般使用的是循环双链表. 正常遍历使用的是list_for_each()宏,但是当遍历过程中删除某个表项时就有可能出错…
本文的目的不完全在于提供调优信息,而是在于告诉读者了解Linux kernel如何处理数据包,从而能够在 自己的实践中发挥Linux 内核协议栈最大的性能 The NIC ring buffer 接收环缓冲区在设备驱动程序和NIC之间共享. 网卡分配发送(TX)和接收(RX)环形缓冲区. 环形缓冲区是一个循环缓冲区,其中溢出只是覆盖现有数据. 应该注意,有两种方式将数据从NIC移动到内核,硬件中断和软件中断(也称为SoftIRQ). RX环形缓冲区用于存储传入的数据包,直到它们被设备驱动程序处理…
Exceptional Control Flow The program counter assumes a sequence of values                                  a0,a1,...,an−1 where each ak is the address of some corresponding instruction Ik. Each transition from ak to ak +1 is called a control transfer…
STM32F4 External interrupts Each STM32F4 device has 23 external interrupt or event sources. They are split into 2 sections. First interrupt section is for external pins (P0 to P15) on each port, and other section is for other events, like RTC interru…
一. 进程Context 定义 当一个进程在执行时, CPU的所有寄存器中的值.进程的状态以及堆栈中的内容,比如各个变量和数据,包括所有的寄存器变量.进程打开的文件.内存信息等.这些信息被称为该进程的上下文(Context). 一个进程的Context可以分为三个部分:用户级上下文.寄存器上下文以及系统级上下文: (1)用户级上下文: 正文.数据.用户堆栈以及共享存储区:       (2)寄存器上下文: 通用寄存器.程序寄存器(IP).处理器状态寄存器(EFLAGS).栈指针(ESP):   …
转自:http://blog.csdn.net/tianlesoftware/article/details/6461207 一. 进程Context 定义 当一个进程在执行时, CPU的所有寄存器中的值.进程的状态以及堆栈中的内容,比如各个变量和数据,包括所有的寄存器变量.进程打开的文件.内存信息等.这些信息被称为该进程的上下文(Context). 一个进程的Context可以分为三个部分:用户级上下文.寄存器上下文以及系统级上下文: (1)用户级上下文: 正文.数据.用户堆栈以及共享存储区:…