AI 中文总结
本文通过受控系统研究对比三种zram设置,发现受限回收配置可降低计算p99响应时间6%,延迟激活的延迟更高,收益取决于前台工作负载及其内存访问路径。
AI 中文摘要
当活跃进程的总工作集超过物理RAM容量时,机器会出现内存压力。应用程序因此可能在内核终止进程前变慢。Linux提供了多种观察和应对方式:压力停滞信息(PSI)可检测与内存相关的任务停滞,zram可提供内存中压缩交换空间,cgroup v2可在选定控制组内请求内存回收。尽管这些设施在压力路径的不同节点发挥作用,却常被一同讨论。本文通过受控系统研究考察该区别。我们对比三种设置:启动时启用zram;仅在PSI指示内存压力后启用zram;启动时启用zram并附带一次96 MiB的cgroup回收请求。我们先在16个试点案例中确定请求大小,再在9台1虚拟CPU的Linux虚拟机上运行180个验证案例,每种设置60个,计算和SQLite为工作负载。与静态zram相比,受限回收配置将计算的p99响应时间降低了6%,而SQLite结果在统计上无差异。延迟激活的中位数p99延迟高于两种替代方案。这些结果表明,收益取决于前台工作负载及其内存访问路径,而非跨工作负载的通用改进。
英文摘要
When the aggregate working set of active processes exceeds physical RAM capacity, the machine experiences memory pressure. Applications may therefore slow down before the kernel kills a process. Linux provides several ways to observe and respond: Pressure Stall Information (PSI) can detect memory-related task stalls, zram can provide compressed in-memory swap space, and cgroup v2 can request memory reclamation within a selected control group. These facilities are often discussed together even though they act at different points in the pressure path. This paper examines that distinction with a controlled systems study. We compare three setups: zram enabled from startup; zram enabled only after PSI indicates memory pressure; and zram enabled from startup with a one-time 96 MiB cgroup reclaim request. We first selected the request size in a 16-case pilot, then ran 180 confirmatory cases, 60 cases for each setup, on nine 1-vCPU Linux virtual machines with compute and SQLite workloads. Compared with static zram, the bounded reclaim configuration reduced compute p99 response time by 6\%, while the SQLite result was statistically indistinguishable. Delayed activation had higher median p99 latency than both alternatives. These results suggest that the benefit depends on the foreground workload and its memory-access path, rather than a general improvement across workloads.
Comments5 pages, 2 figures