Directing data pre-reads using cache feedback information

文档序号:1719601 发布日期:2019-12-17 浏览:14次 中文

阅读说明:本技术 使用缓存反馈信息指导数据预读 (Directing data pre-reads using cache feedback information ) 是由 侯俊伟 孙丛 于 2018-06-11 设计创作,主要内容包括:提供了使用缓存反馈信息指导数据预读的方法及其存储设备。所提供数据预读方法,包括:获取预读请求;根据预读数据的缓存统计数据,确定是否根据所述预读请求执行预读操作。(A method for guiding data pre-reading using cache feedback information and a storage device thereof are provided. The provided data pre-reading method comprises the following steps: obtaining a pre-reading request; and determining whether to execute the pre-reading operation according to the pre-reading request according to the cache statistical data of the pre-reading data.)

1. A method of data pre-reading, comprising:

Obtaining a pre-reading request;

and determining whether to execute the pre-reading operation according to the pre-reading request according to the cache statistical data of the pre-reading data.

2. the method of claim 1, wherein:

And if the accuracy of the cache statistical data of the pre-read data is greater than a first threshold, executing the pre-read operation according to the pre-read request.

3. The method of claim 1 or 2, wherein:

And if the accuracy of the cache statistical data of the pre-read data is not greater than a second threshold, refusing to execute the pre-read operation according to the pre-read request.

4. The method of one of claims 1-3, further comprising:

In response to the first read command not hitting any of the plurality of sequential stream descriptors, a set of recent IO command addresses is updated according to an address accessed by the first read command.

5. The method of claim 4, wherein

And generating a first element according to the address accessed by the first read command, and adding the first element to a recent IO command address set, wherein the first element records the address accessed by the first read command and the number of times of initialization hits.

6. The method of claim 4 or 5, wherein

And if the address accessed by the first read command hits a second element of the recent IO command address set, increasing the hit frequency of the second element.

7. a method according to claim 2 or 3, wherein said accuracy is indicated by a/B, wherein B represents pre-read data and a represents the amount of data hit by a read command in the pre-read data (B).

8. The method of one of claims 1 to 7, further comprising:

And calculating virtual statistical data according to the generated pre-reading request and the read command.

9. The method of claim 8, further comprising:

And determining whether to execute the pre-reading operation according to the virtual statistical data under the condition of determining to refuse to execute the pre-reading operation according to the cache statistical data of the pre-reading data.

10. A storage device comprising a control unit and a non-volatile memory, the control unit performing one of the methods according to claims 1-9.

Technical Field

The present application relates to a memory system, and more particularly, to detecting a sequential stream formed by a plurality of read commands accessing a continuous address space, and performing data pre-reading based on the detection of the sequential stream.

Background

FIG. 1 illustrates a block diagram of a solid-state storage device. The solid-state storage device 102 is coupled to a host for providing storage capabilities to the host. The host and the solid-state storage device 102 may be coupled by various methods, including but not limited to, connecting the host and the solid-state storage device 102 by, for example, SATA (Serial Advanced Technology Attachment), SCSI (Small Computer System Interface), SAS (Serial attached SCSI), IDE (Integrated Drive Electronics), USB (Universal Serial Bus), PCIE (Peripheral Component interconnect Express), NVMe (NVM Express, high-speed nonvolatile storage), ethernet, fibre channel, wireless communication network, etc. The host may be an information processing device, such as a personal computer, tablet, server, portable computer, network switch, router, cellular telephone, personal digital assistant, etc., capable of communicating with the storage device in the manner described above. The Memory device 102 includes an interface 103, a control section 104, one or more NVM chips 105, and a DRAM (Dynamic Random Access Memory) 110.

NAND flash Memory, phase change Memory, FeRAM (Ferroelectric RAM), MRAM (magnetoresistive Memory), RRAM (Resistive Random Access Memory), etc. are common NVM.

The interface 103 may be adapted to exchange data with a host by means such as SATA, IDE, USB, PCIE, NVMe, SAS, ethernet, fibre channel, etc.

The control unit 104 is used to control data transfer between the interface 103, the NVM chip 105, and the DRAM 110, and also used for memory management, host logical address to flash physical address mapping, erase leveling, bad block management, and the like. The control component 104 can be implemented in various manners of software, hardware, firmware, or a combination thereof, for example, the control component 104 can be in the form of an FPGA (Field-programmable gate array), an ASIC (Application-specific integrated Circuit), or a combination thereof. The control component 104 may also include a processor or controller in which software is executed to manipulate the hardware of the control component 104 to process IO (Input/Output) commands. The control component 104 may also be coupled to the DRAM 110 and may access data of the DRAM 110. FTL tables and/or cached IO command data may be stored in the DRAM.

Control section 104 includes a flash interface controller (or referred to as a media interface controller, a flash channel controller) that is coupled to NVM chip 105 and issues commands to NVM chip 105 in a manner that conforms to an interface protocol of NVM chip 105 to operate NVM chip 105 and receive command execution results output from NVM chip 105. Known NVM chip interface protocols include "Toggle", "ONFI", etc.

In the solid-state storage device, mapping information from logical addresses to physical addresses is maintained using FTL (Flash Translation Layer). The logical addresses constitute the storage space of the solid-state storage device as perceived by upper-level software, such as an operating system. The physical address is an address for accessing a physical memory location of the solid-state memory device. Address mapping may also be implemented using an intermediate address modality in the related art. E.g. mapping the logical address to an intermediate address, which in turn is further mapped to a physical address.

a table structure storing mapping information from logical addresses to physical addresses is called an FTL table. FTL tables are important metadata in solid state storage devices. Usually, the data entry of the FTL table records the address mapping relationship in the unit of data page in the solid-state storage device.

