Kernel
éçã³ã¼ã解æãã¼ã«ã®1ã¤ã§ãã Inferã使ã£ã¦Linuxã«ã¼ãã«ã®ã½ã¼ã¹ã³ã¼ãã解æããã¡ã¢ãªé¢é£ã®ä¸å ·åãæ¤åºãã¦ã¿ã¾ããInfer ã®ãã«ãããã解æã®å®è¡ã¨æ¤è¨¼ã解æçµæã®ç²¾æ»ã«ã¤ãã¦ã¾ã¨ãã¾ããã
DPDKã®ã½ã¼ã¹ã³ã¼ããèªã¿è§£ããã¨ã§ããã«ã¼ãã«ã®Ethernetãã©ã¤ãã®ä»£ããã«ã¦ã¼ã¶ç©ºéã§Ethernetãã©ã¤ããä½ã£ã¦ãããã¨ãããå®éã®PCIããã¤ã¹ã«ã©ããã£ã¦ã¦ã¼ã¶ç©ºéããã¢ã¯ã»ã¹ãã¦ããã®ã ãããï¼ãã¨ããçåã(é¨åçãªãã)解決ãã¾ãã
ååã®æ¦è«ç·¨ã§ã¯ãeBPFãã©ããªãã®ã§ãã©ã®ããã«å®ç¾ããã¦ããããä¸å¿ã«è§£èª¬ããeBPFã®æè¡è¦ç´ (BCCãBCC-ToolsãCO-RE) ã«ã触ãã¾ããã å®è£ ç·¨ã¨ãªãä»åã¯ãBCC-Toolsã®å¾ç¶ã¨ãªãlibbpf-toolsããopensnoopã³ãã³ãã«çç®ãã¦ã½ã¼ã¹ã³ã¼ãã¬ãã«â¦
è¿å¹´æ³¨ç®ããã¦ããeBPFã«ã¤ãã¦ãæ¦è«ç·¨ã¨å®è£ ç·¨ã«åãã¦è§£èª¬ãã¾ãã æ¦è«ç·¨ã¨ãªãæ¬ç¨¿ã§ã¯ãeBPFã¨ã¯ä½ããeBPFã§å®ç¾ã§ããäºãeBPFã®ä»çµã¿ãeBPFã®æè¡è¦ç´ (BCCãBCC-ToolsãCO-RE) ã«ã¤ãã¦ã¾ã¨ãã¾ããã
Linux ã®ãªã¢ã«ã¿ã¤ã ã¹ã±ã¸ã¥ã¼ãªã³ã°å®è£ ã§ãã SCHED_DEADLINE ã®æ¦è¦ã«è§¦ããå¾ãæé©ååé¡ IAP (Incremental Assignment Problem) ãæ ¸ã«æ®ã㦠Unrelated ãªãã«ãã»ããã»ããµã¢ãã«ã§ã® SRT-optimality ã証æãã Unr-EDF ããã¼ã¹ã«ãSCHED_DEADLâ¦
ããã¾ã§æ§ã ãªvmlinuxç¹æã®ELFã»ã¯ã·ã§ã³ãè¦ã¦ãã¾ãããä»åã¯`__ex_table`ã»ã¯ã·ã§ã³ãåãä¸ããå®éã®ã³ã¼ããã©ããªã£ã¦ããã®ããã¨ããæ¹åãããã®exception tableãè¦ã¦ããã¾ãã
ååè¨äºã§ã¯ãvmlinuxã®initã»ã°ã¡ã³ãã«å«ã¾ããã`.percpu`ã`.init.text`ã`.init.data`ãªã©ã®ã»ã°ã¡ã³ãã«ã¤ãã¦èª¿ã¹ã¾ãããä»åã¯ãã®ç¶ãã§ããã®initã»ã°ã¡ã³ãã«å«ã¾ãã¦ãã`.parainstructions`ã`.altinstructions`ã`.altinstr_replacement`ã®â¦
åç·¨ã§ã¯ãNAPI ã¨ããã«é¢é£ããã½ããã¦ã§ã¢å²ãè¾¼ã¿ã®ä»çµã¿ã«ã¤ãã¦è§£èª¬ãã¾ããã æ¬ç¨¿ã§ã¯ãååã®æå¾ã«è§¦ããéããLinux kernel ã«çµã¿è¾¼ã¾ãã¦ãããNIC ãã½ããã¦ã§ã¢å²ãè¾¼ã¿ä»¥å¤ã§ polling ããããã®ä»çµã¿ã§ãããBusy Poll Socket 㨠kthreâ¦
1å¹´ååã«æ稿ãããvmlinuxã®ãããã(https://valinux.hatenablog.com/entry/20200910) ã®ç¬¬2å¼¾ã§ãã ä»åã¯ãã³ã¼ãä¾ããªããåã«Linuxã¨ãã巨象ã®æèæ«ç¯ãããã§ããªãããã§ããªãã¨éé²ã«æ«ã§åãã¦ã¿ã¾ããã
Linux ã«ããããããã¯ã¼ã¯åä¿¡å¦çã§å©ç¨ããã¦ãããNAPI (New API) ã¨å¼ã°ããä»çµã¿ã«ã¤ãã¦ãå®è£ ã¬ãã«ã§è§£èª¬ãã¾ãã
perf ã¯ãLinux ã®æ§è½ã«é¢ããæ å ±ãåéãåæããããã®ãã¼ã«ã§ããæ¬è¨äºã§ã¯ããããã¯ã¼ã¯ã®åä¿¡å¦çãä¾ã«ãperf ã使ã£ãæ§è½åæãè¡ãæ¹æ³ã解説ãã¾ãã
è¿å¹´æ´»çºã«éçºãé²ãã§ãã AF_XDP ãå©ç¨ããã¢ããªã±ã¼ã·ã§ã³ã¯ãLinux Kernel Network Stack ããã¤ãã¹åºæ¥ãã¨ãã観ç¹ã§ãDPDK ãæ´»ç¨ããã¢ããªã±ã¼ã·ã§ã³ã¨æ¯è¼ããããã¨ãå°ãªããããããã¨æãã¾ãã æ¬è¨äºã§ã¯ãAF_XDPã¢ããªã±ã¼ã·ã§ã³ã«ããâ¦
vmlinux ã®å ¥æã»ã¤ã³ã¹ãã¼ã«ãã¯ãããELFãã¡ã¤ã«ãã»ã¯ã·ã§ã³ã«ã¤ãã¦è§£èª¬ãã¾ãã
lockdepã¯ãLinux Kernelã®locking primitiveã®èª¤ä½¿ç¨ã«å ãdeadlockæ¤ç¥ã»äºæ¸¬ãã¯ãããsynchronization primitiveã誤ã£ãå½¢ã§ä½¿ç¨ãã¦ãã"_bad code_"ãå¹ åºãæ¤ç¥ããçºã®æ©æ§ã§ããä¸æ¹ã§å··ã«ã¯ãã®ã¡ã«ããºã ãã¤ã¾ãä½ãã©ã®ããã«ãã¦æ¤ç¥ããã®ãâ¦