Some algorithms about the Linux kernel __python

Source: Internet
Author: User
Summarize some of the algorithms for the Linux kernel

Transferred from

Http://www.eechina.com/thread-159896-1-1.html

1.Linux dispatch
    i/ o Consumption-and processor-consuming processes (ensuring timely IO response and efficient CPU utilization) load balancing: Each CPU has a process queue that runs the load-balancing program when the CPU's load difference is greater than 25%. (from the busiest CPU, take the next highest priority and CPU affinity to the lowest-load CPU process queue).
    Why take the highest-priority process?
    because the high priority process is distributed evenly across CPUs, the system can achieve the highest performance. CPU affinity: Primarily for caching or other reasons, such as a process that can only run on one CPU.
    2. The difference between an interrupt handler and a thread.
    1, no sleep in interrupt.
    2, the interrupt context has a tighter time limit because it interrupts the running thread.
    3, interrupt handler does not have its own stack, it shares the stack of interrupted threads, so in allocating a task stack to pay attention to a larger than the actual requirements, in case the interruption occurs, interrupt the application stack overflow.
    3. Spin Lock: The main feature, unlike waiting for a semaphore, is that the process does not sleep when it is not getting the resources it wants.
    4. Introduction of Read-write spin lock. The read-write spin lock reduces the size of the lock.
    5.slab layer: Optimizes dynamic memory allocation (putting dynamic memory allocation and deallocation of the same size into a contiguous memory area so that no memory fragmentation is generated because each allocation happens to be one unit, and each release is just one unit, For example, in dynamic allocation and release of process Control blocks.
    6. Disk Block I/O operations: Using the Linux elevator algorithm, the disk block IO request is sorted by track during the underlying operation of the disk to reduce the head tracing time and optimize disk IO operations.
    7. Use page caching and page writeback to optimize the file system.

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.