The storage device is used for processing IO commands. The IO commands may be sent to a storage device (e.g., a magnetic disk, a solid state disk, a usb disk, an optical disk, etc.), a storage server, or a storage system (such as cloud storage). If the addresses accessed by multiple IO commands are consecutive or nearly consecutive, the IO commands are said to belong to the same sequential stream.

Each IO command carries or indicates an address (logical address or physical address) of data to be accessed. The length of the data to be accessed by each IO command may be a fixed length or may vary. When a host accesses a storage device, a data accessing party, such as an application, may split a large block of data access into multiple IO commands and send the IO commands to the storage device. There may also be multiple applications in the host accessing the storage device and/or multiple operating systems (such as virtual machines), which results in IO commands from multiple accessing parties being interleaved, thereby making access to otherwise contiguous addresses discontinuous.

FIG. 2A illustrates a schematic diagram of IO commands from multiple applications being provided to a storage device.

There are multiple applications in the host, application A generating multiple IO commands (e.g., IO commands A1 and A2) that access consecutive addresses, which belong to sequential flow A. By way of example, these IO commands of application a come from copying large size video files. Application B generates a plurality of IO commands (e.g., IO commands B1 and B2) that access consecutive addresses, which belong to sequential flow B. The application in the host also generates a plurality of IO commands (e.g., IO commands E, D, C in fig. 2A, which belong to random stream C) that access other address spaces. The plurality of IO commands are organized in a different order than originally on the operating system, drivers, device interfaces, and/or bus and received by the storage device. By way of example, referring to FIG. 2A, the storage device receives IO commands in the order A1, B1, C, and B2.

FIG. 2B illustrates a schematic diagram of data placement on a storage device for data from multiple applications.

The storage device receives the IO commands in the order of a1, B1, C, and B2, and writes the data accessed by the IO commands (for example, write commands) to the storage medium in the order in which the IO commands were received. In the example of FIG. 2B, IO commands A1, B1, C, B2 are assigned to consecutive physical addresses, resulting in data corresponding to multiple IO commands (such as IO commands A1 and A2, or IO commands B1 and B2) that would otherwise access consecutive logical addresses being stored scattered across the storage medium rather than contiguously.

The storage device also provides a read-ahead mechanism. For example, in response to the host accessing address A1, the storage device predicts that the host will likely continue to access address A2 consecutive or adjacent to address A1, such that the storage device reads data from address A2 prior to receiving the host's read command, and buffers the data read from address A2 in response to a read command that the host may subsequently issue.

Disclosure of Invention

There is a need to provide improved sequential stream detection and read-ahead capabilities in storage devices to provide lower access latency and better quality of service.

According to a first aspect of the present application, there is provided a first data pre-reading method according to the first aspect of the present application, comprising: in response to an address accessed by a first read command hitting a first sequential stream descriptor in the plurality of sequential stream descriptors, generating a read-ahead request for a first sequential stream corresponding to the first sequential stream descriptor; and determining whether to execute the pre-reading operation according to the pre-reading request according to the cache statistical data of the pre-reading data.

According to a first data pre-reading method of the first aspect of the present application, there is provided a second data pre-reading method of the first aspect of the present application, wherein: and if the accuracy of the cache statistical data of the pre-read data is greater than a first threshold, executing the pre-read operation according to the pre-read request.

According to the first or second data pre-reading method of the first aspect of the present application, there is provided a third data pre-reading method according to the first aspect of the present application, wherein: and if the accuracy of the cache statistical data of the pre-read data is not greater than a second threshold, refusing to execute the pre-read operation according to the pre-read request.

According to one of the first to third data pre-reading methods of the first aspect of the present application, there is provided a fourth data pre-reading method according to the first aspect of the present application, further comprising: in response to the first read command not hitting any of the plurality of sequential stream descriptors, a set of recent IO command addresses is updated according to an address accessed by the first read command.

According to a fourth data pre-reading method of the first aspect of the present application, there is provided the fifth data pre-reading method of the first aspect of the present application, wherein a first element is generated according to an address accessed by a first read command, and the first element is added to a recent IO command address set, wherein the first element records the address accessed by the first read command and the number of initial hits.

according to a fourth or fifth data pre-reading method of the first aspect of the present application, there is provided the sixth data pre-reading method of the first aspect of the present application, wherein if an address accessed by the first read command hits a second element of the recent IO command address set, the number of hits of the second element is incremented.

according to one of the fourth to sixth data pre-reading methods of the first aspect of the present application, there is provided a seventh data pre-reading method of the first aspect of the present application, further comprising: updating a second sequential flow descriptor of the plurality of sequential flow descriptors with an address and a hit count recorded by an element of the recent IO command address set.

According to a seventh data pre-reading method of the first aspect of the present application, there is provided an eighth data pre-reading method of the first aspect of the present application, wherein: the second sequential flow descriptor is a sequential flow descriptor having a smallest hit number among the plurality of sequential flow descriptors.

According to the second or third data pre-reading method of the first aspect of the present application, there is provided the ninth data pre-reading method of the first aspect of the present application, wherein the accuracy is indicated by a/B, where B represents pre-read data and a represents an amount of data hit by a read command in the pre-read data (B).

according to one of the first to ninth data pre-reading methods of the first aspect of the present application, there is provided the tenth data pre-reading method according to the first aspect of the present application, further comprising: and calculating virtual statistical data according to the generated pre-reading request and the read command.

According to a tenth data pre-reading method of the first aspect of the present application, there is provided the eleventh data pre-reading method of the first aspect of the present application, further comprising: and determining whether to execute the pre-reading operation according to the virtual statistical data under the condition of determining to refuse to execute the pre-reading operation according to the cache statistical data of the pre-reading data.

