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
630
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
66
Linuxカーネルの インタフェースは変わりうる?
sat
PRO
1
92
あなたの知らないバージョン命名規則
sat
PRO
3
890
Rook: Intro and Deep Dive with Ceph
sat
PRO
1
64
Machine Check Exception
sat
PRO
2
63
バイナリダンプの模様を読む
sat
PRO
0
88
cpコマンドはディスク上でデータを コピーしないことがある
sat
PRO
3
87
114-ファイルのshallow_copy.pdf
sat
PRO
2
57
113-Btrfsのスナップショット.pdf
sat
PRO
0
40
Featured
See All Featured
Visualization
eitanlees
152
17k
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
67
58k
Thoughts on Productivity
jonyablonski
76
5.4k
Claude Code のすすめ
schroneko
67
230k
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
530
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
Heart Work Chapter 1 - Part 1
lfama
PRO
8
36k
Product Roadmaps are Hard
iamctodd
55
13k
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
2
680
Building the Perfect Custom Keyboard
takai
2
870
Optimising Largest Contentful Paint
csswizardry
37
3.9k
Art, The Web, and Tiny UX
lynnandtonic
304
22k
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