Linux operating system kernel preemptible Patches

Source: Internet
Author: User
Linux operating system kernel preemptible patch basic principle-Linux general technology-Linux programming and kernel information, the following is a detailed description. When the CPU runs in the kernel, it cannot be preemptible everywhere. There are some gaps in the kernel. In this case, it is safe to preemptible, the basic principle of kernel preemption patch is to regard SMP parallel code segments as areas where kernel preemption can be performed.

2.4 The kernel precisely refined the kernel thread synchronization mechanism under multiple CPUs, and made a detailed representation of non-parallel instruction blocks using the spinlock and rwlock. The implementation of this patch can be justified. The specific method is to add a preempt_count variable in the task structure of the process as the kernel preemptible lock. It locks and unlocks along with the spinlock and rwlock. When preempt_count is 0, kernel scheduling can be performed. The entry of the kernel scheduler is preempt_schedule (), which marks the current process as TASK_PREEMPTED and then calls schedule (). In the TASK_PREEMPTED status, schedule () does not delete the process from the running queue.

The following shows the main code for Kernel preemptible patches:
QUOTE:
Related Article

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.