According to a tenth data pre-reading method of the first aspect of the present application, there is provided the twelfth data pre-reading method of the first aspect of the present application, further comprising: and determining whether to execute the pre-reading operation according to the virtual statistical data.

According to one of the tenth to twelfth data pre-reading methods of the first aspect of the present application, there is provided a thirteenth data pre-reading method according to the first aspect of the present application, wherein: the dummy statistics include the accuracy of the dummy read-ahead, indicated by A '/B ', where B ' represents the data that is theoretically read-ahead according to the read-ahead request, and A ' represents the amount of data hit by the read command in the theoretically read-ahead data B '.

According to one of the first to thirteenth data pre-reading methods of the first aspect of the present application, there is provided a fourteenth data pre-reading method according to the first aspect of the present application, further comprising: determining whether to execute pre-reading operation according to the data volume of the cached pre-reading data; and if the data quantity of the cached pre-read data is less than the threshold value, executing the pre-read operation.

According to one of the first to fourteenth data pre-reading methods of the first aspect of the present application, there is provided a fifteenth data pre-reading method according to the first aspect of the present application, wherein: and determining whether to execute the pre-reading operation according to the pre-reading request according to the first cache statistical data of the pre-reading data of the first sequential stream.

According to a fifteenth data pre-reading method of the first aspect of the present application, there is provided the sixteenth data pre-reading method of the first aspect of the present application, wherein if the first cache statistical data of the pre-read data of the first sequential stream is greater than the threshold, it is determined that the pre-read operation is performed according to the pre-read request.

according to a fifteenth or sixteenth data pre-reading method of the first aspect of the present application, there is provided the seventeenth data pre-reading method of the first aspect of the present application, wherein if the first cache statistical data of the pre-read data of the first sequential stream is not greater than the threshold, it is determined that the pre-read operation is rejected to be performed according to the pre-read request.

According to a second aspect of the present application, there is provided a first storage device according to the second aspect of the present application, comprising a control section that performs one of the first to seventeenth data read-ahead methods according to the first aspect of the present application, and a nonvolatile memory.

Drawings

In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments described in the present application, and other drawings can be obtained by those skilled in the art according to the drawings.

FIG. 1 is a schematic diagram of a prior art solid-state memory device provided herein;

FIG. 2A illustrates a schematic diagram of IO commands from multiple applications being provided to a storage device;

FIG. 2B illustrates a schematic diagram of data placement on a storage device for data from multiple applications;

FIG. 3 is a schematic diagram of sequential flow detection for a write command;

FIG. 4 illustrates a block diagram of a storage device according to an embodiment of the present application;

FIG. 5 illustrates a sequential flow descriptor and a candidate sequential flow descriptor according to an embodiment of the present application;

FIG. 6 illustrates a flow diagram for detecting sequential flow in accordance with an embodiment of the present application;

FIG. 7 illustrates a flow chart for implementing read-ahead according to an embodiment of the present application;

FIG. 8 illustrates a schematic diagram of implementing a read ahead according to an embodiment of the present application;

FIG. 9 illustrates a schematic diagram of implementing a read ahead according to yet another embodiment of the present application; and

FIG. 10 illustrates a schematic diagram of implementing a read-ahead according to yet another embodiment of the present application.

Detailed Description

The technical solutions in the embodiments of the present application are clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some, but not all, embodiments of the present application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.

FIG. 3 is a schematic diagram illustrating sequential flow detection for a write command according to an embodiment of the present application. By way of example, sequential stream detection is performed on received write commands in a storage device. From among a plurality of write commands that access a storage device, a sequential stream a, a sequential stream B, which are formed by write commands that access consecutive addresses, and a plurality of write commands (indicated by C, D, E, … S) (also referred to as random streams) in which the accessed addresses do not have sequential properties are detected. And sequential stream a is assigned sequential physical addresses on the storage medium (e.g., data block 1), sequential stream B is assigned sequential physical addresses on the storage medium (e.g., data block 2), and the random stream is written to data block 3. When the data lifecycle corresponding to the sequential stream a is completed and updated or invalidated (for example, when the sequential stream a corresponds to a large-size video file, the video file is deleted), the data in the data block 1 becomes invalid, and when the data block 1 is recovered, the valid data in the data block does not need to be moved (because the valid data does not exist in the data block 1, or the valid data is less), thereby reducing the write amplification. Furthermore, data in the sequential stream may also be read continuously. For example, when the sequential stream a corresponds to a large-sized video file, the data corresponding to a1, a2, A3, and a4 in data block 1 are likely to be read continuously. Therefore, for the data block 1 storing the sequential stream, when responding to the read command, the subsequent data can be read in advance before receiving the subsequent read command, thereby reducing the response time to the subsequent read command, or when responding to the read command, the data with larger size can be read from the data block 1 once, so as to reduce the times of accessing the data block 1. Various embodiments for implementing sequential flow detection are provided in chinese patent application No. 201610169011.1 entitled sequential flow detection method and apparatus, and chinese patent application No. 2018103554271 entitled sequential flow detection and data pre-reading. Which is incorporated by reference in its entirety.

FIG. 4 illustrates a block diagram of a memory device in accordance with an embodiment of the present application. The storage device according to the embodiment of the application performs sequential stream detection on the read command and performs pre-reading according to the detection result.

Referring to fig. 4, the control section 204 of the storage device includes a host interface 210, a media interface 220 for accessing the NVM chip 105, a cache management unit 260, a back-end processing unit 270, a sequential stream detection unit 250, and a read-ahead unit 255.

