Skip to content

RFC do not make cputime scaling in kernel

Stanislaw Gruszka lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest4 patches 6 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4cputime: change parameter of thread_group_cputime_adjustedfs/proc/array.c include/linux/sched.h kernel/exit.c +2 more+25 -260 replies
2/4procfs: add sum_exec_runtime to /proc/PID/statfs/proc/array.c+5 -00 replies
3/4sched,proc: add csum_sched_runtimefs/proc/array.c include/linux/sched.h kernel/exit.c+6 -00 replies
4/4cputime: remove scalingfs/proc/array.c include/linux/sched.h kernel/exit.c +3 more+7 -1456 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC 0/4] do not make cputime scaling in kernel

This patch series removes cputime scaling from kernel. It can be easily done in user space using floating point if we provide sum_exec_runtime, what patches 2/4 and 3/4 do. I have procps which utilize that:

http://people.redhat.com/sgruszka/procps-use-sum_exec_runtime.patch

I will post it, if this patch set will be queued.

Change affect also getrusage() and times() syscals, but I don't think kernel give guarantees about utime/stime precision, in a matter of fact before commit b27f03d4bdc145a09fb7b0c0e004b29f1ee555fa, we do not perform any scaling and we provided raw cputime values to user space.

Providing sum_exec_runtime via proc is done against malware that utilize lot of cpu time but hide itself from top program.

This affect kernels not compiled with CONFIG_VIRT_CPU_ACCOUNTING_{GEN,NATIVE}, if user choose to compile kernel with some of those options, he/she will have more precise cputime accounting, what is documented in Kconfig.