linux2.4 to linux2.6 Kernel dispatch (6) __linux

Source: Internet
Author: User

The

Two time unit system time is in nanosecond (One-zero seconds) as the unit, but this numerical granularity, most of the core applications can only obtain its absolute value, the perception of its accuracy. &NBSP
Time-related core applications typically revolve around a clock interrupt, in Linux 2.6, the system clock interrupts every 1 milliseconds (the clock frequency, expressed as a HZ macro, defined as 1000, that is 1000 interrupts per second,--2.4 is defined as 100, many applications are still used 100 clock frequency), this unit of time is called a jiffie. Many core applications use Jiffies as a time unit, such as a running time slice of a process. &NBSP
The conversion formula between Jiffies and absolute time is as follows:  
nanosecond=jiffies*1000000 
Core uses two macros for swaps of two units of time: Jiffies_to_ns (), Ns_to_jiffies (), many time macros also have two forms, such as Ns_max_sleep_avg and Max_sleep_avg.

3) Prio
The priority, equivalent to the result of goodness () in 2.4, 0~max_prio-1 between the values (Max_prio is defined as 140), where 0~max_rt_prio-1 (max_rt_prio definition 100) is a real-time process range, Max_ Rt_prio~mx_prio-1 belong to a non-real-time process. A larger number indicates a smaller process priority.
In 2.6, dynamic priority is no longer unified in the scheduler calculation and comparison, but independent computation, and stored in the task_struct of the process, and then through the Priority_array structure described above automatically sorted.
Prio's calculations are related to a number of factors, and are discussed in detail in "optimized priority computing methods."
4) Static_prio
The static priority is the same as the nice value of 2.4, but is converted to the same range of values as the Prio.
Nice values follow the tradition of Linux, changing between 20 and 19, the larger the number, the smaller the priority of the process. Nice is user-maintainable, but only affects the priority of non-real-time processes. The nice value is no longer stored in the 2.6 kernel and is replaced with Static_prio. The size of the process's initial time slice is determined only by the static priority of the process, either in real-time or non-real-time processes, although the static_prio of the real-time process does not participate in the priority calculation.
The relationship between Nice and Static_prio is as follows:
Static_prio = Max_rt_prio + nice + 20


The kernel defines two macros to complete this conversion: Prio_to_nice (), Nice_to_prio ().

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.