Skip to content

Commit ab0b054

Browse files
ZhangYuchenLCRguojinhui-liam
authored andcommitted
bytedance: cop: fix cpu num not correct when cpu offline
Override id is used for cgroup_override_proc to provide continue cpu num for container enable this feature. It should not used when not enable COP. Fixes: de9ed0a ("bytedance: sysfs: override /proc/stat in cgroup") Signed-off-by: Zhang Yuchen <zhangyuchen.lcr@bytedance.com>
1 parent 97e151b commit ab0b054

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/proc/stat.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ static int show_stat(struct seq_file *p, void *v)
215215
steal = cpustat[CPUTIME_STEAL];
216216
guest = cpustat[CPUTIME_GUEST];
217217
guest_nice = cpustat[CPUTIME_GUEST_NICE];
218-
seq_printf(p, "cpu%d", id);
218+
seq_printf(p, "cpu%d", override ? id : i);
219219
seq_put_decimal_ull(p, " ", nsec_to_clock_t(user));
220220
seq_put_decimal_ull(p, " ", nsec_to_clock_t(nice));
221221
seq_put_decimal_ull(p, " ", nsec_to_clock_t(system));

0 commit comments

Comments
 (0)