Re: [PATCH v2] sched/cputime: Ensure accurate utime and stime ratio in cputime_adjust()

2018-07-16 Thread Peter Zijlstra
On Mon, Jul 09, 2018 at 10:58:43PM +0800, Xunlei Pang wrote: > If users access "/proc/pid/stat", the utime and stime ratio in the > current SAMPLE period are excepted, but currently cputime_adjust() > always calculates with the ratio of the WHOLE lifetime of the process. > > This results in

Re: [PATCH v2] sched/cputime: Ensure accurate utime and stime ratio in cputime_adjust()

2018-07-16 Thread Peter Zijlstra
On Mon, Jul 09, 2018 at 10:58:43PM +0800, Xunlei Pang wrote: > If users access "/proc/pid/stat", the utime and stime ratio in the > current SAMPLE period are excepted, but currently cputime_adjust() > always calculates with the ratio of the WHOLE lifetime of the process. > > This results in

[PATCH v2] sched/cputime: Ensure accurate utime and stime ratio in cputime_adjust()

2018-07-09 Thread Xunlei Pang
If users access "/proc/pid/stat", the utime and stime ratio in the current SAMPLE period are excepted, but currently cputime_adjust() always calculates with the ratio of the WHOLE lifetime of the process. This results in inaccurate utime and stime in "/proc/pid/stat". For example, a process runs

[PATCH v2] sched/cputime: Ensure accurate utime and stime ratio in cputime_adjust()

2018-07-09 Thread Xunlei Pang
If users access "/proc/pid/stat", the utime and stime ratio in the current SAMPLE period are excepted, but currently cputime_adjust() always calculates with the ratio of the WHOLE lifetime of the process. This results in inaccurate utime and stime in "/proc/pid/stat". For example, a process runs