diff options
-rw-r--r-- | sys/amd64/amd64/mp_machdep.c | 32 | ||||
-rw-r--r-- | sys/amd64/amd64/mptable.c | 32 | ||||
-rw-r--r-- | sys/amd64/include/mptable.h | 32 | ||||
-rw-r--r-- | sys/i386/i386/mp_machdep.c | 32 | ||||
-rw-r--r-- | sys/i386/i386/mptable.c | 32 | ||||
-rw-r--r-- | sys/i386/include/mptable.h | 32 | ||||
-rw-r--r-- | sys/kern/kern_clock.c | 26 | ||||
-rw-r--r-- | sys/kern/subr_smp.c | 32 |
8 files changed, 110 insertions, 140 deletions
diff --git a/sys/amd64/amd64/mp_machdep.c b/sys/amd64/amd64/mp_machdep.c index eceaa81..5056ed1 100644 --- a/sys/amd64/amd64/mp_machdep.c +++ b/sys/amd64/amd64/mp_machdep.c @@ -2507,13 +2507,11 @@ forwarded_statclock(int id, int pscnt, int *astmap) if (pscnt > 1) return; - if (p == SMP_prvspace[id].globaldata.gd_idleproc) { - p->p_sticks++; + p->p_sticks++; + if (p == SMP_prvspace[id].globaldata.gd_idleproc) cp_time[CP_IDLE]++; - } else { - p->p_sticks++; + else cp_time[CP_SYS]++; - } break; case CHECKSTATE_INTR: default: @@ -2536,20 +2534,18 @@ forwarded_statclock(int id, int pscnt, int *astmap) p->p_iticks++; cp_time[CP_INTR]++; } - if (p != SMP_prvspace[id].globaldata.gd_idleproc) { - schedclock(p); + schedclock(p); - /* Update resource usage integrals and maximums. */ - if ((pstats = p->p_stats) != NULL && - (ru = &pstats->p_ru) != NULL && - (vm = p->p_vmspace) != NULL) { - ru->ru_ixrss += pgtok(vm->vm_tsize); - ru->ru_idrss += pgtok(vm->vm_dsize); - ru->ru_isrss += pgtok(vm->vm_ssize); - rss = pgtok(vmspace_resident_count(vm)); - if (ru->ru_maxrss < rss) - ru->ru_maxrss = rss; - } + /* Update resource usage integrals and maximums. */ + if ((pstats = p->p_stats) != NULL && + (ru = &pstats->p_ru) != NULL && + (vm = p->p_vmspace) != NULL) { + ru->ru_ixrss += pgtok(vm->vm_tsize); + ru->ru_idrss += pgtok(vm->vm_dsize); + ru->ru_isrss += pgtok(vm->vm_ssize); + rss = pgtok(vmspace_resident_count(vm)); + if (ru->ru_maxrss < rss) + ru->ru_maxrss = rss; } } diff --git a/sys/amd64/amd64/mptable.c b/sys/amd64/amd64/mptable.c index eceaa81..5056ed1 100644 --- a/sys/amd64/amd64/mptable.c +++ b/sys/amd64/amd64/mptable.c @@ -2507,13 +2507,11 @@ forwarded_statclock(int id, int pscnt, int *astmap) if (pscnt > 1) return; - if (p == SMP_prvspace[id].globaldata.gd_idleproc) { - p->p_sticks++; + p->p_sticks++; + if (p == SMP_prvspace[id].globaldata.gd_idleproc) cp_time[CP_IDLE]++; - } else { - p->p_sticks++; + else cp_time[CP_SYS]++; - } break; case CHECKSTATE_INTR: default: @@ -2536,20 +2534,18 @@ forwarded_statclock(int id, int pscnt, int *astmap) p->p_iticks++; cp_time[CP_INTR]++; } - if (p != SMP_prvspace[id].globaldata.gd_idleproc) { - schedclock(p); + schedclock(p); - /* Update resource usage integrals and maximums. */ - if ((pstats = p->p_stats) != NULL && - (ru = &pstats->p_ru) != NULL && - (vm = p->p_vmspace) != NULL) { - ru->ru_ixrss += pgtok(vm->vm_tsize); - ru->ru_idrss += pgtok(vm->vm_dsize); - ru->ru_isrss += pgtok(vm->vm_ssize); - rss = pgtok(vmspace_resident_count(vm)); - if (ru->ru_maxrss < rss) - ru->ru_maxrss = rss; - } + /* Update resource usage integrals and maximums. */ + if ((pstats = p->p_stats) != NULL && + (ru = &pstats->p_ru) != NULL && + (vm = p->p_vmspace) != NULL) { + ru->ru_ixrss += pgtok(vm->vm_tsize); + ru->ru_idrss += pgtok(vm->vm_dsize); + ru->ru_isrss += pgtok(vm->vm_ssize); + rss = pgtok(vmspace_resident_count(vm)); + if (ru->ru_maxrss < rss) + ru->ru_maxrss = rss; } } diff --git a/sys/amd64/include/mptable.h b/sys/amd64/include/mptable.h index eceaa81..5056ed1 100644 --- a/sys/amd64/include/mptable.h +++ b/sys/amd64/include/mptable.h @@ -2507,13 +2507,11 @@ forwarded_statclock(int id, int pscnt, int *astmap) if (pscnt > 1) return; - if (p == SMP_prvspace[id].globaldata.gd_idleproc) { - p->p_sticks++; + p->p_sticks++; + if (p == SMP_prvspace[id].globaldata.gd_idleproc) cp_time[CP_IDLE]++; - } else { - p->p_sticks++; + else cp_time[CP_SYS]++; - } break; case CHECKSTATE_INTR: default: @@ -2536,20 +2534,18 @@ forwarded_statclock(int id, int pscnt, int *astmap) p->p_iticks++; cp_time[CP_INTR]++; } - if (p != SMP_prvspace[id].globaldata.gd_idleproc) { - schedclock(p); + schedclock(p); - /* Update resource usage integrals and maximums. */ - if ((pstats = p->p_stats) != NULL && - (ru = &pstats->p_ru) != NULL && - (vm = p->p_vmspace) != NULL) { - ru->ru_ixrss += pgtok(vm->vm_tsize); - ru->ru_idrss += pgtok(vm->vm_dsize); - ru->ru_isrss += pgtok(vm->vm_ssize); - rss = pgtok(vmspace_resident_count(vm)); - if (ru->ru_maxrss < rss) - ru->ru_maxrss = rss; - } + /* Update resource usage integrals and maximums. */ + if ((pstats = p->p_stats) != NULL && + (ru = &pstats->p_ru) != NULL && + (vm = p->p_vmspace) != NULL) { + ru->ru_ixrss += pgtok(vm->vm_tsize); + ru->ru_idrss += pgtok(vm->vm_dsize); + ru->ru_isrss += pgtok(vm->vm_ssize); + rss = pgtok(vmspace_resident_count(vm)); + if (ru->ru_maxrss < rss) + ru->ru_maxrss = rss; } } diff --git a/sys/i386/i386/mp_machdep.c b/sys/i386/i386/mp_machdep.c index eceaa81..5056ed1 100644 --- a/sys/i386/i386/mp_machdep.c +++ b/sys/i386/i386/mp_machdep.c @@ -2507,13 +2507,11 @@ forwarded_statclock(int id, int pscnt, int *astmap) if (pscnt > 1) return; - if (p == SMP_prvspace[id].globaldata.gd_idleproc) { - p->p_sticks++; + p->p_sticks++; + if (p == SMP_prvspace[id].globaldata.gd_idleproc) cp_time[CP_IDLE]++; - } else { - p->p_sticks++; + else cp_time[CP_SYS]++; - } break; case CHECKSTATE_INTR: default: @@ -2536,20 +2534,18 @@ forwarded_statclock(int id, int pscnt, int *astmap) p->p_iticks++; cp_time[CP_INTR]++; } - if (p != SMP_prvspace[id].globaldata.gd_idleproc) { - schedclock(p); + schedclock(p); - /* Update resource usage integrals and maximums. */ - if ((pstats = p->p_stats) != NULL && - (ru = &pstats->p_ru) != NULL && - (vm = p->p_vmspace) != NULL) { - ru->ru_ixrss += pgtok(vm->vm_tsize); - ru->ru_idrss += pgtok(vm->vm_dsize); - ru->ru_isrss += pgtok(vm->vm_ssize); - rss = pgtok(vmspace_resident_count(vm)); - if (ru->ru_maxrss < rss) - ru->ru_maxrss = rss; - } + /* Update resource usage integrals and maximums. */ + if ((pstats = p->p_stats) != NULL && + (ru = &pstats->p_ru) != NULL && + (vm = p->p_vmspace) != NULL) { + ru->ru_ixrss += pgtok(vm->vm_tsize); + ru->ru_idrss += pgtok(vm->vm_dsize); + ru->ru_isrss += pgtok(vm->vm_ssize); + rss = pgtok(vmspace_resident_count(vm)); + if (ru->ru_maxrss < rss) + ru->ru_maxrss = rss; } } diff --git a/sys/i386/i386/mptable.c b/sys/i386/i386/mptable.c index eceaa81..5056ed1 100644 --- a/sys/i386/i386/mptable.c +++ b/sys/i386/i386/mptable.c @@ -2507,13 +2507,11 @@ forwarded_statclock(int id, int pscnt, int *astmap) if (pscnt > 1) return; - if (p == SMP_prvspace[id].globaldata.gd_idleproc) { - p->p_sticks++; + p->p_sticks++; + if (p == SMP_prvspace[id].globaldata.gd_idleproc) cp_time[CP_IDLE]++; - } else { - p->p_sticks++; + else cp_time[CP_SYS]++; - } break; case CHECKSTATE_INTR: default: @@ -2536,20 +2534,18 @@ forwarded_statclock(int id, int pscnt, int *astmap) p->p_iticks++; cp_time[CP_INTR]++; } - if (p != SMP_prvspace[id].globaldata.gd_idleproc) { - schedclock(p); + schedclock(p); - /* Update resource usage integrals and maximums. */ - if ((pstats = p->p_stats) != NULL && - (ru = &pstats->p_ru) != NULL && - (vm = p->p_vmspace) != NULL) { - ru->ru_ixrss += pgtok(vm->vm_tsize); - ru->ru_idrss += pgtok(vm->vm_dsize); - ru->ru_isrss += pgtok(vm->vm_ssize); - rss = pgtok(vmspace_resident_count(vm)); - if (ru->ru_maxrss < rss) - ru->ru_maxrss = rss; - } + /* Update resource usage integrals and maximums. */ + if ((pstats = p->p_stats) != NULL && + (ru = &pstats->p_ru) != NULL && + (vm = p->p_vmspace) != NULL) { + ru->ru_ixrss += pgtok(vm->vm_tsize); + ru->ru_idrss += pgtok(vm->vm_dsize); + ru->ru_isrss += pgtok(vm->vm_ssize); + rss = pgtok(vmspace_resident_count(vm)); + if (ru->ru_maxrss < rss) + ru->ru_maxrss = rss; } } diff --git a/sys/i386/include/mptable.h b/sys/i386/include/mptable.h index eceaa81..5056ed1 100644 --- a/sys/i386/include/mptable.h +++ b/sys/i386/include/mptable.h @@ -2507,13 +2507,11 @@ forwarded_statclock(int id, int pscnt, int *astmap) if (pscnt > 1) return; - if (p == SMP_prvspace[id].globaldata.gd_idleproc) { - p->p_sticks++; + p->p_sticks++; + if (p == SMP_prvspace[id].globaldata.gd_idleproc) cp_time[CP_IDLE]++; - } else { - p->p_sticks++; + else cp_time[CP_SYS]++; - } break; case CHECKSTATE_INTR: default: @@ -2536,20 +2534,18 @@ forwarded_statclock(int id, int pscnt, int *astmap) p->p_iticks++; cp_time[CP_INTR]++; } - if (p != SMP_prvspace[id].globaldata.gd_idleproc) { - schedclock(p); + schedclock(p); - /* Update resource usage integrals and maximums. */ - if ((pstats = p->p_stats) != NULL && - (ru = &pstats->p_ru) != NULL && - (vm = p->p_vmspace) != NULL) { - ru->ru_ixrss += pgtok(vm->vm_tsize); - ru->ru_idrss += pgtok(vm->vm_dsize); - ru->ru_isrss += pgtok(vm->vm_ssize); - rss = pgtok(vmspace_resident_count(vm)); - if (ru->ru_maxrss < rss) - ru->ru_maxrss = rss; - } + /* Update resource usage integrals and maximums. */ + if ((pstats = p->p_stats) != NULL && + (ru = &pstats->p_ru) != NULL && + (vm = p->p_vmspace) != NULL) { + ru->ru_ixrss += pgtok(vm->vm_tsize); + ru->ru_idrss += pgtok(vm->vm_dsize); + ru->ru_isrss += pgtok(vm->vm_ssize); + rss = pgtok(vmspace_resident_count(vm)); + if (ru->ru_maxrss < rss) + ru->ru_maxrss = rss; } } diff --git a/sys/kern/kern_clock.c b/sys/kern/kern_clock.c index 33eef3c..bc6bf06 100644 --- a/sys/kern/kern_clock.c +++ b/sys/kern/kern_clock.c @@ -389,20 +389,18 @@ statclock(frame) } pscnt = psdiv; - if (p != idleproc) { - schedclock(p); - - /* Update resource usage integrals and maximums. */ - if ((pstats = p->p_stats) != NULL && - (ru = &pstats->p_ru) != NULL && - (vm = p->p_vmspace) != NULL) { - ru->ru_ixrss += pgtok(vm->vm_tsize); - ru->ru_idrss += pgtok(vm->vm_dsize); - ru->ru_isrss += pgtok(vm->vm_ssize); - rss = pgtok(vmspace_resident_count(vm)); - if (ru->ru_maxrss < rss) - ru->ru_maxrss = rss; - } + schedclock(p); + + /* Update resource usage integrals and maximums. */ + if ((pstats = p->p_stats) != NULL && + (ru = &pstats->p_ru) != NULL && + (vm = p->p_vmspace) != NULL) { + ru->ru_ixrss += pgtok(vm->vm_tsize); + ru->ru_idrss += pgtok(vm->vm_dsize); + ru->ru_isrss += pgtok(vm->vm_ssize); + rss = pgtok(vmspace_resident_count(vm)); + if (ru->ru_maxrss < rss) + ru->ru_maxrss = rss; } } diff --git a/sys/kern/subr_smp.c b/sys/kern/subr_smp.c index eceaa81..5056ed1 100644 --- a/sys/kern/subr_smp.c +++ b/sys/kern/subr_smp.c @@ -2507,13 +2507,11 @@ forwarded_statclock(int id, int pscnt, int *astmap) if (pscnt > 1) return; - if (p == SMP_prvspace[id].globaldata.gd_idleproc) { - p->p_sticks++; + p->p_sticks++; + if (p == SMP_prvspace[id].globaldata.gd_idleproc) cp_time[CP_IDLE]++; - } else { - p->p_sticks++; + else cp_time[CP_SYS]++; - } break; case CHECKSTATE_INTR: default: @@ -2536,20 +2534,18 @@ forwarded_statclock(int id, int pscnt, int *astmap) p->p_iticks++; cp_time[CP_INTR]++; } - if (p != SMP_prvspace[id].globaldata.gd_idleproc) { - schedclock(p); + schedclock(p); - /* Update resource usage integrals and maximums. */ - if ((pstats = p->p_stats) != NULL && - (ru = &pstats->p_ru) != NULL && - (vm = p->p_vmspace) != NULL) { - ru->ru_ixrss += pgtok(vm->vm_tsize); - ru->ru_idrss += pgtok(vm->vm_dsize); - ru->ru_isrss += pgtok(vm->vm_ssize); - rss = pgtok(vmspace_resident_count(vm)); - if (ru->ru_maxrss < rss) - ru->ru_maxrss = rss; - } + /* Update resource usage integrals and maximums. */ + if ((pstats = p->p_stats) != NULL && + (ru = &pstats->p_ru) != NULL && + (vm = p->p_vmspace) != NULL) { + ru->ru_ixrss += pgtok(vm->vm_tsize); + ru->ru_idrss += pgtok(vm->vm_dsize); + ru->ru_isrss += pgtok(vm->vm_ssize); + rss = pgtok(vmspace_resident_count(vm)); + if (ru->ru_maxrss < rss) + ru->ru_maxrss = rss; } } |