The Linux Scheduler - Ubuntu KR...The Linux Scheduler A Decade of Wasted Cores 고민영...

Post on 03-Jun-2020

20 views 1 download

Transcript of The Linux Scheduler - Ubuntu KR...The Linux Scheduler A Decade of Wasted Cores 고민영...

The Linux SchedulerA Decade of Wasted Cores

고민영hedone21@gmail.com

대학원 운영체제 전공(석사과정) 모바일 / 임베디드를 주로 함 Ubuntu 안 씀 (연구실 서버가 ubunt라서 어쩔 수 없이 가끔 씀)

“And you have to realize that there are not very many things that have aged as well as the

scheduler. Which is just another proof that scheduling is easy.”

Linus Torvalds, 2001

배경• TPC-H benchmark를 64-Core 실행• ???• 스케줄러 없이 코어에 강제로 작업을 할당한 경우에 성능이 더 좋게 나옴

배경왜? 메모리 Locality

때문인가?

락과 관련된 동기화 이슈인가?

-

캐시 미스 숫자는 비슷-

여러 번 반복실험 및 오랜 시간에

걸쳐 관찰해도 동일한 현상 스위칭 오버헤드인가?- 스위칭 오버헤드는 미미

배경그래서 원인 분석을 위한 도구를 개발했다.- Online sanity checker- “No core remain idle while another core is overload.”- 최대 100ms 주기로 모니터링

- Scheduler Visualization tool

4가지 버그1. Group Imbalance

2. Overload on Wakeup

3. Scheduling Group Construction

4. Missing Scheduling Domains

4가지 버그1. Group Imbalance

2. Overload on Wakeup

3. Scheduling Group Construction

4. Missing Scheduling Domains

Group Imbalance

Group Imbalance

Group Imbalance

Group Imbalance

Group Imbalance

Group Imbalance

Group Imbalance

Group Imbalance

해결책: 평균 대신 가장 로드가 적은 그룹을 밸런싱

Group Imbalance

해결책: 평균 대신 가장 로드가 적은 그룹을 밸런싱

Group Imbalance

해결책: 평균 대신 가장 로드가 적은 그룹을 밸런싱

13% 속도 증가!

4가지 버그1. Group Imbalance

2. Overload on Wakeup

3. Scheduling Group Construction

4. Missing Scheduling Domains

Overload on Wakeup

Overload on Wakeup

Short Term Idle: 잠깐 일이 없는 것Long Term Idle: 일 없다고 그냥 뻗어버리는 것

Overload on Wakeup

Overload on Wakeup

해결책: 가장 마지막에 Idle상태로 진입한 Core 부터 깨움14.2% 성능 향상

4가지 버그1. Group Imbalance

2. Overload on Wakeup

3. Scheduling Group Construction

4. Missing Scheduling Domains

Scheduling Group Construction

Numa (Non-Uniform Memory Access)

Scheduling Group Construction

Scheduling Group Construction

Scheduling Group Construction

Scheduling Group Construction

Scheduling Group Construction

Scheduling Group Construction

Scheduling Group Construction

해결책: NUMA를 고려하지 않고 task 가져오기

4가지 버그1. Group Imbalance

2. Overload on Wakeup

3. Scheduling Group Construction

4. Missing Scheduling Domains

Missing Scheduling Domains

리얼 버그

Missing Scheduling Domains

Procfs, Sysfs에서 CPU CORE를 껐다 키면, 가용 CPU를 기록하는 전역 변수가 갱신이 안 되서 CPU를 활용하지 못함.

해결책: 버그 수정

결과

감사합니다.