The host interface 210 is used to exchange commands and data with a host. For example, the host and the storage device communicate via the NVMe/PCIe protocol, and the host interface 210 processes the PCIe protocol data packet, extracts the NVMe protocol command, and returns a processing result of the NVMe protocol command to the host.

The cache management unit 260 is coupled to the host interface 210, and is configured to receive an IO command sent by a host to a storage device, and try to utilize one or more cache units to service the received IO command, so as to improve the certainty of the performance of the IO command processed by the storage device.

The buffer management unit 260 also writes data in the buffer unit to the NVM chip (105) through the back-end processing unit 270, and/or reads data from the NVM chip (105) to fill the buffer unit.

Optionally, cache molecule 260 forwards portions of received IO commands (e.g., read commands that miss the cache molecule) to back-end processing unit 270 for processing without using the cache molecule to service the IO commands.

The back-end processing unit 270 receives an IO command (the IO command form is changed by the processing of the cache management unit 260, and is herein collectively referred to as an IO command for brevity) and accesses one or more NVM chips.

Alternatively, the back-end processing unit 270 processes the IO command using an existing technique, or processes the IO command using a technique generated in the future.

Optionally, the cache management unit 260 maintains a cache descriptor table (or pool of cache descriptors). The buffer descriptor table 260 records a plurality of buffer descriptors. One or more of the cache descriptors record the address of the corresponding cache location in DRAM 110, the status of the cache location, and/or the location of valid data in the cache location. The use of cache management unit 260 to provide a cache is described in, for example, chinese patent application No. 201810264435.5 entitled "storage device with cache having enhanced IO performance certainty," filed 3/28/2018. Caches for storage devices are also provided in application numbers 201610819411.2, 201610819400.4, 201710219096.4 and 201710219077.1.

The control component is also coupled to an external memory (e.g., DRAM) 110.

With continued reference to FIG. 4, a portion of the space of external memory 110 (cache location 0, cache location 1 … … cache location 7) is used as cache. The cache unit has a specified size. For example, the buffer unit is specified to be 512 bytes, 1KB, 2KB, 4KB, etc.

The cache management unit 260 manages allocation and usage of cache units. Illustratively, for a write command, the data to be written is transferred from the host to the cache location in external memory 110 through host interface 210 under the direction of cache management unit 260, and the data in the cache location is also transferred to NVM chip 105 through media interface 220. For example, the buffer management unit 260 transmits the data in the buffer unit to the NVM chip 105 through the media interface 220 via the back-end processing unit 270.

for a read command, cache management unit 260 identifies whether the cache location hits. If the cache unit is hit, under the instruction of the cache management unit 260, the data is obtained from the cache unit and sent to the host. If the cache unit misses, the data is retrieved from NVM chip 105 and sent to the host.

The back-end processing unit 270 includes an FTL module for converting a logical address of an IO command into a physical address. The back-end processing unit 270 also manages the NVM chip and the data thereon, providing services such as wear leveling, garbage collection, etc.

Optionally, the storage device exposes a physical address space to the host, such as a physical address space following an (Open Channel SSD, ocsd) protocol. Thereby indicating the physical address to access in the IO command. So that the back-end processing unit 270 does not have to use FTL modules for the translation from logical addresses to physical addresses.

With continued reference to fig. 4, the host interface 210 is also coupled to a sequential flow detection unit 250. The sequential stream detection unit 250 also receives IO commands sent by the host to the storage device, or alternatively receives logical addresses/physical addresses accessed by the IO commands (referred to simply as addresses accessed by the IO commands). The sequential flow detection unit identifies one or more sequential flows according to the address of the received IO command and indicates the identified sequential flows to the read-ahead unit 255.

The pre-reading unit 255 performs pre-reading on the identified sequential stream, performs pre-reading in advance on data to be read by a read command that may occur later on the sequential stream, and stores the read data in the buffer unit. Alternatively, the data read out by the pre-reading unit 255 is also managed by the cache management unit 260. The buffer management unit 260 allocates a buffer unit to the pre-read data, and records the pre-read logical address/physical address and an index of the buffer unit in which the pre-read data is stored in the buffer descriptor table.

Alternatively, the buffering of the read-ahead data is managed by another buffer management unit than the buffer management unit 260 or the sequential flow detection unit 250.

In response to receiving the read command from the host interface, the cache management unit 260, the other cache management units, or the sequential stream detection unit 250 also checks whether the data to be read by the read command hits the read-ahead data in the cache unit. By way of example, the cache management unit 260 generates statistical data of the data read ahead by the read-ahead unit 255, and supplies the statistical data to the read-ahead unit 255. For example, the cache management unit 260 counts the accuracy of the pre-read, wherein the accuracy is indicated by a/B, where B represents the pre-read data and a represents the amount of data hit by the real read command in the pre-read data (B). Optionally, the statistical data provided by the cache management unit 260 includes a hit rate of the cache units, a number of cache units occupied by the read-ahead data, and/or a proportion of the cache units occupied by the read-ahead data. The read-ahead unit 255 adjusts its read-ahead policy according to the statistical data received from the cache management unit 260.

FIG. 5 illustrates a schematic diagram of implementing sequential flow detection according to an embodiment of the present application. The sequential flow detection unit 250 maintains a sequential flow descriptor and a set of recent IO command addresses. The sequential stream descriptor indicates the sequential stream recognized by the sequential stream detecting unit 250.

By way of example, there may be one or more sequential flow descriptors. In fig. 5, 2 sequential stream descriptors (510 and 512) are shown. It will be appreciated that other numbers of sequential flow descriptors may be maintained by sequential flow detection unit 250.

The sequential flow descriptor is used to describe the identified sequential flow. By way of example, the sequential stream descriptor describes the sequential stream by address (the address accessed by a read command, and/or the read-ahead address currently performing a read-ahead access to the sequential stream) and hit count. Further, the sequential stream descriptor further describes the sequential stream by pre-reading the data size. Still optionally, the sequential stream descriptor further records the size of the IO command read data.

