Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Linuxのプロセススケジューラのしくみ その1 時分割によるスケジューリング
Search
Satoru Takeuchi
PRO
August 23, 2020
640
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Linuxのプロセススケジューラのしくみ その1 時分割によるスケジューリング
以下動画のテキストです。
https://youtu.be/b924MxEt42Q
Satoru Takeuchi
PRO
August 23, 2020
More Decks by Satoru Takeuchi
See All by Satoru Takeuchi
119-多機能ファイルシステムBtrfs_のコピー.pdf
sat
PRO
1
70
Linuxカーネルの インタフェースは変わりうる?
sat
PRO
1
95
あなたの知らないバージョン命名規則
sat
PRO
3
900
Rook: Intro and Deep Dive with Ceph
sat
PRO
1
64
Machine Check Exception
sat
PRO
2
67
バイナリダンプの模様を読む
sat
PRO
0
89
cpコマンドはディスク上でデータを コピーしないことがある
sat
PRO
3
89
114-ファイルのshallow_copy.pdf
sat
PRO
2
58
113-Btrfsのスナップショット.pdf
sat
PRO
0
41
Featured
See All Featured
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
710
VelocityConf: Rendering Performance Case Studies
addyosmani
331
25k
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
340
What's in a price? How to price your products and services
michaelherold
247
13k
Rebuilding a faster, lazier Slack
samanthasiow
85
9.6k
The Curse of the Amulet
leimatthew05
3
15k
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
3.1k
Designing for Performance
lara
611
70k
[RailsConf 2023] Rails as a piece of cake
palkan
59
7k
New Earth Scene 8
popppiees
4
2.6k
Evolving SEO for Evolving Search Engines
ryanjones
0
300
Transcript
Linuxのプロセススケジューラのしくみ その1: 時分割によるスケジューリング Aug 23th, 2020 Satoru Takeuchi Twitter: satoru_takeuchi,
EnSatoru 1
Linuxのプロセススケジューリング • 1つのCPU上で実行可能プロセスが複数個あれば所定の時間づつ実行させる ◦ いわゆる時分割によるスケジューリング ◦ この「所定の時間」を「タイムスライス」と呼ぶ CPU上で動作 するプロセス n=1
n=2 n=3 同上 同上 P0 P0 P1 P0 P0 P1 P2 P0 P1 2 時間
実験 • 目的 ◦ Linuxのスケジューラが時分割によるスケジューリングをしていることを確かめる • 実験プログラムsched.cの概要 1. 1つのCPU上で無限ループするプログラムを 1~4個同時に100ミリ秒間動かす
2. 各プログラムはCPUを1ミリ秒使うごとに次の情報を記録する ▪ プロセスの番号 ▪ プログラム開始時からの経過時間を記録 3. 100ミリ秒経過後に全プログラムについての記録を出力 3
sched.cの動作イメージ(n=2, タイムスライス=2ミリ秒) P0 P1 P0 P1 経過時間(ミリ秒) 0 2 1
3 5 4 6 8 7 記録 記録 記録 記録 記録 記録 記録 記録 測定終了 図示 経過時間(ミリ秒) 4 P1 P0 0 1 2 3 4 5 6 7 8 1ミリ秒の精度では 順番に実行している プロセス 経過時間 P0 1,2,5,6 P1 3,4,7,8
結果(n=1) • p0が動き続ける 5 0
結果(n=2) • P0とP1がおおよそ同じ時間づつ交互に動く 6 0 1 タイムスライス
結果(n=3) • P0~P2がおおよそ均等な時間づつ動作 7 0 1 2
結果(n=4) • P0~P3がおおよそ均等な時間づつ動作 8 0 1 2 3
疑問 • nが増えるとタイムスライスが短くなってるような…? 9 0 1 0 1 2 0
1 2 3
今回はここまで • まとめ ◦ Linuxのスケジューラは時分割式 ◦ 実際にそうなっていることを実験で確認した • 「Linuxのプロセススケジューラのしくみ」次回予告 ◦
タイムスライスはどう決まるのか 10