1. Linux scheduling I/O-consuming and processor-consuming processes (to ensure timely Io response and efficient CPU utilization) Load Balancing: Each CPU has a process queue, load Balancing when the CPU load difference is greater than 25%
Program . (Take the process with the highest priority and the least CPU affinity from the busiest CPU to the CPU process queue with the least load ). Why the process with the highest priority? The high-priority processes are evenly allocated to each cpu so that the system performance can reach the highest level. CPU affinity: this is mainly because of high-speed cache or other reasons. For example, a process can only run on a CPU.
2. The difference between the interrupt handler and the thread. 1. Do not sleep during interruption. 2. the interrupt context has a strict time limit because it interrupts the running thread. 3. the interrupt processing program does not have its own stack. It shares the stack of the interrupted thread. Therefore, when assigning a task stack, pay attention to a larger value than the actual requirement to prevent interruption, an overflow occurs when the program is interrupted to use the stack.
3. Spin lock: The main feature, unlike waiting for a semaphore, is that the process does not sleep when the desired resource is not available.
4. Introduce the read/write spin lock. Read/write spin locks reduce the granularity of locks.
5. Slab layer: optimizes the dynamic memory allocation (allocate and release dynamic memory of the same size in a continuous memory zone, so that no memory fragments are generated, because each allocation happens to be a unit, each release happens to be a unit, for example, it is used in the dynamic allocation and release of process control blocks ).
6. Disk block I/O operation: Linux elevator
Algorithm The disk block I/O requests are sorted by track during underlying disk operations to reduce the head tracing time and optimize disk I/O operations.
7. Optimize the file system by using high-speed page cache and page write-back.