Adaptive stream management
The present disclosure describes apparatuses and methods for implementing adaptive stream management. In aspects, an adaptive stream manager receives a read request from a host with an indication for a stream transaction of multiple reads of data from media coupled to a media controller. The adaptive stream manager determines a priority level for the stream transaction based on an identifier of the host and a quality-of-service indicator of the read request and allocates a stream identifier to the host for the read request based on the priority level determined. The stream transaction is then initiated to prefetch, from the media, respective data of at least one of the multiple reads to a cache of the media controller. By so doing, aspects of adaptive stream management can prioritize stream transactions among hosts to efficiently manage resources of the controller and improve processing of stream transactions and other data access requests.
1 . A method for adaptive stream management implemented by a media controller, comprising:
receiving, from a host, a read request with an indication for a stream transaction of multiple reads of respective data from media operably coupled to the media controller;
determining a priority level for the stream transaction of the host based on an identifier of the host and a quality-of-service indicator of the read request;
allocating a stream transaction identifier to the host for the read request based on the priority level of the stream transaction; and
initiating the stream transaction to prefetch, from the media coupled to the controller, the respective data of at least one of the multiple reads to a cache of the media controller as part of the stream transaction.
2 . The method of claim 1 , wherein allocating the stream transaction identifier associates a portion of the cache of the media controller with the stream transaction identifier to enable the stream transaction.
3 . The method of claim 1 , wherein the read request received from the host includes a stream transaction field that includes the indication for the stream transaction, the stream transaction field configured to indicate at least one of a start of the stream transaction, an end of the stream transaction, a length of the stream transaction, or a size of the stream transaction.
4 . The method of claim 1 , wherein the read request is a first read request from a first host with a first QoS indicator, the stream transaction is a first stream transaction, and the priority level of the first stream transaction is a first priority level, and the method further comprises:
receiving, from a second host, a second read request with an indication for a second stream transaction of multiple reads of respective data from the media operably coupled to the media controller;
determining a second priority level for the second stream transaction of the second host based on an identifier of the second host and a second QoS indicator of the second read request;
comparing the second priority level of the second stream transaction to the first priority level of the first stream transaction; and
not allocating another stream transaction identifier to the second host for the second data request based on the second priority level of the second stream transaction being lower than the first priority level of the first stream transaction.
5 . The method of claim 4 , further comprising associating the second read request from the second host to a waiting list for stream transaction identifiers, the second read request associated with a position in the waiting list based on the second priority level of the second stream transaction relative to other respective priority levels of other stream transactions in the waiting list.
6 . The method of claim 1 , wherein the read request is from a first host, the stream transaction is a first stream transaction with a first priority level, the stream transaction identifier is a first stream transaction identifier, and the method further comprises:
comparing, prior to allocating the first stream transaction identifier to the first host, the first priority level of the first stream transaction with a second priority level of a second stream transaction of a second host; and
deallocating a second stream transaction identifier from the second host based the first priority level of the first stream transaction being higher than the second priority level of the second stream transaction, second or other as first identifier.
7 . The method of claim 6 , wherein:
the deallocated second stream transaction identifier is assigned to the first host as the first stream transaction identifier; or
another stream transaction identifier different from the second stream transaction identifier is assigned to the first host as the first stream transaction identifier.
8 . The method of claim 1 , wherein allocating the stream transaction identifier associates the priority level of the stream transaction with the stream transaction identifier.
9 . The method of claim 8 , wherein allocating the stream transaction identifier further associates, with the stream transaction identifier, a stream transaction status, a read address, the host identifier, or the quality-of-service indicator of the read request.
10 . The method of claim 1 , wherein the quality-of-service indicator of the read request comprises a traffic class of the read request.
11 . The method of claim 1 , wherein the media controller comprises a storage controller, the media comprises storage media, and the stream transaction comprises a sequential read of the storage media.
12 . The method of claim 1 , wherein the media controller comprises a memory controller, the media comprises memory media, and the stream transaction comprises a speculative read of the memory media.
13 . An apparatus comprising:
media configured to store data;
a media controller that includes a cache and is configured to enable access to the data stored by the media;
a host interface configured to communicate with one or more hosts; and
an adaptive stream manager configured to:
receive, from a host, a read request with an indication for a stream transaction of multiple reads of respective data from the media;
determine a priority level for the stream transaction of the host based on an identifier of the host and a quality-of-service indicator of the read request;
allocate a stream transaction identifier to the host for the read request based on the priority level of the stream transaction; and
initiate the stream transaction to prefetch, from the media, the respective data of at least one of the multiple reads to the cache of the media controller as part of the stream transaction.
14 . The apparatus of claim 13 , wherein the allocation of the stream transaction identifier associates a portion of the cache of the media controller with the stream transaction identifier to enable the stream transaction.
15 . The apparatus of claim 13 , wherein:
the read request of the host includes a stream transaction field;
the indication for the stream transaction is indicated by the stream transaction field; and
the stream transaction field is configured to indicate at least one of a start of the stream transaction, an end of the stream transaction, a length of the stream transaction, or a size of the stream transaction.
16 . The apparatus of claim 13 , wherein the allocation of the stream transaction identifier associates, with the stream transaction identifier, the priority level of the stream transaction, a stream transaction status, a read address of the read request, the host identifier, or the quality-of-service indicator of the read request.
17 . A System-on-Chip comprising:
a media controller that includes a cache and is configured to enable access to media operably coupled to the media controller;
a host interface configured to communicate with one or more hosts; and
an adaptive stream manager configured to:
receive, from a host, a read request with an indication for a stream transaction of multiple reads of respective data from the media operably coupled to the media controller;
determine a priority level for the stream transaction of the host based on an identifier of the host and a quality-of-service indicator of the read request;
allocate a stream transaction identifier to the host for the read request based on the priority level of the stream transaction; and
initiate the stream transaction to prefetch, from the media, the respective data of at least one of the multiple reads to the cache of the media controller as part of the stream transaction.
18 . The System-on-Chip of claim 17 , wherein the allocation of the stream transaction identifier associates a portion of the cache of the media controller with the stream transaction identifier to enable the stream transaction.
19 . The System-on-Chip of claim 17 , wherein the quality-of-service indicator of the read request comprises a traffic class of the read request.
20 . The System-on-Chip of claim 17 , wherein:
the media controller comprises a storage controller, the media comprises storage media, and the stream transaction comprises a sequential read of the storage media; or
the media controller comprises a memory controller, the media comprises memory media, and the stream transaction comprises a speculative read of the memory media.