Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/kern sched_pstats: fix previous, exclude system/softintr...
details: https://anonhg.NetBSD.org/src/rev/78ff0ea25545
branches: trunk
changeset: 754108:78ff0ea25545
user: rmind <rmind%NetBSD.org@localhost>
date: Tue Apr 20 16:49:48 2010 +0000
description:
sched_pstats: fix previous, exclude system/softintr threads from loadavg.
diffstat:
sys/kern/kern_synch.c | 33 +++++++++++++++++----------------
1 files changed, 17 insertions(+), 16 deletions(-)
diffs (61 lines):
diff -r 822b28de0817 -r 78ff0ea25545 sys/kern/kern_synch.c
--- a/sys/kern/kern_synch.c Tue Apr 20 15:42:21 2010 +0000
+++ b/sys/kern/kern_synch.c Tue Apr 20 16:49:48 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_synch.c,v 1.281 2010/04/16 03:21:49 rmind Exp $ */
+/* $NetBSD: kern_synch.c,v 1.282 2010/04/20 16:49:48 rmind Exp $ */
/*-
* Copyright (c) 1999, 2000, 2004, 2006, 2007, 2008, 2009
@@ -69,7 +69,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_synch.c,v 1.281 2010/04/16 03:21:49 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_synch.c,v 1.282 2010/04/20 16:49:48 rmind Exp $");
#include "opt_kstack.h"
#include "opt_perfctrs.h"
@@ -1198,6 +1198,21 @@
runtm += l->l_rtime.sec;
l->l_swtime++;
sched_lwp_stats(l);
+
+ /* For load average calculation. */
+ if (__predict_false(lavg_count == 0) &&
+ (l->l_flag & (LW_SINTR | LW_SYSTEM)) == 0) {
+ switch (l->l_stat) {
+ case LSSLEEP:
+ if (l->l_slptime > 1) {
+ break;
+ }
+ case LSRUN:
+ case LSONPROC:
+ case LSIDL:
+ nrun++;
+ }
+ }
lwp_unlock(l);
l->l_pctcpu = (l->l_pctcpu * ccpu) >> FSHIFT;
@@ -1209,20 +1224,6 @@
lpctcpu += ((FSCALE - ccpu) *
(lcpticks * FSCALE / clkhz)) >> FSHIFT;
l->l_pctcpu = lpctcpu;
-
- /* For load average calculation. */
- if (__predict_false(lavg_count == 0)) {
- switch (l->l_stat) {
- case LSSLEEP:
- if (l->l_slptime > 1) {
- break;
- }
- case LSRUN:
- case LSONPROC:
- case LSIDL:
- nrun++;
- }
- }
}
/* Calculating p_pctcpu only for ps(1) */
p->p_pctcpu = (p->p_pctcpu * ccpu) >> FSHIFT;
Home |
Main Index |
Thread Index |
Old Index