今日重点:✍️ 写作——一个横跨 sched / mm / cgroup 三个子系统的生产事故 (systemd 卡 D 态最长 10 分钟),怎么写成一封维护者愿意读的 cover letter? 今天拆 Matthew Ruffell(Canonical)的 [PATCH 0/6] mm, sched, cgroup: LRU Cache never drains when isolcpus are used with spinning SCHED_FIFO tasks:抬头把三个子系统点名、影响写成运维语言、 根因一句话讲完五层调用链、修复路线用编号列清。最后练一段「影响陈述」。

✍️ 原文(真实邮件,逐字引用)

/ section
Dear maintainers of the scheduler, memory management, and cgroup subsystems, A user, Caron Wills, ran into this problem in production and authored the patch series, which we have iterated on, tested, and verified on bare metal with the included reproducer together.
Caron Wills has been running into a problem where their low latency workloads are causing systemd / PID 1 to be stuck in D state for extended periods of time, up to 10 minutes in their production environment, and I have seen 3-5 minutes in testing my synthetic reproducers. This prevents user sessions from being created / ssh logins fail / and system services cannot be restarted or containers cannot be killed or launched.
What happens is that the spinning SCHED_FIFO processes running on isolcpus are constantly dirtying the LRU cache, and when we attempt NUMA migration of the 50GB of pages, systemd calls flush_migrate_mm_task_workfn() which creates a kworker that calls cpuset_migrate_mm_workfn() then do_migrate_pages() then lru_cache_disable(), and then __lru_add_drain_all().

出处:linux-mm,Matthew Ruffell 的封面信 [PATCH 0/6] mm, sched, cgroup: LRU Cache never drains when isolcpus are used with spinning SCHED_FIFO tasks causing page migration stalls, 2026-11-03 08:00 UTC(北京时间 11-03 16:00)。背景一句话:isolcpus(把 CPU 从通用调度里隔离出来) 上跑着 100% 占满的 SCHED_FIFO 实时任务,一旦触发跨 NUMA 页迁移,全机 192 个 CPU 的 LRU 缓存迟迟排不干,PID 1 被卡住。下面四张卡片引用的都是这封封面信里的原句。

✍️ 第一层:抬头点名人,归功给发现者

/ section

★ ① Dear maintainers of A, B, and C——寄信先写清收件人

跨子系统补丁,抬头就是路由表

原句 Dear maintainers of the scheduler, memory management, and cgroup subsystems, A user, Caron Wills, ran into this problem in production and authored the patch series, which we have iterated on, tested, and verified on bare metal with the included reproducer together.
拆解 补丁横跨 sched / mm / cgroup,开头一句把三个子系统全点名—— Dear maintainers of the scheduler, memory management, and cgroup subsystems。 这不是客套,是路由:告诉三方维护者「这封信和你们每家都有关」。
第二句是归功:A user, Caron Wills, ran into this problem in production and authored the patch series——发现问题的是用户、写补丁的也是用户, 发信人自己只做 iterated on, tested, and verified(迭代、测试、验证)。 一句话把「功劳归用户、信誉归自己」两件事都办了。
写法 跨子系统系列的第一句 = 收件人名单,照子系统全名写,不用缩写。 归功句的骨架:谁 + ran into this problem in production + authored the series, 再加自己的角色。on bare metal with the included reproducer 是信用背书: 真机验证过、复现器随信附上——维护者看到这两个短语,就知道这不是纸面猜测。

✍️ 第二层:影响写成运维语言

/ section

★ ② 10 分钟 production / 3-5 分钟 reproducer——数字带两个环境

后果枚举用对方听得懂的词:ssh 登不上、容器杀不掉

原句 …causing systemd / PID 1 to be stuck in D state for extended periods of time, up to 10 minutes in their production environment, and I have seen 3-5 minutes in testing my synthetic reproducers. This prevents user sessions from being created / ssh logins fail / and system services cannot be restarted or containers cannot be killed or launched.
拆解 数字给了两组:up to 10 minutes in their production environment (用户生产环境最长 10 分钟)和 3-5 minutes in testing my synthetic reproducers (我用合成复现器测到 3-5 分钟)。两组数字对应两个环境,说明这不是一次性事故, 而且可以复现——可复现是维护者最在意的三个字。
影响枚举全用运维后果:ssh logins fail、system services cannot be restarted、containers cannot be killed or launched。 没有一个内核术语,但每个运维都看得懂这意味着什么级别的故障。
写法 影响段的公式:症状 + 双环境数字 + 用户视角后果枚举。 写 「D state」 是对的(内核人都懂),但别停在那里——D 态对业务意味着什么, 要用对方的语言补一句。枚举用斜杠并列(/)是邮件里的速写体, 比写成三个完整句子更急、更像事故现场。

✍️ 第三层:根因一句话讲完五层调用链

/ section

★ ③ What happens is that…then…then——长句不断气

函数名原样保留,读者可以直接 grep

