Template Version: @(#)onepager.txt 1.35 07/11/07 SMI Copyright 2007 Sun Microsystems 1. Introduction 1.1. Project/Component Working Name: Disk IO Stack PM Enhancement 1.2. Name of Document Author/Supplier: Author: Jane.Chu@sun.com 1.3. Date of This Document: 04/24/2009 1.4. Name of Major Document Customer(s)/Consumer(s): 1.4.1 The PAC or CPT you expect to review your project Solaris PAC 1.4.2 The ARC(s) you expect to review your project PSARC 1.4.3 The Director/VP who is "Sponsoring" this project michael.sanfratello@sun.com 1.4.4 The name of your business unit Common Software Feature, Solaris 1.5. Email Aliases: 1.5.1. Responsible Managers: Alan.Slivensky@sun.com Grant.Zhang@sun.com Kevin.X.Song@sun.com 1.5.2. Responsible Engineers: Jane.Chu@sun.com Ada.Feng@sun.com Larry.Liu@sun.com Li.He@sun.com 4. Technical Description 4.1 Background The Solaris power management framework provides for a mechanism (pm-components(9P)) for device drivers to export the set of power states that they support, and some interfaces (pm(7d), power.conf(4), pmconfig(1M)) for controlling the transitions of devices into those power states. The power states of devices are controlled by autopm if enabled (see power.conf(4)), or can be controlled by an application (currently only X, which controls frame buffer power states if autopm is enabled). Currently, sd(7D), the common disk driver, supports only On and Off states for disk drives, and only for certain transport types. 4.2 The Problem Different types of disk drives and transports use different mechanisms for controlling the power state of the disk drive, and for providing the information needed to monitor and enforce disk start-stop cycle limits. In particular, sd does not monitor and enforce SATA disk start-stop cycle limits, as it does for SCSI 3 disks, and has no mechanism for providing information about SATA disk supported power states. These features are required for more complete disk PM support via the existing autopm framework. 4.3 Proposal The IO framework and driver stack will be enhanced to provide generic support of modern disks' power management capabilities. The new features include support of SPC-4/SBC-3 compliant disk power conditions. The SATA framework will be enhanced to provide comparable software translation between ATA power conditions and SBC-3 power conditions. Disk health monitoring will be improved in that, if the driver firmware provides the necessary information, a disk will be protected from exceeding its maximum spindle start/stop cycles or head load/unload cycles. An interface will be provided (see 4.3.5.4 USCSI_PMFAILFAST flag support) that will allow the fma disk module to know not to spin up a disk to collect health data. There is no interesting data accumulating while the disk is spun down. There is some risk of deterioration if a disk stays down for too long. A self-test will be arranged on a weekly basis to prevent/predict such deterioration. Details follow. 4.3.1 pm_trans_check(9F) pm_trans_check(9F) will be updated to accept and process SMART start-stop count attribute data. An updated man page is in the materials directory. 4.3.2 update to "pm-capable" property (PSARC/2005/250, consolidation private) The "pm-capable" property was originally created as a boolean property indicating that a target disk does not support the Log Sense page, but is nonetheless capable of power management. This property will be extended to a 32 bit integer bitmask. The lower 16 bits (bits under PM_CAPABLE_MODE_MASK) contains a value equivalent to one of the published ANSI-Approved versions to which the target's power conditions is compliant, (one of PM_CAPABLE_MODE_CCS, PM_CAPABLE_MODE_SCSI2, PM_CAPABLE_MODE_SPC, PM_CAPABLE_MODE_SPC2, PM_CAPABLE_MODE_SPC3, or PM_CAPABLE_MODE_SPC4). Refer to the SPC-4 specification for the published versions. If the lower 16 bits of "pm-capable" indicates that the target disk supports power management, but PM_CAPABLE_LOG_SUPPORTED (bit 16) is not set, it indicates that the target driver should not try to access Log Sense, but should honor all requests to power off the drive. If PM_CAPABLE_LOG_SUPPORTED (bit 16) is set in the "pm-capable" it indicates that the target may support Log Sense, and that the target driver should access the Log Sense page to get the information needed to determine whether the power off will be allowed. If PM_CAPABLE_SMART_LOG (bit 17) is set, it indicates that the target's Start-Stop Counter log page contains the SMART Start-stop count attribute tranlated into SCSI format. The remaining bits are reserved, and must be set to 0. The materials directory contains an updated usr/src/uts/common/sys/scsi/generic/inquiry.h file with symbolic definitions of the bit masks. 4.3.3 add power-condition tunable (PSARC 2008/465, committed) A new tunable "power-condition" is introduced into [s]sd-config-list. "power-condition" can be configured in sd.conf or added in the internal sd(7D) configuration table per device type (identified by Product ID and Vender ID) which can be set to false to indicate that the disk so identified reports PM_CAPABLE_SPC4 but does not support the power condition field in the START STOP UNIT command. If "power-condition" appears in both sd's internal configuration table and in sd.conf, the value in sd.conf takes precedence. This tunable defaults to true, indicating that the power condition field is supported. The tunable is defined as power-condition Committed BOOLEAN See "PSARC 2008/465 Improved [s]sd-config-list support" for the syntax. 4.3.4 USCSI_PMFAILFAST flag A new USCSI flag, USCSI_PMFAILFAST, will be added in uscsi.h file To effectively use the USCSI_PMFAILFAST flag, a uscsi(7I) caller must open the device with flag O_NONBLOCK or O_NDELAY to prevent a powered down disk from being spun up as a result of the open(2) call. When handling a uscsi(7I) command, sd(7D) will fail the command and return ECANCELED if the USCSI_PMFAILFAST flag is set and disk is in low power state. 4.4 Interface Tables ------------------------------------------------------------------------ Interface Commitment Comments Name Level ------------------------------------------------------------------------ pm_trans_check(9F) Committed accept and process SCSI LOG page 1Eh and SMART START/STOP COUNT attribute (modifies: PSARC 1999/388) power-condition Committed tunable in [s]sd-config-list overrides disk reported power-condition field of PM_CAPABLE_MODE_SPC4 (modifies: PSARC/2008/465) USCSI_PMFAILFAST Consolidation uscsi(7I) flag indicates not Private to power up a disk to process the associated command, but fail "pm-capable" property Consolidation Indicates type of pm support Private (modifies: PSARC 2005/250) ------------------------------------------------------------------------ 4.5 References [1] PSARC/1999/388 Advisory Check for Device Power Cycles pm_trans_check http://sac.sfbay/PSARC/1999/388 [2] PSARC/2005/250 SCSI target "pm-capable" property http://sac.sfbay/PSARC/2005/250 [3] PSARC/2008/465 Improved [s]sd-config-list support http://sac.sfbay/PSARC/2008/465 [4] PSARC/2006/672 USCSI LUN reset flag (general USCSI info) http://sac.sfbay/PSARC/2006/672 [5] T10 Specifications from http://t10.org/ spc4r17 - SCSI Primary Commands - 4(SPC-4), 13 November, 2008 sat2r6 - SCSI to ATA Translation - 2(SAT-2), 22 June 2008 sat-standby-09-113r1 - SCSI to ATA Translation-2(SAT-2), 13 March 2009 sbc3r17 - SCSI Block Commands - 3(SBC-3), 17 November, 2008 4.6 Man page changes See materials directory for the following new/changed man pages. Deliver (Evolving): pm_trans_check.9F.diff 4.7 Bug/RFE Numbers: 6827942 pm_trans_check enhancement 6832227 sd to export disk power attributes 6832232 enhanced sd(7D) to support power condition field in Start-Stop Unit command 6832245 "pm-capable" property updates 6832247 sata(7D) enhancement for SBC-3 power conditions and ATA power conditions translation 6781588 sata(7D) to support additional Mode Sense and Log Sense for PM 4.8 Doc Impact: 4.9 Admin/Config Impact: 6. Resources and Schedule 6.4. Steering Committee requested information 6.4.1. Consolidation C-team Name: ON 6.5 ARC review type: FaskTrack 6.6 ARC Exposure: Open