sched/cputime: Support other fields on kcpustat_field()
authorFrederic Weisbecker <frederic@kernel.org>
Thu, 21 Nov 2019 02:44:25 +0000 (03:44 +0100)
committerIngo Molnar <mingo@kernel.org>
Thu, 21 Nov 2019 06:33:23 +0000 (07:33 +0100)
commit5a1c95580f1d89c8a736bb02ecd82a8858388b8a
tree90a120e1683e4e81829317127b1cecfa7c8ab637
parentbef69dd87828ef5d8ecdab8d857cd3a33cf98675
sched/cputime: Support other fields on kcpustat_field()

Provide support for user, nice, guest and guest_nice fields through
kcpustat_field().

Whether we account the delta to a nice or not nice field is decided on
top of the nice value snapshot taken at the time we call kcpustat_field().
If the nice value of the task has been changed since the last vtime
update, we may have inacurrate distribution of the nice VS unnice
cputime.

However this is considered as a minor issue compared to the proper fix
that would involve interrupting the target on nice updates, which is
undesired on nohz_full CPUs.

Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Wanpeng Li <wanpengli@tencent.com>
Cc: Yauheni Kaliuta <yauheni.kaliuta@redhat.com>
Link: https://lkml.kernel.org/r/20191121024430.19938-2-frederic@kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
kernel/sched/cputime.c