diff options
-rw-r--r-- | kernel/sched.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/kernel/sched.c b/kernel/sched.c index 29a3152c45db..ebb03def564b 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -4042,10 +4042,12 @@ EXPORT_PER_CPU_SYMBOL(kstat); | |||
4042 | */ | 4042 | */ |
4043 | unsigned long long task_delta_exec(struct task_struct *p) | 4043 | unsigned long long task_delta_exec(struct task_struct *p) |
4044 | { | 4044 | { |
4045 | struct rq *rq; | ||
4046 | unsigned long flags; | 4045 | unsigned long flags; |
4046 | struct rq *rq; | ||
4047 | u64 ns = 0; | 4047 | u64 ns = 0; |
4048 | 4048 | ||
4049 | rq = task_rq_lock(p, &flags); | ||
4050 | |||
4049 | if (task_current(rq, p)) { | 4051 | if (task_current(rq, p)) { |
4050 | u64 delta_exec; | 4052 | u64 delta_exec; |
4051 | 4053 | ||
@@ -4055,6 +4057,8 @@ unsigned long long task_delta_exec(struct task_struct *p) | |||
4055 | ns = delta_exec; | 4057 | ns = delta_exec; |
4056 | } | 4058 | } |
4057 | 4059 | ||
4060 | task_rq_unlock(rq, &flags); | ||
4061 | |||
4058 | return ns; | 4062 | return ns; |
4059 | } | 4063 | } |
4060 | 4064 | ||