Try   HackMD

L11: ktcp

主講人: jserv / 課程討論區: 2023 年系統軟體課程

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →
返回「Linux 核心設計」課程進度表

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →
自我檢查清單

  • 給定的 kecho 已使用 CMWQ,請陳述其優勢和用法,應重現相關實驗
  • 搭配閱讀《Demystifying the Linux CPU Scheduler》第 1 章和第 2 章,描述 CPU 排程器和 workqueue/CMWQ 的互動,應探究相關 Linux 核心原始程式碼
  • 研讀〈Linux 核心設計: RCU 同步機制〉並測試相關 Linux 核心模組以理解其用法
  • 如何測試網頁伺服器的效能,針對多核處理器場景調整
  • 如何利用 Ftrace 找出 khttpd 核心模組的效能瓶頸,該如何設計相關實驗學習。搭配閱讀《Demystifying the Linux CPU Scheduler》第 6 章
  • 解釋 drop-tcp-socket 核心模組運作原理。TIME-WAIT sockets 又是什麼?
  • 研讀 透過 eBPF 觀察作業系統行為,如何用 eBPF 測量 kthread / CMWQ 關鍵操作的執行成本?

    參照 eBPF 教程

  • 參照〈測試 Linux 核心的虛擬化環境〉和〈建構 User-Mode Linux 的實驗環境〉,在原生的 Linux 系統中,利用 UML 或 virtme 建構虛擬化執行環境,搭配 GDB 追蹤 khttpd 核心模組

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →
作業要求

  • 回答上述「自我檢查清單」的所有問題,需要附上對應的參考資料和必要的程式碼,以第一手材料 (包含自己設計的實驗) 為佳

    Image Not Showing Possible Reasons
    • The image file may be corrupted
    • The server hosting the image is unavailable
    • The image path is incorrect
    • The image format is not supported
    Learn More →
    如果你在 2023 年 4 月 18 日前,已從 GitHub khttpd 進行 fork,請對舊的 repository 做對應處置,然後重新 fork
    Image Not Showing Possible Reasons
    • The image file may be corrupted
    • The server hosting the image is unavailable
    • The image path is incorrect
    • The image format is not supported
    Learn More →
    2023 年的作業要求和 2022 年不同,請留意!

  • 在 GitHub 上 fork khttpd,目標是
    1. 引入 Concurrency Managed Workqueue (cmwq),改寫 kHTTPd,分析效能表現和提出改進方案,可參考 kecho
    2. 提供目錄檔案存取功能,提供基本的 directory listing 功能
    3. 目前的 kHTTPd 初步實作 HTTP 1.1 keep-alive,不過效率不彰,以 ftrace 一類的工具指出問題所在並改進
    4. 引入 timer,讓 kHTTPd 主動關閉逾期的連線
    5. 以 RCU 搭配自行設計的 lock-free 資料結構,在並行環境中得以釋放系統資源

      參照 http-server-rcu

    6. 學習 cserv 的 memcache 並在 kHTTPd 重新實作
  • 過程中應一併完成以下:
    • 修正 kHTTPd 的執行時期缺失
    • 指出 kHTTPd 實作的缺失 (特別是安全疑慮) 並予以改正
  • 用你改進的 kHTTPd 和 cserv 進行效能評比,解釋行為落差

繳交方式

編輯 Homework7 作業區共筆,將你的觀察、上述要求的解說、應用場合探討,以及各式效能改善過程,善用 gnuplot 製圖,紀錄於新建立的共筆

截止日期

  • May 14, 2023 (含) 之前

越早在 GitHub 上有動態、越早接受 code review,評分越高

作業觀摩