page 1 of 4 Date: April 23, 1988 X3T9.2/88-049R0 To: X3T9.2 Committee (SCSI) From: James McGrath (Quantum) Subject: Proposed Read Caching Page On April 22 a special working group met to discuss the formation of a proposal for caching mode parameters for DASDs. The focus of the meeting was on read caching for embedded (typically 64K to 256K cache memory size) drives. It was envisioned that such focus would quickly lead to a solid proposal, that it would address the coming introduction of a number of such products in the marketplace, and that this proposal could later incorporate the special needs of other caching devices. Participants at the meeting include Adaptec, ENDL, Fujitsu, Micropolis, Miniscribe, NCR, Quantum, and Seimens. While we reached general agreement on the parameters and their definition, specific wording was not agreed to at that time. One important point to note is that these parameters are, in a sense, default parameters for caching. The specific cache commands (LOCK/UNLOCK and PRE-FETCH), along with the cache control bits (DPO, FUA, and DP) would, if used in conjunction with these parameters, supersede the advice to the target embodied in these parameters. This proposal creates a new page of mode parameters for read caching. Some of the terms used are defined in 88-030R0 (note that in that draft the term "anticipatory prefetch" is referred to as "auto-prefetch"). UPDATE: On April 25, a brief meeting was held after the first day of the plennary to examine a draft of this proposal. Issues arose that will be discussed at the working group. These include: 1) controlling prefetching if substantial media delays would be encountered (e.g. across tracks and cylinder boundaries) 2) reducing confusion between the PRE-FETCH command and the term anticipatory prefetching. 3) adding a disable prefetch DP bit (byte 1, bit 2) to the READ (group 1) command (section 8.1.6). 4) whether the page parameters should advise or instruct the target (may vs shall) - this will be settled as a more general issue for all MODE SELECT/MODE SENSE parameters. 5) simplifying the computation of the prefetch amounts by reducing the number of parameters (e.g. eliminating absolute) page 2 of 4 8.2.3. Read Caching Parameters Table 8-56: Read Caching Parameters ============================================================================== Bit| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | Byte | | | | | | | | | ============================================================================== 0 |Reserved|Reserved| Page Code (08h) | -----|-----------------------------------------------------------------------| 1 | Parameter Length (12h) | -----|-----------------------------------------------------------------------| 2 | Reserved | RCD | -----|-----------------------------------------------------------------------| 3 | Reserved | -----|-----------------------------------------------------------------------| 4 | Demand Read Retention Priority | -----|-----------------------------------------------------------------------| 5 | Write Retention Priority | -----|-----------------------------------------------------------------------| 6 | (MSB) | -----|--- Disable Prefetch Transfer Length ---| 7 | (LSB) | -----|-----------------------------------------------------------------------| 8 | (MSB) | -----|--- Minimum Prefetch Absolute ---| 9 | (LSB) | -----|-----------------------------------------------------------------------| 10 | (MSB) | -----|--- Minimum Prefetch Multiple ---| 11 | (LSB) | -----|-----------------------------------------------------------------------| 12 | (MSB) | -----|--- Minimum Prefetch Ceiling ---| 13 | (LSB) | -----|-----------------------------------------------------------------------| 14 | (MSB) | -----|--- Maximum Prefetch Absolute ---| 15 | (LSB) | -----|-----------------------------------------------------------------------| 16 | (MSB) | -----|--- Maximum Prefetch Multiple ---| 17 | (LSB) | -----|-----------------------------------------------------------------------| 18 | (MSB) | -----|--- Maximum Prefetch Ceiling ---| 19 | (LSB) | ============================================================================== page 3 of 4 The read caching parameters page specifies the control parameters that limit, or advise on, the use of target's cache. A read cache disable (RCD) bit of zero indicates that the target may return some or all of the the data requested by a READ (group 0) or READ (group 1) command by accessing the cache, not the media. A RCD bit of one indicates that the target shall not return any of the the data requested by a READ (group 0) or READ (group 1) command by accessing the cache. Rather, all of the data requested shall be read from the media. The demand read retention priority field advises the target on the retention priority to assign data read into the cache that has been specifically requested by the initiator. A value of 00h indicates that the priority should be low - the data can be replaced at the target's earliest opportunity. A value of 80h indicates that the priority should be the same as the average priority for all data in the cache. Note that this value necessarily implies a vendor specific assignment of priority, and should be used whenever no distinction should be made between demand read data and other data. A value of FFh indicates that the priority should be high - that data should not be replaced in favor of data fetched into the cache by another strategy (e.g. prefetching or writing). Other values for this field indicate the relative retention priority with reference to these three calibration points. The write retention priority field advises the target on the retention priority to assign data written into the cache that has been sent by the initiator. A value of 00h indicates that the priority should be low - the data can be replaced at the target's earliest opportunity. A value of 80h indicates that the priority should be the same as the average priority for all data in the cache. Note that this value necessarily implies a vendor specific assignment of priority, and should be used whenever no distinction should be made between demand read data and other data. A value of FFh indicates that the priority should be high - that data should not be replaced in favor of data fetched into the cache by another strategy (e.g. prefetching or reading). Other values for this field indicate the relative retention priority with reference to these three calibration points. Anticipatory prefetch is the data prefetched immediately after the requested data has been successfully read from the media. Specifically, if the last logical block requested by the initiator is X, and the amount to be prefetched is Y, then the data prefetched shall be from logical blocks X+1 to X+Y, inclusive. If an error occurs on the command or during the prefetch, then the prefetch may be aborted, the data successfully read may or may be in the cache, and any or all data previously stored in the cache may be displaced. page 4 of 4 The disable prefetch transfer length is used to selectively disable anticipatory prefetching on long requests for data. The value in this field is compared to the number of blocks requested by the READ (group 0) or READ (group 1) command. If the number of blocks is greater than the disable prefetch transfer length, then no anticipatory prefetch will be done for that request. Otherwise an anticipatory prefetch shall be attempted. If the prefetch disable transfer length is set to zero, then all anticipatory prefetching is disabled for any request for data, including those for zero logical blocks. The minimum prefetch specifies the number of logical blocks that the target shall prefetch during anticipatory prefetches. This amount shall be prefetched even if an initiator is attempting to or has already selected the target, or if another command is ready for execution. The minimum prefetch for each READ (group 0) or READ (group 1) command is computed as follows: Minimum Prefetch = MINIMUM OF EITHER (Minimum Prefetch Absolute + (Minimum Prefetch Multiple * Number of Blocks), OR Minimum Prefetch Ceiling) where the number of blocks is the number of logical blocks requested by the READ (group 0) or READ (group 1) command. The maximum prefetch specifies the number of logical blocks that the target shall prefetch during anticipatory prefetches. This amount shall not be exceeded, even if the target is otherwise completely idle. The maximum prefetch for each READ (group 0) or READ (group 1) command is computed as follows: Maximum Prefetch = MINIMUM OF EITHER (Maximum Prefetch Absolute + (Maximum Prefetch Multiple * Number of Blocks), OR Maximum Prefetch Ceiling) where the number of blocks is the number of logical blocks requested by the READ (group 0) or READ (group 1) command. IMPLEMENTOR'S NOTE: For both the minimum and maximum prefetches, the absolute and multiple values are the constants of a linear equation used to compute the nominal amount to prefetch. It is recommended that one of these values be set to zero. This then allows the amount to prefetch to be set as either a number of logical blocks (via the absolute field), or a multiple of the transfer length of the READ command. The ceiling field can be used to limit the amount of data to be prefetched, and is normally used in conjunction with the multiple field. IMPLEMENTOR'S NOTE: an initiator can allow the target to terminate the anticipatory prefetch whenever another command is ready for execution by setting the minimum prefetch parameters to zero. The initiator can ensure a deterministic amount of prefetch data by setting the minimum prefetch parameters equal to the maximum prefetch parameters.