The number of hits of the sequential stream descriptor record is the number of read commands that hit the sequential stream described by the sequential stream descriptor within its lifetime. Situations where a read command hits a sequential stream include, for example, the read command accessing an address that is the same as, overlapping with, and/or adjacent to the address recorded by the sequential stream descriptor (the difference between the two addresses is less than a specified threshold).

The pre-read address recorded by the sequential stream descriptor is the address (logical address or physical address) of the data read by the current pre-read operation performed by the sequential stream descriptor. The pre-read data size recorded by the sequential stream descriptor is the size of data read by the current pre-read operation performed by the sequential stream descriptor.

The address set of recent IO commands accommodates the address of the recently received read command and the number of times it was hit in each element of the set, limited by the storage space of the set. Optionally, the set of addresses of recent IO commands is ordered, ordered in the order in which the addresses of the IO commands were received. Such that when the set of addresses for the recent IO command is full, the set element indicating the oldest received IO command is deleted from the set to obtain storage space to accommodate the new element.

By way of example, each element of the address set of recent IO commands records the address of the IO command (read command) and optionally the number of times the address is hit (also referred to as the number of times the element is hit). The address set of recent IO commands holds a specified number of elements. And for the received IO command, if the address set of the recent IO command has a free space, generating an element according to the address accessed by the IO command and adding the element to the address set of the recent IO command. If the address set of the recent IO command has no free space, sorting the elements of the address set of the recent IO command, and deleting the element which is added to the address set of the recent IO command earliest to obtain the free space. Alternatively or additionally, when deleting an element from the set of addresses of recent IO commands, the number of hits on the element is also considered. For example, when an element is deleted from the address set of the recent IO command, the element that has been hit less frequently is deleted.

In order to add the generated element to the address set of the recent IO command, each element of the address set of the recent IO command is traversed to find whether an element hit by an address to be accessed by the IO command exists in the address set of the recent IO command. If the address set of the recent IO command has an element hit by the address accessed by the IO command, the hit times of the element are increased. And if the address set of the recent IO command does not have the elements hit by the address accessed by the IO command, generating the elements according to the address accessed by the IO command, and adding the elements into the address set of the recent IO command. Situations where the read command hits an element of the address set of the recent IO command include, for example, the read command accesses an address that is the same as, overlapping with, and/or adjacent to the address of an element record of the address set of the recent IO command (the difference between the two addresses is less than a specified threshold).

when the specified condition is met or a specified condition occurs, elements in the address set of the recent IO command are upgraded to a sequential stream (and get a sequential stream descriptor). The specified conditions include, for example, that the number of times an element in the address set of the recent IO command is hit is greater than a specified threshold, the number of times an element in the address set of the recent IO command is hit is greater than the number of times the sequential stream descriptor is hit, and the like.

FIG. 6 illustrates a flow diagram for detecting sequential flow in accordance with an embodiment of the present application.

The sequential stream detection unit 250 (see also fig. 4) obtains 610 a read command (optionally, an address accessed by the read command) from the host interface 210, and determines 620 whether the address accessed by the read command hits in the sequential stream. Whether the address accessed by the read command hits the sequential stream is judged by comparing the address accessed by the read command with the address recorded by the sequential stream descriptor. For example, if the address accessed by the read command is a1 and the address recorded by the sequential stream descriptor 510 is a2, if a1 is the same as, overlapped with and/or adjacent to a2 (the absolute value of the difference between a1 and a2 is less than the threshold), it is determined that the address a1 accessed by the read command hits in the sequential stream 510. Optionally, the address accessed by the read command is compared with the addresses recorded by each (510 and 512) of the sequential stream descriptors maintained by the sequential stream detection unit 250 to identify whether the address accessed by the read command hits in any of the sequential streams represented by the sequential stream descriptors.

For a sequential stream descriptor (e.g., sequential stream descriptor 510) hit by an address accessed by a read command, the hit sequential stream descriptor is updated (630), e.g., the address recorded by sequential stream descriptor 510 is replaced with the address accessed by the read command (a1), and the number of hits recorded by sequential stream descriptor is incremented.

If the address accessed by the read command (A1) does not hit any of the maintained sequential stream descriptors, it is determined whether the address accessed by the read command hits in the address set of the recent IO command (640). And judging whether the address accessed by the read command hits the address set of the recent IO command or not by comparing the address accessed by the read command with the address recorded by the element of the address set of the recent IO command. If the address accessed by the read command hits the element of the address set of the recent IO command, the hit element of the address set of the recent IO command is updated, for example, the address recorded by the element is replaced by the address accessed by the read command (A1), and the number of hits recorded by the element is increased. If the address accessed by the read command does not hit any element of the address set of the recent IO command, a new element for recording the address accessed by the read command is generated and added to the address set of the recent IO command.

Further, for the updated set of addresses of the recent IO command, it is also identified whether an element of the set of addresses of the recent IO command satisfies a condition to be upgraded to a sequential flow descriptor (650). For example, if the number of hits recorded by one of the elements of the address set of the recent IO command exceeds a threshold (e.g., 5, 10, or 100), if the number of hits recorded by one of the elements of the address set of the recent IO command is greater than the number of hits recorded by all other elements of the address set of the recent IO command, or if the number of hits recorded by one of the elements of the address set of the recent IO command is greater than the number of hits recorded by one or more sequence flow descriptors, the element of the address set of the recent IO command is updated. One of the sequential flow descriptors is updated according to the element to be upgraded (650). For example, the sequential flow descriptor with the lowest hit count recorded in all the sequential flow descriptors is selected, or the sequential flow descriptor with the longest time since the last update is selected, or the sequential flow descriptor that has not been used is selected, and the address and hit count of the selected sequential flow descriptor are replaced with the address and hit count recorded in the element to be upgraded, so as to upgrade the element to be the sequential flow descriptor.

