Linux Kernel Algorithms

Source: Internet
Author: User

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.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.