[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210928050804.4156102-1-hasegawa-hitomi@fujitsu.com>
Date: Tue, 28 Sep 2021 14:08:03 +0900
From: Hasegawa Hitomi <hasegawa-hitomi@...itsu.com>
To: frederic@...nel.org
Cc: bristot@...hat.com, bsegall@...gle.com, dietmar.eggemann@....com,
fweisbec@...il.com, juri.lelli@...hat.com,
linux-kernel@...r.kernel.org, mgorman@...e.de, mingo@...nel.org,
peterz@...radead.org, rostedt@...dmis.org, tglx@...utronix.de,
vincent.guittot@...aro.org,
Hasegawa Hitomi <hasegawa-hitomi@...itsu.com>
Subject: [RFC][PATCH 0/1] sched/cputime: Improve getrusage(RUSAGE_THREAD) with nohz_full
Frederic, seems busy, so I create the proper patch, would you please add
your Signed-off-by: if this fix is okey.
This patch is a fix proposed in the following thread [1].
The getrusage(RUSAGE_THREAD) with nohz_full returns shorter utime/stime
than the actual time.
In the current implementation, task_cputime_adjusted() calls task_cputime()
to get the "current" utime and stime, then calls cputime_adjust () to adjust
the sum of utime and stime to be equal to cputime.sum_exec_runtime.
In nohz_full, sum_exec_runtime is not updated regularly, which is the cause
of this discrepancy.
This patch add a process to update sum_exec_runtime after getting
the information from "current" and before adjusting.
This addition applies only when run with nohz_full.
Thanks.
Hitomi Hasegawa
[1] https://lore.kernel.org/lkml/OSBPR01MB21837C8931D90AE55AF4A955EB529@OSBPR01MB2183.jpnprd01.prod.outlook.com/
--
Hasegawa Hitomi (1):
sched/cputime: Improve getrusage(RUSAGE_THREAD) with nohz_full
include/linux/sched/cputime.h | 5 +++--
kernel/sched/cputime.c | 12 +++++++++---
2 files changed, 12 insertions(+), 5 deletions(-)
--
2.25.1
Powered by blists - more mailing lists