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

Multi

Multi-processor scheduling involves managing multiple CPUs that share resources to execute processes efficiently, with two main approaches: symmetric and asymmetric scheduling. Processor affinity determines how processes are assigned to CPUs, with soft and hard affinity types influencing process migration and cache memory usage. Load balancing is essential to ensure even distribution of workload among processors, employing push and pull migration strategies to manage task allocation.

Uploaded by

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

Multi

Multi-processor scheduling involves managing multiple CPUs that share resources to execute processes efficiently, with two main approaches: symmetric and asymmetric scheduling. Processor affinity determines how processes are assigned to CPUs, with soft and hard affinity types influencing process migration and cache memory usage. Load balancing is essential to ensure even distribution of workload among processors, employing push and pull migration strategies to manage task allocation.

Uploaded by

puneee05
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Multi-processor Scheduling

A Multi-processor is a system that has more than one processor but shares the same
memory, bus, and input/output devices. In multi-processor scheduling, more than one
processors(CPUs) share the load to handle the execution of processes smoothly.

The scheduling process of a multi-processor is more complex than that of a single processor
system. The CPUs may be of the same kind(homogeneous) or different(heterogeneous).

The multiple CPUs in the system share a common bus, memory, and other I/O
devices. There are two approaches to multi-processor scheduling –

 Symmetric Multi-processor scheduling.


 Asymmetric Multi-processor scheduling.

Symmetric Multiprocessing: In symmetric multi-processor scheduling, the


processors are self-scheduling. The scheduler for each processor checks the
ready queue and selects a process to execute.

 Symmetrical Scheduling with global queues: If the processes to be


executed are in a common queue or a global queue, the scheduler for each
processor checks this global-ready queue and selects a process to execute.
 Symmetrical Scheduling with per queues: If the processors in the system
have their own private ready queues, the scheduler for each processor
checks their own private queue to select a process.

Asymmetric Multiprocessing: In asymmetric multi-processor scheduling, there is a master


server, and the rest of them are slave servers. The master server handles all the scheduling
processes and I/O processes, and the slave servers handle the users' processes. If the master
server goes down, the whole system comes to a halt. However, if one of the slave servers
goes down, the rest of the system keeps working.

Processor Affinity
A process has an affinity for a processor on which it runs. This is
called processor affinity.

 When a process runs on a processor, the data accessed by the process most recently is
populated in the cache memory of this processor. The following data access calls by
the process are often satisfied by the cache memory.
 However, if this process is migrated to another processor for some reason, the content
of the cache memory of the first processor is invalidated, and the second processor's
cache memory has to be repopulated.
 To avoid the cost of invalidating and repopulating the cache memory, the Migration
of processes from one processor to another is avoided.
There are two types of processor affinity.

 Soft Affinity: The system has a rule of trying to keep running a process on the same
processor but does not guarantee it. This is called soft affinity.
 Hard Affinity: The system allows the process to specify the subset of processors on
which it may run, i.e., each process can run only some of the processors. Systems
such as Linux implement soft affinity, but they also provide system calls such as
sched_setaffinity() to support hard affinity.

Load Balancing

In a multi-processor system, all processors may not have the same workload. Some may have
a long ready queue, while others may be sitting idle. To solve this problem, load
balancing comes into the picture. Load Balancing is the phenomenon of distributing
workload so that the processors have an even workload in a symmetric multi-processor
system.

In symmetric multiprocessing systems which have a global queue, load balancing is not
required. In such a system, a processor examines the global ready queue and selects a process
as soon as it becomes ideal.

However, in asymmetric multi-processor with private queues, some processors may end up
idle while others have a high workload. There are two ways to solve this.

 Push Migration: In push migration, a task routinely checks the load on each processor. Some
processors may have long queues while some are idle. If the workload is unevenly
distributed, it will extract the load from the overloaded processor and assign the load to an
idle or a less busy processor.
 Pull Migration: In pull migration, an idle processor will extract the load from an overloaded
processor itself.

You might also like