aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2020-09-30 16:11:37 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2020-09-30 16:11:37 +0000
commitfd618e2e2108e49ac96a0df9d8df84ebe44cf40b (patch)
tree42f801a28bc586cf2236daa79c6b72a7bd670c92
parentb89f0f0a3a54e7cad2423b0b951b3cfc710868fe (diff)
downloadsrc-fd618e2e2108e49ac96a0df9d8df84ebe44cf40b.tar.gz
src-fd618e2e2108e49ac96a0df9d8df84ebe44cf40b.zip
MFC r357530/MFS r357530:
Remove unneeded assert for curproc. Simplify. Approved by: re (gjb)
Notes
Notes: svn path=/releng/12.2/; revision=366292
-rw-r--r--sys/kern/kern_time.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/sys/kern/kern_time.c b/sys/kern/kern_time.c
index 0890bb76c8cc..9c37ae6a2771 100644
--- a/sys/kern/kern_time.c
+++ b/sys/kern/kern_time.c
@@ -255,11 +255,8 @@ void
kern_thread_cputime(struct thread *targettd, struct timespec *ats)
{
uint64_t runtime, curtime, switchtime;
- struct proc *p;
if (targettd == NULL) { /* current thread */
- p = curthread->td_proc;
- PROC_LOCK_ASSERT(p, MA_OWNED);
critical_enter();
switchtime = PCPU_GET(switchtime);
curtime = cpu_ticks();
@@ -267,8 +264,7 @@ kern_thread_cputime(struct thread *targettd, struct timespec *ats)
critical_exit();
runtime += curtime - switchtime;
} else {
- p = targettd->td_proc;
- PROC_LOCK_ASSERT(p, MA_OWNED);
+ PROC_LOCK_ASSERT(targettd->td_proc, MA_OWNED);
thread_lock(targettd);
runtime = targettd->td_runtime;
thread_unlock(targettd);