Date: Mon, 2 Jan 2017 08:22:41 +0000 (UTC) From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r311047 - stable/11/sys/vm Message-ID: <201701020822.v028Mf4U074732@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kib Date: Mon Jan 2 08:22:40 2017 New Revision: 311047 URL: https://svnweb.freebsd.org/changeset/base/311047 Log: MFC r310616: Remove redundancy in vmtotal(). Modified: stable/11/sys/vm/vm_meter.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/vm/vm_meter.c ============================================================================== --- stable/11/sys/vm/vm_meter.c Mon Jan 2 08:20:26 2017 (r311046) +++ stable/11/sys/vm/vm_meter.c Mon Jan 2 08:22:40 2017 (r311047) @@ -119,15 +119,10 @@ vmtotal(SYSCTL_HANDLER_ARGS) */ sx_slock(&allproc_lock); FOREACH_PROC_IN_SYSTEM(p) { - if (p->p_flag & P_SYSTEM) + if ((p->p_flag & P_SYSTEM) != 0) continue; PROC_LOCK(p); - switch (p->p_state) { - case PRS_NEW: - PROC_UNLOCK(p); - continue; - break; - default: + if (p->p_state != PRS_NEW) { FOREACH_THREAD_IN_PROC(p, td) { thread_lock(td); switch (td->td_state) { @@ -144,15 +139,13 @@ vmtotal(SYSCTL_HANDLER_ARGS) total.t_pw++; } break; - case TDS_CAN_RUN: total.t_sw++; break; case TDS_RUNQ: case TDS_RUNNING: total.t_rq++; - thread_unlock(td); - continue; + break; default: break; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201701020822.v028Mf4U074732>