RLIMIT_CPU charges a VM-clone child's CPU time to its parent
维护者通常 2 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 55/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- c, linux
调研方向
Start by reading src/runtime/forkipc.c around sys_clone_vm and src/syscall/sys.c around rlimit_cpu_main to see how VM-clone children are tracked and how CLOCK_PROCESS_CPUTIME_ID is sampled. Inspect test-rlimit-cpu for the existing limit tests, then add the described parent/child case so each guest process accounts for its own vCPU threads and the parent avoids SIGXCPU.
由索引模型根据 Issue 内容生成。
描述
A clone(CLONE_VM) child without CLONE_THREAD or CLONE_VFORK runs inside its parent's host process (sys_clone_vm in src/runtime/forkipc.c). The RLIMIT_CPU sampler from #475 (rlimit_cpu_main in src/syscall/sys.c) reads CLOCK_PROCESS_CPUTIME_ID, which counts the whole host process, so the parent and every VM-clone child share one CPU clock and one limit.
On Linux these are separate processes, each with its own CPU time and its own RLIMIT_CPU. Under elfuse, a parent whose VM-clone child spins gets SIGXCPU or SIGKILL for CPU time the child spent. signal_queue_info also puts the signal in the shared pending set, where the child's vCPU can dequeue it.
Follow-ups
- Account CPU time per guest process, summing the vCPU threads of each one, and give each VM-clone child its own
RLIMIT_CPUcheck. - Add a case to
test-rlimit-cpu: a parent under a soft limit of 1 s sleeps while aCLONE_VMchild spins for 2 s, and the parent gets noSIGXCPU.
- 主要语言
- C
- 星标
- 278
- 派生
- 31
- 平均合并
- 2 天 18 小时
- 30 天内合并 PR
- 16
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
sysprog21/elfuse 的其他 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 86/100
维护者通常 2 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 2 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 2 天内回复
-
难度 4/5 3-5 天 新手友好度 52/100
维护者通常 2 天内回复
-
难度 3/5 1-2 天 新手友好度 68/100
sysprog21/elfuse#476 · 3 条评论 ·
维护者通常 2 天内回复
相似的 Issue
-
examples/dnsdoctor: cleanup.sh stops at the first missing piece of a setup.sh that did not finish未关闭severity: low
难度 2/5 1-3 小时 新手友好度 70/100
luainkernel/lunatik#2263 ·
维护者通常 1 天内回复
-
难度 2/5 半天 新手友好度 72/100
vercel-labs/scriptc#2910 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
darktable-org/darktable#22939 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 82/100
espressif/idf-extra-components#903 ·
维护者通常 1 天内回复
-
os: input_password leaves terminal echo disabled when reading fails可能已有人在做 @davlgd 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复