Alternatively or additionally, to upgrade elements of the address set of recent IO commands, the selected sequential flow descriptor (e.g., sequential flow descriptor 510) is also downgraded. The element of the address set of the recently updated IO command is updated with the address and hit count of the staged sequential stream descriptor (510). By demoting the sequential flow descriptor to an element of the address set of the recent IO command, the element of the address set of the recent IO command is provided an opportunity to be promoted to the sequential flow descriptor again.

It should be noted that in the description of the embodiment according to fig. 6, the sequential flow is not carefully distinguished from the sequential flow descriptor. This is for simplicity and clarity of illustration, and the meaning will be understood by those skilled in the art. The sequential stream descriptor may be, for example, data describing the sequential stream that is accommodated in a section of memory space in the memory that may be modified to cause the sequential stream descriptor to be updated. The sequential flow descriptor indicates the sequential flow (e.g., address and hit count) by which the data is recorded. The address of the read command thus hits the sequential stream descriptor, which is also understood to hit the sequential stream indicated by the sequential stream descriptor.

FIG. 7 illustrates a flow chart for implementing read-ahead according to an embodiment of the present application.

According to an embodiment of the present application, the read-ahead unit 255 performs a read-ahead operation while the sequential flow detection unit 250 maintains a valid sequential flow descriptor. The presence of a valid sequential flow descriptor means that there is currently a sequential flow that is identified and valid. The sequential flow descriptor is dynamic and, accordingly, the sequential flow is also dynamic. At any instant in time, there may be 0, 1 or more sequential streams. The pre-reading unit 255 performs pre-reading on the existing sequential stream.

By way of example, read-ahead unit 255 generates a read-ahead request (710) in response to a read command obtained from the host interface hitting a sequential stream or in response to identifying a new sequential stream (elements of the address set for which there is a recent IO command are upgraded to a sequential stream). The sequential stream detection unit 250 provides a read-ahead indication to the read-ahead unit 255 upon a read command acquired from the host interface hitting a sequential stream or recognizing a new sequential stream. Optionally, the sequential flow detection unit 250 further obtains a pre-read start address and a pre-read data size from the hit sequential flow descriptor or the newly upgraded sequential flow descriptor, and provides the pre-read unit 255 with the pre-read start address and the pre-read data size. The pre-read start address and the pre-read size recorded in the sequential stream descriptor are the start address and the pre-read size of the last pre-read operation performed on the sequential stream indicated by the sequential stream descriptor.

The read-ahead unit 255 acquires the statistical data from the cache management unit 260, and determines whether or not to perform a read-ahead operation according to the generated read-ahead request, based on the acquired statistical data (720). By way of example, the cache management unit 260 provides statistical data indicating the accuracy of the read ahead. The read-ahead unit 255 performs a read-ahead operation according to the read-ahead request when the acquired accuracy is greater than a specified threshold (730). Alternatively, the pre-reading unit 255 rejects the pre-reading operation according to the pre-reading request when the acquired pre-reading accuracy is not greater than the specified threshold (740). The accuracy of the read-ahead provided by cache management unit 260 indicates whether the read-ahead operation previously performed was valid, and whether the read-ahead data was fully utilized. The lack of precision of the read-ahead indicates that performing the read-ahead operation may be wasteful of resources of the storage device, while the high precision of the read-ahead indicates that performing the read-ahead operation is advantageous.

optionally, the statistical data provided by the cache management unit 260 indicates a hit rate of the cache units, a number of cache units occupied by the read-ahead data, and/or a proportion of the cache units occupied by the read-ahead data. The read-ahead unit 255 performs a read-ahead operation according to the read-ahead request when the hit rate of the cache unit is higher than a specified threshold, and rejects the read-ahead operation according to the read-ahead request when the hit rate of the cache unit is not high. Similarly, the read-ahead unit 255 performs the read-ahead operation according to the read-ahead request when the number/ratio of the buffer cells occupied by the read-ahead data is higher than a specified threshold, and rejects the read-ahead operation according to the read-ahead request when the number/ratio of the buffer cells occupied by the read-ahead data is not high. Further, the read-ahead unit 260 comprehensively considers various statistical data to determine whether to perform the read-ahead operation.

Alternatively or additionally, after the pre-reading unit 255 refuses to perform the pre-reading operation according to the pre-reading request (740), the statistical data from the cache management unit 260 continues to be acquired. Since the pre-read unit 255 rejects the pre-read operation (740), the statistical data such as the accuracy of the pre-read provided by the cache management unit 260 is gradually increased as time passes (because the subsequent read command may hit the rate pre-read data). In response to the new statistics being greater than the specified threshold (which may be the same or different threshold as used in synchronization step 720), the read-ahead unit 255 again performs a read-ahead operation according to the read-ahead request. And in response to the new statistics not being greater than the specified threshold (which may be the same or a different threshold as the threshold used in synchronization step 720), the read-ahead unit 255 still denies the read-ahead operation from the read-ahead request.

