• Real-Time Scheduling Of Kernel Processes
  • Traditional Scheduling Algorithm
  • Implementation Of Planning In Linux




    Download 6,34 Mb.
    Pdf ko'rish
    bet49/203
    Sana10.01.2024
    Hajmi6,34 Mb.
    #134102
    1   ...   45   46   47   48   49   50   51   52   ...   203
    Bog'liq
    Linux This Book Includes 4 Manuscripts The Underground Bible

    Implementation Of Planning In Linux
    Consider two options for implementing Linux scheduling - the traditional
    one (which includes kernels up to 2.4 inclusive) and the new one included
    in the 2.6 kernels. The Linux kernel does not distinguish between processes
    and flows when planning, so for certainty, we will continue to discuss
    process planning. All processes in the system can be divided into three
    groups: real-time with FIFO scheduling, real-time with circular scheduling,
    normal.
    Real-Time Scheduling Of Kernel Processes
    Regarding real-time processes, it is enough to say that:

    They will always have priority over normal processes when
    planning
    ❖ 
    The FIFO scheduling process is performed until it itself gives in to
    the processor (for example, as a result of suspension or termination)
    or until it is superseded by a higher-priority real-time process
    ❖ 
    The same applies to the circular scheduling process, except that it
    will be further displaced after the quantum of time is exhauste d
    Traditional Scheduling Algorithm
    Consider an algorithm for scheduling ordinary processes. At the core of the
    algorithm is the allocation of CPU time to the epoch  ( epochs ). During the
    epoch, each process has a quantum of time, the length of which is
    calculated at the time of the epoch. For the most part, different processes


    have quanta of different lengths. When the process has exhausted its
    quantum, it is displaced and during the current era, it will no longer be
    performed. Management is given to another process. If, however, the
    process is paused for I / O or due to synchronization, its quantum is not
    considered exhausted and it may be exhausted by the scheduler during the
    current era. The era ends when all ready-to-complete processes have
    exhausted their quanta. In this case, the scheduling algorithm recalculates
    the quanta for all processes and begins a new era.
    The quantum, which is set at the beginning of the era, is called the basic
    quantum of the processing time.  Its values can be dynamically modified by
    the nice () and setpriority () system calls. The descendant process always
    inherits the basic quantum of its ancestor.
    There are two types of process priority: fixed, for real-time processes that
    are set only during the process creation, and dynamic, for normal processes,
    which depend on the basic priority and the time remaining until the
    quantum is exhausted. Dynamic priority to any conventional process is
    always lower than the priority of any real process for the first time.
    We describe the most important fields of the process data structure for
    planning:
    ❖ 
    Policy - determines to which group the process belongs (normal,
    real-time FIFO algorithm, etc.)

    Nice - specifies the value on which the base quantum of the
    processing time is based (in the future, for simplicity, we will
    consider nice to be equal to the base quantum; in fact, this is not quite
    so)
    ❖ 
    Counter - Contains the number of timer interrupts left before the
    process quantum is exhausted. At the beginning of the era of a
    counter, the values of the base quantum are reduced and reduced by
    one in the timer interrupt handler

    Download 6,34 Mb.
    1   ...   45   46   47   48   49   50   51   52   ...   203




    Download 6,34 Mb.
    Pdf ko'rish