原句 What happens is that the spinning SCHED_FIFO processes running on isolcpus are constantly dirtying the LRU cache, and when we attempt NUMA migration of the 50GB of pages, systemd calls flush_migrate_mm_task_workfn() which creates a kworker that calls cpuset_migrate_mm_workfn() then do_migrate_pages() then lru_cache_disable(), and then __lru_add_drain_all().
拆解 一句话装下五层调用:systemd → kworker → cpuset_migrate_mm_workfn() → do_migrate_pages() → lru_cache_disable() → __lru_add_drain_all()。 连接件是 which creates a kworker that calls … then … then … and then—— 定语从句先起头,后面全用 then 顺接,读者顺着词就能走完这条链。
关键纪律:函数名一个都不改。维护者看完可以直接拿 __lru_add_drain_all() 去源码里 grep,这就是可核对的根因。 开头 What happens is that 是事故叙事的经典起句,等于「事情的经过是」。
写法 调用链别画成 bullet,写成一句带 then 的长句反而好读——因果顺序就是句子顺序。 写完检查:把每个函数名遮住,句子还剩什么?如果剩下的连词还讲得通,说明结构对了; 函数名是骨架上的肉,随时可以按名索骥。
顺带 dirtying the LRU cache:不断弄脏 LRU 缓存(这里指 per-CPU 的 LRU folio batch,页先攒在本地批里再统一刷回全局 LRU 链表)。spinning 指任务 100% 占着 CPU 空转干活,不让出。

✍️ 第四层:修复路线编号化

/ section

★ ④ The following patches fix this problem by: 1)…6)

六条各一句,动名词开头,每条说清做什么

原句 The following patches fix this problem by: 1) Adding HK_TYPE_KERNEL_NOISE back to the test in cpu_is_isolated(). 3) Bypassing per-CPU LRU/mlock batching on isolated CPUs, committing folios directly to the LRU lists instead. 6) Dropping the redundant workqueue flush in cpuset_fork() so forking tasks do not block on asynchronous memory migrations.
拆解 (原信共 6 条,这里摘 3 条作样例。)每条 = 动名词 + 动作对象 + 目的/效果: Adding … back to(加回来)、Bypassing … instead(绕开,改走直路)、 Dropping … so … do not block(删掉多余的等待,让 fork 不被拖住)。 动词全部用 -ing 形式,挂在总起句 fix this problem by: 后面, 语法上是一个整体,视觉上是一张清单。
写法 路线图段 = 总起句 + 编号 + 动名词短句。每条只写「做什么 + 为什么」, 「怎么做」留给各补丁自己的 commit message——cover letter 只负责给地图, 不负责带路。6 个补丁 6 行,维护者 30 秒就能判断这个系列该不该细看。
对照 结尾一句也别省:Please have a look, and please let me know if you have any questions or need any more information.(请过目,有问题或需要补充信息请告诉我。) 两个 please 不嫌多——你在求三个子系统的维护者花时间。

✨ 辅助彩蛋:四个可以顺手拿走的表达

/ section

★ 撞上问题、卡在 D 态、一长串麻烦、请过目

都是真实原文里的用法,不是仿写

① ran into this problem 撞上这个问题。run into sth 是「意外碰上(麻烦)」,比 found a bug 多一层「猝不及防」的现场感,事故报告的常用开场。
② stuck in D state 卡在 D 态(不可中断睡眠)。stuck 比 blocked 更口语、更有「动弹不得」 的画面感;内核邮件里两个都常见,描述等待超时用 stuck 更传神。
③ all sorts of problems 各种各样的麻烦。原句:This stalls page migration, systemd gets stuck in D state, and causes all sorts of problems. 前面已经枚举过具体后果, 这里用 all sorts of 一笔收拢——先具体后概括,顺序别反。
④ Please have a look 请过目。比 Please review my patches 轻,比 Comments welcome 诚恳, 适合 cover letter 收尾;后面接 let me know if … 把沟通通道留开。
记忆钩子 run into 撞上、stuck 卡住、all sorts of 一长串、have a look 请过目。

✍️ 今日练习

/ column
✍️ 下面是从这组补丁里摘出的事实,请写成一段两句的「影响陈述」:第 1 句写症状 + 双环境数字(生产环境 / 复现器),第 2 句用斜杠并列枚举用户视角的后果。事实:PID 1 卡 D 态;用户生产环境最长 10 分钟;合成复现器测到 3-5 分钟;ssh 登录失败;用户会话建不起来;系统服务无法重启;容器不能启动也不能停止。
💡 显示答案
参考作答(仿写示范,非原文):PID 1 can be stuck in D state for extended periods of time, up to 10 minutes in the user's production environment and 3-5 minutes with our synthetic reproducer. This prevents ssh logins / new user sessions from being created / and system services cannot be restarted or containers started or stopped. 写法要点:第 1 句把两个数字各挂一个环境(production environment / synthetic reproducer),用 and 并列;第 2 句 This prevents 开头,后果全部用运维语言,斜杠并列保留事故现场的紧迫感,不翻译成内核术语。
📖 原文:Caron Wills has been running into a problem where their low latency workloads are causing systemd / PID 1 to be stuck in D state for extended periods of time, up to 10 minutes in their production environment, and I have seen 3-5 minutes in testing my synthetic reproducers. This prevents user sessions from being created / ssh logins fail / and system services cannot be restarted or containers cannot be killed or launched.
📎 原文引用

每日一句:Write the impact in the operator's language, and the cause in the kernel's.

仿写示范