changed 6 years ago
Published Linked with GitHub

藉由減少例外處理的途徑

降低 Linux 系統呼叫執行成本



slide: https://hackmd.io/@afcidk/Syy-KJomS#/



$ whoami

  • 洪培軒
  • afcidk@NCKU CSIE

例外處理



途徑



成本



  • Direct (Mode switch cost)
  • Indirect (Processor structure pollution)

FlexSC

Flexible System Call

  • OSDI 2010
  • 1.4x improvement on MySQL
  • 2.0x improvement on Apache

Exception-less syscall


Normal syscall


Exception-less syscall


Syscall page







Syscall Batching


經驗


為什麼回頭看十年前的論文?


  • 實驗數據的差異
  • 小改變 -> 肉眼可見的結果

為什麼要修改 kernel


  • 特別的情境
  • 某些不需要的功能

電腦技術的演進


  • microarchitecture
  • Context switch


https://bit.ly/33vKhi8



插曲


實驗結果


  • Syscall batching
    • multicore (CMWQ)
    • single core (CMWQ)
    • single core (WQ)

Syscall batching, multicore execution (CMWQ)


Syscall batching, single core execution (CMWQ)


  • flexsc 實作的成本
  • flexsc 概念的效能提升
  • 處理器的進步

Syscall batching, single core execution (CMWQ)


Syscall batching, single core execution (WQ)


workqueue v.s. CMWQ


難題


操作 shared page 的成本

  • lock
  • get_user_pages

https://lwn.net/Articles/753027/


current pointer



  • getpid
  • open/read/write

結論


結果不如預期也不算是壞事



Select a repo