Date: Wed, 30 Sep 2020 16:11:37 +0000 (UTC) From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r366292 - releng/12.2/sys/kern Message-ID: <202009301611.08UGBbN9014692@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kib Date: Wed Sep 30 16:11:37 2020 New Revision: 366292 URL: https://svnweb.freebsd.org/changeset/base/366292 Log: MFC r357530/MFS r357530: Remove unneeded assert for curproc. Simplify. Approved by: re (gjb) Modified: releng/12.2/sys/kern/kern_time.c Directory Properties: releng/12.2/ (props changed) Modified: releng/12.2/sys/kern/kern_time.c ============================================================================== --- releng/12.2/sys/kern/kern_time.c Wed Sep 30 14:55:54 2020 (r366291) +++ releng/12.2/sys/kern/kern_time.c Wed Sep 30 16:11:37 2020 (r366292) @@ -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 ti 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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202009301611.08UGBbN9014692>