今日重点:💬 地道表达——今天 radar 的 media 板块有三封值得逐句读的邮件: Karl Mehltretter 的 [PATCH v2 0/3] media: synchronize CPU access to imported DMA-BUFs、 venus 解码器流式状态修复(已获 Reviewed-by)、以及 camss 的 SOF 帧同步 v3 系列。 从中挑出 五个书面讨论里反复出现的地道说法:bracket...with、stale bytes、 disagree about、as if ... were、「evil plan」。原句逐字引用,全部带 lore 链接。
💬 表达一:bracket the interval from A through B with X and Y
/ column★ bracket ... with ... —— 用一对调用把区间夹住
原句 Add an opt-in uses_cpu_access queue flag for vb2-vmalloc queues to bracket the interval from buf_prepare() through buf_finish() with dma_buf_begin_cpu_access() and dma_buf_end_cpu_access().
中文 给 vb2-vmalloc 队列加一个可选的 uses_cpu_access 队列标志,用 dma_buf_begin_cpu_access() 和 dma_buf_end_cpu_access() 把 buf_prepare() 到 buf_finish() 这段区间首尾夹住。
用法 bracket 本义是括号、支架;作动词 = 用一对东西把一段区间夹住。内核里成对出现的 API(begin/end、lock/unlock、get/put)要描述「这段区间被它俩包住」时,一句 bracket the interval from A through B with X and Y 就说完了——比 「call X at the beginning and Y at the end」紧凑一倍。注意介词搭配: from ... through ...(through 含终点,美式用法;换英式是 from ... to ... inclusive)。下次写 commit message 描述「在某区间首尾各调一次」就直接套这个句型。
🔗 原文
💬 表达二:stale bytes + while 弱对比
/ column★ stale —— cache 领域的「陈旧」,while 表对照
原句 When a non-coherent importer such as V3D maps the same DMA-BUF persistently, captured data remains in the CPU cache while physical RAM holds stale bytes.
中文 当 V3D 这类非一致性(non-coherent)importer 持久映射同一块 DMA-BUF 时, 采集到的数据还停在 CPU cache 里,而物理内存里放着的却是旧字节。
用法 stale 是 cache/数据一致性问题里的核心形容词:stale data、stale cacheline、 stale bytes——一律译「陈旧失效的」。这句话还示范了两个高级小动作:一是 while 不是「当…的时候」而是弱对比「而/却」,前后两个主语状态对照 (remains in the CPU cache while RAM holds stale bytes);二是 holds 的拟物化——内存「持有」旧数据,比 contains 更常见于系统编程写作。
🔗 原文
💬 表达三:disagree about + as if ... were
/ column★ 双方状态不一致 = disagree about;错位必用虚拟语气
原句 In both cases the driver and vb2 disagree about the streaming state: vdec_decoder_cmd() and delayed_process_buf_func() keep going as if the queue were still streaming, and a later capture streamon assumes the output queue is streaming too.
中文 这两种情况下,驱动和 vb2 对流式状态各执一词:vdec_decoder_cmd() 和 delayed_process_buf_func() 还以为队列仍在流式传输、继续跑, 之后 capture 端的 streamon 也以为 output 队列正在流传。
用法 disagree about:描述「双方对同一状态认知不一致」的标准说法,拟人但极通用—— the driver and the hardware disagree about the clock state 这类句子在评审里随处可见。 更值的是后半句的语法点:as if + were(虚拟语气)——队列实际已不在流式传输, 但代码表现得「好像还在」。描述状态错位、假活、假象时,英语必须用虚拟 (were / had done),用 is 就把「假」写成了「真」。这句是把两者焊在一起的范例: 先 disagree about 定调「不一致」,再 as if ... were 演出「谁在将错就错」。
🔗 原文
💬 表达四:evil plan + build off of
/ column★ 邮件文化里的自嘲幽默,与「在…之上搭建」
原句 So SOF serves the immediate purpose of timestamp alignment in user-space as well as the 'evil plan' to trigger off of it programming camera parameters for the next frame. / Whilst the code is actually very simple the functionality we want to build off of that simple code is not.
中文 所以 SOF 眼下的用途是用户空间的时间戳对齐,顺带还承载着一个「邪恶计划」: 以它为触发点,给下一帧编程相机参数。/ 代码本身其实很简单,但我们想在这份 简单代码之上搭建的功能可不简单。
用法 'evil plan' 带引号的自嘲:真实意思是「后续的大动作/真正意图」,用幽默消解 「我后面还有一堆补丁」的压迫感——LKML 邮件文化里这类自嘲很常见,读 cover letter 时看到引号 + 贬义自指,基本都是在预告路线图。build off of = 在…基础上构建 (口语化,正式文档多写 build on)。Whilst = while(英式拼写,英联邦作者 高频);那句话的巧思是 simple 与 not (simple) 的首尾对照,一句话把「代码易、 功能难」说圆了。
🔗 原文
💬 表达五:predate + must survive
/ column★ 描述状态时序的高级动词
原句 A selection that predates the call belongs to a live pin or mapping and must survive, otherwise the next pin or map would reselect under it without an invalidate.
中文 先于这次调用就已存在的选择,属于一个仍活跃的 pin 或映射,必须保留下来; 否则下一次 pin/map 会在没有 invalidate 的情况下在它底下重选。
用法 predate(动词)= 早于…存在,比 「was made before the call」 雅且短, 评审和代码注释里描述状态时序时非常好用:this value predates the reset。 must survive 拟物化「必须存活」= 不能被清掉/覆盖;后半句 otherwise ... would ... 是「不这样做的后果」的标准论证句式—— 评审里反驳一个改动时,先给规则、再用 otherwise 推演崩坏路径,这段就是模板。
🔗 原文
✨ 辅助彩蛋(术语卡)
/ section opt-in 可选开启的机制(默认不开)。原文两处:Add an opt-in uses_cpu_access queue flag / Keep this opt-in because some vb2-vmalloc drivers pass imported buffers to hardware——作者特意解释为什么做成可选:有些驱动会把导入的 buffer 直接交给硬件, 默认强加 CPU 同步会误伤它们。记忆钩子:opt = 选择,in = 加入 → 「主动选择加入」, 反义词 opt-out。原文
✍️ 今日练习
/ section✍️ 两题。① 把这句平铺直叙改写成一句地道英文,必须用 bracket ... the interval from ... through ... with ...:「We call dma_buf_begin_cpu_access() in buf_prepare() and dma_buf_end_cpu_access() in buf_finish(), so the whole interval is covered.」② 把 captured data remains in the CPU cache while physical RAM holds stale bytes 译成中文,并回答:这里的 while 是不是「当…的时候」?
💡 显示答案
① 参考:We bracket the interval from buf_prepare() through buf_finish() with dma_buf_begin_cpu_access() and dma_buf_end_cpu_access().(一个动词把「两处调用 + 整段区间」一次说清;from ... through ... 标明区间含终点。)② 参考译文:采集到的数据还停留在 CPU cache 里,而物理内存里保存的却是旧字节。while 在这里不是「当…的时候」,而是弱对比连词,相当于「而/却」——cache 里的新数据与 RAM 里的旧字节形成对照。
📖 原文:Add an opt-in uses_cpu_access queue flag for vb2-vmalloc queues to bracket the interval from buf_prepare() through buf_finish() with dma_buf_begin_cpu_access() and dma_buf_end_cpu_access(). Keep this opt-in because some vb2-vmalloc drivers pass imported buffers to hardware, and end CPU access in process context because DMA-BUF callbacks may sleep. / When a non-coherent importer such as V3D maps the same DMA-BUF persistently, captured data remains in the CPU cache while physical RAM holds stale bytes.
📎 原文引用 每日一句:Whilst the sentences look simple, the English we build off of them is not.
仿写示范