A processing method and device based on storage control card
By determining the data hit situation in the storage control card and using an independent path for transmission, the problem of complexity and delay in the data reading process in the case of partial hits in the storage control card is solved, and a more efficient data reading process is achieved.
Patent Information
- Application Number
- CN202410766378.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-14
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2044-06-14
AI Technical Summary
In the case of partial hits in the existing storage control card, the data reading process is complicated, which increases the IO response delay and the occupation of local storage bandwidth.
By receiving the data read command issued by the host, it determines the hit status of the data in the power-off protection area, and uses independent paths to transmit the data from the storage control card and the storage device to the host based on the attribute information and the hit status, simplifying the data The reading process reduces IO response delay and storage bandwidth usage.
Optimized the cache processing of the storage control card in the case of partial hits, simplified the overall process, and reduced the IO response delay and the occupation of local storage bandwidth.
Smart Images

Figure CN118331512B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of storage technology, and in particular to a processing method and device based on a storage control card. Background Art
[0002] At present, the data cache in the storage control card (RAID) is driven by the host write operation, that is, in the write back mode, the storage control card will first temporarily store the data in the power-off protection area (i.e., data cache) in the storage control card, and then immediately respond to the host write IO (Input Output) operation completion. In the background tasks of the storage control card, there is usually a task responsible for flushing the data in the data cache to the disk, generally called de-caching. The de-caching task is asynchronously separated from the foreground host IO reading and writing.
[0003] Due to the data cache settings and de-caching tasks in the storage control card, each host read IO needs to search the content in the data cache first. The search results are divided into three cases:
[0004] 1. Cache Miss: When the data requested by the host does not exist in the data cache at all, this is called a cache miss, and the data can all be read directly from the storage device.
[0005] 2. Cache Hit: When the data requested by the host is completely present in the data cache, this is called a cache hit. The data can be read directly from the cache without accessing the storage device.
[0006] 3. Partial Cache Hit: When only part of the data requested by the host exists in the data cache, and the other part needs to be read from the storage device, in this case, the storage system needs to perform some additional operations to satisfy the host's complete data request.
[0007] For partial hits, the related technology requires first reading the missed data from the storage device into the data cache in the storage control card, merging it with the data in the data cache, and then responding to the host. However, this method has a complicated overall process and increases the IO response delay and the occupancy of the local storage bandwidth. Summary of the invention
[0008] In view of the above problems, a processing method and device based on a storage control card is proposed to overcome the above problems or at least partially solve the above problems, including:
[0009] A processing method based on a storage control card, wherein the storage control card is connected to a host and a storage device, and the storage control card is provided with a power-off protection area, the method comprising:
[0010] Receiving a data read command sent by the host;
[0011] In a case where only part of the data requested by the data read command is stored in the power-off protected area, determining attribute information of the data requested by the data read command and a data hit condition of the data requested by the data read command in the power-off protected area;
[0012] Based on the attribute information and the data hit situation, a target data transmission strategy adapted to the data read command is determined, and based on the target data transmission strategy, the data requested by the data read command is transmitted from the power-off protected area and the storage device to the host via independent paths respectively, in response to the data read command.
[0013] Optionally, the transmitting the data requested by the data read command from the power-off protected area and the storage device to the host using independent paths according to the target data transmission strategy includes:
[0014] When the target data transmission strategy is the first data transmission strategy, the complete data requested by the data read command in the storage device is transmitted to the host, and the partial data hit by the data read command in the power-off protected area is transmitted to the host, so that the hit partial data is used to cover the corresponding part of the complete data.
[0015] Optionally, the transmitting the data requested by the data read command from the power-off protected area and the storage device to the host using independent paths according to the target data transmission strategy includes:
[0016] When the target data transmission strategy is the second data transmission strategy, part of the data hit by the data read command in the power-off protected area is transmitted to the host, and other data requested by the data read command in the storage device is transmitted to the host.
[0017] Optionally, the transmitting the complete data requested by the data read command in the storage device to the host, and transmitting the partial data hit by the data read command in the power-off protected area to the host, so as to use the hit partial data to cover the corresponding part of the complete data, includes:
[0018] Perform a cache line query in the storage control card according to the data read command, obtain a relevant cache line hit by the data read command, and store a first page table pointer of the relevant cache line in a first data list; wherein the first page table pointer is a page table pointer for a power-off protected area in the storage control card;
[0019] Converting a first page table pointer in the first data list into a second page table pointer, and storing the second page table pointer in the second data list; wherein the second page table pointer is a page table pointer for a complete storage area in the storage control card, the complete storage area includes a power-off protected area and a non-power-off protected area, and the second page table pointer has a flag bit, and the flag bit is used to indicate whether a data page table of the second page table pointer is hit;
[0020] Reading a host data address of a target storage area in the host, and storing the host data address in a third data list;
[0021] Converting the host data address in the third data list into the storage control card data address in the storage control card through a pre-established address mapping table, and storing the storage control card data address in the fourth data list;
[0022] Using the storage control card data address in the fourth data list, the complete data requested by the data read command in the storage device is transferred to the target storage area in the host;
[0023] The data page table that hits the second page table pointer in the second data list in the storage control card is transmitted to the target storage area of the host and covers the corresponding part of the complete data; wherein, the hit second page table pointer is a second page table pointer whose flag bit indicates that the data page table is hit.
[0024] Optionally, transmitting part of the data hit by the data read command in the power-off protected area to the host, and transmitting other data requested by the data read command in the storage device to the host, comprises:
[0025] Perform a cache line query in the storage control card according to the data read command, obtain a relevant cache line hit by the data read command, and store a first page table pointer of the relevant cache line in a first data list; wherein the first page table pointer is a page table pointer for a power-off protected area in the storage control card;
[0026] Converting a first page table pointer in the first data list into a second page table pointer, and storing the second page table pointer in the second data list; wherein the second page table pointer is a page table pointer for a complete storage area in the storage control card, the complete storage area includes a power-off protected area and a non-power-off protected area, and the second page table pointer has a flag bit, and the flag bit is used to indicate whether a data page table of the second page table pointer is hit;
[0027] Reading a host data address of a target storage area in the host, and storing the host data address in a third data list;
[0028] Converting the host data address in the third data list into the storage control card data address in the storage control card through a pre-established address mapping table, and storing the storage control card data address in the fourth data list;
[0029] Using the storage control card data address in the fourth data list, the data page table that does not hit the second page table pointer in the second data list in the storage device is transmitted to the target storage area in the host; wherein the second page table pointer that does not hit is a second page table pointer whose flag bit indicates that the data page table is not hit;
[0030] The data page table that hits the second page table pointer in the second data list in the storage control card is transmitted to the target storage area of the host; wherein the hitting second page table pointer is a second page table pointer whose flag bit indicates that the data page table is hit.
[0031] Optionally, the steps of transferring the data page table of the second page table pointer in the second data list in the storage control card to the target storage area of the host and using the storage control card data address in the fourth data list to transfer the data page table that does not hit the second page table pointer in the second data list in the storage device to the target storage area in the host are performed in parallel.
[0032] Optionally, the data read command includes a logical volume identifier, a starting logical block address, and a data size;
[0033] The querying of cache lines in the storage control card according to the data read command to obtain relevant cache lines hit by the data read command comprises:
[0034] A cache line query is performed in the storage control card according to the logical volume identifier, the starting logical block address, and the data size in the data read command to obtain a related cache line hit by the data read command.
[0035] Optionally, after performing a cache line query in the storage control card according to the data read command to obtain a relevant cache line hit by the data read command, the method further includes:
[0036] locking the relevant cache line;
[0037] After the data page table of the second page table pointer in the second data list in the storage control card is transmitted to the target storage area of the host, the method further includes:
[0038] The associated cache line is unlocked.
[0039] Optionally, after performing a cache line query in the storage control card according to the data read command to obtain a relevant cache line hit by the data read command, the method further includes:
[0040] Locking the relevant stripe covered by the data read command;
[0041] After the data page table of the second page table pointer in the second data list in the storage control card is transmitted to the target storage area of the host, the method further includes:
[0042] The associated stripe covered by the data read command is unlocked.
[0043] Optionally, before converting the first page table pointer in the first data list into a second page table pointer and storing the second page table pointer in the second data list, the method further includes:
[0044] In the storage control card, three data list entries are applied to store the second data list, the third data list, and the fourth data list;
[0045] After the data page table of the second page table pointer in the second data list in the storage control card is transmitted to the target storage area of the host, the method further includes:
[0046] The second data list, the third data list, and the fourth data list are recovered.
[0047] Optionally, converting the first page table pointer in the first data list into a second page table pointer includes:
[0048] Convert each of the first page table pointers in the first data list into a plurality of second page table pointers;
[0049] According to a hit condition of the data page table of the second page table pointer, a flag bit of the second page table pointer is set.
[0050] Optionally, the first page table pointer points to a cache line with a first data size as a granularity, and the second page table pointer points to a cache line with a second data size as a granularity, and the first data size is larger than the second data size.
[0051] Optionally, the adopting the storage control card data address in the fourth data list to transmit the complete data requested by the data read command in the storage device to the target storage area in the host includes:
[0052] The storage control card data address in the fourth data list is used to send the data read command request to the storage device, so that the storage device transmits the complete data of the data read command request to the storage control card data address, and directly transmits it to the target storage area in the host via the routing function of the storage control card.
[0053] Optionally, the adopting the storage control card data address in the fourth data list to transmit the data page table that does not hit the second page table pointer in the second data list in the storage device to the target storage area in the host includes:
[0054] The storage control card data address in the fourth data list is used to send the data read command request to the storage device, so that the storage device transfers the data page table that does not hit the second page table pointer in the second data list to the storage control card data address, and directly transfers it to the target storage area in the host via the routing function of the storage control card.
[0055] Optionally, the attribute information includes data size, the data hit condition includes a hit data ratio, and determining a target data transmission strategy adapted to the data read command according to the attribute information and the data hit condition includes:
[0056] Determining data size from the attribute information;
[0057] Determine the hit data ratio from the data hit situation;
[0058] According to the data size and the hit data ratio, a target data transmission strategy adapted to the data read command is determined from the first data transmission strategy and the second data transmission strategy.
[0059] Optionally, determining, according to the data size and the hit data ratio, a target data transmission strategy adapted to the data read command from the first data transmission strategy and the second data transmission strategy includes:
[0060] Determine whether the data size is greater than a data size threshold;
[0061] Determine whether the hit data ratio is less than a ratio threshold;
[0062] In a case where the data size is greater than a data size threshold and the hit data ratio is less than a ratio threshold, determining that the target data transmission strategy adapted to the data read command is a first data transmission strategy;
[0063] When the data size is less than or equal to the data size threshold or the hit data ratio is greater than or equal to the ratio threshold, it is determined that the target data transmission strategy adapted to the data read command is the second data transmission strategy.
[0064] A processing device based on a storage control card, wherein the storage control card is connected to a host and a storage device, and the storage control card is provided with a power-off protection area, and the device comprises:
[0065] A data reading command receiving module, used for receiving a data reading command sent by the host;
[0066] an information determination module, configured to determine, when only part of the data requested by the data read command is stored in the power-off protected area, attribute information of the data requested by the data read command and a data hit condition of the data requested by the data read command in the power-off protected area;
[0067] A strategy selection and execution module is used to determine a target data transmission strategy adapted to the data read command based on the attribute information and the data hit situation, and according to the target data transmission strategy, transmit the data requested by the data read command from the power-off protected area and the storage device to the host using independent paths respectively, in response to the data read command.
[0068] An electronic device comprises a processor, a memory and a computer program stored in the memory and capable of running on the processor, wherein the computer program implements the method described above when executed by the processor.
[0069] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described above is implemented.
[0070] A computer program product comprises a computer program, wherein when the computer program is executed by a processor, the computer program implements the method as described above.
[0071] The embodiments of the present invention have the following advantages:
[0072] In an embodiment of the present invention, by receiving a data read command issued by the host, when the data requested by the data read command is only partially stored in the power-off protected area, the attribute information of the data requested by the data read command and the data hit situation of the data requested by the data read command in the power-off protected area are determined, and according to the attribute information and the data hit situation, a target data transmission strategy adapted to the data read command is determined, and according to the target data transmission strategy, the data requested by the data read command is transmitted from the power-off protected area and the storage device to the host respectively through independent paths to respond to the data read command, thereby optimizing the processing of the cache situation in the partial hit storage control card, simplifying the overall process, and reducing the IO response delay and the occupancy of the local storage bandwidth. BRIEF DESCRIPTION OF THE DRAWINGS
[0073] In order to more clearly illustrate the technical solution of the present invention, the accompanying drawings required for use in the description of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.
[0074] Figure 1a is a schematic diagram of a system architecture provided by some embodiments of the present invention;
[0075] Figure 1b is a schematic diagram of a system architecture provided by some embodiments of the present invention;
[0076] Figure 1c is a schematic diagram of a system architecture provided by some embodiments of the present invention;
[0077] Figure 2 is a flowchart of a processing method based on a storage control card provided by some embodiments of the present invention;
[0078] Figure 3a is a schematic diagram of a storage space provided by some embodiments of the present invention;
[0079] Figure 3b is a schematic diagram of a data page list provided by some embodiments of the present invention;
[0080] Figure 4a is a flowchart of another processing method based on a storage control card provided by some embodiments of the present invention;
[0081] Figure 4b is a schematic diagram of a page table conversion provided by some embodiments of the present invention;
[0082] Figure 4cis a schematic diagram of another page table conversion provided by some embodiments of the present invention;
[0083] Figure 5a is a flowchart of another processing method based on a storage control card provided by some embodiments of the present invention;
[0084] Figure 5b is a schematic diagram of IO segmentation provided by some embodiments of the present invention;
[0085] Figure 6 is a structural block diagram of a processing device based on a storage control card provided by some embodiments of the present invention;
[0086] Figure 7 is a structural block diagram of an electronic device provided by some embodiments of the present invention;
[0087] Figure 8 is a structural block diagram of a storage medium provided by some embodiments of the present invention;
[0088] Fig. 9 It is a structural block diagram of a program product provided by some embodiments of the present invention. DETAILED DESCRIPTION
[0089] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0090] like Figure 1a The data cache in the storage control card is driven by the host write operation, that is, in write-back mode, the storage control card will first temporarily store the data in the power-off protection area (i.e., data cache) in the storage control card, and then immediately respond to the host write IO operation completion. In the background tasks of the storage control card, there is usually a task responsible for flushing the data in the data cache to the disk, which is generally called decaching. The decaching task is asynchronously separated from the foreground host IO reading and writing.
[0091] Due to the data cache settings and de-caching tasks in the storage control card, each host read IO needs to search the content in the data cache first. The search results are divided into three cases:
[0092] 1. Cache Miss: When the data requested by the host does not exist in the data cache at all, this is called a cache miss, and the data can all be read directly from the storage device.
[0093] 2. Cache Hit: When the data requested by the host is completely present in the data cache, this is called a cache hit. The data can be read directly from the cache without accessing the storage device.
[0094] 3. Partial Cache Hit: When only part of the data requested by the host exists in the data cache, and the other part needs to be read from the storage device, in this case, the storage system needs to perform some additional operations to satisfy the host's complete data request.
[0095] For partial hits, such as Figure 1b In the related technology, it is necessary to first read the missed data from the storage device into the data cache in the storage control card, merge it with the data in the data cache, and then respond to the host. The specific operation steps are as follows:
[0096] 1. Read missing data from the storage device: For the missing data in the cache, the system will initiate a read operation on the storage device.
[0097] 2. Merge data: Once the missing data is read from the storage device, the system needs to merge the data in the cache with the newly read data to form a complete data set.
[0098] 3. Update cache status: After merging the data, the system will update the cache status, including marking the data as read.
[0099] 4. Send response to host: Finally, the system sends the complete data set to the host, completing the read request.
[0100] In this case, the missed data needs to be read from the storage device into the local data cache first, and then merged with the data in the cache before responding to the host. The overall process is complicated and increases the IO response delay and the occupation of the local storage bandwidth. The details are as follows:
[0101] 1. There are many boundary scenarios that need to be covered, such as cache space or cache line slot resource exhaustion, which requires conflict resolution, and the overall process is complicated;
[0102] 2. The operation of disk reading and responding to the host needs to be completed serially, which increases the delay of IO response.
[0103] 3. The data of the storage device needs to be cached to the local storage first, which increases the usage of the local storage bandwidth and affects the overall performance of the system.
[0104] In the embodiment of the present invention, two possible solutions are proposed for the problem that the read IO part hits the data cache, such as Figure 1c The core difference from the above solution is that the hit and miss data are not spliced in the storage controller card cache, but go through independent paths from the data cache in the storage controller card and the hard disk in the storage device to the DDR (Double Data Rate Synchronous Dynamic Random Access Memory) in the host. Depending on the type of hard disk, the data DMA (Direct Memory Access) controller may exist inside the storage controller card or on the storage device side.
[0105] The first data transmission strategy: first read the complete IO data from the storage device to the host side DDR according to the miss processing method, then overwrite the hit part of the data in the data cache and write it to the corresponding storage space on the host side for update, and finally respond to the host to complete the read IO. The first data transmission strategy is relatively simple to implement, but it will waste the host PCIe (Peripheral Component Interconnect Express, a high-speed serial computer expansion bus standard) uplink bandwidth to a certain extent. Specifically, the hit part of the data will be uploaded twice, so it is suitable for scenarios where only a small part of the request is hit in a large read IO.
[0106] The second data transmission strategy: After querying the cache, two parallel tasks are triggered at the same time. One is to transfer the hit data in the data cache to the corresponding address of the host DDR, and the other is to directly send a read IO from the storage device to the host DDR for the missed data. Both are performed at the same time. After both are completed, the host read IO is responded to as completed. The second data transmission strategy is complex to implement, but compared with the first data transmission strategy, it can significantly reduce IO latency and will not occupy additional host PCIe uplink bandwidth.
[0107] The present invention is further described below:
[0108] Reference Figure 2 , shows a flowchart of a method for processing based on a storage control card provided by some embodiments of the present invention, wherein the storage control card is connected to a host and a storage device, and the storage control card is provided with a power-off protection area, and specifically may include the following steps:
[0109] Step 201, receiving a data read command sent by the host.
[0110] In actual applications, the host can send a data read command, namely, read IO, to the storage control card.
[0111] Step 202: when the data requested by the data read command is only partially stored in the power-off protected area, determine the attribute information of the data requested by the data read command and the data hit status of the data requested by the data read command in the power-off protected area.
[0112] Among them, the area protected by power failure is the data cache.
[0113] Step 203, based on the attribute information and the data hit situation, determine a target data transmission strategy adapted to the data read command, and based on the target data transmission strategy, transmit the data requested by the data read command from the power-off protected area and the storage device to the host via independent paths respectively, in response to the data read command.
[0114] The independent paths may refer to two paths: one for transmitting from the power-off protected area to the host and the other for transmitting from the storage device to the host, without splicing in the storage control card cache.
[0115] In some embodiments of the present invention, the attribute information includes data size, the data hit status includes a hit data ratio, and determining a target data transmission strategy adapted to the data read command based on the attribute information and the data hit status includes: determining the data size from the attribute information; determining the hit data ratio from the data hit status; and determining, based on the data size and the hit data ratio, a target data transmission strategy adapted to the data read command from a first data transmission strategy and a second data transmission strategy.
[0116] In some embodiments of the present invention, determining a target data transmission strategy adapted to the data read command from a first data transmission strategy and a second data transmission strategy based on the data size and the hit data ratio includes: judging whether the data size is greater than a data size threshold; judging whether the hit data ratio is less than a ratio threshold; when the data size is greater than the data size threshold and the hit data ratio is less than the ratio threshold, determining that the target data transmission strategy adapted to the data read command is the first data transmission strategy; when the data size is less than or equal to the data size threshold or the hit data ratio is greater than or equal to the ratio threshold, determining that the target data transmission strategy adapted to the data read command is the second data transmission strategy.
[0117] Among them, the first data transmission strategy: first read the complete IO data from the storage device to the host side DDR according to the miss processing method, and then overwrite the hit part of the data in the data cache and write it to the corresponding storage space on the host side for update, and finally respond to the host to complete the read IO. The first data transmission strategy is relatively simple to implement, but it will waste the host PCIe uplink bandwidth to a certain extent.
[0118] The second data transmission strategy: After querying the cache, two parallel tasks are triggered at the same time. One is to transfer the hit data in the data cache to the corresponding address of the host DDR, and the other is to directly issue a read IO from the storage device to the host DDR for the missed data. Both are carried out at the same time, and the host read IO is responded to as completed after both are completed.
[0119] In the first data transmission strategy, the hit part of the data will be uploaded twice, so it is suitable for the scenario where only a small part of the request is hit in a large read IO. The second data transmission strategy is complex to implement, but compared with the first data transmission strategy, it can significantly reduce the IO latency without occupying additional host PCIe uplink bandwidth.
[0120] Based on this, it can be determined whether the data size requested by the data read command is greater than the data size threshold, and then whether it is a large read IO, and whether the hit data ratio is less than the ratio threshold, and then whether only a small part is hit.
[0121] When the data size is greater than the data size threshold and the hit data ratio is less than the ratio threshold, the target data transmission strategy is determined to be the first data transmission strategy, that is, only a small part of the request is hit in a large read IO scenario; when the data size is less than or equal to the data size threshold or the hit data ratio is greater than or equal to the ratio threshold, the target data transmission strategy is determined to be the second data transmission strategy.
[0122] In some examples, a target data transmission strategy can also be selected based on other content, and different methods can be used to transfer the data requested by the data read command from the data cache and the storage device to the storage space in the host using independent paths, such as based on the type and scale of the data requested by the data read command. If the data type is key-value pair storage, the first data transmission strategy is used.
[0123] In some embodiments of the present invention, the data requested by the data read command is transmitted from the power-off protected area and the storage device to the host using independent paths according to the target data transmission strategy, including: when the target data transmission strategy is a first data transmission strategy, the complete data requested by the data read command in the storage device is transmitted to the host, and the partial data hit by the data read command in the power-off protected area is transmitted to the host, so as to cover the corresponding part of the complete data with the hit partial data.
[0124] Before introducing the first data transmission strategy and the second data transmission strategy in detail, it should be noted that: the data storage space address is first agreed upon as follows: the host manages the host-side storage space with a granularity of 4KB, and the host data address used when issuing IO is collectively referred to as HPRP4 (Host-Physical Region Page-4KB, host-physical region page-4KB), and the address width of HPRP4 is 64 bits; the storage control card also manages the storage space on the storage control card side with a granularity of 4KB, and the storage control card data address used when issuing IO to the disk is collectively referred to as CPRP4 (Client-Physical Region Page-4KB, client-physical region page-4KB, and the address width of CPRP4 is 64 bits.
[0125] To improve efficiency, the various software and hardware engines inside the storage control card manage and use data pages through 32-bit address pointers when processing data. Figure 3a One type is the management of the power-off protected storage area, which is managed with a granularity of 32KB as a cache line, and the address pointer is defined as LPRP32 (Local-Physical Region Page-32KB), which is the first page table pointer in the following text. The other type is the address pointer definition for the data storage area in the entire storage control card, including power-off protected and non-power-off protected areas, which are managed with a granularity of 4KB, and the address pointer is defined as LPRP4 (Local-Physical Region Page-4KB), which is the second page table pointer in the following text. In addition, the fast IO path needs to open up the address space of the host and the storage card, and can directly route interactive data between the host DDR and the hard disk. It is necessary to map the HPRP4 address to the unique corresponding CPRP4 address according to certain rules, that is, the fast path remapping area.
[0126] For the convenience of management, when the storage control chip serves each host IO, all operation steps are centrally defined in a "control page" data structure, which contains all the control information for processing the IO step by step, including the data pointer (64-bit storage control card absolute address) storage area pointing to the specific IO data page. Figure 3b , four data lists are used, namely:
[0127] The first data list CLM_List is used to store cache line query results. Its address points to a local 4KB data page, and several LPRP32 cache line page table pointers are stored in sequence.
[0128] The second data list Ref_CLM_List is used to store the page table pointer result of converting LPRP32 in the above CLM_List to LPRP4. The LPPR4 page table pointer corresponding to the hit 4KB page is expressed as "valid (valid: the highest bit of the LPRP4 pointer is expressed as "1")", and the LPPR4 page table pointer corresponding to the missed 4KB page is expressed as "invalid (invalid: the highest bit of the LPRP4 pointer is expressed as "0")".
[0129] The third data list HOST_List is used to store the host data page table pointer HPRP4, which is also the storage location required by the read IO to store the read data.
[0130] The fourth data list Remap_List: The HPRP4 pointers in the above HOST_List are translated one by one into the local storage space CPRP4 pointers for use when sending IO to the disk side. The DMA in the storage control chip or the DMA on the disk side will write the corresponding data into the above CPRP4 virtual address, and finally route it to the data page pointed to by the corresponding HRPR4 address on the host side through the PCIe EP interface of the storage card control chip.
[0131] The first data transmission strategy is introduced in detail below:
[0132] In some embodiments of the present invention, the transmitting of the complete data requested by the data read command in the storage device to the host, and transmitting the partial data hit by the data read command in the power-off protected area to the host, so as to use the hit partial data to cover the corresponding part of the complete data, includes:
[0133] Sub-step 11, performing a cache line query in the storage control card according to the data read command, obtaining a relevant cache line hit by the data read command, and storing a first page table pointer of the relevant cache line in a first data list; wherein the first page table pointer is a page table pointer for a power-off protected area in the storage control card;
[0134] In some embodiments of the present invention, the data read command includes a logical volume identifier, a starting logical block address, and a data size; performing a cache line query in the storage control card according to the data read command to obtain the relevant cache line hit by the data read command includes: performing a cache line query in the storage control card according to the logical volume identifier, the starting logical block address, and the data size in the data read command to obtain the relevant cache line hit by the data read command.
[0135] In actual applications, the host sends a read IO (data read command) to the storage control card, carrying information such as NS (NameSpace, logical volume identifier), SLBA (Starting Logical Block Address, starting logical block address), IO size and HPRP4 list.
[0136] After receiving the IO request, the storage control card performs a cache line query based on the NS, SLBA, IO size and other information of the IO command. If a hit occurs (including a partial hit), all related cache lines are locked and the queried cache lines are merged into an LPRP32 data page list: CLM_List, which is the first data list.
[0137] Sub-step 12, converting the first page table pointer in the first data list into a second page table pointer, and storing the second page table pointer in the second data list; wherein the second page table pointer is a page table pointer for a complete storage area in the storage control card, the complete storage area includes a power-off protected area and a non-power-off protected area, and the second page table pointer has a flag bit, and the flag bit is used to indicate whether the data page table of the second page table pointer is hit;
[0138] In some embodiments of the present invention, converting the first page table pointer in the first data list into a second page table pointer includes: converting each of the first page table pointers in the first data list into multiple second page table pointers; and setting a flag bit of the second page table pointer according to a hit condition of the data page table of the second page table pointer.
[0139] In some embodiments of the present invention, the first page table pointer points to a cache line with a first data size as a granularity, and the second page table pointer points to a cache line with a second data size as a granularity, and the first data size is larger than the second data size.
[0140] In actual applications, the data page table pointer conversion module converts CLM_List (i.e., the second data list) into Ref_CLM_List (i.e., the third data list): each LPPR32 page table pointer (i.e., the first page table pointer) is sequentially converted into 8 LPRP4 page table pointers (i.e., the second page table pointer). The highest bit (i.e., the flag bit) of each LPRP4 indicates whether the data page table is valid. Its source is the cache hit information in LPPR32 (8 bits, each bit corresponds to a 4KB data page), from low to high, corresponding to LPRP4 page table pointers 0 to 7. Figure 4b This is an example of converting LPRP32 to LPRP4.
[0141] Sub-step 13, reading the host data address of the target storage area in the host, and storing the host data address in a third data list;
[0142] In actual applications, the HPRP4 list (ie, the host data address of the target storage area in the host) is read from the host through the host data DMA module and stored in the HOST_List (ie, the third data list).
[0143] Sub-step 14, converting the host data address in the third data list into the storage control card data address in the storage control card through a pre-established address mapping table, and storing the storage control card data address in the fourth data list;
[0144] In actual application, the data page table pointer conversion module converts HOST_List (i.e., the third data list) into Remap_List (i.e., the fourth data list): search the address mapping table and convert HPRP4 into the corresponding CPRP4 address in sequence. Figure 4c This is an example of the conversion of HPRP4 to CPRP4.
[0145] Sub-step 15, using the storage control card data address in the fourth data list, transferring the complete data requested by the data read command in the storage device to the target storage area in the host;
[0146] In some embodiments of the present invention, the use of the storage control card data address in the fourth data list to transfer the complete data of the data read command request in the storage device to the target storage area in the host includes: using the storage control card data address in the fourth data list to send the data read command request to the storage device, so that the storage device transfers the complete data of the data read command request to the storage control card data address, and directly transfers it to the target storage area in the host via the routing function of the storage control card.
[0147] In actual applications, if multiple disks need to be accessed, the IO acceleration module is used to concurrently issue read IO instructions to the disks using Remap_List (the fourth data list), and all host read IO data is first transferred to the host storage space.
[0148] Sub-step 16, transfers the data page table that hits the second page table pointer in the second data list in the storage control card to the target storage area of the host, and covers the corresponding part of the complete data; wherein, the hit second page table pointer is a flag bit indicating the second page table pointer that the data page table is hit.
[0149] In actual applications, through the host data DMA module, all "valid (cache hit)" 4KB data pages (i.e., the data page table that hits the second page table pointer) in the Ref_CLM_List list (i.e., the second data list) are transferred to the host storage space at the equivalent position in the HOST_List, covering the corresponding part of the complete data.
[0150] In some embodiments of the present invention, after performing a cache line query in the storage control card according to the data read command to obtain a relevant cache line hit by the data read command, the method further includes:
[0151] locking the relevant cache line;
[0152] After the data page table of the second page table pointer in the second data list in the storage control card is transmitted to the target storage area of the host, the method further includes:
[0153] The associated cache line is unlocked.
[0154] In actual applications, the cache management module locks and unlocks the CL, and allows write updates to the corresponding CL again after unlocking, thereby ensuring data stability during data reading.
[0155] In some embodiments of the present invention, after performing a cache line query in the storage control card according to the data read command to obtain a relevant cache line hit by the data read command, the method further includes:
[0156] Locking the relevant stripe covered by the data read command;
[0157] After the data page table of the second page table pointer in the second data list in the storage control card is transmitted to the target storage area of the host, the method further includes:
[0158] The associated stripe covered by the data read command is unlocked.
[0159] In actual applications, the stripe lock management module locks and unlocks the corresponding stripe, and allows write updates to the corresponding stripe again after unlocking, thereby ensuring the stability of data in the stripe during data reading.
[0160] In some embodiments of the present invention, before converting the first page table pointer in the first data list into a second page table pointer and storing the second page table pointer in the second data list, the method further includes:
[0161] In the storage control card, three data list entries are applied to store the second data list, the third data list, and the fourth data list;
[0162] After the data page table of the second page table pointer in the second data list in the storage control card is transmitted to the target storage area of the host, the method further includes:
[0163] The second data list, the third data list, and the fourth data list are recovered.
[0164] For the first data transmission strategy, the distribution operation process is as follows: Figure 4a As shown:
[0165] ① The host sends a read IO (data read command) to the storage control card, carrying information such as NS, SLBA, IO size, and HPRP4 list.
[0166] ② After receiving the IO request, the storage control card queries the cache line according to the NS, SLBA, IO size and other information of the IO command. If a hit occurs (including a partial hit), all related cache lines are locked and the queried cache lines are merged into an LPRP32 data page list: CLM_List, which is the first data list.
[0167] ③ If RAID is set, the stripe lock management module needs to be used to lock the relevant stripes covered by the IO, and no write update is allowed before the current read IO is completed.
[0168] ④ Apply for 3 data list entries in the local storage space through the dynamic memory allocation module, which are used to store Ref_CLM_List (i.e. the second data list), HOST_List (i.e. the third data list), and Remap_List (i.e. the fourth data list).
[0169] ⑤ Convert CLM_List (i.e., the second data list) into Ref_CLM_List (i.e., the third data list) through the data page table pointer conversion module: Each LPPR32 page table pointer (i.e., the first page table pointer) is sequentially converted into 8 LPRP4 page table pointers (i.e., the second page table pointer). The highest bit (i.e., the flag bit) of each LPRP4 indicates whether the data page table is valid. Its source is the cache hit information in LPPR32 (8 bits, each bit corresponds to a 4KB data page). From low to high, it corresponds to LPRP4 page table pointers 0 to 7. Figure 4b This is an example of converting LPRP32 to LPRP4.
[0170] ⑥ Read the HPRP4 list (i.e., the host data address of the target storage area in the host) from the host through the host data DMA module and store it in HOST_List.
[0171] ⑦ Convert HOST_List (i.e., the third data list) to Remap_List (i.e., the fourth data list) through the data page table pointer conversion module: search the address mapping table and convert HPRP4 to the corresponding CPRP4 address in sequence. Figure 4c This is an example of the conversion of HPRP4 to CPRP4.
[0172] ⑧ If multiple disks need to be accessed, the IO acceleration module is used to concurrently issue read IO instructions to the disks using Remap_List (the fourth data list), and all host read IO data is first transferred to the host storage space.
[0173] ⑨ Then, through the host data DMA module, all "valid (cache hit)" 4KB data pages in the Ref_CLM_List list (i.e., the second data list), i.e., the data page table that hits the second page table pointer, are transferred to the host storage space at the equivalent position in HOST_List, overwriting the older data transferred in step ⑧.
[0174] ⑩ Reclaim the data page tables used to store Ref_CLM_List, HOST_List, and Remap_List through the dynamic memory recovery module.
[0175] ⑪ Unlock the corresponding stripe lock through the stripe lock management module, and allow write updates to the corresponding stripe again.
[0176] ⑫ Unlock the corresponding CL through the cache management module and allow write updates to the corresponding CL again.
[0177] ⑬ Response to host that read IO is completed.
[0178] The second data transmission strategy is introduced in detail as follows:
[0179] In some embodiments of the present invention, the data requested by the data read command is transmitted from the power-off protected area and the storage device to the host using independent paths according to the target data transmission strategy, including: when the target data transmission strategy is a second data transmission strategy, part of the data hit by the data read command in the power-off protected area is transmitted to the host, and other data requested by the data read command in the storage device is transmitted to the host.
[0180] In some embodiments of the present invention, transmitting part of the data hit by the data read command in the power-off protected area to the host, and transmitting other data requested by the data read command in the storage device to the host, comprises:
[0181] Sub-step 21, performing a cache line query in the storage control card according to the data read command, obtaining a relevant cache line hit by the data read command, and storing a first page table pointer of the relevant cache line in a first data list; wherein the first page table pointer is a page table pointer for a power-off protected area in the storage control card;
[0182] In some embodiments of the present invention, the data read command includes a logical volume identifier, a starting logical block address, and a data size; performing a cache line query in the storage control card according to the data read command to obtain the relevant cache line hit by the data read command includes: performing a cache line query in the storage control card according to the logical volume identifier, the starting logical block address, and the data size in the data read command to obtain the relevant cache line hit by the data read command.
[0183] In actual applications, the host sends a read IO (i.e., a data read command) to the storage control card, carrying information such as NS, SLBA, IO size, and HPRP4 list.
[0184] After receiving the IO request, the storage control card performs a cache line query based on the NS, SLBA, IO size and other information of the IO command. If a hit occurs (including a partial hit), all related cache lines are locked and the queried cache lines are merged into an LPRP32 data page list: CLM_List, which is the first data list.
[0185] Sub-step 22, converting the first page table pointer in the first data list into a second page table pointer, and storing the second page table pointer in the second data list; wherein the second page table pointer is a page table pointer for a complete storage area in the storage control card, the complete storage area includes a power-off protected area and a non-power-off protected area, and the second page table pointer has a flag bit, and the flag bit is used to indicate whether the data page table of the second page table pointer is hit;
[0186] In some embodiments of the present invention, converting the first page table pointer in the first data list into a second page table pointer includes: converting each of the first page table pointers in the first data list into multiple second page table pointers; and setting a flag bit of the second page table pointer according to a hit condition of the data page table of the second page table pointer.
[0187] In some embodiments of the present invention, the first page table pointer points to a cache line with a first data size as a granularity, and the second page table pointer points to a cache line with a second data size as a granularity, and the first data size is larger than the second data size.
[0188] In actual applications, the data page table pointer conversion module converts CLM_List (i.e., the second data list) into Ref_CLM_List (i.e., the third data list): each LPPR32 page table pointer (i.e., the first page table pointer) is sequentially converted into 8 LPRP4 page table pointers (i.e., the second page table pointer). The highest bit (i.e., the flag bit) of each LPRP4 indicates whether the data page table is valid. Its source is the cache hit information in LPPR32 (8 bits, each bit corresponds to a 4KB data page). From low to high, it corresponds to LPRP4 page table pointers 0 to 7. Figure 4b This is an example of converting LPRP32 to LPRP4.
[0189] Sub-step 23, reading the host data address of the target storage area in the host, and storing the host data address in a third data list;
[0190] In actual applications, the HPRP4 list (ie, the host data address of the target storage area in the host) is read from the host through the host data DMA module and stored in the HOST_List (ie, the third data list).
[0191] Sub-step 24, converting the host data address in the third data list into the storage control card data address in the storage control card through a pre-established address mapping table, and storing the storage control card data address in the fourth data list;
[0192] In actual application, the data page table pointer conversion module converts HOST_List (i.e., the third data list) into Remap_List (i.e., the fourth data list): search the address mapping table and convert HPRP4 into the corresponding CPRP4 address in sequence. Figure 4c This is an example of the conversion of HPRP4 to CPRP4.
[0193] Sub-step 25, using the storage control card data address in the fourth data list, transmitting the data page table that does not hit the second page table pointer in the second data list in the storage device to the target storage area in the host; wherein the second page table pointer that does not hit is a second page table pointer whose flag bit indicates that the data page table is not hit;
[0194] In some embodiments of the present invention, the use of the storage control card data address in the fourth data list to transfer the data page table that does not hit the second page table pointer in the second data list in the storage device to the target storage area in the host includes: using the storage control card data address in the fourth data list to send the data read command request to the storage device, so that the storage device transfers the data page table that does not hit the second page table pointer in the second data list to the storage control card data address, and directly transfers it to the target storage area in the host via the routing function of the storage control card.
[0195] In actual applications, the IO acceleration module needs to refer to the "valid" bit (i.e., flag bit) information of each LPRP4 pointer (i.e., the second page table pointer) in Ref_CLM_List (the second data list) to split an IO of the current disk, such as Figure 5b If the LPRP4 is marked as "valid (Cache hit)", the reading of the corresponding data page from the storage device is skipped (i.e., the data page table that hits the second page table pointer is skipped), and the reading of several consecutive "invalid (Cache miss)" 4KB data pages is aggregated into a sub-IO (i.e., the data page table that misses the second page table pointer is read). As a result, the data reading on the disk side is only for the data that is not hit in the cache, avoiding the waste of the host upstream bandwidth in method A.
[0196] Sub-step 26, transmitting the data page table that hits the second page table pointer in the second data list in the storage control card to the target storage area of the host; wherein the hit second page table pointer is a second page table pointer whose flag bit indicates that the data page table is hit.
[0197] In some embodiments of the present invention, the steps of transferring the data page table of the second page table pointer in the second data list in the storage control card to the target storage area of the host and using the storage control card data address in the fourth data list to transfer the data page table that does not hit the second page table pointer in the second data list in the storage device to the target storage area in the host are performed in parallel.
[0198] In actual applications, through the host data DMA module, all "valid (cache hit)" 4KB data pages in the Ref_CLM_List list (i.e. the second data list) are transferred to the host storage space at the equivalent position in the HOST_List without waiting for the completion of step ⑧, but are executed in parallel, further reducing the IO delay.
[0199] In some embodiments of the present invention, after performing a cache line query in the storage control card according to the data read command to obtain a relevant cache line hit by the data read command, the method further includes:
[0200] locking the relevant cache line;
[0201] After the data page table of the second page table pointer in the second data list in the storage control card is transmitted to the target storage area of the host, the method further includes:
[0202] The associated cache line is unlocked.
[0203] In some embodiments of the present invention, after performing a cache line query in the storage control card according to the data read command to obtain a relevant cache line hit by the data read command, the method further includes:
[0204] Locking the relevant stripe covered by the data read command;
[0205] After the data page table of the second page table pointer in the second data list in the storage control card is transmitted to the target storage area of the host, the method further includes:
[0206] The associated stripe covered by the data read command is unlocked.
[0207] In some embodiments of the present invention, before converting the first page table pointer in the first data list into a second page table pointer and storing the second page table pointer in the second data list, the method further includes:
[0208] In the storage control card, three data list entries are applied to store the second data list, the third data list, and the fourth data list;
[0209] After the data page table of the second page table pointer in the second data list in the storage control card is transmitted to the target storage area of the host, the method further includes:
[0210] The second data list, the third data list, and the fourth data list are recovered.
[0211] For the aforementioned second data transmission strategy, its distribution operation process is as follows: Figure 5a As shown, compared with method A, the difference is in steps ⑧ and ⑨, and the operations of other process steps are the same.
[0212] ① The host sends a read IO (data read command) to the storage control card, carrying information such as NS, SLBA, IO size, and HPRP4 list.
[0213] ② After receiving the IO request, the storage control card queries the cache line according to the NS, SLBA, IO size and other information of the IO command. If a hit occurs (including a partial hit), all related cache lines are locked and the queried cache lines are merged into an LPRP32 data page list: CLM_List, which is the first data list.
[0214] ③ If RAID is set, the stripe lock management module needs to be used to lock the relevant stripes covered by the IO, and no write update is allowed before the current read IO is completed.
[0215] ④ Apply for 3 data page table entries in the local storage space through the dynamic memory allocation module to store Ref_CLM_List (i.e. the second data list), HOST_List (i.e. the third data list), and Remap_List (i.e. the fourth data list).
[0216] ⑤ Convert CLM_List (i.e., the second data list) into Ref_CLM_List (i.e., the third data list) through the data page table pointer conversion module: Each LPPR32 page table pointer (i.e., the first page table pointer) is sequentially converted into 8 LPRP4 page table pointers (i.e., the second page table pointer). The highest bit (i.e., the flag bit) of each LPRP4 indicates whether the data page table is valid. Its source is the cache hit information in LPPR32 (8 bits, each bit corresponds to a 4KB data page). From low to high, it corresponds to LPRP4 page table pointers 0 to 7. Figure 4b This is an example of converting LPRP32 to LPRP4.
[0217] ⑥ Read the HPRP4 list (i.e., the host data address of the target storage area in the host) from the host through the host data DMA module and store it in HOST_List.
[0218] ⑦ Convert HOST_List (i.e., the third data list) to Remap_List (i.e., the fourth data list) through the data page table pointer conversion module: search the address mapping table and convert HPRP4 to the corresponding CPRP4 address in sequence. Figure 4c This is an example of the conversion of HPRP4 to CPRP4.
[0219] ⑧The IO acceleration module needs to refer to the "valid" bit (i.e., flag bit) of each LPRP4 pointer (i.e., the second page table pointer) in Ref_CLM_List (the second data list) to split an IO of the current disk, such as Figure 5b If the LPRP4 is marked as "valid (Cache hit)", the reading of the corresponding data page from the storage device is skipped (i.e., the data page table that hits the second page table pointer is skipped), and the reading of several consecutive "invalid (Cache miss)" 4KB data pages is aggregated into a sub-IO (i.e., the data page table that misses the second page table pointer is read). As a result, the data reading on the disk side is only for the data that is not hit in the cache, avoiding the waste of the host upstream bandwidth in method A.
[0220] ⑨ Then, through the host data DMA module, all "valid (cache hit)" 4KB data pages in the Ref_CLM_List list (i.e., the second data list) are transferred to the host storage space at the equivalent position in the HOST_List without waiting for the completion of step ⑧ to start again, but are executed in parallel, further reducing the IO delay.
[0221] ⑩ Reclaim the data page tables used to store Ref_CLM_List, HOST_List, and Remap_List through the dynamic memory recovery module.
[0222] ⑪ Unlock the corresponding stripe lock through the stripe lock management module, and allow write updates to the corresponding stripe again.
[0223] ⑫ Unlock the corresponding CL through the cache management module and allow write updates to the corresponding CL again.
[0224] ⑬ Response to host that read IO is completed.
[0225] In an embodiment of the present invention, by receiving a data read command issued by the host, when the data requested by the data read command is only partially stored in the power-off protected area, the attribute information of the data requested by the data read command and the data hit situation of the data requested by the data read command in the power-off protected area are determined, and according to the attribute information and the data hit situation, a target data transmission strategy adapted to the data read command is determined, and according to the target data transmission strategy, the data requested by the data read command is transmitted from the power-off protected area and the storage device to the host respectively through independent paths to respond to the data read command, thereby optimizing the processing of the cache situation in the partial hit storage control card, simplifying the overall process, and reducing the IO response delay and the occupancy of the local storage bandwidth.
[0226] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.
[0227] Reference Figure 6 , shows a schematic diagram of the structure of a processing device based on a storage control card provided in some embodiments of the present invention, wherein the storage control card is connected to a host and a storage device, and the storage control card is provided with a power-off protection area, which may specifically include the following modules:
[0228] A data read command receiving module 601 is used to receive a data read command sent by the host;
[0229] An information determination module 602, configured to determine attribute information of the data requested by the data read command and a data hit condition of the data requested by the data read command in the power-off protected area when only part of the data requested by the data read command is stored in the power-off protected area;
[0230] The strategy selection and execution module 603 is used to determine the target data transmission strategy adapted to the data read command based on the attribute information and the data hit situation, and according to the target data transmission strategy, transmit the data requested by the data read command from the power-off protected area and the storage device to the host using independent paths respectively, in response to the data read command.
[0231] Optionally, the transmitting the data requested by the data read command from the power-off protected area and the storage device to the host using independent paths according to the target data transmission strategy includes:
[0232] When the target data transmission strategy is the first data transmission strategy, the complete data requested by the data read command in the storage device is transmitted to the host, and the partial data hit by the data read command in the power-off protected area is transmitted to the host, so that the hit partial data is used to cover the corresponding part of the complete data.
[0233] Optionally, the transmitting the data requested by the data read command from the power-off protected area and the storage device to the host using independent paths according to the target data transmission strategy includes:
[0234] When the target data transmission strategy is the second data transmission strategy, part of the data hit by the data read command in the power-off protected area is transmitted to the host, and other data requested by the data read command in the storage device is transmitted to the host.
[0235] Optionally, the transmitting the complete data requested by the data read command in the storage device to the host, and transmitting the partial data hit by the data read command in the power-off protected area to the host, so as to use the hit partial data to cover the corresponding part of the complete data, includes:
[0236] Perform a cache line query in the storage control card according to the data read command, obtain a relevant cache line hit by the data read command, and store a first page table pointer of the relevant cache line in a first data list; wherein the first page table pointer is a page table pointer for a power-off protected area in the storage control card;
[0237] Converting a first page table pointer in the first data list into a second page table pointer, and storing the second page table pointer in the second data list; wherein the second page table pointer is a page table pointer for a complete storage area in the storage control card, the complete storage area includes a power-off protected area and a non-power-off protected area, and the second page table pointer has a flag bit, and the flag bit is used to indicate whether a data page table of the second page table pointer is hit;
[0238] Reading a host data address of a target storage area in the host, and storing the host data address in a third data list;
[0239] Converting the host data address in the third data list into the storage control card data address in the storage control card through a pre-established address mapping table, and storing the storage control card data address in the fourth data list;
[0240] Using the storage control card data address in the fourth data list, the complete data requested by the data read command in the storage device is transferred to the target storage area in the host;
[0241] The data page table that hits the second page table pointer in the second data list in the storage control card is transmitted to the target storage area of the host and covers the corresponding part of the complete data; wherein, the hit second page table pointer is a second page table pointer whose flag bit indicates that the data page table is hit.
[0242] Optionally, transmitting part of the data hit by the data read command in the power-off protected area to the host, and transmitting other data requested by the data read command in the storage device to the host, comprises:
[0243] Perform a cache line query in the storage control card according to the data read command, obtain a relevant cache line hit by the data read command, and store a first page table pointer of the relevant cache line in a first data list; wherein the first page table pointer is a page table pointer for a power-off protected area in the storage control card;
[0244] Converting a first page table pointer in the first data list into a second page table pointer, and storing the second page table pointer in the second data list; wherein the second page table pointer is a page table pointer for a complete storage area in the storage control card, the complete storage area includes a power-off protected area and a non-power-off protected area, and the second page table pointer has a flag bit, and the flag bit is used to indicate whether a data page table of the second page table pointer is hit;
[0245] Reading a host data address of a target storage area in the host, and storing the host data address in a third data list;
[0246] Converting the host data address in the third data list into the storage control card data address in the storage control card through a pre-established address mapping table, and storing the storage control card data address in the fourth data list;
[0247] Using the storage control card data address in the fourth data list, the data page table that does not hit the second page table pointer in the second data list in the storage device is transmitted to the target storage area in the host; wherein the second page table pointer that does not hit is a second page table pointer whose flag bit indicates that the data page table is not hit;
[0248] The data page table that hits the second page table pointer in the second data list in the storage control card is transmitted to the target storage area of the host; wherein the hitting second page table pointer is a second page table pointer whose flag bit indicates that the data page table is hit.
[0249] Optionally, the steps of transferring the data page table of the second page table pointer in the second data list in the storage control card to the target storage area of the host and using the storage control card data address in the fourth data list to transfer the data page table that does not hit the second page table pointer in the second data list in the storage device to the target storage area in the host are performed in parallel.
[0250] Optionally, the data read command includes a logical volume identifier, a starting logical block address, and a data size;
[0251] The querying of cache lines in the storage control card according to the data read command to obtain relevant cache lines hit by the data read command comprises:
[0252] A cache line query is performed in the storage control card according to the logical volume identifier, the starting logical block address, and the data size in the data read command to obtain a related cache line hit by the data read command.
[0253] Optionally, after performing a cache line query in the storage control card according to the data read command to obtain a relevant cache line hit by the data read command, the method further includes:
[0254] locking the relevant cache line;
[0255] After the data page table of the second page table pointer in the second data list in the storage control card is transmitted to the target storage area of the host, the method further includes:
[0256] The associated cache line is unlocked.
[0257] Optionally, after performing a cache line query in the storage control card according to the data read command to obtain a relevant cache line hit by the data read command, the method further includes:
[0258] Locking the relevant stripe covered by the data read command;
[0259] After the data page table of the second page table pointer in the second data list in the storage control card is transmitted to the target storage area of the host, the method further includes:
[0260] The associated stripe covered by the data read command is unlocked.
[0261] Optionally, before converting the first page table pointer in the first data list into a second page table pointer and storing the second page table pointer in the second data list, the method further includes:
[0262] In the storage control card, three data list entries are applied to store the second data list, the third data list, and the fourth data list;
[0263] After the data page table of the second page table pointer in the second data list in the storage control card is transmitted to the target storage area of the host, the method further includes:
[0264] The second data list, the third data list, and the fourth data list are recovered.
[0265] Optionally, converting the first page table pointer in the first data list into a second page table pointer includes:
[0266] Convert each of the first page table pointers in the first data list into a plurality of second page table pointers;
[0267] According to a hit condition of the data page table of the second page table pointer, a flag bit of the second page table pointer is set.
[0268] Optionally, the first page table pointer points to a cache line with a first data size as a granularity, and the second page table pointer points to a cache line with a second data size as a granularity, and the first data size is larger than the second data size.
[0269] Optionally, the adopting the storage control card data address in the fourth data list to transmit the complete data requested by the data read command in the storage device to the target storage area in the host includes:
[0270] The storage control card data address in the fourth data list is used to send the data read command request to the storage device, so that the storage device transmits the complete data of the data read command request to the storage control card data address, and directly transmits it to the target storage area in the host via the routing function of the storage control card.
[0271] Optionally, the adopting the storage control card data address in the fourth data list to transmit the data page table that does not hit the second page table pointer in the second data list in the storage device to the target storage area in the host includes:
[0272] The storage control card data address in the fourth data list is used to send the data read command request to the storage device, so that the storage device transfers the data page table that does not hit the second page table pointer in the second data list to the storage control card data address, and directly transfers it to the target storage area in the host via the routing function of the storage control card.
[0273] Optionally, the attribute information includes data size, the data hit condition includes a hit data ratio, and determining a target data transmission strategy adapted to the data read command according to the attribute information and the data hit condition includes:
[0274] Determining data size from the attribute information;
[0275] Determine the hit data ratio from the data hit situation;
[0276] According to the data size and the hit data ratio, a target data transmission strategy adapted to the data read command is determined from the first data transmission strategy and the second data transmission strategy.
[0277] Optionally, determining, according to the data size and the hit data ratio, a target data transmission strategy adapted to the data read command from the first data transmission strategy and the second data transmission strategy includes:
[0278] Determine whether the data size is greater than a data size threshold;
[0279] Determine whether the hit data ratio is less than a ratio threshold;
[0280] In a case where the data size is greater than a data size threshold and the hit data ratio is less than a ratio threshold, determining that the target data transmission strategy adapted to the data read command is a first data transmission strategy;
[0281] When the data size is less than or equal to the data size threshold or the hit data ratio is greater than or equal to the ratio threshold, it is determined that the target data transmission strategy adapted to the data read command is the second data transmission strategy.
[0282] In an embodiment of the present invention, by receiving a data read command issued by the host, when the data requested by the data read command is only partially stored in the power-off protected area, the attribute information of the data requested by the data read command and the data hit situation of the data requested by the data read command in the power-off protected area are determined, and according to the attribute information and the data hit situation, a target data transmission strategy adapted to the data read command is determined, and according to the target data transmission strategy, the data requested by the data read command is transmitted from the power-off protected area and the storage device to the host respectively through independent paths to respond to the data read command, thereby optimizing the processing of the cache situation in the partial hit storage control card, simplifying the overall process, and reducing the IO response delay and the occupancy of the local storage bandwidth.
[0283] Reference Figure 7 , shows an electronic device provided by some embodiments of the present invention, including a processor 701, a memory 702, and a computer program stored in the memory 702 and capable of running on the processor 701, and the computer program implements the above method when executed by the processor.
[0284] Reference Figure 8 , shows a computer-readable storage medium 800 provided in some embodiments of the present invention, on which a computer program is stored, and the computer program implements the above method when executed by a processor.
[0285] Reference Fig. 9 , shows a computer program product 900 provided by some embodiments of the present invention, including a computer program, and the computer program implements the above method when executed by a processor.
[0286] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0287] The above is a detailed introduction to a processing method and device based on a storage control card. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for general technicians in this field, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A processing method based on a storage control card, characterized in that: The storage control card is connected to a host and a storage device, and the storage control card is provided with a power-off protection area. The method includes: Receiving a data read command sent by the host; In a case where only a portion of the data requested by the data read command is stored in the power-off protected area, determining attribute information of the data requested by the data read command and a data hit condition of the data requested by the data read command in the power-off protected area; Determine a target data transmission strategy adapted to the data read command based on the attribute information and the data hit condition, and transmit the data requested by the data read command from the power-off protected area and the storage device to the host using independent paths, respectively, to respond to the data read command; wherein the attribute information includes data size, and the data hit condition includes a hit data ratio; if the data size is greater than a data size threshold and the hit data ratio is less than a ratio threshold, the target data transmission strategy is a first data transmission strategy; if the data size is less than or equal to the data size threshold or the hit data ratio is greater than or equal to the ratio threshold, the target data transmission strategy is a second data transmission strategy; The method of transmitting the data requested by the data read command from the power-off protected area and the storage device to the host using independent paths according to the target data transmission strategy includes: When the target data transmission strategy is the first data transmission strategy, transmitting the complete data requested by the data read command in the storage device to the host, and transmitting the partial data hit by the data read command in the power-off protected area to the host, so as to overwrite the corresponding part of the complete data with the hit partial data; When the target data transmission strategy is the second data transmission strategy, part of the data hit by the data read command in the power-off protected area is transmitted to the host, and other data requested by the data read command in the storage device is transmitted to the host.
2. The method according to claim 1, characterized in that The transmitting the complete data requested by the data read command in the storage device to the host, and transmitting the partial data hit by the data read command in the power-off protected area to the host, so as to overwrite the corresponding part of the complete data with the hit partial data, includes: Performing a cache line query in the storage control card according to the data read command, obtaining a relevant cache line hit by the data read command, and storing a first page table pointer of the relevant cache line in a first data list; wherein the first page table pointer is a page table pointer for a power-off protected area in the storage control card; Converting a first page table pointer in the first data list into a second page table pointer, and storing the second page table pointer in the second data list; wherein the second page table pointer is a page table pointer for a complete storage area in the storage control card, the complete storage area including a power-off protected area and a non-power-off protected area, and the second page table pointer has a flag bit, and the flag bit is used to indicate whether a data page table of the second page table pointer is hit; Reading a host data address of a target storage area in the host, and storing the host data address in a third data table; Converting the host data address in the third data list into the storage control card data address in the storage control card through a pre-established address mapping table, and storing the storage control card data address in the fourth data list; Using the storage control card data address in the fourth data list, the complete data requested by the data read command in the storage device is transferred to the target storage area in the host; The data page table that hits the second page table pointer in the second data list in the storage control card is transferred to the target storage area of the host and covers the corresponding part of the complete data; wherein, the hitting second page table pointer is a second page table pointer whose flag bit indicates that the data page table is hit.
3. The method according to claim 1, characterized in that The step of transmitting part of the data hit by the data read command in the power-off protected area to the host, and transmitting other data requested by the data read command in the storage device to the host, comprises: Performing a cache line query in the storage control card according to the data read command, obtaining a relevant cache line hit by the data read command, and storing a first page table pointer of the relevant cache line in a first data list; wherein the first page table pointer is a page table pointer for a power-off protected area in the storage control card; Converting a first page table pointer in the first data list into a second page table pointer, and storing the second page table pointer in the second data list; wherein the second page table pointer is a page table pointer for a complete storage area in the storage control card, the complete storage area including a power-off protected area and a non-power-off protected area, and the second page table pointer has a flag bit, and the flag bit is used to indicate whether a data page table of the second page table pointer is hit; Reading a host data address of a target storage area in the host, and storing the host data address in a third data table; Converting the host data address in the third data list into the storage control card data address in the storage control card through a pre-established address mapping table, and storing the storage control card data address in the fourth data list; Using the storage control card data address in the fourth data list, the data page table that does not hit the second page table pointer in the second data list in the storage device is transmitted to the target storage area in the host; wherein the missed second page table pointer is a second page table pointer whose flag bit indicates that the data page table does not hit; The data page table that hits the second page table pointer in the second data list in the storage control card is transmitted to the target storage area of the host; wherein the hitting second page table pointer is a second page table pointer whose flag bit indicates that the data page table is hit.
4. The method according to claim 3, characterized in that The steps of transferring the data page table of the second page table pointer in the second data list in the storage control card to the target storage area of the host and using the storage control card data address in the fourth data list to transfer the data page table that does not hit the second page table pointer in the second data list in the storage device to the target storage area in the host are performed in parallel.
5. The method according to claim 2 or 3, characterized in that The data read command includes a logical volume identifier, a starting logical block address, and a data size; The performing cache line query in the storage control card according to the data read command to obtain a related cache line hit by the data read command includes: A cache line query is performed in the storage control card according to the logical volume identifier, the starting logical block address, and the data size in the data read command to obtain a related cache line hit by the data read command.
6. The method according to claim 2 or 3, characterized in that After performing cache line query in the storage control card according to the data read command to obtain a relevant cache line hit by the data read command, the method further includes: locking the relevant cache line; After transferring the data page table of the second page table pointer in the second data list in the storage control card to the target storage area of the host, the method further includes: The relevant cache line is unlocked.
7. The method according to claim 2 or 3, characterized in that After performing cache line query in the storage control card according to the data read command to obtain a relevant cache line hit by the data read command, the method further includes: Locking the relevant stripe covered by the data read command; After transferring the data page table of the second page table pointer in the second data list in the storage control card to the target storage area of the host, the method further includes: Unlock the relevant stripe covered by the data read command.
8. The method according to claim 2 or 3, characterized in that Before converting the first page table pointer in the first data list into a second page table pointer and storing the second page table pointer in the second data list, the method further includes: In the storage control card, three data list entries are applied to store the second data list, the third data list, and the fourth data list; After transferring the data page table of the second page table pointer in the second data list in the storage control card to the target storage area of the host, the method further includes: The second data list, the third data list, and the fourth data list are recovered.
9. The method according to claim 2 or 3, characterized in that Converting the first page table pointer in the first data list into a second page table pointer includes: converting each of the first page table pointers in the first data list into a plurality of second page table pointers; The flag bit of the second page table pointer is set according to a hit condition of the data page table of the second page table pointer.
10. The method according to claim 8, characterized in that The first page table pointer points to a cache line with a first data size as a granularity, and the second page table pointer points to a cache line with a second data size as a granularity, and the first data size is larger than the second data size.
11. The method according to claim 2, characterized in that The method of using the storage control card data address in the fourth data list to transmit the complete data requested by the data read command in the storage device to the target storage area in the host includes: The storage control card data address in the fourth data list is used to send the data read command request to the storage device, so that the storage device transmits the complete data of the data read command request to the storage control card data address, and directly transmits it to the target storage area in the host via the routing function of the storage control card.
12. The method according to claim 3, characterized in that The method of using the storage control card data address in the fourth data list to transfer the data page table in the second data list in the storage device that does not hit the second page table pointer to the target storage area in the host includes: The storage control card data address in the fourth data list is used to send the data read command request to the storage device, so that the storage device transfers the data page table that does not hit the second page table pointer in the second data list to the storage control card data address, and directly transfers it to the target storage area in the host via the routing function of the storage control card.
13. The method according to any one of claims 1 to 3, characterized in that Determining a target data transmission strategy adapted to the data read command according to the attribute information and the data hit condition includes: Determining data size from the attribute information; Determining a hit data ratio from the data hit situation; According to the data size and the hit data ratio, a target data transmission strategy adapted to the data read command is determined from the first data transmission strategy and the second data transmission strategy.
14. A processing device based on a storage control card, characterized in that: The storage control card is connected to a host and a storage device, and the storage control card is provided with a power-off protection area. The device includes: A data read command receiving module, configured to receive a data read command issued by the host; an information determining module, configured to determine, when only part of the data requested by the data read command is stored in the power-off protected area, attribute information of the data requested by the data read command and a data hit condition of the data requested by the data read command in the power-off protected area; a strategy selection and execution module, configured to determine a target data transmission strategy adapted to the data read command based on the attribute information and the data hit condition, and transmit the data requested by the data read command from the power-off protected area and the storage device to the host using independent paths, respectively, in response to the data read command, wherein the attribute information includes data size, the data hit condition includes a hit data ratio, and when the data size is greater than a data size threshold and the hit data ratio is less than a ratio threshold, the target data transmission strategy is a first data transmission strategy; and when the data size is less than or equal to the data size threshold or the hit data ratio is greater than or equal to the ratio threshold, the target data transmission strategy is a second data transmission strategy; The method of transmitting the data requested by the data read command from the power-off protected area and the storage device to the host using independent paths according to the target data transmission strategy includes: When the target data transmission strategy is the first data transmission strategy, transmitting the complete data requested by the data read command in the storage device to the host, and transmitting the partial data hit by the data read command in the power-off protected area to the host, so as to overwrite the corresponding part of the complete data with the hit partial data; When the target data transmission strategy is the second data transmission strategy, part of the data hit by the data read command in the power-off protected area is transmitted to the host, and other data requested by the data read command in the storage device is transmitted to the host.
15. An electronic device, characterized in that: The method comprises a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the computer program implements the method according to any one of claims 1 to 13 when executed by the processor.
16. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 13 is implemented.
17. A computer program product, characterized in that The invention comprises a computer program which, when executed by a processor, implements the method according to any one of claims 1 to 13.
Citation Information
Patent Citations
Disk data reading method
CN105138292A
Segmented junk recovery method for solid-state storage device
CN106528438A
Loading and storing controls regulating the operation of a guarded storage facility
CN110199266A
Electronic device for communicating with host and operating method of electronic device
CN111177058A
Apparatus and method for improving input / output throughput of memory system
CN113495689A
