今日重点:✍️ 写作——今天不背单词,学「怎么写」。素材是 Suren Baghdasaryan 给 per-VMA 锁 v6 系列写的真实 cover letter(投 linux-mm),我们拆解它怎么组织一封信、用什么句式,再自己仿写一段。

✍️ 写作:cover letter 的四步写法

/ section

内核补丁系列的 cover letter(0/N 封)是「给维护者的电梯简报」:他要在几秒内知道这个系列是什么、为什么值得看。Suren 这份 v6 是教科书式结构,四步——① tl;dr 一句话总结 → ② longer version 展开动机 → ③ 代价与收益权衡 → ④ 逐补丁预告。下面看真实原文(引文来自 cover letter 邮件本身)。

真实原文:Suren 怎么权衡「代价 vs 收益」

linux-mm · [PATCH v6 0/5] mm: Unconditional per-VMA locks and cleanups

英文原段 Make per-VMA locks available in all configs. Right now, they are only available on select architectures when SMP and MMU are enabled. But all of the primitives that per-VMA locks are built on (RCU, maple trees, refcounts) work just fine without SMP or MMU. The only real downside is that making VMAs a wee bit bigger on !MMU and !SMP builds. The upside is much cleaner code, lower complexity and less #ifdeffery.
中文理解 「让 per-VMA 锁在所有配置下可用。目前它们只在启用 SMP 且启用 MMU 的特定架构上可用。但构成 per-VMA 锁的全部原语(RCU、maple tree、引用计数)在无 SMP / 无 MMU 下也完全正常。唯一的真实代价,是 !MMU 和 !SMP 构建里 VMA 会稍微变大一点点。而收益是代码干净得多、复杂度更低、#ifdef 堆砌更少。」
写作要点 三个可直接模仿的句式——Make X available in all configs(祈使句当主题句,动作明确);The only real downside is ... The upside is ...(代价收益对仗,'only' 压低代价让读者不慌);a wee bit bigger(轻描淡写,把代价说得可爱)。最后用 less #ifdeffery 收尾——把 #ifdef 名词化,带点自嘲,是内核社区标志性幽默。

✨ 辅助彩蛋

/ section

cover letter 里的「礼貌求 review」

同一封 cover letter

真实原句 I'm not quite sure how this pile would get merged, but ack/review tags would be appreciated if this looks good to you.
中文理解 「我不太确定这一堆会怎么被合进去,但如果你们觉得没问题,给个 ack/review 标签就感激不尽了。」
可学点 this pile 用「一堆」自嘲式指代这一系列补丁(谦逊);tags would be appreciated 用被动语态把请求说得客气(不是 Please ack,而是「标签会被感激」);if this looks good to you 把决定权完全交给对方——求审阅的标准姿态。

✍️ 今日练习

/ section
✍️ 仿写:用今天学的四步结构(tl;dr 一句话 → 动机 → 代价/收益 → 预告),给今天的另一个系列「scalable COW:MAP_PRIVATE 文件页改按匿名 pgoff 索引」写一份 4 句英文 cover letter(tl;dr 风格)。提示:动机 = 匿名 folio 偏移互相冲突,快速路径走不上;收益 = 为 scalable COW 铺路。
💡 显示答案
参考(仿写示范,非原句):tl;dr: Index MAP_PRIVATE file-backed folios by anonymous pgoff so they behave like pure anonymous memory. Right now, COW'd anonymous folios keep the file offset, so offsets collide and the maple-tree fast path never kicks in. The main downside is that only the edge case of COW-then-remap requires the offset to match. The upside is a clean foundation for scalable COW — and room to skip most remap tracking later.
📖 原文:Make per-VMA locks available in all configs. Right now, they are only available on select architectures when SMP and MMU are enabled. But all of the primitives that per-VMA locks are built on (RCU, maple trees, refcounts) work just fine without SMP or MMU. The only real downside is that making VMAs a wee bit bigger on !MMU and !SMP builds. The upside is much cleaner code, lower complexity and less #ifdeffery.
📎 原文引用

tl;dr first, then the why, then the cost — a good cover letter is a patch summary with manners.

内核英语 · 每日一篇