代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/lxcfs 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From a6e4ec48f7ad6e64eb95bcd46e8656f1cef95cfd Mon Sep 17 00:00:00 2001
From: vegbir <[email protected]>
Date: Wed, 12 Jul 2023 08:25:20 +0000
Subject: [PATCH 07/15] limit stat by quota period setting
Signed-off-by: vegbir <[email protected]>
---
src/proc_fuse.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/proc_fuse.c b/src/proc_fuse.c
index 0af559f..e69e867 100644
--- a/src/proc_fuse.c
+++ b/src/proc_fuse.c
@@ -1087,6 +1087,8 @@ static int proc_stat_read(char *buf, size_t size, off_t offset,
size_t linelen = 0, total_len = 0;
int curcpu = -1; /* cpu numbering starts at 0 */
int physcpu = 0;
+ int max_cpus = 0;
+ bool use_view;
uint64_t user = 0, nice = 0, system = 0, idle = 0, iowait = 0, irq = 0,
softirq = 0, steal = 0, guest = 0, guest_nice = 0;
uint64_t user_sum = 0, nice_sum = 0, system_sum = 0, idle_sum = 0,
@@ -1138,6 +1140,13 @@ static int proc_stat_read(char *buf, size_t size, off_t offset,
if (!cpuset)
return 0;
+ if (cgroup_ops->can_use_cpuview(cgroup_ops) && opts && opts->use_cfs)
+ use_view = true;
+ else
+ use_view = false;
+ if (use_view)
+ max_cpus = max_cpu_count(cg, cpu_cg);
+
f = fopen_cached("/proc/stat", "re", &fopen_cache);
if (!f)
return 0;
@@ -1186,6 +1195,9 @@ static int proc_stat_read(char *buf, size_t size, off_t offset,
continue;
}
+ if (use_view && max_cpus > 0 && (curcpu + 1) == max_cpus)
+ continue;
+
if (sscanf(cpu_char, "%d", &physcpu) != 1)
continue;
--
2.41.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。