Storage array controller, storage array system and data processing method
By introducing redundant modules and nonvolatile storage control modules into the storage array controller to manage namespaces and logical address spaces, the problem of low efficiency in handling read and write data by existing storage array controllers is solved, and more efficient data processing is achieved.
Patent Information
- Application Number
- CN202411637672.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-15
- Publication Date
- 2025-08-08
- Estimated Expiration
- 2044-11-15
AI Technical Summary
Existing storage array controllers are inefficient in processing read and write data, and fail to fully utilize the advantages of redundant storage arrays.
A storage array controller is designed, including a storage interface control module, a redundant module and a nonvolatile storage control module. The data is redundantly calculated through the redundant module and written to the controller memory. The logical address space of the storage array is managed based on the namespace to realize data interaction.
The read and write data efficiency of the storage array controller is improved. The controller memory is managed through the pre-redundant module, and redundant calculations are directly performed and memory is stored, reducing data processing time and significantly improving data processing efficiency.
Smart Images

Figure CN119536649B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of storage technology, and in particular to a storage array controller, a storage array system, and a data processing method. Background Art
[0002] The controller of the NVMe-oF / TCP flash storage array includes NVMe master, master memory and redundant array computing unit, such as Figure 1 As shown in the figure, the flash storage array establishes a connection with the remote host through the NVMe master, receiving and executing commands sent by the remote host. The NVMe master interacts with the NVMe storage disk to provide memory space and data transmission to the remote host.
[0003] In the existing technology, the execution logic of the NVMe master is not designed based on the redundant storage array, but is only managed by a remote host. As a result, the entire data end cannot take advantage of the independent redundant storage array, resulting in a time-consuming processing process and low data processing efficiency. Summary of the Invention
[0004] In view of this, embodiments of the present application provide a storage array controller, a storage array system, and a data processing method, which can effectively solve the problem of low efficiency in processing read and write data by existing storage array controllers.
[0005] In a first aspect, an embodiment of the present application provides a storage array controller, comprising: a storage interface control module, a redundancy module, a non-volatile storage control module, and a controller memory; the redundancy module is respectively connected to the storage interface control module, the non-volatile storage control module, and the controller memory;
[0006] The storage interface control module is in communication with the remote host, and is used to receive and parse message data sent by the remote host to obtain operation commands, and schedule and manage the operation commands based on the namespace and then transmit them to the redundancy module;
[0007] The redundancy module is used to perform redundancy calculation on the data and then write the data into the controller memory, and to manage the logical address space of the storage array and the controller memory based on the namespace;
[0008] The non-volatile storage control module is in communication with the storage array, and in response to a data transmission request from the redundancy module, maps the controller memory to implement data interaction with the storage array.
[0009] In some embodiments, the storage interface control module includes a message parsing module and a command queue processing module;
[0010] The message parsing module is used to receive and parse the message data sent by the remote host, obtain an operation command, and send the operation command of the data transmission type to the command queue processing module;
[0011] The command queue processing module is used to store the operation command into the corresponding namespace command queue according to the accessed target namespace for scheduling management, and transmit the operation command to the redundancy module in sequence.
[0012] In some embodiments, when executing an operation command of a write data type, the redundancy module is further configured to send a command completion notification to the remote host after receiving target data through the storage interface control module and storing the target data in the controller memory.
[0013] In some embodiments, the redundancy module is configured to allocate an idle first cache subspace in the controller memory according to the target logical address of the operation command, and to feed back a readiness completion notification to the remote host through the command queue processing module, wherein the readiness completion notification is configured to instruct the remote host to send the target write data;
[0014] The redundancy module is further configured to cache the target write data into the first cache subspace after performing integrity check and redundancy calculation.
[0015] In some embodiments, the redundancy module is further configured to transmit a write command to the non-volatile storage control module, wherein the write command includes a target logical address and an address of the first cache subspace;
[0016] The non-volatile storage control module is specifically configured to map the first cache subspace of the controller memory into its own memory according to the disk write command, and complete data interaction with the storage array.
[0017] In some embodiments, the non-volatile storage control module is further configured to send a write-to-disk completion notification to the redundancy module after the target write data is written into the storage array;
[0018] The redundancy module is further configured to release the first cache subspace according to the disk flushing completion notification.
[0019] In some embodiments, when executing a read data type operation command,
[0020] The command queue processing module is specifically configured to send a read data instruction command to the redundancy module according to the operation command when executing the operation command in the namespace command queue;
[0021] The redundancy module is configured to determine an idle second cache subspace in the controller memory according to the read data instruction command, and send a read data execution command to the non-volatile storage control module, wherein the read data execution command includes an address of the second cache subspace and a target logical address;
[0022] The non-volatile storage control module is specifically configured to map the second cache subspace to its own memory, and read target read data from the storage array according to the target logical address and store the target read data into the second cache subspace of the controller memory;
[0023] The redundancy module is used to integrate the target read data according to a preset redundancy mode, and send the integrated target read data to the remote host through the command queue processing module.
[0024] In some embodiments, the redundancy module is further configured to divide the controller memory into a write controller memory and a read controller memory; and then divide the write controller memory and the read controller memory respectively according to the namespace to obtain a cache submodule corresponding to each namespace;
[0025] The redundant module is also used to cache the target data to the cache submodule corresponding to the namespace under the write controller memory when the operation command is a write data type; and to cache the target data to the cache submodule corresponding to the namespace under the read controller memory when the operation command is a read data type.
[0026] In some embodiments, the storage interface control module further includes a processor; the processor is connected to both the message parsing module and the command queue processing module;
[0027] The message parsing module is further configured to send non-data transmission type operation commands to the processor;
[0028] The processor is used to establish a connection with the remote host according to the operation command, and configure and manage the scheduling function parameters of the command queue processing module.
[0029] In some embodiments, the storage interface control module is implemented using FPGA; wherein the processor is a built-in processor unit of the FPGA; the command queue processing module and the command queue processing module are both implemented through programming logic of the FPGA.
[0030] In some embodiments, further comprising a protocol offload engine;
[0031] The protocol offload engine is used to receive a protocol message of a preset protocol type sent by the remote host, parse the protocol message, and send the message data obtained by parsing to the storage interface control module.
[0032] In a second aspect, an embodiment of the present application provides a storage array system, comprising: a storage array and a storage array controller provided in the first aspect of the present application.
[0033] In a third aspect, an embodiment of the present application provides a data processing method applicable to a redundancy module in a storage array controller, wherein the storage array controller includes a storage interface control module, a redundancy module, a non-volatile storage control module, and a controller memory, the method comprising:
[0034] Performing redundancy calculation on data determined based on an operation command and then writing it into the controller memory; wherein the operation command is obtained by the storage interface control module by parsing message data sent by the remote host, and the operation command is scheduled and managed based on the namespace and then transmitted to the redundancy module;
[0035] Managing the logical address space of the storage array and the controller memory based on the namespace;
[0036] A data transmission request is sent to the non-volatile storage control module; the data transmission request is used to instruct the non-volatile storage control module to map the controller memory and implement data interaction with the storage array.
[0037] The embodiments of the present application have the following beneficial effects:
[0038] The storage array controller of the present application includes a storage interface control module, a redundancy module, a non-volatile storage control module and a controller memory; the storage interface control module is connected to a remote host for receiving and parsing message data sent by the remote host to obtain operation commands, and the operation commands are scheduled and managed based on the namespace and then transmitted to the redundancy module; the redundancy module is used to perform redundancy calculations on the data and then write it to the controller memory, and manage the logical address space of the storage array and the controller memory based on the namespace; the non-volatile storage control module is connected to the storage array for responding to the data transmission request of the redundancy module and mapping the controller memory to realize data interaction with the storage array. In the present application, the redundancy module is placed in front, and a controller memory is set for the redundancy module. The controller memory is managed by the redundancy module. The received data to be written is directly sent to the redundancy module for redundancy calculation, stored in the controller memory, and then sent to the storage array through the non-volatile storage control module. Therefore, the present application can effectively solve the problem of low efficiency of processing read and write data in the existing storage array controller. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can be obtained based on these drawings without creative work.
[0040] Figure 1 A structural block diagram of a controller of a flash memory storage array related to the background technology of this application is shown;
[0041] Figure 2 A structural block diagram of a storage array system according to an embodiment of the present application is shown;
[0042] Figure 3 A structural block diagram of a storage array controller according to an embodiment of the present application is shown;
[0043] Figure 4 A second structural block diagram of a storage array controller according to an embodiment of the present application is shown;
[0044] Figure 5 A schematic diagram showing the format of an Ethernet message received by a storage array controller according to an embodiment of the present application is shown;
[0045] Figure 6 A schematic diagram showing the format of the data portion of an Ethernet message received by a storage array controller according to an embodiment of the present application is shown;
[0046] Figure 7 A schematic diagram showing a flow chart of a data processing method according to an embodiment of the present application is shown;
[0047] Figure 8 A schematic structural diagram of a redundancy module according to an embodiment of the present application is shown;
[0048] Figure 9 A schematic diagram of a redundancy group in a cache management method of a storage array according to an embodiment of the present application is shown;
[0049] Figure 10 A schematic diagram of a namespace array in a cache management method for a storage array according to an embodiment of the present application is shown;
[0050] Figure 11 A schematic diagram showing a LBAG to be cleared with all active factor flag bits being 0 in a cache management method for a storage array according to an embodiment of the present application is shown;
[0051] Figure 12A schematic diagram of a namespace array in a namespace-based cache management method according to an embodiment of the present application is shown;
[0052] Figure 13 A schematic diagram of a namespace group in a namespace-based cache management method according to an embodiment of the present application is shown;
[0053] Figure 14 A schematic diagram showing a partitioning of controller memory in a namespace-based cache management method according to an embodiment of the present application is shown;
[0054] Figure 15 A schematic diagram of stripes in the storage array data reading and writing method according to an embodiment of the present application is shown.
[0055] Description of main component symbols:
[0056] 100 - storage array controller; 200 - non-volatile storage array; 300 - remote host; 110 - storage interface control module; 111 - message parsing module; 112 - command queue processing module; 113 - processor; 120 - redundancy module; 130 - non-volatile storage control module; 140 - controller memory; 150 - protocol offload engine; 810 - redundancy calculation submodule; 820 - address management module; 830 - data transmission module. DETAILED DESCRIPTION
[0057] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments.
[0058] The components of the embodiments of the present application generally described and illustrated in the drawings herein may be arranged and designed in a variety of different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the claimed application, but rather merely represents selected embodiments of the present application. All other embodiments obtained by those skilled in the art based on the embodiments of the present application without creative effort are within the scope of protection of the present application.
[0059] Hereinafter, the terms "including", "having" and their cognates used in various embodiments of the present application are intended only to indicate specific features, numbers, steps, operations, elements, components or combinations of the aforementioned items, and should not be understood as excluding the existence of one or more other features, numbers, steps, operations, elements, components or combinations of the aforementioned items or adding the possibility of one or more features, numbers, steps, operations, elements, components or combinations of the aforementioned items. In addition, the terms "first", "second", "third" and the like are only used to distinguish descriptions and should not be understood as indicating or implying relative importance.
[0060] Unless otherwise defined, all terms used herein (including technical and scientific terms) have the same meaning as commonly understood by those skilled in the art to which the various embodiments of the present application belong. The terms (such as those defined in generally used dictionaries) will be interpreted as having the same meaning as in the context of the relevant technical field and will not be interpreted as having an idealized meaning or an overly formal meaning unless clearly defined in the various embodiments of the present application.
[0061] The following are the keywords involved in the embodiments of this application:
[0062] PCIe: peripheral component interconnect express, a high-speed serial computer expansion bus standard.
[0063] NVMe: non volatile memory express, non-volatile high-speed transmission bus.
[0064] NVMeoF Specification: The Non-Volatile Memory Express over Fabrics (NVMe oF) specification, abbreviated as NVMe oF, is a storage network protocol. Currently, NVMe oF-based storage devices typically use a multi-node architecture (a node can also be understood as a controller) to enable host access to storage devices, improving the reliability and continuity of storage services. The NVMe oF specification is a high-speed storage protocol built on the NVMe protocol. NVMe oF is used to access NVMe storage media across networks. NVMe oF adds fabric-related commands to NVMe, expanding NVMe's application scenarios beyond the scope of a single device to include cross-network communications. "Fabric" refers to the network between the host and the storage media. Typical fabric types include Ethernet, Fibre Channel, InfiniBand (IB), and Remote Direct Memory Access (RDMA).
[0065] SSD: Solid State Drive.
[0066] HBM: High Bandwidth Memory.
[0067] The following describes some embodiments of the present application in detail with reference to the accompanying drawings. In the absence of conflict, the following embodiments and features in the embodiments may be combined with each other.
[0068] In the prior art, when the CPU acts as the NVMe master, taking data writing as an example, the data writing process performed by the NVMe master is as follows:
[0069] 1) Parse the command sent by the remote host; 2) If the command is a write command, allocate storage space and address for the write command; 3) After being ready to receive data, send the R2T (Ready to Transter) command to the remote host to instruct the remote host to transmit the data to be written; 4) Receive the data to be written and store it in the main control memory according to the allocated storage space; 5) Send the data to be written to the redundant array (RAID / EC) calculation unit to complete the redundancy calculation; 6) Write the data block and check block obtained by the redundancy calculation back to the main control memory; 7) The NVMe memory takes the data block and check block through DMA (Direct Memory Access) to complete the actual disk write of the written data, and sends the CQ (Completion Queque) of the data writing completion to the remote host.
[0070] In the existing flash storage array controller, both read and write data need to be processed by the redundant computing unit. In order to save CPU computing power, separate hardware is generally used to accelerate the redundant computing. The data exchange between the redundant computing unit and the main control memory occupies the cache bandwidth, which leads to low efficiency of the flash storage array controller in processing read and write data. In addition, in the prior art, after the data block and the check block are written to the storage array, the CQ of the data writing completion is also sent to the remote host, that is, the data writing completion notification is sent to the remote host after the data is actually written to the disk. The entire data writing process takes a long time, which further reduces the efficiency of the storage array controller in processing read and write data. Therefore, the embodiment of the present application provides a storage array controller, a storage array system and a data processing method to improve the efficiency of the storage array controller in processing read and write data. The storage array in the present application includes a non-volatile storage array, and the present application is explained based on the non-volatile storage array as an example.
[0071] Figure 2 A block diagram of a storage array system according to an embodiment of the present application is shown. Exemplarily, the storage array system includes a storage array controller 100 and a non-volatile storage array 200, as provided in an embodiment of the present application. The non-volatile storage array 200 is communicatively connected to a remote host 300 via the storage array controller 100. The present application does not limit the non-volatile storage array 200; for example, the non-volatile storage array 200 may include multiple SSDs. The SSDs include an SSD controller and multiple flash memories.
[0072] The storage array controller 100 is described below with reference to some specific embodiments.
[0073] Figure 3 FIG. 1 is a block diagram of a storage array controller 100 according to an embodiment of the present application. Exemplarily, the storage array controller 100 includes: a storage interface control module 110 , a redundancy module 120 , a non-volatile storage control module 130 , and a controller memory 140 .
[0074] The redundancy module 120 is respectively connected to the storage interface control module 110, the non-volatile storage control module 130 and the controller memory 140. The controller memory 140 may adopt a storage method such as HBM / DDR.
[0075] The storage interface control module 110 is in communication with the remote host 300 and is configured to receive and parse message data sent by the remote host 300 to obtain operation commands, schedule and manage the operation commands based on the namespace, and then transmit them to the redundancy module 120. In the embodiment of the present application, the remote host 300 accesses the non-volatile storage array 200 based on the namespace. It is understandable that the operation commands sent by the remote host 300 include an indication of the accessed namespace.
[0076] The storage interface control module 110 schedules and manages each operation command according to each namespace. Naturally, a priority can also be set for each namespace, and the operation commands corresponding to each namespace can be scheduled and managed according to the set priority.
[0077] The redundancy module 120 is configured to perform redundancy calculation on the data and then write the data into the controller memory 140 , and to manage the logical address space of the non-volatile storage array 200 and the controller memory 140 based on the namespace.
[0078] The non-volatile storage control module 130 is in communication with the non-volatile storage array 200 , and in response to a data transmission request from the redundancy module 120 , maps the controller memory 140 to implement data interaction with the non-volatile storage array 200 .
[0079] Furthermore, if Figure 4 As shown, the storage array controller 100 of the embodiment of the present application further includes a protocol offload engine 150. The protocol offload engine 150 is configured to receive protocol packets of a preset protocol type sent by the remote host 300, parse the protocol packets, and send the parsed packet data to the storage interface control module 110. Exemplarily, the protocol offload engine 150 receives TCP / IP / Ethernet packets sent by the remote host 300 from a network port and then passes the packet data stream to the storage interface control module 110.
[0080] For example, the protocol offload engine 150 receives Figure 5 The protocol offload engine 150 parses the received Ethernet message according to the Ethernet related protocol and converts the data part (ie Figure 5 The TCP (Application) data) in the data is passed to the storage interface control module 110.
[0081] In one embodiment, Figure 4 As shown, the storage interface control module 110 includes a message parsing module 111 and a command queue processing module 112 .
[0082] The message parsing module 111 is configured to receive and parse the message data sent by the remote host 300, obtain an operation command, and send the data transmission type operation command to the command queue processing module 112. The data transmission type operation command is an IO queue-related command, for example, a data transmission type operation command includes a read command, a write command, and an erase command.
[0083] The command queue processing module 112 (also called the IO processing module) is used to store the operation command into the corresponding namespace command queue according to the accessed target namespace for scheduling management, and transmit the operation command to the redundancy module 120 in sequence.
[0084] Furthermore, if Figure 4 As shown, the storage interface control module 110 further includes a processor 113 ; the processor 113 is connected to both the message parsing module 111 and the command queue processing module 112 .
[0085] The message parsing module 111 is further configured to send non-data transmission operation commands to the processor 113 .
[0086] The processor 113 is configured to establish a connection with the remote host 300 according to the operation command, and to configure and manage the scheduling function parameters of the command queue processing module 112. Specifically, the processor 113 is primarily configured to establish a connection with the remote host 300, maintain and manage, and configure the functional characteristics of the IO processing module, such as configuring the command queue mode and scheduling policy adopted by the IOQ processing module.
[0087] Furthermore, the message parsing module 111 is connected to the remote host 300 through the protocol offload engine 150, and the message parsing module 111 receives the data portion (message data) obtained by parsing the Ethernet message by the protocol offload engine 150, such as Figure 6As shown, the protocol data unit PDU is then parsed, and the data transmission type of the operation command is determined according to the PDU type. Finally, the data transmission type operation command is passed to the command queue processing module 112, and the non-data transmission type operation command is sent to the processor 113.
[0088] Exemplarily, the storage interface control module 110 is implemented using an FPGA; the processor 113 is a built-in processor unit (CPU) of the FPGA; and the command queue processing module 112 and the command queue processing module 112 are both implemented through programming logic of the FPGA. In this embodiment of the application, the IOQ processing module is separated and implemented using the FPGA, thereby reducing the burden on the processor CPU.
[0089] In one embodiment, when executing an operation command of a write data type, the redundancy module 120 is further configured to send a command completion notification to the remote host 300 after receiving the target data through the storage interface control module 110 and storing it in the controller memory 140. When the operation command is a write data type command, the redundancy module 120 allocates cache space in the controller memory 140 for the data to be written and responds with an R2T (Ready to Transmit) instruction to the remote host 300, instructing the remote host 300 to transmit the data to be written. The redundancy module 120 stores the data to be written in the controller memory 140 and sends a notification of data write completion to the remote host 300. In other words, the redundancy module 120 of the embodiment of the present application supports write termination. When a write command data is written to the redundancy module 120, a CQ is sent to the host, which can significantly reduce write latency and significantly improve the processing efficiency of write commands, allowing the remote host 300 to believe that writing data to the non-volatile storage array 200 is very fast.
[0090] Furthermore, when executing an operation command of a write data type, the redundancy module 120 is also used to allocate an idle first cache subspace in the controller memory 140 according to the target logical address of the operation command, and to feedback a readiness notification to the remote host 300 through the command queue processing module 112, wherein the readiness notification is used to instruct the remote host 300 to send the target write data; wherein the operation command includes the target logical address.
[0091] Before storing the target write data in the controller memory 140 , the redundancy module 120 is further configured to perform integrity check and redundancy calculation, and then cache the target write data after the redundancy calculation in the first cache subspace.
[0092] Furthermore, after caching the target write data after redundancy calculation into the first cache subspace, the redundancy module 120 is also used to transmit a write command to the non-volatile storage control module 130, and the write command includes the target logical address and the address of the first cache subspace.
[0093] The non-volatile storage control module 130 is specifically configured to map the first cache subspace of the controller memory 140 into its own memory according to the write-to-disk command, and complete data interaction with the non-volatile storage array 200. That is, the target write data is stored in the non-volatile storage array 200. Exemplarily, the non-volatile storage control module 130 interacts with the controller of the non-volatile storage array 200 to complete data reading or writing through DMA. When writing data, the non-volatile storage control module 130 receives the write-to-disk command from the redundancy module 120, maps the first cache subspace where the target write data is located into the memory of the non-volatile storage control module 130, and provides the storage array controller 100 with DMA (Direct Memory Access) for reading. After the reading is completed, the first cache subspace is unmapped and released to return to the redundancy module 120 for management.
[0094] In the embodiment of the present application, the redundancy module 120 is placed in front, and a separate memory is no longer set for the non-volatile storage control module 130. Instead, the redundancy module 120 manages the cache. The received data to be written is directly sent to the redundancy calculation module for redundancy calculation, and then the data block and the check block are stored in the cache. The cache address is sent to the non-volatile storage control module 130 and mapped to the temporary memory of the non-volatile storage control module 130, waiting for the non-volatile storage array 200 (NVMe hard drive) to take away the data through DMA.
[0095] Furthermore, the non-volatile storage control module 130 is further configured to send a write completion notification to the redundancy module 120 after the target write data is written into the non-volatile storage array 200 .
[0096] The redundancy module 120 is further configured to release the first cache subspace according to the disk flushing completion notification.
[0097] In one embodiment, when executing an operation command of a read data type, the command queue processing module 112 is specifically configured to send a read data indication command to the redundancy module 120 according to the operation command when executing the operation command in the namespace command queue.
[0098] The redundancy module 120 is used to determine an idle second cache subspace in the controller memory 140 according to the read data indication command, and send a read data execution command to the non-volatile storage control module 130, where the read data execution command includes the address of the second cache subspace and the target logical address (the logical address of the storage array).
[0099] The non-volatile storage control module 130 is specifically configured to map the second cache subspace to its own memory, and read target read data from the non-volatile storage array 200 according to the target logical address and store the target data into the second cache subspace of the controller memory 140 .
[0100] The redundancy module 120 is configured to integrate the target read data according to a preset redundancy mode, and send the integrated target read data to the remote host 300 through the command queue processing module 112 .
[0101] Furthermore, embodiments of the present application support pre-reading. When an IO command is a read data type read command, upon receiving the read command, the command queue processing module 112 generates a command to read consecutive addresses within the same namespace and transmits it to the redundancy module 120. The redundancy module 120 reads data from the non-volatile storage array 200 based on the command to read consecutive addresses within the same namespace and temporarily stores the read data in the controller memory 140. Upon receiving a subsequent related command, the command queue processing module 112 can quickly retrieve the corresponding read data from the controller memory 140 of the redundancy module 120, thereby significantly reducing the latency of the read command. The related commands are commands that access consecutive addresses within the same namespace.
[0102] Furthermore, the redundancy module 120 is also used to divide the controller memory 140 into a write controller memory and a read controller memory; and then divide the write controller memory and the read controller memory respectively according to the namespace to obtain a cache submodule corresponding to each namespace.
[0103] The redundancy module 120 is further configured to cache the target data in a cache submodule corresponding to the namespace in the memory of the write controller when the operation command is of a write data type, and to cache the target data in a cache submodule corresponding to the namespace in the memory of the read controller when the operation command is of a read data type.
[0104] The following describes the storage array controller 100 according to an embodiment of the present application, taking a write command as an example. In this example, the storage interface control module 110 uses an NVMe-oF controller, the non-volatile storage control module 130 uses an NVMe-PCIe host, the protocol offload engine 150 uses a TOE module (TCP / IP Offload Engine), and the controller memory 140 uses HBM. The specific processing of the storage array controller 100 includes the following steps:
[0105] S101, the TOE module parses the received TCP / IP / Ethernet message and sends the parsed message data (data part) to the NVMe-oF controller.
[0106] S102, the message parsing module 111 in the NVMe-oF controller decapsulates the message data to obtain an operation command, which includes a PDU (Protocol Data Unit). According to the PDU, it is determined that the operation command is a data transmission type (write operation command), and then the write operation command is sent to the IOQ processing module (command queue processing module 112).
[0107] S103, the IOQ processing module adds the received write operation command to a command queue for management and scheduling, such as a read / write command queue, a priority command queue, or an NS (NameSpace) command queue.
[0108] When the IOQ processing module executes the write operation command for writing the data, it sends an instruction command to the redundancy module 120 to instruct the redundancy module 120 to prepare the cache space (the first cache subspace) to receive the data to be written.
[0109] S104 , the redundancy module 120 queries the cache status table to determine whether there is sufficient cache space in the controller memory 140 to receive the data to be written.
[0110] Redundancy module 120 needs to determine whether controller memory 140 has address space for the corresponding LBA block. If so, but the LBA block is in an uncompleted state from a previous command, processing of the write command is suspended until the corresponding LBA block is unlocked. If controller memory 140 does not have address space for the corresponding LBA block, an idle first cache subspace is allocated in controller memory 140. If the controller memory has address space for the corresponding LBA block, the LBA block is unlocked, and there is sufficient space to write the command data, an R2T command is sent back to remote host 300, instructing remote host 300 to send the data to be written.
[0111] If there is not enough cache space, the data in the corresponding namespace will be actively written to disk to free up cache space.
[0112] S105 , after receiving the R2T command, the remote host 300 sends the data to be written in the form of a TCP / IP / Ethernet message, which is then parsed by the TOE module and the message parsing module 111 and sent to the redundancy module 120 via the IOQ processing module.
[0113] S106 , the redundancy module 120 divides the data blocks and calculates the check blocks according to the redundancy mode of the current storage array.
[0114] First, the redundancy module 120 needs to perform a data integrity check on the data to be written, and check whether the data is consistent based on the DIF (Data Integrity Field) of the data.
[0115] After the integrity check is passed, redundancy calculation is performed. If the current redundancy mode is k+m, the data is divided into k parts, and m parts of verification data are obtained based on the encoding of the k parts of data. The k+m parts of data obtained after the redundancy calculation are written into the controller memory 140.
[0116] The CQ (Completion Queque) corresponding to the data write completion is sent to the remote host 300 to notify the remote host 300 that the data write is complete. Since the redundancy module 120 has completed the data integrity check, ensuring the reliability of the data to be written in the cache, the remote host 300 can be directly notified that the data write is complete without waiting for the data to be actually written to the non-volatile storage array 200 (NVME hard drive). If an integrity check error occurs at the non-volatile storage array 200 during the subsequent disk write process, the data can be read again from the controller memory 140.
[0117] S107, the redundancy module 120 generates an instruction to inform the NVMe-PCIe host of the cache address of k+m copies of data (data to be written and verification data after redundancy calculation).
[0118] S108, the NVMe-PCIe host maps the corresponding cache address to the memory of the NVMe-PCIe host.
[0119] For example, the cache address of k+m copies of data is A1-A5. The NVME-PCIe host writes the first address A1 and the data length into the DMA register of the corresponding namespace in the NVMe hard disk. Each namespace corresponds to a register. The register address is exchanged when the NVMe-PCIe host and the NVME hard disk initialize and establish a DMA connection.
[0120] When a DMA register in the NVMe hard drive is enabled, the NVMe hard drive can directly read k+m copies of data from the cache mapped by the corresponding NVMe-PCIe host by writing the first address A1 and data length of the register through the NVMe-PCIe host.
[0121] After the data is read, the NVMe hard drive writes the DMA completion flag into the DMA register of the NVMe-PCIe host.
[0122] S109, the NVMe-PCIe host sends a disk write completion notification in response to the DMA completion to notify the redundancy module 120 that the cache space A1-A5 has been released, and the cache space can be continued to be used by the redundancy module 120.
[0123] The following describes the storage array controller 100 according to an embodiment of the present application, taking a read command as an example. In this example, the storage interface control module 110 uses an NVMe-oF controller, the non-volatile storage control module 130 uses an NVMe-PCIe host, the protocol offload engine 150 uses a TOE module (TCP / IP Offload Engine), and the controller memory 140 uses HBM. The specific processing of the storage array controller 100 includes the following steps:
[0124] S201, the TOE module parses the received TCP / IP / Ethernet message and sends the parsed message data (data part) to the NVMe-oF controller.
[0125] S202, the message parsing module 111 in the NVMe-oF controller decapsulates the message data to obtain an operation command, which includes a PDU (Protocol Data Unit). According to the PDU, the operation command is determined to be a data transmission type (read operation command), and then the read operation command is sent to the IOQ processing module (command queue processing module 112).
[0126] S203 , the IOQ processing module adds the received read operation command to a command queue for management and scheduling, such as a read / write command queue, a priority command queue, or an NS (NameSpace) command queue.
[0127] When the read operation command is executed, an indication command is sent to the redundant module 120 to instruct the redundant module 120 to check whether there is an address space for the corresponding LBA block in the controller memory 140. If so, and it is not in a locked state, the data is directly read from the address space of the corresponding LBA block in the controller memory 140; if so, and the corresponding LBA block is in a locked state, the execution of the command is temporarily suspended; if there is no address space for the corresponding LBA block in the controller memory 140, the cache space (the second cache subspace) is prepared and the relevant data is read.
[0128] At the same time, the IOQ processing module generates a command for reading consecutive addresses in the same namespace and transmits it to the redundancy module 120 .
[0129] S204, the redundancy module 120 queries the cache status table to see if there is enough cache space to receive the data to be read. If so, it instructs the NVMe-PCIe host to read the data from the NVMe hard disk, and informs the address of the cache space for receiving the data and the target address of the data to be read.
[0130] If there is not enough cache space, the data in the corresponding namespace will be sent to the remote host 300 first to free up cache space.
[0131] S205, the NVMe-PCIe host sends a command to read data to the NVMe hard disk, and maps the cache space to the memory of the NVMe-PCIe host to receive the data to be read.
[0132] S206, after the NVMe hard disk prepares the data to be read, it writes the first address and length of the data into the DMA register of the NVMe-PCIe host.
[0133] S207, the NVMe-PCIe host responds to the DMA register enable, directly reads data from the memory of the NVMe hard disk according to the data address and data length written by the NVMe hard disk, and notifies the redundancy module 120 to release the relevant cache after reading.
[0134] S208 , the redundancy module 120 merges the data blocks or recovers the data according to the redundancy mode of the current array, and sends the data to the remote host 300 .
[0135] If the current redundancy mode is k+m, if the data is read successfully, k copies of user data among the k+m copies of data are merged and sent to the remote host 300.
[0136] If data loss or read errors occur, data recovery is completed based on the remaining correct data in the k+m data copies. For example, if a piece of data is lost, the lost data is recovered based on the remaining data in the k+m data copies to obtain the complete data.
[0137] Figure 7 A flow chart of a data processing method according to an embodiment of the present application is shown. The method is applicable to the redundancy module 120 in the storage array controller 100. Exemplarily, the data processing method includes the following steps:
[0138] S100, performing redundancy calculation on the data determined based on the operation command and writing it into the controller memory 140; wherein, the operation command is obtained by the storage interface control module 110 by parsing the message data sent by the remote host 300, and the operation command is scheduled and managed based on the namespace and then transmitted to the redundancy module 120.
[0139] S200 , managing the logical address space of the non-volatile storage array 200 and the controller memory 140 based on a namespace.
[0140] S300 , sending a data transmission request to the non-volatile storage control module 130 ; the data transmission request is used to instruct the non-volatile storage control module 130 to map the controller memory 140 and implement data interaction with the non-volatile storage array 200 .
[0141] It can be understood that the method of this embodiment corresponds to the redundancy module 120 in the storage array controller 100 of the above embodiment. The options in the above embodiment are also applicable to this embodiment, so they will not be described again here.
[0142] Figure 8 FIG. 8 is a schematic diagram showing a structure of the redundancy module 120 according to an embodiment of the present application. Exemplarily, the redundancy module 120 includes: a redundancy calculation submodule 810 , an address management module 820 , and a data transmission module 830 .
[0143] a redundancy calculation submodule 810 configured to perform redundancy calculation on data determined based on an operation command and then write the resultant data into the controller memory 140; wherein the operation command is obtained by the storage interface control module 110 by parsing message data sent by the remote host 300, and is then scheduled and managed based on the namespace before being transmitted to the redundancy module 120;
[0144] an address management module 820 for managing the logical address space of the non-volatile storage array 200 and the controller memory 140 based on a namespace;
[0145] The data transmission module 830 is used to send a data transmission request to the non-volatile storage control module 130 ; the data transmission request is used to instruct the non-volatile storage control module 130 to map the controller memory 140 and implement data interaction with the non-volatile storage array 200 .
[0146] It can be understood that the device of this embodiment corresponds to the data processing method of the above embodiment, and the options in the above embodiment are also applicable to this embodiment, so they will not be described again here.
[0147] In order to improve the efficiency of the redundancy module in processing data on the controller memory based on the namespace, the present invention also provides a cache management method, device, controller and medium for a storage array. In the embodiment of the present invention, the redundancy module implements a cache management method for a storage array provided by the present invention.
[0148] The cache management method of the storage array is described below with reference to some specific embodiments.
[0149] In the embodiment of the present application, the redundancy module performs cache management on the controller memory 140 (hereinafter referred to as cache) according to the current redundancy mode and the number of NS (Namespace). Exemplarily, the cache management method of the storage array includes the following steps:
[0150] S2210, map the non-volatile storage array 200 to a virtual logical address space according to the namespace, and divide the virtual logical address space into virtual logical address groups. Map the logical addresses of the non-volatile storage array 200 one by one to obtain a virtual logical address space, which includes virtual logical addresses (also known as VIR_LBA addresses) corresponding to all logical addresses (also known as LBA addresses, logical block addresses, Logical Block Address) in the non-volatile storage array 200. What is managed in the embodiment of the present application is the mapping relationship between the VIR_LBA address of the storage array controller 100 and the LBA address of the non-volatile storage array 200, and the mapping and address conversion of the LBA address and the PBA address (Physics Block Address) in the non-volatile storage array 200 are not limited in this application. The storage array controller 100 of the present application is an external controller of the non-volatile storage array 200.
[0151] In one embodiment, the present application supports HMB (Host Memory Buffer) technology, where the memory of the storage array controller 100 is open to the controller of the non-volatile storage array 200 to store the FTL (Flash Translation Layer) table. When the non-volatile storage array 200 is a DRAM-less hard drive, enabling this function can significantly improve the performance of the storage array.
[0152] Furthermore, dividing the virtual logical address space into virtual logical address groups includes:
[0153] The virtual logical address space is divided according to a preset number of namespaces to obtain virtual logical address subspaces of a number equal to the preset number.
[0154] That is, the redundancy module 120 allocates a fixed VIR_LBA address space (virtual logical address subspace) to each namespace, as shown in Table 2-1.
[0155] Table 2-1 Namespace and VIR_LBA address space
[0156] Namespace VIR_LBA address NameSpace1 VIR_LBA0-VIR_LBA99 NameSpace2 VIR_LBA100-VIR_LBA249 … … NameSpacex VIR_LBAm-VIR_LBAn
[0157] A fixed mapping is established between each VIR_LBA address in each namespace and the LBA address of the non-volatile storage array 200. As shown in Table 2-2, the LBA addresses of NS1 in the non-volatile storage array 200 are LBA1050-LBA1149.
[0158] Table 2-2 Mapping relationship between VIR_LBA address and LBA address in storage array
[0159] NS1's VIR_LBA address LBA address in the storage array NS1-VIR_LBA0 LBA1050 NS1-VIR_LBA2 LBA1051 … … NS1-VIR_LBA99 LBA1149
[0160] For example, when a write data command for NS1 is received, the write data size is 10, and a virtual logical address of VIR_LBA0-VIR_LBA9 is assigned to the write data command, and sufficient cache space is requested from the controller memory 140 (e.g., HBM High Bandwidth Memory) for VIR_LBA0-VIR_LBA9 to prepare for receiving the write data. VIR_LBA0-VIR_LBA9 is mapped to the logical addresses LBA1050-LBA1059 of the non-volatile storage array 200 (e.g., SSD hard disk). Furthermore, each continuous logical address block in the virtual logical address subspace is divided into a namespace array according to the redundancy mode of the non-volatile storage array 200; a row of the logical address blocks in the namespace array is regarded as a stripe, wherein the number of logical address blocks in the stripe is the same as the number of redundant group members in the non-volatile storage array 200, and the namespace array is divided into multiple virtual logical address groups, each of which includes one or more stripes.
[0161] If the current redundancy mode is k+m, that is, there are k+m i members in a redundancy group, such as Figure 9 As shown, SSD1-SSDi is a redundant group.
[0162] To improve performance, this embodiment of the application divides the namespace array into multiple virtual logical address groups. Specifically, the contiguous VIR_LBA address space within a namespace is defined as a VIR_LBA group, denoted as a VIR_LBAG. When the array is redundant, each VIR_LBAG is further divided into arrays based on the current redundancy mode.
[0163] Divide the cache array according to the current redundancy mode Figure 10 (A namespace array divided by a virtual logical address group in a namespace under a certain redundancy group), each row in the NS array (namespace array) is a stripe, and the number of LBA_BLOCKs (logical address blocks) in the stripe is determined by the number of redundancy group members. The VIR_LBA address of the namespace corresponds one-to-one to the LBA address of the SSD disk. The number of LBA_BLOCK blocks in each column is related to the total VIR_LBA capacity allocated to the current NS, the overall cache capacity, and the actual storage business characteristics. For example, a certain NS may be mainly small random IO, then the number of LBA_BLOCK blocks in the array can be designed to be very small, and the same cache space can be divided into more VIR_LBAGs. For devices that support redundancy features, the VIR_LBAG in its cache is at least one stripe. In other cases, multiple stripes can also be divided into one VIR_LBAG for management and operation as needed.
[0164] The space size of a VIR_LBAG and the number of LBA_BLOCKs remain unchanged when the redundancy group configuration remains unchanged. This also applies if individual members of the redundancy group fail (for example, an SSD member is damaged and cannot be used, but the entire redundancy group can still recover data normally).
[0165] S2220: Determine the activity level of cached data in the virtual logical address group according to the storage status corresponding to the virtual logical address group.
[0166] S2230: Determine a target virtual logical address group that needs to be stored in the non-volatile storage array 200 according to the activity level.
[0167] In order to ensure that there is enough free space in the cache space, the present application writes data with low activity levels to the disk. It can be understood that the target virtual logical address group that needs to be stored in the non-volatile storage array 200 according to the activity level includes:
[0168] The virtual logical address group with a low activity level is determined as the target virtual logical address group.
[0169] When the cache space is full, the virtual logical address group at the intermediate activity level may also be determined as the target virtual logical address group.
[0170] Furthermore, the determining of the target virtual logical address group to be stored in the non-volatile storage array 200 according to the activity level includes:
[0171] The target cache data that needs to be stored in the non-volatile storage array 200 in the target virtual logical address group is determined according to the storage status.
[0172] Furthermore, the determining of the target virtual logical address group to be stored in the non-volatile storage array 200 according to the activity level includes:
[0173] The target logical address for storing the target cache data in the non-volatile storage array 200 is determined according to the virtual logical address group and the preset logical address mapping relationship.
[0174] The target cache data is written into the non-volatile storage array 200 according to the target logical address.
[0175] In one embodiment, the storage status includes a read / write status flag corresponding one-to-one to each logical address block in the virtual logical address group.
[0176] Exemplarily, in an embodiment of the present application, an LBAG status table (also known as a virtual logical address group status table) is used to record the allocation and usage of VIR_LBAG in each namespace. That is, the storage status is stored in the LBAG status table. The activity level of the cached data in the virtual logical address group is determined based on the storage status recorded in the LBAG status table. The LBAG status table includes read-write status flags that correspond one-to-one to each logical address block (LBA_BLOCK) in the virtual logical address group. Multiple read-write status flags are required depending on the number of LBA_BLOCKs in the current virtual logical address group, and each LBA_BLOCK corresponds to a 1-bit read-write status flag, as shown in Table 2-3.
[0177] Table 2-3LBAG status table 1
[0178]
[0179] The step of determining target cache data in the target virtual logical address group that needs to be stored in the non-volatile storage array 200 according to the storage state includes:
[0180] The cached data in the logical address block corresponding to the read / write status flag in the target virtual logical address group is determined as the target cached data. That is, within the target virtual logical address group, the logical address block corresponding to the read / write status flag in the write state is first determined to obtain the target logical address block, and the cached data in the target logical address block is determined as the target cached data. The target cached data is stored in the non-volatile storage array 200 to complete the write to disk.
[0181] Furthermore, the method further includes: updating the corresponding storage status according to the read and write operations on the virtual logical address groups corresponding to the namespaces in the cache, specifically including:
[0182] If the data stored in the cache of the logical address block is first data, the read / write status flag corresponding to the logical address block is set to the write state, and the first data is the write data sent by the remote host 300. For example, if the data in the logical address block is write data from the NVMe-oF controller, the read / write status flag corresponding to the logical address block is set to 1, indicating the write state. Therefore, when the current virtual logical address group needs to be written to disk, the data corresponding to the logical address block with the read / write status flag set to 1 must be written to disk.
[0183] If the data stored in the cache of the logical address block is second data, the read / write status flag corresponding to the logical address block is set to the read state; the second data is empty data or read data read from the non-volatile storage array 200. For example, if the data in the logical address block is read data from the SSD, or if no data is currently written to the logical address block, the read / write status flag corresponding to the logical address block is set to 0, indicating a read state. Therefore, when the current virtual logical address group needs to be written to disk, the data in the logical address blocks set to 0 is not written to disk.
[0184] Furthermore, the method further comprises:
[0185] When writing the target cache data into the non-volatile storage array 200, redundancy calculation is performed on the cache data in each logical address block in the stripe to obtain verification data and write it into the verification block in the stripe; and the read-write status flag corresponding to the verification block is set to the write state.
[0186] In redundancy mode, when the IOQ processing module transmits write data to the redundancy module 120, it only divides the write data according to the current redundancy mode and stores it in the corresponding data block cache. No verification calculation is performed temporarily, and the corresponding check block is empty. The verification data is calculated and filled into the corresponding check block when it needs to be written to the disk. The read-write status flag corresponding to the check block used to store the check data will be forced to 1 to indicate that the LBA_BLOCK needs to be written to the disk. For example, if the current redundancy mode is k+m, then the write data is written to the k data LBA_BLOCKs in a stripe, and the read-write status flag is set to 1. Although the m check blocks are temporarily empty and the check data does not come from the NVMe-oF controller, the check data will be calculated when it needs to be written to the disk, and the check blocks will be written and the corresponding read-write status flag will be set to 1, indicating that the LBA_BLOCK needs to be written to the disk.
[0187] In one embodiment, the storage status includes a full flag corresponding to each virtual logical address group. One virtual logical address group corresponds to one full flag, and one full flag is stored using 1 bit.
[0188] The method further comprises:
[0189] Determine whether each read / write status flag corresponding to each logical address block in the virtual logical address group is in the write state, and obtain the number of logical address blocks whose read / write status flag is in the write state. If the number of blocks is greater than a preset threshold, determine that the full flag corresponding to the virtual logical address group is in the full state. For example, in the write state, the full flag is set to 1, indicating that the cache space corresponding to the virtual logical address group is full or about to be full.
[0190] The method further includes: using the virtual logical address group corresponding to the full state of the write flag as the target virtual logical address group, that is, the virtual logical address group that needs to be written to the disk, and then determining the target cache data that needs to be written to the disk according to the read-write status identification bit.
[0191] Exemplarily, the number of 1s in each read / write status flag within a virtual logical address group is counted. When this number exceeds a preset threshold (e.g., 2 / 3 of the logical address block), the full flag is set to 1 to indicate that the virtual logical address group is full, as a condition for flushing to disk. In one embodiment, the storage status includes a number of activity factor flags corresponding to each virtual logical address group. Each virtual logical address group corresponds to one activity factor flag, and the activity factor flag has a size of 1 to n bits.
[0192] The method further includes: updating corresponding storage states according to read and write operation commands of the virtual logical address groups corresponding to each namespace in the cache, specifically including:
[0193] The activity factor flag value corresponding to the virtual logical address group is set according to the frequency of the read and write operation commands received for the virtual logical address group. The greater the frequency of the read and write operations, the more active the virtual logical address group is.
[0194] Furthermore, setting the corresponding activity factor flag value according to the frequency of the read and write operation commands received by the virtual logical address group includes:
[0195] Counting objects based on the virtual logical address group according to a preset frequency and counting period;
[0196] During the counting period, the activity factor flag value is updated according to a preset updating rule based on whether the virtual logical address group receives a read or write operation command.
[0197] Furthermore, the activity factor flag value is updated according to a preset update rule based on whether the virtual logical address group receives a read or write operation command within the counting period, including:
[0198] If the read / write operation command is not received within the counting period, the respective digits of the activity factor flag value are retrieved in a set digit order, and the second state value is updated and written to the digit corresponding to the first first state value; wherein, in the initial state, the values of the respective digits of the activity factor flag value are all the first state values.
[0199] If the read / write operation command is received within the counting cycle, the respective digits of the activity factor flag value are retrieved in the reverse order of the set digits, and the first state value is updated and written to the digit corresponding to the first second state value.
[0200] For example, once a virtual logical address group is allocated, the activity factor flag value of the activity factor flag bit defaults to all 1s. Whether the individual bits in the activity factor flag value are set to 0 depends on a counter that continuously accumulates naturally, and the operating frequency of the counter (i.e., the speed of counting) can be set. A certain technical cycle is set based on the counter. If no read or write operation is received for the current virtual logical address group when the counter overflows, one of the bits of the activity factor flag value is set to 0; if a read or write operation is received for the current virtual logical address group within one counting cycle of the counter, the counter is reset to zero and the count is restarted, and a 0-bit bit of the activity factor flag value is flipped to 1.
[0201] For example, if a 3-bit liveness factor flag is set, and the counter's counting period is t, the counter will naturally increment from 0. After counting period t, the counter reaches its maximum value and overflows. After the current virtual logical address group is allocated, the liveness factor flag value is 111, and the counter begins counting. If no read / write operation is received for the current virtual logical address group after counting period t, the liveness factor rolls over to 110. The counter resets to zero and counts again. If no read / write operation is received for the current virtual logical address group after counting period t, the liveness factor flag value rolls over to 100. If the counter resets to zero and counts again but receives a read / write operation for the current virtual logical address group before the end of the counting period, the liveness factor flag value rolls over to 110, and so on. That is, if the liveness factor flag value receives a read or write command within the counting period, the value of the 0 digit rolls over to 1, and so on. When the liveness factor flag value is all 1, there is no overflow and it remains all 1. If no read or write operation command is received during the counting cycle, the value of the 1 digit is flipped to 0, and so on; when the activity factor flag value is all 0, it does not overflow and remains all 0.
[0202] Furthermore, determining the activity level of cached data in the virtual logical address group according to the storage state corresponding to the virtual logical address group includes:
[0203] If the numbers on each digit of the activity factor flag value corresponding to the virtual logical address group are all the second state values, the activity level of the cached data in the virtual logical address group is determined to be a low activity level.
[0204] If the numbers on each digit of the activity factor flag value corresponding to the virtual logical address group are all the first state values, the activity level of the cache data in the virtual logical address group is determined to be a high activity level.
[0205] Counting the number of digits of each digit of the activity factor flag value that are the first state value;
[0206] If the number of digits is greater than a preset number, the activity level of the cached data in the virtual logical address group is determined to be an intermediate activity level.
[0207] The activity factor flag value represents the activity of the virtual logical address group, that is, the hotness or coldness of the data. A larger activity factor flag value indicates a more active virtual logical address group. Active data is kept in the cache as much as possible. An activity factor flag value of all 0 indicates that the virtual logical address group is no longer active and requires a write command to the SSD. If cache space is insufficient, cached data in virtual logical address groups with intermediate activity (non-all 0 values) can be written to disk based on activity.
[0208] In this embodiment, an activity factor flag value is used to represent the activity level of the data in the current virtual logical address group. Retaining highly active data in the cache reduces frequent operations on the SSD after the active data is written to disk, thereby reducing wear on the SSD and extending its lifespan. This also reduces the bandwidth requirements of the backend PCIe channel, significantly improving the I / O command performance of active data.
[0209] In one embodiment, the virtual logical address group is the granularity of read and write operation commands.
[0210] The storage state includes a number of lock flag bits equal to the number of virtual logical address groups. One virtual logical address group corresponds to one lock flag bit, for example, the size of the lock flag bit is 1 bit.
[0211] The method further comprises:
[0212] When operating the current virtual logical address group according to the read / write operation command, the lock flag corresponding to the current virtual logical address group is set to a locked state; and the read / write operation command accessing the virtual logical address group in the locked state is delayed. That is, after a read / write operation command operates the current virtual logical address group, the virtual logical address group is in a locked state before the read / write operation command is completed. For example, the lock flag is set to 1 to indicate a locked state. When a subsequent read / write operation command accessing the virtual logical address group in the locked state is received, the subsequent read / write operation command is delayed to prevent the two previous read / write operation commands from conflicting with each other, thereby causing confusion in the data of the virtual logical address group.
[0213] Each read or write command operates at the virtual logical address group granularity. Even if the currently requested cache space only covers one logical address block within a virtual logical address group, the entire virtual logical address group is locked until the current command completes. Only then can the next read or write command targeting the current virtual logical address group be executed. This reduces I / O execution speed somewhat, but it reduces repeated and frequent redundant calculations and wear and tear on the SSD.
[0214] The following describes the cache management method of the non-volatile storage array 200 according to an embodiment of the present application with reference to an example. In this example, the storage status includes a read / write status flag, a full flag, an activity factor flag, and a lock flag, as shown in Table 2-4.
[0215] Table 2-4LBAG status table 2
[0216]
[0217]
[0218] The activity factor flag bits of the current virtual logical address group are all 0, indicating that the current virtual logical address group has been inactive for a long time and needs to be cleared. The specific steps include:
[0219] S2301: The redundancy module 120 checks the activity factor flag bits of the virtual logical address group and finds that the flag bits are all 0, and determines that the virtual logical address group is of low activity level.
[0220] S2302: For the virtual logical address group of the low activity level, the redundancy module 120 calculates redundant check data based on the data of each LBA_BLOCK in the stripe and writes the redundant check data into the LBA_BLOCK corresponding to the check block, and sets the read / write status flag of the LBA_BLOCK corresponding to the check block to 1.
[0221] S2303, for the virtual logical address group with low activity level, the redundant module 120 uses the cache data in the LBA_BLOCK with the read / write status flag position 1 as the target cache data, submits the write operation instruction to the SSD disk, and writes the target cache data to the disk. After writing to the disk, the target cache data needs to be cleared and the read / write status flag position is set to 0.
[0222] For example, if the current redundancy mode is 4+2, with 4 data blocks and 2 redundancy check blocks, and the number of members in a stripe in the namespace is 6, then the number of members in a stripe in the corresponding virtual logical address group is also 6.
[0223] like Figure 11 As shown, for a virtual logical address group with all activity factor flags set to zero, redundancy calculation is performed based on the data in the logical address blocks LBA_BLOCK5, LBA_BLOCK2, LBA_BLOCK1, and LBA_BLOCK0. The calculated parity data is written to the parity blocks LBA_BLOCK4 and LBA_BLOCK3, and the read / write flags of LBA_BLOCK4 and LBA_BLOCK3 are set to 1. This changes the current read / write flags from 100001 to 111001. An SSD write operation instruction is then issued based on the read / write flags, writing the data in LBA_BLOCK5, LBA_BLOCK4, LBA_BLOCK3, and LBA_BLOCK0 (with the read / write flags set to 1) to the SSD. After the write is complete, the cache occupied by the virtual logical address group is released.
[0224] The following describes the cache management method of the non-volatile storage array 200 according to an embodiment of the present application with reference to another example. In this example, when the cache space corresponding to the current namespace is insufficient, it is necessary to quickly organize virtual logical address groups that can be cleared to free up cache space for storing data for other read / write commands. The specific steps are as follows:
[0225] S2401: The redundancy module 120 detects that the cache space corresponding to the current namespace is insufficient.
[0226] S2402 , the redundancy module 120 checks the full flag corresponding to each virtual logical address group in the LBAG status table, and uses the virtual logical address group with the full flag set to 1 as the target virtual logical address group that needs to be written to disk.
[0227] S2403 , the redundancy module 120 checks the activity factor flag value of the activity factor flag corresponding to the target virtual logical address group, determines the activity level of the target virtual logical address group according to the activity factor flag value, and selects a target virtual logical address group with a low activity level.
[0228] S2404: For the target virtual logical address group with low activity level, the redundancy module 120 calculates redundant check data based on the data of each LBA_BLOCK of the stripe and writes the check data into the LBA_BLOCK corresponding to the check block.
[0229] At S2405, for the target virtual logical address group with a low activity level, the redundancy module 120 sets the cached data in the LBA_BLOCK with the read / write status flag set to 1 as the target cached data, submits a write instruction to the SSD, and writes the target cached data to the SSD. After writing to the SSD, the target cached data is cleared. Furthermore, after sending the data read from the non-volatile storage array 200 to the remote host 300, the cached data in the LBA_BLOCK with the read / write status flag set to 0 is also cleared.
[0230] In order to improve the management efficiency of the controller memory by the redundancy module, the present application further provides a cache management method, storage array controller, apparatus, device and medium. In the embodiment of the present application, the redundancy module implements a namespace-based cache management method of the present application.
[0231] In a namespace-based cache management method according to an embodiment of the present application, for simplicity, the cache in the redundant module does not have separate read and write cache spaces. Data in the cache space may originate from a remote host 300 or a storage array. The cache is internally divided and managed solely by namespace, with each namespace allocated a separate cache for storing data. Namespaces belonging to different hard drives can write data in parallel. Independent namespace caching prevents data from a single namespace from occupying the entire cache and slowing down overall read and write speeds.
[0232] The namespace-based cache management method is described below with reference to some specific embodiments.
[0233] In the embodiment of the present application, the redundancy module 120 performs cache management on the controller memory 140 (hereinafter referred to as cache) according to the current redundancy mode and the number of NS (Namespace). Exemplarily, the namespace-based cache management method includes the following steps:
[0234] S3210 , allocating a cache area for the access command in the static cache subspace according to the namespace to be accessed by the access command.
[0235] The controller memory 140 in the embodiment of the present application includes a static cache space. It can be understood that the present application uses a preset capacity allocation rule to divide the static cache space according to the number of namespaces, and obtains static cache subspaces corresponding to each of the namespaces. In this way, a static cache subspace is obtained. For example, a device supports i NS (NameSpace), and the static cache space is divided into i NS, as shown in Table 3-1. Each namespace corresponds to a static cache subspace. In this way, it is ensured that each NS has a certain amount of cache space. Once a read or write operation command accesses the NS, the remote host 300 can be immediately notified that there is enough cache space to instruct the remote host 300 to send write data; the cache space will not be used up by other NSs and cannot respond to the command.
[0236] Table 3-1 Correspondence between namespaces and static cache subspaces
[0237] Namespace Static cache space NS1 Static cache subspace 1 NS2 Static cache subspace 2 … … NSi Static cache subspace i
[0238] Furthermore, the static cache space is divided according to the number of namespaces using a preset capacity allocation rule, including:
[0239] The static cache space is evenly divided according to the number of namespaces to obtain various static cache subspaces, and the static cache subspaces are fixed.
[0240] Alternatively, the namespaces can be divided based on a preset capacity ratio. For example, a ratio of static cache space occupied by each namespace can be set, and fixed static cache subspaces can be divided for each namespace based on the ratio. However, once a static cache subspace is divided, its capacity is fixed and will not be adjusted based on actual cache usage or the validity of the NS.
[0241] Furthermore, the nonvolatile storage array 200 is mapped into a virtual logical address space based on each of the namespaces. All logical addresses of the nonvolatile storage array 200 are mapped to equal sizes to obtain a virtual logical address space. The virtual logical address space includes virtual logical addresses (referred to as VIR_LBA addresses) that correspond one-to-one with each logical address (referred to as LBA addresses) in the nonvolatile storage array 200, as shown in Table 3-2.
[0242] Table 3-2 Mapping relationship between VIR_LBA address and LBA address in storage array
[0243] VIR_LBA address LBA address in the storage array VIR_LBA0 LBA0 VIR_LBA1 LBA1 … … VIR_LBAi LbI
[0244] The virtual logical address space is divided according to the number of namespaces to obtain virtual logical address subspaces corresponding to each namespace. Thus, each virtual logical address subspace is obtained. The virtual logical address subspace includes multiple virtual logical addresses, as shown in Table 3-3.
[0245] Table 3-3 Correspondence between namespace and virtual logical address subspace
[0246] Namespace Virtual logical address subspace NS1 VIR_LBA0-VIR_LBA99 NS2 VIR_LBA100-VIR_LBA249 … … NSi VIR_LBAm-VIR_LBAn
[0247] Furthermore, allocating a cache area for the access command in the static cache subspace according to the namespace to be accessed by the access command includes:
[0248] S3211: Obtain a virtual logical address subspace according to the namespace matching.
[0249] S3212: Allocate a target virtual logical address for the access command from the virtual logical address subspace.
[0250] S3213: Allocate the cache area for the target virtual logical address from the static cache subspace uniquely corresponding to the namespace.
[0251] To improve performance and facilitate management, the allocation granularity of the virtual logical address subspace corresponding to NS is set according to the redundancy mode of the SSD hard disk (non-volatile storage array 200). The virtual logical address subspace is divided into multiple stripes according to the number of members in the redundancy group of the SSD hard disk. Specifically, according to the redundancy mode of the non-volatile storage array 200, the virtual logical address subspace is divided into a namespace array. A row of virtual logical addresses in the namespace array is regarded as a stripe, such as Figure 12 As shown (namespace array corresponding to NS1).
[0252] Furthermore, in step S3212, allocating a target virtual logical address for the access command from the virtual logical address subspace includes:
[0253] When the access command is to access any virtual logical address in the stripe, the stripe is assigned to the access command as the target virtual logical address. It can be understood that when an access command accesses any virtual logical address in a stripe, the entire stripe where the virtual logical address is located will be allocated to the access command, and a cache area of the entire stripe size will be requested from the corresponding static cache subspace. Therefore, the static cache subspace should be set to an integer multiple of the stripe length. If a read command is received for NS1 to read the data corresponding to VIR_LBA3, it is necessary to request a corresponding cache area from the static cache subspace in NS1 for the entire stripe where VIR_LBA3 is located.
[0254] In step S3213, allocating the cache area for the target virtual logical address from the static cache subspace uniquely corresponding to the namespace includes:
[0255] If the cache area is not matched according to the stripe, a cache area is allocated to the stripe from the static cache subspace corresponding to the namespace according to the capacity of the stripe.
[0256] In one embodiment, to improve data processing speed, the method of the embodiment of the present application further includes: dividing each namespace within the hard disk group of the non-volatile storage array 200 into a namespace group. Allocating a cache area for the access command in the static cache subspace based on the namespace to be accessed by the access command includes:
[0257] Access commands in different namespace groups are executed in parallel, and cache areas are allocated for corresponding access commands in corresponding static cache subspaces according to the namespaces to be accessed. Figure 13 The figure shows a schematic diagram of an NS Group, where NameSpace1, NameSpace2, and NameSpace3 belong to NS Group1, and NameSpace4, NameSpace5, and NameSpace6 belong to NS Group2. Different namespace groups can be accessed in parallel without affecting each other because they store different hard disk groups. Therefore, limiting the dynamic space usage of a single namespace group is beneficial to improving the overall processing efficiency of the array system.
[0258] S3220: Receive target data for reading and writing the non-volatile storage array 200 based on the access command, and cache the data in the cache area. The static cache subspace is obtained by dividing the static cache space in the controller memory 140 according to the namespace.
[0259] In one embodiment, in order to increase the speed of reading data, the present application also supports pre-reading data. The method further includes:
[0260] S3310: If the access command is a read command for reading a first virtual logical address, determine the stripe in which the first virtual logical address is located according to the first virtual logical address.
[0261] S3320, read the read data corresponding to the stripe in the non-volatile storage array 200; map the logical address of the non-volatile storage array 200 according to the virtual logical addresses corresponding to the stripe, and read the read data in the non-volatile storage array 200 according to the logical address of the non-volatile storage array 200.
[0262] S3330: Cache the read data in a cache area corresponding to the stripe to serve as pre-read data for subsequent reading of other addresses in the stripe except the first virtual logical address.
[0263] For example, if a read command is received from NS1 to read data corresponding to VIR_LBA3, a corresponding cache area must be allocated from the static cache subspace in NS1 for the entire stripe containing VIR_LBA3. Alternatively, only the data corresponding to VIR_LBA3 can be read, or a pre-read operation can be performed to read all the data corresponding to the entire stripe from the non-volatile storage array 200 into the corresponding cache area. A subsequent command to read data corresponding to VIR_LBA4 in the stripe can then be read directly from the cache area, thereby improving data reading efficiency.
[0264] In one embodiment, the controller memory 140 also includes a dynamic shared cache space, such as Figure 14 shown.
[0265] The method further comprises:
[0266] When the static cache subspace corresponding to the namespace is full, a storage area of preset capacity is requested from the dynamic shared cache space for the namespace.
[0267] Furthermore, the method further comprises:
[0268] Whether the application is approved is determined based on the current space capacity, the current space group capacity, and preset space capacity thresholds and space group capacity thresholds. The current space capacity is the current capacity of the static cache subspace already obtained by the namespace; the current space group capacity is the sum of the current capacities of the static cache subspaces obtained by each namespace contained in the namespace group.
[0269] Exemplarily, if the current capacity of the space group corresponding to the namespace group does not reach the space group capacity threshold, and the current capacity of the space corresponding to the namespace does not reach the space capacity threshold, then the application is determined to be approved, that is, the storage area is allowed to be allocated from the dynamic shared cache space, otherwise the application is rejected.
[0270] In other words, in order to prevent a certain NS from occupying a large amount of dynamic space and affecting the use of other NSs, the embodiment of the present application sets a watermark for the dynamic space that can be applied for for each NS and the namespace group in which the NS is located. The application of dynamic space for all namespaces belonging to the same namespace group is limited by the watermark of the namespace itself and the namespace group to which it belongs (i.e., the threshold). When a namespace applies for dynamic space and touches any of the above watermarks, no more dynamic space will be allocated to it.
[0271] Furthermore, the method further comprises:
[0272] If the static cache subspace is full and the request is rejected, the write data and pre-read data in the static cache subspace corresponding to the namespace are cleared. To execute commands, the namespace needs to free up cache space occupied by completed commands. For write command caches, this triggers the backend to flush data to disk as quickly as possible; for read command caches, pre-read data is cleared.
[0273] The following describes the namespace-based cache management method according to an embodiment of the present application with reference to an example of a write command, which specifically includes the following steps:
[0274] S3401: The redundancy module 120 receives a write command and allocates an idle virtual logical address VIR_LBA according to the namespace accessed by the current write command and the length of the data to be written, which is recorded as the first address.
[0275] S3402: The redundancy module 120 determines whether the stripe to which the first address belongs has been allocated a cache area according to the cache status table. If the stripe has been allocated a cache area, step S3403 is executed; if not, step S3404 is executed.
[0276] S3403 , the redundancy module 120 sends an R2T (Ready to Transfer, indicating that the cache area is ready) to the remote host 300 to instruct the remote host 300 to send the data to be written.
[0277] S3404: The redundancy module 120 determines whether there is any free cache area in the static cache sub-area of the namespace corresponding to the stripe. If there is a free cache area, step S3405 is executed; otherwise, step S3406 is executed.
[0278] S3405 , the redundancy module 120 allocates an available fixed cache area to the stripe from the static cache sub-area corresponding to the namespace.
[0279] S3406, the redundancy module 120 determines whether the dynamic shared cache space applied for by the currently accessed NS triggers the preset watermark (including the space capacity threshold and the space group capacity threshold). If triggered, cache cleanup is performed and the released cache space is allocated to the stripe. If not triggered, the corresponding shared cache area is allocated from the dynamic shared cache space to the stripe.
[0280] S3407, sends R2T (Ready to Transfer, indicating that the cache area is ready) to the remote host 300 to instruct the remote host 300 to send the data to be written, and stores the received data to be written into the second address (physical address of the cache space) corresponding to the first address (VIR_LBA of NS) in the allocated cache area.
[0281] To increase the speed of data read and write processing for a storage array, for example, to increase the speed of determining the first cache subspace and the second cache subspace in the controller memory 140, the present application further provides a storage array data read and write method. The redundancy module in the present application implements a storage array data read and write method of the present application.
[0282] The storage array data reading and writing method is described below with reference to some specific embodiments.
[0283] In the embodiment of the present application, the redundancy module performs cache management on the controller memory 140 (hereinafter referred to as cache) according to the current redundancy mode and the number of NS (Namespace). Exemplarily, the storage array data reading and writing method includes the following steps:
[0284] S4210: Determine a corresponding cache address space in a cache space management table according to an index of a target address stripe in a command to access the storage array.
[0285] Furthermore, in the embodiment of the present application, the non-volatile storage array 200 is mapped into a virtual logical address space based on each namespace. For each logical address in the non-volatile storage array 200, there is a unique virtual logical address (Vir_LBA) corresponding to it in the virtual logical address space. The virtual logical address is used to determine the logical address in the non-volatile storage array 200 to be accessed.
[0286] The virtual logical address space is divided according to the number of each namespace to obtain virtual logical address subspaces corresponding to each namespace one by one. Thus, the virtual logical address subspaces are obtained by division, as shown in Table 4-1.
[0287] Table 4-1 Correspondence between namespace and virtual logical address subspace
[0288] Namespace Virtual logical address subspace NameSpace 1 VIR_LBA0-VIR_LBA99 NameSpace 1 VIR_LBA100-VIR_LBA249 … … NameSpace x VIR_LBAm-VIR_LBAn
[0289] Furthermore, in order to improve performance and facilitate management, the virtual logical address subspace corresponding to the namespace is divided into a namespace array according to the redundancy mode of the non-volatile storage array 200. A row of virtual logical addresses in the namespace array is regarded as a stripe, thereby obtaining the target address stripe. That is, the allocation granularity of the VIR_LBA in the NS is set according to the redundancy mode of the SSD hard disk (the SSD hard disk in the non-volatile storage array 200), and the VIR_LBA in the NS is divided into LBA stripes according to the number of members in the redundancy group of the SSD hard disk, such as Figure 15 shown.
[0290] Furthermore, determining the corresponding cache address space in the cache space management table according to the index of the target address stripe includes:
[0291] S4211: Determine a target namespace and a target virtual logical address to be accessed according to an access command to the non-volatile storage array 200. The access command includes the target namespace and the target virtual logical address.
[0292] S4212: Determine the target address stripe according to the target namespace and the target virtual logical address.
[0293] In one embodiment, determining the corresponding cache address space in the cache space management table according to the index of the target address stripe includes:
[0294] Matching the cache address space in the cache space management table according to the index;
[0295] If the match fails, the cache address space is obtained by partitioning the target address stripe from the controller memory 140 ;
[0296] If the match is successful, the index is obtained, and the corresponding cache address space in the cache space management table is obtained.
[0297] Furthermore, to facilitate cache space management, in an embodiment of the present application, a cache space management table is established based on the stripe index. It is understood that the method further includes: storing the divided cache address space in the cache space management table based on the sequence number of the target address stripe. After allocating cache space (cache address space) from the controller memory 140 for a stripe, the address of the cache space is written into the cache space management table. As shown in Table 4-2, the cache space management table records the physical address (Physics Block Address, PBA) of the controller memory 140 corresponding to each stripe.
[0298] Table 4-2 Cache space management table
[0299]
[0300] When a cache search is needed, the index of the stripe mapped to the virtual logical address corresponding to the access command is first determined. Then, based on the stripe index, the cache space management table is checked to see if cache space is allocated for that stripe. This application uses NS as the management unit, the index of the stripe where the virtual logical address is located as the KEY, and the Value of each physical address bit allocated to the stripe to construct a key-value pair. When read or write commands need to search for data stored in the cache space, they can quickly hit the target.
[0301] S4220 , cache the read and write data determined based on the access command to the non-volatile storage array 200 in the controller memory 140 according to the cache address space.
[0302] When any VIR_LBA within a stripe is used, the virtual logical address of the entire stripe in which the VIR_LBA is located is allocated, and cache space for the entire stripe is requested. For example, if a write data command for NS1 is received with a data length of 5, virtual logical addresses VIR_LBA0-VIR_LBA4 are assigned. Since VIR_LBAs are allocated and managed on a stripe-by-strip basis, stripe 1 is assigned to the current write data command, and sufficient cache space is requested from controller memory 140 for this stripe to cache the incoming write data. The received write data is cached in the cache space corresponding to LBA0-LBA4.
[0303] S4230: If the access command is a read command, read the target data and pre-read data according to the target address stripe and cache them in the controller memory.
[0304] In one embodiment, in order to significantly reduce the latency of read commands, the present application supports pre-reading data. It can be understood that the cache address space is used to cache the read and write data determined based on the access command to the non-volatile storage array 200 to the controller memory 140, including:
[0305] If the access command is a read command, obtaining the virtual logical address segment of the target data and the continuous virtual logical address segments adjacent thereto according to the target address stripe;
[0306] Target data and pre-read data are read from the non-volatile storage array 200 according to the virtual logical address segment and cached into the controller memory.
[0307] S4240: Send the target data.
[0308] The target data requested by the read command is sent to the host, and then the target data and the pre-read data are retained in the controller memory 140 so as to be directly read from the controller memory 140 by subsequent access commands related to the virtual logical address segment.
[0309] For example, when a read command is received, a command to read the relevant continuous addresses is generated based on the target access address of the read command and passed to the redundancy module 120 (EC / RAID). The redundancy module 120 reads data from the non-volatile storage array 200 based on the relevant continuous addresses and caches the read data in the HBM. When the IOQ processor 113 subsequently receives a command to access the relevant continuous addresses, it can quickly remove the above data from the HBM, thereby significantly reducing the latency of the read command.
[0310] In one embodiment, the method further comprises:
[0311] If the access command is a read command, determining the target address stripe to which the virtual logical address segment to be accessed by the read command belongs according to the virtual logical address segment to be accessed;
[0312] Matching a target cache address space in the cache space management table according to the index of the target address stripe;
[0313] If the match is successful, the pre-read data is read from the target cache address space according to the cache address to be accessed by the read command.
[0314] In one embodiment, the embodiment of the present application not only supports write termination and significantly reduces write latency, but also can identify the activity level of data in HBM to reduce wear on the SSD hard disk. It can be understood that the method also includes: writing the write data cached in the controller memory 140 to the non-volatile storage array 200 according to the activity level of the data. Under the premise of the write termination mechanism, the present application enables the redundant module 120 to identify the activity level of data in HBM, temporarily store active data in the cache space, and not write it to the disk. When there is a subsequent related write command to update the data, it can be completed directly in the cache space, reducing wear on the SSD hard disk.
[0315] In one embodiment, the present application supports a write summary function. After the redundancy module 120 writes the data corresponding to the write command to the controller memory 140 managed by the redundancy module 120, a command completion message CQ can be sent to the remote host 300 without waiting for the data to be actually written to the SSD disk, thereby significantly reducing the write latency. It can be understood that in step S4220, the read and write data determined based on the access command to the non-volatile storage array 200 is cached in the controller memory 140 according to the cache address space, including:
[0316] If the read / write data is write data, the write data is cached in the controller memory 140 and then command completion information is sent to the remote host 300 .
[0317] Furthermore, if the read / write data is write data, after caching the write data in the controller memory 140 , a command completion message is sent to the remote host 300 , including:
[0318] An integrity check is performed on the write data.
[0319] If the verification fails, a prompt message indicating a data write error is sent to the remote host 300;
[0320] If the verification passes, a command completion message is sent to the remote host 300.
[0321] In one embodiment, the embodiment of the present application not only supports write termination, significantly reducing write latency, but also can identify the activity level of data in the controller memory 140 to reduce wear on the SSD hard disk. It can be understood that the method also includes: writing the write data cached in the controller memory 140 to the non-volatile storage array 200 based on the activity level of the data. Under the premise of the write termination mechanism, the present application enables the redundancy module 120 to identify the activity level of data in the controller memory 140, temporarily store active data in the cache space, and not write it to the disk. When there is a subsequent related write command to update the data, it can be completed directly in the cache space, reducing wear on the SSD hard disk.
[0322] The following describes the storage array data reading and writing method according to an embodiment of the present application with reference to an example of a write command, which specifically includes the following steps:
[0323] S4301: The redundancy module 120 receives a write command and determines the stripe to which it is mapped based on the namespace and target virtual logical address accessed by the current write command.
[0324] S4302: Based on the stripe's index, the established cache space management table is checked to see if the stripe is in the cache. If the stripe is in the cache, indicating that a cache address space (e.g., PBAx-PBAy) has been allocated for the stripe, then step S4304 is executed. If not, indicating that no cache address space has been allocated for the stripe, then step S4303 is executed.
[0325] S4303: Apply for a cache address space in the controller memory 140 for the stripe, for example, PBAx-PBAy.
[0326] S4304, sending R2T (Ready to Transfer, indicating that the cache address space is ready) to the host to instruct the remote host 300 to send the data to be written.
[0327] In step S4305, the redundancy module 120 performs an integrity check on the data to be written. If the check fails, a CQ with an error message is sent to the remote host 300; if the check passes, a CQ with a completion status (corresponding to command completion information) is sent and step S4306 is executed.
[0328] S4306: Store the integrity-verified data to be written into the allocated cache address space.
[0329] The following describes the storage array data reading and writing method according to an embodiment of the present application with reference to an example of a read command, which specifically includes the following steps:
[0330] S4401: The redundancy module 120 receives a read command and determines the mapped stripe according to the namespace and target virtual logical address accessed by the current read command.
[0331] S4402: Query the cache space management table based on the index of the stripe to see if the stripe is in the cache. If the stripe is in the cache, execute step S4404; if not, execute step S4403.
[0332] S4403: Apply for a cache address space in the controller memory for the stripe, for example, PBAm-PBAn.
[0333] S4404, determining whether the physical address corresponding to the virtual logical address of the stripe is used; if it is used, it indicates that pre-read data already exists, and the pre-read data in the physical address cache is directly read and the pre-read data is used as the read data.
[0334] If it is not in use, a pre-read command is initiated to the SSD hard disk to read the data corresponding to the entire stripe, and the pre-read data read is stored in the allocated cache address space.
[0335] S4405, returning the read data in the physical address corresponding to the target virtual logical address to the remote host 300.
[0336] The present application also provides a terminal device. Exemplarily, the terminal device includes a processor and a memory, wherein the memory stores a computer program, and the processor runs the computer program to enable the terminal device to execute the above-mentioned data processing method or the functions of each sub-module in the above-mentioned redundant module.
[0337] Among them, the processor can be an integrated circuit chip with signal processing capabilities. The processor can be a general-purpose processor, including a central processing unit (CPU), a graphics processing unit (GPU) and a network processor (NP), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or at least one of other programmable logic devices, discrete gate or transistor logic devices, and discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc., which can implement or execute the disclosed methods, steps and logic block diagrams in the embodiments of the present application.
[0338] The memory may be, but is not limited to, a random access memory (RAM), a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), etc. The memory is used to store a computer program, and the processor may execute the computer program accordingly after receiving an execution instruction.
[0339] The present application also provides a computer-readable storage medium for storing the computer program used in the terminal device. For example, the computer-readable storage medium may include, but is not limited to, various media capable of storing program code, such as a USB flash drive, a mobile hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0340] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and structure diagrams in the accompanying drawings show the possible architectures, functions and operations of the devices, methods and computer program products according to the multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of the code, and the module, program segment or a part of the code contains one or more executable instructions for implementing the specified logical functions. It should also be noted that in an alternative implementation, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the structure diagram and / or flowchart, and the combination of boxes in the structure diagram and / or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or action, or can be implemented using a combination of dedicated hardware and computer instructions.
[0341] In addition, the functional modules or units in the various embodiments of the present application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0342] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a computer device (which can be a smart phone, personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application.
[0343] The above is only a specific implementation method of the present application, but the scope of protection of the present application is not limited thereto. Any technician familiar with this technical field can easily think of changes or replacements within the technical scope disclosed in this application, which should be covered by the scope of protection of the present application.
Claims
1. A storage array controller, characterized in that: include: Storage interface control module, redundancy module, non-volatile storage control module and controller memory; The redundancy module is respectively connected to the storage interface control module, the non-volatile storage control module and the controller memory; The storage interface control module is in communication with the remote host, and is used to receive and parse message data sent by the remote host to obtain operation commands, and schedule and manage the operation commands based on the namespace and then transmit them to the redundancy module; The redundancy module is used to perform redundancy calculation on the data and then write the data into the controller memory, and to manage the logical address space of the storage array and the controller memory based on the namespace; The non-volatile storage control module is in communication with the storage array, and in response to a data transmission request from the redundancy module, maps the controller memory to implement data interaction with the storage array; When executing an operation command of a write data type, the redundancy module is specifically configured to allocate an idle first cache subspace in the controller memory according to a target logical address of the operation command, and to feed back a preparation completion notification to the remote host, wherein the preparation completion notification is configured to instruct the remote host to send the target write data; The redundancy module is further configured to cache the target write data into the first cache subspace after performing integrity check and redundancy calculation.
2. The storage array controller according to claim 1, wherein: The storage interface control module includes a message parsing module and a command queue processing module; The message parsing module is used to receive and parse the message data sent by the remote host, obtain an operation command, and send the operation command of the data transmission type to the command queue processing module; The command queue processing module is used to store the operation command into the corresponding namespace command queue according to the accessed target namespace for scheduling management, and transmit the operation command to the redundancy module in sequence.
3. The storage array controller according to claim 2, wherein: When executing an operation command of a write data type, the redundancy module is further configured to send a command completion notification to the remote host after receiving target data through the storage interface control module and storing the target data in the controller memory.
4. The storage array controller according to claim 3, wherein: The redundancy module is specifically used to allocate an idle first cache subspace in the controller memory according to the target logical address of the operation command, and to feedback a readiness notification to the remote host through the command queue processing module, wherein the readiness notification is used to instruct the remote host to send target write data.
5. The storage array controller according to claim 4, wherein: The redundancy module is further configured to transmit a write command to the non-volatile storage control module, wherein the write command includes a target logical address and an address of the first cache subspace; The non-volatile storage control module is specifically configured to map the first cache subspace of the controller memory into its own memory according to the disk write command, and complete data interaction with the storage array.
6. The storage array controller according to claim 4, wherein: The non-volatile storage control module is further configured to send a write-to-disk completion notification to the redundancy module after the target write data is written into the storage array; The redundancy module is further configured to release the first cache subspace according to the disk flushing completion notification.
7. The storage array controller according to claim 2, wherein: When executing the read data type operation command, The command queue processing module is specifically configured to send a read data instruction command to the redundancy module according to the operation command when executing the operation command in the namespace command queue; The redundancy module is configured to determine an idle second cache subspace in the controller memory according to the read data indication command, and send a read data execution command to the non-volatile storage control module, wherein the read data execution command includes an address of the second cache subspace and a target logical address; The non-volatile storage control module is specifically configured to map the second cache subspace to its own memory, and read target read data from the storage array according to the target logical address and store the target read data into the second cache subspace of the controller memory; The redundancy module is used to integrate the target read data according to a preset redundancy mode, and send the integrated target read data to the remote host through the command queue processing module.
8. The storage array controller according to claim 2, wherein: The redundancy module is further configured to divide the controller memory into a write controller memory and a read controller memory; and then divide the write controller memory and the read controller memory respectively according to the namespace to obtain a cache submodule corresponding to each namespace; The redundant module is also used to cache the target data to the cache submodule corresponding to the namespace under the write controller memory when the operation command is a write data type; and to cache the target data to the cache submodule corresponding to the namespace under the read controller memory when the operation command is a read data type.
9. The storage array controller according to any one of claims 2 to 8, wherein: The storage interface control module further includes a processor; the processor is connected to both the message parsing module and the command queue processing module; The message parsing module is further configured to send non-data transmission type operation commands to the processor; The processor is used to establish a connection with the remote host according to the operation command, and configure and manage the scheduling function parameters of the command queue processing module.
10. The storage array controller according to claim 9, wherein: The storage interface control module is implemented using FPGA; wherein the processor is a built-in processor unit of the FPGA; the command queue processing module and the command queue processing module are both implemented through programming logic of the FPGA.
11. The storage array controller according to any one of claims 1 to 8, wherein: Also includes a protocol offload engine; The protocol offload engine is used to receive a protocol message of a preset protocol type sent by the remote host, parse the protocol message, and send the message data obtained by parsing to the storage interface control module.
12. A storage array system, characterized in that: include: A storage array and a storage array controller according to any one of claims 1 to 11.
13. A data processing method, applicable to a redundant module in a storage array controller, wherein the storage array controller comprises a storage interface control module, a redundant module, a non-volatile storage control module, and a controller memory, characterized in that: The method comprises: Performing redundancy calculation on data determined based on an operation command and then writing it into the controller memory; wherein the operation command is obtained by the storage interface control module by parsing message data sent by the remote host, and the operation command is scheduled and managed based on the namespace and then transmitted to the redundancy module; Managing the logical address space of the storage array and the controller memory based on the namespace; Sending a data transmission request to the non-volatile storage control module; the data transmission request is used to instruct the non-volatile storage control module to map the controller memory and implement data interaction with the storage array; When executing an operation command of a write data type, an idle first cache subspace is allocated in the controller memory according to the target logical address of the operation command, and a preparation completion notification is fed back to the remote host, wherein the preparation completion notification is used to instruct the remote host to send the target write data; after performing integrity check and redundancy calculation, the target write data is cached in the first cache subspace.
Citation Information
Patent Citations
Network RAID (redundant array of independent disk) system
CN102053802A
Redundancy Coding Stripe Based On Internal Addresses Of Storage Devices
US20190102250A1