diff options
author | mh27603 <none@none> | 2008-07-22 05:24:18 -0700 |
---|---|---|
committer | mh27603 <none@none> | 2008-07-22 05:24:18 -0700 |
commit | fc68e77cbcc83bea00515c84d65cfca81b667900 (patch) | |
tree | b5bcd507393a08feebe4713aace41c30eb7f4475 | |
parent | 4bfb3cb6ef3fb38c53dd286090e19e92ab8a45fb (diff) | |
download | illumos-gate-fc68e77cbcc83bea00515c84d65cfca81b667900.tar.gz |
6647538 cpupm should be on by default
6714184 x86 CPU power management could be a little more aggressive.
-rw-r--r-- | usr/src/cmd/power/power.conf.i386 | 5 | ||||
-rw-r--r-- | usr/src/uts/common/os/sunpm.c | 20 | ||||
-rw-r--r-- | usr/src/uts/common/sys/cpudrv.h | 12 | ||||
-rw-r--r-- | usr/src/uts/common/sys/epm.h | 5 |
4 files changed, 29 insertions, 13 deletions
diff --git a/usr/src/cmd/power/power.conf.i386 b/usr/src/cmd/power/power.conf.i386 index 0c1d37132b..e6cd26fcb2 100644 --- a/usr/src/cmd/power/power.conf.i386 +++ b/usr/src/cmd/power/power.conf.i386 @@ -18,7 +18,7 @@ # # CDDL HEADER END # -# Copyright 2007 Sun Microsystems, Inc. All rights reserved. +# Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. # #pragma ident "%Z%%M% %I% %E% SMI" @@ -33,3 +33,6 @@ device-dependency-property removable-media /dev/fb autopm default autoS3 default + +cpupm enable +cpu-threshold 1s diff --git a/usr/src/uts/common/os/sunpm.c b/usr/src/uts/common/os/sunpm.c index d929b997c9..b83856794a 100644 --- a/usr/src/uts/common/os/sunpm.c +++ b/usr/src/uts/common/os/sunpm.c @@ -313,8 +313,12 @@ callb_id_t pm_halt_cb_id; int pm_comps_notlowest; /* no. of comps not at lowest power */ int pm_powering_down; /* cpr is source of DDI_SUSPEND calls */ -clock_t pm_min_scan = PM_MIN_SCAN; clock_t pm_id_ticks = 5; /* ticks to wait before scan during idle-down */ +clock_t pm_default_min_scan = PM_DEFAULT_MIN_SCAN; +clock_t pm_cpu_min_scan = PM_CPU_MIN_SCAN; + +#define PM_MIN_SCAN(dip) (PM_ISCPU(dip) ? pm_cpu_min_scan : \ + pm_default_min_scan) static int pm_busop_set_power(dev_info_t *, void *, pm_bus_power_op_t, void *, void *); @@ -1000,7 +1004,7 @@ pm_rescan(void *arg) } scanp->ps_scan_id = timeout(pm_rescan, (void *)dip, (scanp->ps_idle_down ? pm_id_ticks : - (pm_min_scan * hz))); + (PM_MIN_SCAN(dip) * hz))); PMD(PMD_SCAN, ("%s: %s@%s(%s#%d): scheduled next pm_rescan, " "scanid %lx\n", pmf, PM_DEVICE(dip), (ulong_t)scanp->ps_scan_id)) @@ -1185,18 +1189,20 @@ pm_scan_dev(dev_info_t *dip) int circ; static int cur_threshold(dev_info_t *, int); static int pm_next_lower_power(pm_component_t *, int); + clock_t min_scan = pm_default_min_scan; /* * skip attaching device */ if (DEVI_IS_ATTACHING(dip)) { PMD(PMD_SCAN, ("%s: %s@%s(%s#%d) is attaching, timeleft(%lx)\n", - pmf, PM_DEVICE(dip), pm_min_scan)) - return (pm_min_scan); + pmf, PM_DEVICE(dip), min_scan)) + return (min_scan); } PM_LOCK_DIP(dip); scanp = PM_GET_PM_SCAN(dip); + min_scan = PM_MIN_SCAN(dip); ASSERT(scanp && PM_GET_PM_INFO(dip)); PMD(PMD_SCAN, ("%s: [BEGIN %s@%s(%s#%d)]\n", pmf, PM_DEVICE(dip))) @@ -1258,10 +1264,10 @@ pm_scan_dev(dev_info_t *dip) if ((timestamp[i] == 0) || (cp->pmc_busycount > 0)) { /* were busy or newly became busy by another thread */ if (timeleft == 0) - timeleft = max(thresh, pm_min_scan); + timeleft = max(thresh, min_scan); else timeleft = min( - timeleft, max(thresh, pm_min_scan)); + timeleft, max(thresh, min_scan)); continue; } @@ -1278,7 +1284,7 @@ pm_scan_dev(dev_info_t *dip) PMD(PMD_SCAN, ("%s: %s@%s(%s#%d) comp %d, " "%d->%d Failed\n", pmf, PM_DEVICE(dip), i, curpwr, nxtpwr)) - timeleft = pm_min_scan; + timeleft = min_scan; continue; } else { PMD(PMD_SCAN, ("%s: %s@%s(%s#%d) comp %d, " diff --git a/usr/src/uts/common/sys/cpudrv.h b/usr/src/uts/common/sys/cpudrv.h index 7a11276eba..decdc77636 100644 --- a/usr/src/uts/common/sys/cpudrv.h +++ b/usr/src/uts/common/sys/cpudrv.h @@ -19,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -99,15 +99,17 @@ typedef struct cpudrv_pm { #if defined(__x86) #define CPUDRV_PM_IDLE_HWM 85 /* idle high water mark */ #define CPUDRV_PM_IDLE_LWM 70 /* idle low water mark */ +#define CPUDRV_PM_IDLE_BLWM_CNT_MAX 1 /* # of iters idle can be < lwm */ +#define CPUDRV_PM_IDLE_BHWM_CNT_MAX 1 /* # of iters idle can be < hwm */ #else #define CPUDRV_PM_IDLE_HWM 98 /* idle high water mark */ #define CPUDRV_PM_IDLE_LWM 8 /* idle low water mark */ +#define CPUDRV_PM_IDLE_BLWM_CNT_MAX 2 /* # of iters idle can be < lwm */ +#define CPUDRV_PM_IDLE_BHWM_CNT_MAX 2 /* # of iters idle can be < hwm */ #endif #define CPUDRV_PM_USER_HWM 20 /* user high water mark */ #define CPUDRV_PM_IDLE_BUF_ZONE 4 /* buffer zone when going down */ -#define CPUDRV_PM_IDLE_BLWM_CNT_MAX 2 /* # of iters idle can be < lwm */ -#define CPUDRV_PM_IDLE_BHWM_CNT_MAX 2 /* # of iters idle can be < hwm */ /* * Maximums for creating 'pm-components' property @@ -140,7 +142,11 @@ typedef struct cpudrv_pm { * might really be using the CPU fully, we monitor less frequently * (CPUDRV_PM_QUANT_CNT_NORMAL). */ +#if defined(__x86) +#define CPUDRV_PM_QUANT_CNT_NORMAL (hz * 1) /* 1 sec */ +#else #define CPUDRV_PM_QUANT_CNT_NORMAL (hz * 5) /* 5 sec */ +#endif #define CPUDRV_PM_QUANT_CNT_OTHR (hz * 1) /* 1 sec */ /* diff --git a/usr/src/uts/common/sys/epm.h b/usr/src/uts/common/sys/epm.h index d1c67f383f..2e5b89f475 100644 --- a/usr/src/uts/common/sys/epm.h +++ b/usr/src/uts/common/sys/epm.h @@ -19,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2007 Sun Microsystems, Inc. All rights reserved. + * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -116,7 +116,8 @@ typedef struct pm_scan { #define PM_SCAN_STOP 0x400 #define PM_SCAN_DISPATCHED 0x800 -#define PM_MIN_SCAN ((clock_t)15) /* Minimum scan interval in seconds */ +#define PM_DEFAULT_MIN_SCAN ((clock_t)15) /* Minimum scan interval in sec */ +#define PM_CPU_MIN_SCAN ((clock_t)1) /* Minimum interval for CPUs */ /* * Power management component definitions, used for tracking idleness of |