summaryrefslogtreecommitdiffstats
path: root/kernel/delayacct.c
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2021-05-04 22:43:48 +0200
committerPeter Zijlstra <peterz@infradead.org>2021-05-12 11:43:23 +0200
commit4b7a08a0b6e4e910a6feee438d76e426381df0cb (patch)
tree1901c17ad0097405f2aeb5f3356f196ccff3212b /kernel/delayacct.c
parent619e090c8e409e09bd3e8edcd5a73d83f689890c (diff)
downloadlinux-4b7a08a0b6e4e910a6feee438d76e426381df0cb.tar.gz
linux-4b7a08a0b6e4e910a6feee438d76e426381df0cb.tar.bz2
linux-4b7a08a0b6e4e910a6feee438d76e426381df0cb.zip
delayacct: Use sched_clock()
Like all scheduler statistics, use sched_clock() based time. Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Reviewed-by: Rik van Riel <riel@surriel.com> Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Ingo Molnar <mingo@kernel.org> Acked-by: Johannes Weiner <hannes@cmpxchg.org> Acked-by: Balbir Singh <bsingharora@gmail.com> Link: https://lkml.kernel.org/r/20210505111525.001031466@infradead.org
Diffstat (limited to 'kernel/delayacct.c')
-rw-r--r--kernel/delayacct.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/kernel/delayacct.c b/kernel/delayacct.c
index 27725754ac99..3fe7cd52b459 100644
--- a/kernel/delayacct.c
+++ b/kernel/delayacct.c
@@ -7,9 +7,9 @@
#include <linux/sched.h>
#include <linux/sched/task.h>
#include <linux/sched/cputime.h>
+#include <linux/sched/clock.h>
#include <linux/slab.h>
#include <linux/taskstats.h>
-#include <linux/time.h>
#include <linux/sysctl.h>
#include <linux/delayacct.h>
#include <linux/module.h>
@@ -42,10 +42,9 @@ void __delayacct_tsk_init(struct task_struct *tsk)
* Finish delay accounting for a statistic using its timestamps (@start),
* accumalator (@total) and @count
*/
-static void delayacct_end(raw_spinlock_t *lock, u64 *start, u64 *total,
- u32 *count)
+static void delayacct_end(raw_spinlock_t *lock, u64 *start, u64 *total, u32 *count)
{
- s64 ns = ktime_get_ns() - *start;
+ s64 ns = local_clock() - *start;
unsigned long flags;
if (ns > 0) {
@@ -58,7 +57,7 @@ static void delayacct_end(raw_spinlock_t *lock, u64 *start, u64 *total,
void __delayacct_blkio_start(void)
{
- current->delays->blkio_start = ktime_get_ns();
+ current->delays->blkio_start = local_clock();
}
/*
@@ -151,21 +150,20 @@ __u64 __delayacct_blkio_ticks(struct task_struct *tsk)
void __delayacct_freepages_start(void)
{
- current->delays->freepages_start = ktime_get_ns();
+ current->delays->freepages_start = local_clock();
}
void __delayacct_freepages_end(void)
{
- delayacct_end(
- &current->delays->lock,
- &current->delays->freepages_start,
- &current->delays->freepages_delay,
- &current->delays->freepages_count);
+ delayacct_end(&current->delays->lock,
+ &current->delays->freepages_start,
+ &current->delays->freepages_delay,
+ &current->delays->freepages_count);
}
void __delayacct_thrashing_start(void)
{
- current->delays->thrashing_start = ktime_get_ns();
+ current->delays->thrashing_start = local_clock();
}
void __delayacct_thrashing_end(void)