Date: Tue, 10 Nov 2020 21:29:11 +0000 (UTC) From: Mateusz Guzik <mjg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367580 - head/sys/kern Message-ID: <202011102129.0AALTB4q039938@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mjg Date: Tue Nov 10 21:29:10 2020 New Revision: 367580 URL: https://svnweb.freebsd.org/changeset/base/367580 Log: thread: tidy up r367543 "locked" variable is spurious in the committed version. Modified: head/sys/kern/kern_proc.c Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Tue Nov 10 21:12:32 2020 (r367579) +++ head/sys/kern/kern_proc.c Tue Nov 10 21:29:10 2020 (r367580) @@ -2748,7 +2748,6 @@ sysctl_kern_proc_kstack(SYSCTL_HANDLER_ARGS) struct stack *st; struct sbuf sb; struct proc *p; - bool locked; name = (int *)arg1; error = pget((pid_t)name[0], PGET_NOTINEXEC | PGET_WANTREAD, &p); @@ -2789,14 +2788,12 @@ sysctl_kern_proc_kstack(SYSCTL_HANDLER_ARGS) i++; } PROC_UNLOCK(p); - locked = false; numthreads = i; for (i = 0; i < numthreads; i++) { td = tdfind(lwpidarray[i], p->p_pid); if (td == NULL) { continue; } - locked = true; bzero(kkstp, sizeof(*kkstp)); (void)sbuf_new(&sb, kkstp->kkst_trace, sizeof(kkstp->kkst_trace), SBUF_FIXEDLEN); @@ -2810,7 +2807,6 @@ sysctl_kern_proc_kstack(SYSCTL_HANDLER_ARGS) kkstp->kkst_state = KKST_STATE_RUNNING; thread_unlock(td); PROC_UNLOCK(p); - locked = false; stack_sbuf_print(&sb, st); sbuf_finish(&sb); sbuf_delete(&sb); @@ -2818,10 +2814,7 @@ sysctl_kern_proc_kstack(SYSCTL_HANDLER_ARGS) if (error) break; } - if (!locked) - PROC_LOCK(p); - _PRELE(p); - PROC_UNLOCK(p); + PRELE(p); if (lwpidarray != NULL) free(lwpidarray, M_TEMP); stack_destroy(st);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202011102129.0AALTB4q039938>