svn commit: r311047 - stable/11/sys/vm
Konstantin Belousov
kib at FreeBSD.org
Mon Jan 2 08:22:42 UTC 2017
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;
}
More information about the svn-src-stable
mailing list