From owner-svn-src-head@freebsd.org Mon Dec 26 19:29:05 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DCC3BC92D56; Mon, 26 Dec 2016 19:29:05 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AC7FE19EF; Mon, 26 Dec 2016 19:29:05 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBQJT4s3067527; Mon, 26 Dec 2016 19:29:04 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBQJT4Y8067526; Mon, 26 Dec 2016 19:29:04 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201612261929.uBQJT4Y8067526@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 26 Dec 2016 19:29:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310616 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Dec 2016 19:29:06 -0000 Author: kib Date: Mon Dec 26 19:29:04 2016 New Revision: 310616 URL: https://svnweb.freebsd.org/changeset/base/310616 Log: Remove redundancy in vmtotal(). There are two instances of inlined unlocks + continue in vmtotal() switch statements, which are ordinary expressed with break from the switch case and code after the switch. Also, the combination of continue and break statement is redundand. Reviewed by: alc Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/vm/vm_meter.c Modified: head/sys/vm/vm_meter.c ============================================================================== --- head/sys/vm/vm_meter.c Mon Dec 26 19:28:10 2016 (r310615) +++ head/sys/vm/vm_meter.c Mon Dec 26 19:29:04 2016 (r310616) @@ -121,15 +121,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) { @@ -146,15 +141,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; }