Try   HackMD

N03: review

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

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 核心設計」課程進度表

第一次作業檢討 (2023 年)*
解說錄影 (2021 年)

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 →
預期目標

  • 強化第 1 次作業,補完指定進度
  • code review 做好必要的準備工作,練習 Software peer review
  • 歌德說:「要欣賞自己的價值,就得給世界增添價值」,從反省和觀摩中重新檢視自己作品的具體突破機會
  • 軟體工程師要學會說故事,從良性詳盡的批評開始
  • 工程師也許無法賺大錢,但一定要做大事 (開發的資訊系統給數千萬人每天用,當然是大事),為了這樣的目標,提高自身素養

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 →
Code Review

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 →
作業要求

  1. 研讀上方
    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 →
    Code Review 區域所列出的材料,搭配檢討及解說錄影,更新自己列於 Homework1 作業區 的開發紀錄
    • 詳閱第 1 次作業規範,不需要建立新的共筆,在你原本第 1 次作業的頁面更新即可。第一週的作業值得花上超過一個月來做,但若授課教師一開始把繳交時限寫為三周,因人性使然,繳交的狀況會很慘 (總有人會在最後一日才投入),於是授課教師故意縮短時限並安排在課堂檢閱,給同學們持續精進自己的機會,期許有更好的結果。務必詳閱「第一次作業檢討 (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 →
      你可能會發現單頁 HackMD 筆記會有內容長度的限制,這也是為何作業規範強調要記錄你的洞見和關鍵程式碼,完整的程式碼該在 GitHub 儲存庫或 gist 出現。藉本次作業,整理既有的筆記,用精簡且明確的行文反映出你的投入。

    • 檢查事項 1: 確認分析 Linux 核心的 lib/list_sort.c 實作並評估其效益、針對 Linux 核心風格的鏈結串列開發 Timsort 排序程式,該設計對應的排序測試實驗方案。

      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,直接執行於電腦硬體之上。

    • 檢查事項 2: 閱讀指定的論文〈Dude, is my code constant time?〉及列於 lib/list_sort.c 修改紀錄 (即 commit b5c56e)中的 3 篇論文,闡述你的洞見,需要指出論文和現有 Linux 核心原始程式碼不同的地方,並予以討論,過程中該有對應的效能分析實驗。參考 CPython 的 listsort 的說明文件,對不同的資料分佈進行測試:
    • 檢查事項 3:請先詳讀〈Git 教學與 GitHub 設定指引〉(包含解說錄影),接著使用 git fetch 命令以取得 sysprog21/lab0-c 的最新更新,並利用 git rebase 將你已提交的 commit 移至 3 月 18 日或之後的更新之上。注意:在操作過程中可能會出現衝突,需自行解決。此外,請確保所有 commit 訊息皆符合〈How to Write a Git Commit Message〉的規範,必要時可使用 git rebase -i 命令進行修改,最終再以 git push --force(請務必謹慎操作)將更新公開推送至 GitHub。確保你在 rebase 時,基底包含 commit 4a2ff9f

      git rebase 示意:

      Image Not Showing Possible Reasons
      • The image was uploaded to a note which you don't have access to
      • The note which the image was originally uploaded to has been deleted
      Learn More →

      確認已安裝所需的字典: sudo apt install wamerican

    • 檢查事項 4: 確保符合指定的書寫規範,技術用語依循〈資訊科技詞彙翻譯〉,並針對授課教師的要求,以清晰、明確,和流暢的漢語書寫。倘若你選擇用英語書寫開發紀錄,則依正式英語技術報告慣例。 理解詞彙背後的考量因素,和使用精準詞彙,其實也是工程素養的一環。
    • 檢查事項 5: 針對現有 (及自己的) 程式碼,提出可重用程度更高、效能更好,且更安全的實作,過程中應有對應的實驗及分析。過程中,應查閱 C 語言規格書 (原文) 及 The Linux Programming Interface
    • 檢查事項 6: 研讀 select(2) 並探討 sysprog21/lab0-c 如何偵測程式執行的超時、現有的網頁伺服器如何與 linenoise 並存,以及相關的 signal(7) 使用方式。
    • 檢查事項 7: 使用 valgrind, massif, gdb, perf 等課程提及的開發量化程式碼執行時期的資訊,應分析記憶體開銷、執行的指令 (instruction) 數量、cache 表現,和程式熱點 (hotspot),並予以改進,過程中應有充分的實驗紀錄及討論。
    • 檢查事項 8: 紀錄研讀第 1 到第 4 週課程教材的發現和疑惑,描述於上述開發紀錄,之後授課教師和其他學員會參與討論。

      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 →
      你可建立新的 HackMD 筆記 (記得要公開發表並設定所有登入者皆可編輯) 來闡述你對教材的認知,並在原本的筆記加上對應的超連結。

    • 檢查事項 9: 改寫 lab0-c 既有的 shannon_entropy.clog2_lshift16.h,採用更有效、準確度 (accuracy) 更高的定點數運算實作,需要有對應的數學統計分析和實際執行的討論。

      Linux 核心原始程式碼 fs/btrfs/compression.c 存在 Shannon Entropy 的計算,其程式碼註解提到 "Use of ilog2() decreases precision, we lower the LVL to 5 to compensate"。檔名的 "compression" 意味著 btrfs 檔案系統具備壓縮,而這機制就用到 Shannon Entropy 進行估算。

    • 檢查事項 10: 針對 sysprog21/lab0-c 專案,提交 pull request 以修正你在作業過程中發現的缺失和提出改進,並於 GitHub 進行 code review
    • 檢查事項 11: 詳閱〈Teach Yourself Programming in Ten Years〉,闡述你的認知和發現,並描述你在本課程發現可對應到該文章的觀點。
  2. 課程助教預計在 3 月 19 日,針對每位選課的學員,從 Homework1 作業區 挑出 5 位學員,逐一發信通知,若你在 3 月 20 日中午尚未收到如此的信件,請聯繫授課教師,當然若你願意額外評論其他同學,也歡迎。針對其他學員的開發紀錄,請編輯內文,加上 Reviewed by 你的GitHub帳號名稱 的段落,參見: 示範的 Review-1示範的 Review-2,你的總結意見要寫在共筆的最上方,僅次於 "contributed by"。要從以下方面探討:
    • 程式碼的 coding style, git commit messages (務必查閱其 GitHub repository)
    • 程式碼和共筆是否達到指定作業要求,特別是上述的「檢查事項」1 到 8。
    • 實驗設計的不足處、涵蓋程度是否全面,以及後續的改進空間
    • 共筆行文是否流暢且具體,結構規劃是否清晰 台大電機系李宏毅教授對於 ChatGPT 的看法是,要善用人工智慧的成果,一旦人們得以善用,人類的書寫不該比 GPT 一類的大語言模型差。
    • 建議引入新的方法或工具,如 Valgrind 參數變更、縮減排序的時間成本
    • 斟酌在選定的 GitHub repository 留下 code review 意見。
    • 嘗試回覆學員提出的問題。

      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 →
      及早提交對學員的意見並藉由 HackMD 平台互動
      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 →
      不必擔心得罪人而刻意用委婉或模糊的詞彙,如此非但不利於有效溝通,還可能導致真正的訊息丟失。關鍵是不要過分拘謹於形式,若因你沒有直接說出問題,導致他人錯失學習機會,那才是真正的失禮 —— 真誠地分享你的專業知識,讓溝通能夠達到共鳴,才是真正展現禮貌的方式

  3. 應適時回應授課教師和其他同學在你羅列於 Homework1 作業區 的共筆中所做的評語意見、建議,和提問。你可趁這個機會,在其他學員的共筆提交相關疑惑。
  4. 截止日期: Apr 6, 2025