[OS] Multiple-Processor Scheduling, Load Balancing, Processor Affinity

Ko Hyejung·2021년 10월 16일
0

Operating Systems

목록 보기
19/26

Multiple-Processor Scheduling

CPU scheduling is more complex when multiple CPUs are available.
CPU를 여러 개 사용할 수 있으면 CPU 스케줄링이 더 복잡해집니다.

Assume that processors are identicalhomogeneous – in terms of their functionality for simplicity.

Two approaches are possible :

  • Asymmetric multiprocessing – only one processor accesses the system, data structures, alleviating the need for data sharing.
    하나의 프로세서만 시스템에 액세스, 데이터 구조, 데이터 공유의 필요성을 완화합니다.
  • Symmetric multiprocessing (SMP) – each processor is self-scheduling by accessing and updating a common data structure (ready queue) or private queue of ready processes.
    각 프로세서가 공통 데이터 구조(ready queue) 또는 준비 프로세스의 프라이빗 큐에 액세스하고 업데이트함으로써 자가 스케줄링됩니다.

In the text, the SMP approach is discussed.

Load Balancing

https://www.nginx.com/resources/glossary/load-balancing/

Load balancing attempts to keep the workload evenly distributed across all processors in an SMP system.

로드 밸런싱은 SMP 시스템의 모든 프로세서에서 워크로드를 고르게 분산하려고 시도합니다.

Load balancing is typically only necessary on systems where each processor has its own private queue (c.f., a system with common run queue).

로드 밸런싱은 일반적으로 각 프로세서가 자체적인 개인 큐(c.f., 공통 실행 큐가 있는 시스템)를 가지고 있는 시스템에서만 필요합니다.

Most contemporary operating systems supporting SMP have a private queue of eligible processors.

SMP를 지원하는 대부분의 현대 운영 체제에는 적격 프로세서의 개인 queue 있습니다.

Two general approaches :

  • Push migration : A specific task periodically checks the load on each processor and distribute the load evenly .

각 프로세서의 Load를 주기적으로 확인하여 균등하게 분배하는 작업입니다

  • Pull migration : An idle processor pulls a waiting task from a busy processor.

idle 프로세서가 사용 중인 프로세서에서 대기 중인 작업을 가져옵니다.

Both approaches can be implemented at the same time (i.e., Linux runs its load balancing algorithm every 200 ms (push migration) or whenever the run queue for a processor is empty (pull migration)).

두 접근 방식은 동시에 구현할 수 있습니다(즉, 리눅스는 200ms마다 로드 밸런싱 알고리즘을 실행(푸시 마이그레이션)하거나 프로세서의 실행 대기열이 비어 있을 때마다 실행(풀 마이그레이션)).

Processor Affinity

Consider what happens to cache memory when a process has been running on a specific processor.

프로세스가 특정 프로세서에서 실행되었을 때 캐시에 메모리가 어떻게 되는지 생각해 보십시오.

If the system allows process migration, the contents of cache memory in the source processor is useless and the destination processor needs to populate the contents again.

시스템에서 프로세스 마이그레이션을 허용하면 소스 프로세서의 캐시 메모리 내용이 무용지물이 되어 대상 프로세서가 다시 내용을 채워야 합니다.

  • Cost is high; Most SMP systems try to avoid migration of processes.
    비용이 많이 듭니다. 대부분의 SMP 시스템은 프로세스 이동을 피하려고 합니다.

Processor affinity keeps a process running on the same processor.
프로세스가 동일한 프로세서에서 계속 실행되도록 합니다.

  • A process has an affinity for the processor on which it is currently running.
    프로세스는 현재 실행 중인 프로세서에 대한 선호도를 가집니다.

Two possibilities :

  • Soft affinity : Attempt to keep a process running on the same processor
    but not guarantee it – possible to migrate.

동일한 프로세서에서 프로세스를 계속 실행하려고 시도합니다.
하지만 마이그레이션이 가능하다고 보장하지는 않습니다.

  • Hard affinity : Prohibit migration – provide system calls to specify that the processor should not be migrated (e.g., Linux).

마이그레이션 금지 - 프로세서를 마이그레이션하지 않도록 지정하는 시스템 호출을 제공합니다(예: Linux).

0개의 댓글