Invitation to Kernel Parameter and Code Exploration

16
<予告> カーネルパラメータ 読書会 for YLUG#107, 2011/5/31 @tyamadajp

description

Invitation fo "Linux Kernel parameter reading" at YLUG#107. Kernel source code exploration and history tracking based on each kernel parameter.

Transcript of Invitation to Kernel Parameter and Code Exploration

Page 1: Invitation to Kernel Parameter and Code Exploration

<予告>カーネルパラメータ読書会

for YLUG#107, 2011/5/31

@tyamadajp

Page 2: Invitation to Kernel Parameter and Code Exploration

カーネルパラメータ

質問:どれだけある?

Page 3: Invitation to Kernel Parameter and Code Exploration

カーネルパラメータ

質問:どれだけある?

# sysctl -a | wc -l1807# sysctl -a | \perl -pe 's/\d+/X/g;s/=.*$//' | \sort | uniq | wc -l1104

Page 4: Invitation to Kernel Parameter and Code Exploration

カーネルパラメータ

質問:どれだけある?

# sysctl -a | wc -l1807# sysctl -a | \perl -pe 's/\d+/X/g;s/=.*$//' | \sort | uniq | wc -l1104

モジュールによって更に追加されるものの、吊るしの PC でもこんなにある

Page 5: Invitation to Kernel Parameter and Code Exploration

パラメータについて調べたい!

そんなあなたに:

- kernel-parameters.txt- networking/ip-sysctl.txt- その他 Documentation/ の下

優しいカーネルハッカーのお兄さん達が説明してくれてます!

Page 6: Invitation to Kernel Parameter and Code Exploration

パラメータについて調べたい!

そんなあなたに:

- kernel-parameters.txt- networking/ip-sysctl.txt- その他 Documentation/ の下

優しいカーネルハッカーのお兄さん達が説明してくれてます!そんな風に考えていた時期が・・・

俺にもありました・・・

Page 7: Invitation to Kernel Parameter and Code Exploration

さわるな危険・・・でも

基本:あんまりいじらない

→ 明確に必要なアプリなら、  きちんと案内がある( DB 系とか)→ あまり変な値をセットしたりすると  システムが不思議な踊りを!→ 搭載リソース量から自動で  設定されるよう書かれていたり

そうは言っても知りたい事も

Page 8: Invitation to Kernel Parameter and Code Exploration

さわるな危険・・・でも知りたい

実益:→ リソース枯渇で止まった後に  知るより、止まる前に知るべき

趣味(?):→ 実世界のニーズがあるから  (一部やむなく)存在する訳で、  これを起点にソースを読むのは  勉強になる(かもしれない) 

Page 9: Invitation to Kernel Parameter and Code Exploration

たとえば・・・ここでクイズ

以下のパラメータはper-kernel? それとも per-container?

・ kernel.msgmax・ kernel.threads-max・ net.core.somaxconn・ sunrpc.tcp_fin_timeout

cgroup namespace

Page 10: Invitation to Kernel Parameter and Code Exploration

たとえば・・・ここでクイズ

以下のパラメータはper-kernel? それとも per-container?

・ kernel.msgmax → per-c・ kernel.threads-max・ net.core.somaxconn・ sunrpc.tcp_fin_timeout

Page 11: Invitation to Kernel Parameter and Code Exploration

たとえば・・・ここでクイズ(1)

以下のパラメータはper-kernel? それとも per-container?

・ kernel.msgmax → per-c・ kernel.threads-max → per-k・ net.core.somaxconn・ sunrpc.tcp_fin_timeout

Page 12: Invitation to Kernel Parameter and Code Exploration

たとえば・・・ここでクイズ(1)

以下のパラメータはper-kernel? それとも per-container?

・ kernel.msgmax → per-c・ kernel.threads-max → per-k・ net.core.somaxconn → per-c・ sunrpc.tcp_fin_timeout → per-k

試せば判ることだけど、まとまってるといいよね?

Page 13: Invitation to Kernel Parameter and Code Exploration

まとめてみました

まだ 500 個くらい

Page 14: Invitation to Kernel Parameter and Code Exploration

まとめてみてよかったこと

辞書を読む楽しみ、のような… 「こんなパラメータがあったのか」

例: crypto.fips_enabled →暗号化・乱数生成系の厳格さを   FIP-120 準拠にします(矛盾を   発見すると即 panic する)

Page 15: Invitation to Kernel Parameter and Code Exploration

調べてみてわかったこと

ここを探せばわかる:→ ソースとコメント(当然)→ パッチを投げたメール→ その人が他で投げたメール→ その人が他で書いた資料・論文

$ grep -ri crypto.fips_enabled \ Documentation/$

Page 16: Invitation to Kernel Parameter and Code Exploration

これから

こういった k-p.txt の翻訳ではない、

  パラメータを起点にした  カーネル探検

を細々とやってきたいので、一緒にやりたい方、いかがですか?