Referring back to FIG. 7, the read-ahead unit 255 also maintains virtual statistics. The virtual statistics include, for example, the accuracy of the virtual read-ahead. The exact read of the dummy read-ahead is indicated by, for example, a '/B ', where B ' represents the data theoretically read-ahead according to the read-ahead request, and a ' represents the amount of data hit by the real read command in the theoretically read-ahead data (B '). It will be appreciated that B' is less than the pre-read data B, since the pre-read request may be denied 740.

Optionally, the virtual statistics are provided by the cache management unit 260. To compute the virtual statistics, read-ahead unit 255 also provides the rejected read-ahead request to cache management unit 260. The cache management unit 260 maintains the dummy read-ahead data according to the rejected read-ahead request to know which dummy read-ahead data are hit by the read command.

With continued reference to fig. 7, after the pre-reading unit 255 rejects the pre-reading operation according to the pre-reading request (740), the virtual statistical data is continuously obtained. It is determined whether a read-ahead operation is to be performed according to the generated read-ahead request based on the dummy statistics (750). By way of example, the dummy statistics indicate the accuracy of the read-ahead. The read-ahead unit 255 performs a read-ahead operation according to the read-ahead request when the acquired virtual accuracy is greater than a specified threshold (760). Optionally, the pre-reading unit 255 rejects the pre-reading operation according to the pre-reading request when the acquired virtual pre-reading accuracy is not greater than the specified threshold (770).

by using the virtual statistics to indicate whether to perform the read-ahead operation, the problem of how to resume performing the read-ahead operation in time after refusing to perform the read-ahead operation in step 740 is solved.

FIG. 8 illustrates a schematic diagram of implementing read ahead according to an embodiment of the present application.

the read-ahead unit 255 acquires the sequential stream information provided by the sequential stream detection unit 250 and the statistical data provided by the buffer management unit 260, determines whether to perform a read-ahead operation and what read-ahead operation to perform, and generates a read-ahead command to provide to the back-end processing unit 270 to read data according to the read-ahead command.

The read-ahead unit 255 generates a read-ahead request based on the sequential stream information provided by the sequential stream detection unit 250 (810). For the generated read-ahead request, a read-ahead operation corresponding to the read-ahead request is performed according to the generated read-ahead request only if the statistical data for read-ahead currently provided by the cache management unit 260 satisfies a specified condition (830). For example, if the read-ahead request indicates that the data at address a is to be read ahead, and the accuracy data of the read-ahead provided by cache management unit 260 indicates that the accuracy of the current read-ahead is already too low, then read-ahead unit 260 discards the current read-ahead request (810) without performing the corresponding read-ahead operation.

Alternatively, the read-ahead unit 255 acquires the specified statistical data from the cache management unit 260 in response to receiving the read-ahead request. For the purpose of the mixed pre-read statistics, the buffer management unit 260 distinguishes whether it is from a read command or a pre-read command with respect to the data filled in the buffer unit.

The read-ahead unit 255 generates a read-ahead command for performing a read-ahead operation, and provides the read-ahead command to the back-end processing unit 270 to read data according to the read-ahead command.

FIG. 9 illustrates a schematic diagram of implementing a read ahead according to yet another embodiment of the present application.

The read-ahead unit 255 acquires the sequential stream information provided by the sequential stream detection unit 250 and the statistical data provided by the buffer management unit 260, determines whether to perform a read-ahead operation and what read-ahead operation to perform, and generates a read-ahead command to provide to the back-end processing unit 270 to read data according to the read-ahead command.

The read-ahead unit 255 generates a read-ahead request based on the sequential stream information provided by the sequential stream detection unit 250 (910). The sequential flow detection unit 250 may maintain multiple sequential flows simultaneously. By way of example, sequential stream detection unit 250 maintains 3 sequential streams (sequential stream 1, sequential stream 2, and sequential stream 3). The read-ahead request directly or indirectly indicates which sequential stream to perform the read-ahead. For example, the address of the sequential stream is indicated in the read-ahead request, and the read-ahead unit 255 identifies which sequential stream the read-ahead request indicates to read ahead according to the address. The pre-read unit 255 also maintains a pre-read start address and a pre-read data size for each sequential stream.

For the generated read-ahead request, a read-ahead operation corresponding to the read-ahead request is performed according to the generated read-ahead request only if the statistical data for read-ahead currently provided by the cache management unit 260 satisfies a specified condition (930). For example, the read-ahead request indicates that read-ahead is to be performed on the sequential stream 1, and the read-ahead unit 255 acquires the accuracy of the read-ahead that has been performed on the sequential stream 1 from the cache management unit 260. When the accuracy of the pre-reading already made to sequential stream 1 meets a specified condition (e.g., above a specified threshold) (920), a pre-reading operation to sequential stream 1 is performed (930), and a pre-reading command is generated from the pre-reading request and provided to the back-end processing unit (270). If the accuracy of the read-ahead that has been made for sequential stream 1 does not meet a specified condition (e.g., is below a specified threshold) (920), then the read-ahead operation is denied for sequential stream 1 (940).

In an alternative embodiment, after the storage device is started, since there is no read-ahead data, the accuracy of the read-ahead provided by the cache management unit 260 is 0. Read-ahead unit 255 also maintains virtual statistics about the read-ahead (950). For example, in response to the get read-ahead request indicating that a read-ahead operation is to be performed on sequential stream 2, the read-ahead data for sequential stream 2 is obtained assuming that the read-ahead operation for sequential stream 2 is performed, and the hit of the subsequent read command on the read-ahead data for the assumed sequential stream 2 is recorded to obtain the virtual read-ahead accuracy. By way of example, the virtual read-ahead accuracy is the amount of read-ahead data of the hypothetical sequential stream 2 hit by the read command divided by the amount of read-ahead data of the hypothetical sequential stream 2. So that the virtual read-ahead accuracy is not affected by operation 920. After a while, the virtual read-ahead accuracy may satisfy the specified condition (960) (at this time, the read-ahead accuracy provided by the cache management unit 260 may not satisfy the specified condition (920) because the actual read-ahead operation is not performed), so that the read-ahead unit 255 performs the read-ahead operation according to the read-ahead request (935), generates the read-ahead command, and provides the read-ahead command to the back-end processing unit 270.

As yet another example, after operation 920 rejects performing the read-ahead operation (940) because the accuracy of the read-ahead for, e.g., sequential stream 3 does not satisfy the specified condition, if the virtual statistics (950) maintained by the read-ahead unit 255 for the read-ahead of sequential stream 3 satisfies the specified condition (960), the read-ahead operation is also performed on sequential stream 3 according to the read-ahead request (935), a read-ahead command is generated, and provided to the back-end processing unit 270.

And optionally, avoiding generating the same read-ahead command in operations 930 and 935.

FIG. 10 illustrates a schematic diagram of implementing a read-ahead according to yet another embodiment of the present application.

The read-ahead unit 255 acquires the sequential stream information provided by the sequential stream detection unit 250 and the statistical data provided by the buffer management unit 260, determines whether to perform a read-ahead operation and what read-ahead operation to perform, and generates a read-ahead command to provide to the back-end processing unit 270 to read data according to the read-ahead command.

The read-ahead unit 255 generates a read-ahead request based on the sequential flow information provided by the sequential flow detection unit 250 (1010). By way of example, sequential stream detection unit 250 maintains 3 sequential streams (sequential stream 1, sequential stream 2, and sequential stream 3).

For the generated read-ahead request, the read-ahead operation corresponding to the read-ahead request is performed according to the generated read-ahead request only if the statistical data for read-ahead currently provided by the cache management unit 260 satisfies a specified condition. For example, the read-ahead request indicates that read-ahead is to be performed on the sequential stream 1, and the read-ahead unit 255 acquires the accuracy of the read-ahead that has been performed on the sequential stream 1 from the cache management unit 260. When the accuracy of the read-ahead that has been made for sequential stream 1 meets a specified condition (e.g., above a specified threshold) (1020), a read-ahead operation for sequential stream 1 is performed (1030), a read-ahead command is generated from the read-ahead request and provided to the back-end processing unit (270). If the accuracy of the read-ahead that has been made for sequential stream 1 does not meet a specified condition (e.g., is below a specified threshold) (1020), then the read-ahead operation is denied for sequential stream 1 (1040).

According to the embodiment illustrated in fig. 10, it is also determined whether or not to perform a read ahead according to the amount of data of the read ahead. The amount of data to be read ahead may be obtained by counting the read ahead operations performed in a specified period of time by the read ahead unit 255. The currently cached read-ahead data may also be provided by the cache management unit 260. Since the cache management unit 260 may perform replacement on the cache unit as needed, the read-ahead amount of the current cache provided by the cache management unit 260 may be the amount of data counted by the read-ahead unit 266. It is desirable to maintain the amount of read-ahead data buffered at a level that balances the use of resources (buffers, bandwidth, etc.) with the reduced read latency associated with read-ahead.

According to one embodiment, at operation 1020, if the accuracy of the pre-reads already made to sequential stream 1 does not meet a specified condition, a further determination is made as to whether the amount of data currently pre-read is below a threshold (1025). If the amount of data currently read ahead is below the threshold, then a read ahead operation for sequential stream 1 is performed (1030) to increase the amount of data currently read ahead. If the amount of data currently read ahead is not less than the threshold, then the read ahead operation is denied for sequential stream 1 (1040). Optionally, a read-ahead data amount threshold is provided for each identified sequential stream, such that it is determined for each sequential stream whether a read-ahead operation is performed, so that the current read-ahead data amount of each data stream can be maintained at a certain level.

According to the embodiment of fig. 10, even in the initialization stage of the memory device without the read-ahead data, although the read-ahead statistical data does not satisfy the condition in operation 1020, the read-ahead operation is performed by the judgment based on the amount of the read-ahead data in operation 1025.

Embodiments of the present application also provide a program comprising program code which, when loaded into a host computer and executed thereon, causes the processor of the host computer to perform one of the methods provided above in accordance with embodiments of the present application.

It will be understood that each block of the block diagrams and flowchart illustrations, and combinations of blocks in the block diagrams and flowchart illustrations, respectively, can be implemented by various means including computer program instructions. These computer program instructions may be loaded onto a general purpose computer, special purpose computer, or other programmable data control apparatus to produce a machine, such that the instructions which execute on the computer or other programmable data control apparatus create means for implementing the functions specified in the flowchart block or blocks.

these computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data control apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including computer-readable instructions for implementing the function specified in the flowchart block or blocks. The computer program instructions may also be loaded onto a computer or other programmable data control apparatus to cause a series of operational operations to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide operations for implementing the functions specified in the flowchart block or blocks.

Accordingly, blocks of the block diagrams and flowchart illustrations support combinations of means for performing the specified functions, combinations of operations for performing the specified functions and program instruction means for performing the specified functions. It will also be understood that each block of the block diagrams and flowchart illustrations, and combinations of blocks in the block diagrams and flowchart illustrations, can be implemented by special purpose hardware-based computer systems that perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.

Although the present invention has been described with reference to examples, which are intended to be illustrative only and not to be limiting of the application, changes, additions and/or deletions may be made to the embodiments without departing from the scope of the application.

Many modifications and other embodiments of the application set forth herein will come to mind to one skilled in the art to which these embodiments pertain having the benefit of the teachings presented in the foregoing descriptions and the associated drawings. Therefore, it is to be understood that the application is not to be limited to the specific embodiments disclosed and that modifications and other embodiments are intended to be included within the scope of the appended claims. Although specific terms are employed herein, they are used in a generic and descriptive sense only and not for purposes of limitation.

20页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:存储设备组及包括存储设备组的存储系统

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类