svn commit: r311049 - stable/10/sys/vm
Konstantin Belousov
kib at FreeBSD.org
Mon Jan 2 08:31:30 UTC 2017
Author: kib
Date: Mon Jan 2 08:31:29 2017
New Revision: 311049
URL: https://svnweb.freebsd.org/changeset/base/311049
Log:
MFC r310616:
Remove redundancy in vmtotal().
Modified:
stable/10/sys/vm/vm_meter.c
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/sys/vm/vm_meter.c
==============================================================================
--- stable/10/sys/vm/vm_meter.c Mon Jan 2 08:28:37 2017 (r311048)
+++ stable/10/sys/vm/vm_meter.c Mon Jan 2 08:31:29 2017 (r311049)
@@ -123,15 +123,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) {
@@ -148,15 +143,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;
}
More information about the svn-src-stable
mailing list