Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a shared clean file page cache for VFS-backed filesystems (integrated with ext4), refactors tmpfs page allocation, adds support for /proc/[pid]/oom_score and /proc/[pid]/oom_score_adj, implements memory locking syscalls (mlock/munlock), and improves directory snapshot caching. Critical feedback highlights a potential deadlock in the bind syscall where a spinlock is held during user-space memory copies, a POSIX compliance bug in dup_from that could allocate file descriptors below min_fd, and a data race in the new page cache when refreshing pages concurrently with readers. Additionally, improvements are suggested for OOM score calculations to avoid overestimating memory usage and to handle trailing null bytes when parsing oom_score_adj inputs.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
概述
本 PR 将
ccy-dev02合并回main。本分支主要围绕 OSComp/musl 测试环境做兼容性和内核语义修复,目标是让真实用户态测试程序少卡在内核行为差异上。重点覆盖文件系统缓存、procfs 进程文件、futex/wait/signal 状态、内存锁兼容、socket errno 行为,以及本地评测镜像挂载路径。相对
origin/main,当前分支包含 38 个非 merge 提交和 3 个 merge 提交,共修改 54 个文件,约 2.9k 行新增、0.45k 行删除。主要变更
OSComp 与 musl 测试运行环境
/dev/vda,内核分区盘暴露为/dev/vdb。cp -a调整为cp -R,避免不必要的元数据保留语义影响测试搬运。PATH,同时把默认启动流程收窄到当前确认不会卡死的脚本范围。VFS、ext4、tmpfs 与 page cache
max_fds下的 dup/dup-from 行为。procfs 进程兼容性
/proc/<pid>/oom_score_adj,支持用户态写入。/proc/<pid>/oom_score。syscall 与进程语义
FUTEX_WAIT_BITSET、FUTEX_WAKE_BITSET、requeue/cmp-requeue 等行为。mlock、munlock、mlockall、munlockall兼容路径:在不支持 swap 的内核中作为 no-op,但仍校验地址范围和资源限制。wait4:当不存在匹配子进程时返回ECHILD,避免阻塞等待永久睡眠。网络兼容性
accept返回EOPNOTSUPP。sendto和connect前确保 socket 绑定到合适的本地 endpoint,并处理 loopback 源地址。代表提交
a2e1b9dfix: 确定默认不会卡死的脚本范围fb7c405procfs: 实现每进程 oom_score6e7bfd4procfs: 实现每进程 oom_score_adjf96f58fprocfs: 增加可写动态 proc inode 支持596741bnet: 对 UDP accept 返回 EOPNOTSUPP11ea465net: Unix socket bind 前释放 task lock6ab12f6fix(libc): 改进 syscall 兼容性0038e83fix(net): 返回 Linux 风格 bind 地址错误5257d33fix(compat): 增加 cyclictest 兼容 hook6d4345dfix(mm): 增加 memlock syscall 兼容6236827fix(wait): 在 wait status 中编码信号退出230841efix(oscomp): 对齐 test image 启动路径8e3abc5fix(tmpfs): 加固页存储语义63fd74cfeat(vfs): 增加 clean page cachedc5e04efeat(ext4): 使用 VFS page cache 读取 ext41686ee9fix(ext4): 在文件变更时失效 page cache