0% found this document useful (0 votes)
8 views

16 Multiple Processor Scheduling

Uploaded by

sivakunjumon
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

16 Multiple Processor Scheduling

Uploaded by

sivakunjumon
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 10

MULTIPLE PROCESSOR

SCHEDULING
MULTIPLE PROCESSOR SCHEDULING
• Multiple CPUs (processors) are used

• When multiple processors are available, then


the scheduling gets more complicated,
because now there is more than one CPU
which must be kept busy and in effective use
at all times.
Multiple-Processor Scheduling

• Load sharing means balancing the load


between multiple processors.
• Multi-processor systems may
be heterogeneous, (different kinds of CPUs),
or homogenous, (all the same kind of CPU,
which is used commonly). Even in the latter
case there may be special scheduling
constraints, such as devices which are
connected via a private bus to only one of the
CPUs.
1 Approaches to Multiple-Processor Scheduling

• One approach to multi-processor scheduling


is asymmetric multiprocessing, in which one
processor is the master which controls all the
activities. The other processors execute only
user code.
• This approach is relatively simple, since there
is no need to share critical system data, as
only one processor accesses the system data
structures.
1 Approaches to Multiple-Processor Scheduling

• Another approach is symmetric


multiprocessing ( SMP) where each processor
schedules its own jobs, either from a common
ready queue or from separate ready queues
for each processor.
• Virtually all modern OSs support SMP,
including XP, Win 2000, Solaris, Linux, and Mac
OSX.
2 Processor Affinity

• Processors contain cache memory, which


speeds up repeated accesses to the same
memory locations.
• If a process switch from one processor to
another each time it got a time slice, the data
in the cache ( for that process ) would have to
be invalidated and re-loaded to the cache of
switched processor.
2 Processor Affinity

• Therefore SMP systems attempt to keep


processes on the same processor, called
processor affinity.
• Soft affinity occurs when the system attempts
to keep processes on the same processor but
makes no guarantees. Linux and some other
OSs support hard affinity, in which a process
specifies that it is not to be moved between
processors.
3 Load Balancing

• Obviously an important goal in a


multiprocessor system is to balance the load
between processors, so that one processor
won't be sitting idle while another is
overloaded.
• Systems using a common ready queue are
naturally self-balancing, and do not need any
special handling. Most systems, however,
maintain separate ready queues for each
processor.
3 Load Balancing

• Balancing can be achieved through


either push migration or pull migration:
– Push migration involves a separate process that
runs periodically, ( e.g. every 200 milliseconds ),
and moves processes from heavily loaded
processors onto less loaded ones.
– Pull migration involves idle processors taking
processes from the ready queues of other
processors.
– Push and pull migration are not mutually
exclusive.
3 Load Balancing

• Note that moving processes from processor to


processor to achieve load balancing works
against the principle of processor affinity, and
if not carefully managed, the savings gained by
balancing the system can be lost in rebuilding
caches. One option is to only allow migration
when imbalance surpasses a given threshold.

You might also like