Controller and storage device

The controller addresses parity data inconsistencies and maintains Trim command effectiveness by distributing data and generating parity across multiple drives, ensuring efficient space release and data integrity in RAID configurations.

JP2026015930APending Publication Date: 2026-02-03KK TOSHIBA
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
JP2024116854
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Filing Date
2024-07-22
Publication Date
2026-02-03

AI Technical Summary

Technical Problem

Conventional RAID controllers and storage devices face issues with Trim commands causing inconsistencies in parity data and losing the effectiveness of the Trim command during rebuilds, particularly in RAID5/RAID6 configurations, due to differences in write and erase units in SSDs and the need for internal processing like garbage collection.

Method used

A controller that distributes data and parity data across multiple physical drives, using a command acquisition unit to receive Trim commands, a command issuing unit to issue Trim commands to corresponding physical drives, and a parity generation unit to generate parity data assuming zero data, maintaining parity consistency during rebuilds.

Benefits of technology

The solution ensures parity data consistency and maintains the effectiveness of Trim commands, allowing efficient space release in physical drives while preserving data integrity in RAID configurations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2026015930000001_ABST
    Figure 2026015930000001_ABST
Patent Text Reader

Abstract

To provide a controller and a storage device capable of effectively functioning a Trim command even when rebuilding is executed by preventing mismatching of parity data.SOLUTION: A controller controls a RAID configuration in which data written in a logical drive is divided into a plurality of blocks, and the data of the plurality of divided blocks and parity data calculated on the basis of the data of the plurality of blocks are distributed and recorded in a plurality of physical drives. A controller according to an embodiment includes a command acquisition unit configured to receive a first Trim command for a first area of a logical drive, a command issuing unit configured to issue a second Trim command for a second area of a plurality of physical drives corresponding to the first area of the logical drive, and a parity generation unit configured to generate parity data by assuming that data of zero is written in the second area for which the second Trim command is issued.SELECTED DRAWING: Figure 4
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

[0001] FIELD Embodiments of the present invention relate to a controller and a storage device. [Background technology]

[0002] Host computers that require reliability often have a RAID controller. A RAID controller is a device that applies RAID (Redundant Arrays of Inexpensive Disks) technology to multiple physical drive devices to improve performance and ensure redundancy. Generally, a RAID controller configures a logical drive using multiple physical drives and makes the logical drive recognized by the host computer. User programs can access the logical drive through the operating system (OS) or file system.

[0003] In recent years, solid-state drives (SSDs) have become widely used as physical drive devices. SSDs are storage devices that use nonvolatile memory such as flash memory as their recording media. SSDs are faster than hard disk drives (HDDs), but due to differences in their recording mechanisms, they require internal processing such as garbage collection and wear leveling. To perform internal processing, SSDs use free space on the recording media and surplus space known as over-provisioning.

[0004] The more free and available space there is, the more efficient the internal processing of an SSD can function. For this reason, Windows file systems (NTFS, for example) have a function that automatically issues a Trim command to an SSD by specifying the logical block address (LBA) of an area that is no longer needed. Here, LBA is a method of expressing the location of individual storage units on a recording medium, and the Trim command is a command that has the function of notifying the SSD of unused areas from the host computer. When an SSD receives a Trim command, it releases the specified LBA and manages it as free space within the SSD.

[0005] In a RAID5 / RAID6 configuration, which is a type of RAID technology, data is split across multiple physical drives and recorded together with parity data. In this situation, if part of the LBA is freed up using the Trim command, it will no longer be consistent with the parity data, making it impossible to restore the data from the failed storage device in the event of degradation.

[0006] In addition, in storage devices that use RAID technology, when a physical drive is replaced due to a failure or other reason, the RAID controller rebuilds the replaced physical drive. During the rebuild, all data is written to the replaced physical drive, but as a result, the effect of the LBA release performed by the Trim command up to that point is lost for the replaced physical drive. [Prior art documents] [Patent documents]

[0007] [Patent Document 1] Patent Publication No. 2022-171202 Summary of the Invention [Problem to be solved by the invention]

[0008] As such, conventional controllers and storage devices have problems in that the Trim command can cause inconsistencies in parity data and can lose the effectiveness of the Trim command during a rebuild. The controller and storage device of the embodiment have been made to solve these problems, and their object is to provide a controller and storage device that can prevent inconsistencies in parity data and allow the Trim command to function effectively even when a rebuild is performed. [Means for solving the problem]

[0009] A controller according to an embodiment controls a RAID configuration in which data written to a logical drive is divided into a plurality of blocks, and the data of the divided blocks and parity data calculated based on the data of the plurality of blocks are distributed and recorded across a plurality of physical drives. The controller according to an embodiment includes a command acquisition unit that receives a first Trim command for a first area of ​​the logical drive, a command issuing unit that issues a second Trim command to second areas of a plurality of physical drives corresponding to the first area of ​​the logical drive, and a parity generation unit that generates parity data by regarding the second area to which the second Trim command has been issued as having zero data written. [Brief explanation of the drawings]

[0010] [Figure 1] FIG. 1 is a block diagram showing the configuration of a computer system according to first to fifth embodiments. [Figure 2] FIG. 2 is a block diagram showing the functional configuration of a program in a computer system according to the first to fifth embodiments. [Figure 3] FIG. 2 is a diagram illustrating the relationship between a logical drive and a plurality of physical disk drives in a storage device according to the first to fifth embodiments. [Figure 4] 10 is a flowchart illustrating the operation of the storage device according to the first embodiment. [Figure 5] FIG. 2 is a conceptual diagram illustrating the operation of a storage device according to the first embodiment. [Figure 6] 10 is a flowchart illustrating the operation of a storage device according to the second embodiment. [Figure 7] 11 is a flowchart illustrating the operation of a storage device according to the third embodiment. [Figure 8] FIG. 11 is a schematic diagram illustrating the operation of a storage device according to a third embodiment. [Figure 9] 10 is a flowchart illustrating the operation of a storage device according to the fourth embodiment. [Figure 10] 13 is a flowchart illustrating the operation of a storage device according to the fifth embodiment. [Figure 11] FIG. 13 is a conceptual diagram illustrating the operation of a storage device according to the fifth embodiment. DETAILED DESCRIPTION OF THE INVENTION

[0011] (Trim command) Typically, when a file system deletes data, it flags the data block as unused. This allows the file system to use the data block as free space, regardless of whether or not it contains data. However, the unused flag set by the file system is not communicated to the SSD. As a result, the SSD does not recognize that the area has become available due to being unused.

[0012] In SSDs, the write unit (page) and the erase unit (block) are different. Also, in SSDs, write operations can only be performed when the area is completely empty. Therefore, internal processes such as garbage collection are required. Unused data blocks reported by the Trim command can be subject to garbage collection.

[0013] The Trim command functions to convey the location (e.g., LBA) of unused data from the file system on the host computer to the SSD controller. Generally, after receiving a Trim command, when an SSD controller receives a Read access to the same LBA, it returns a response indicating that all data is zero (all zeros). The controller of the embodiment uses this operation to determine whether the LBA is the one to which the Trim command was issued.

[0014] (Trim command on RAID controller) For example, in a RAID5 / RAID6 configuration, data written to a logical drive is divided into multiple blocks, and the data in the divided blocks and parity data calculated based on the data in the multiple blocks are distributed and recorded on multiple physical drives. Therefore, if a portion of the LBA is released using a Trim command, inconsistency in the parity data occurs, making it impossible to restore data from a physical drive that has failed during degeneration. Figure 3 shows an example of a logical drive 224 with a RAID5 configuration, configured using physical drives 30a to 30c.

[0015] 3, when a series of data is written to the logical drive 224, in a RAID5 configuration, the data is distributed (striping) across the physical drives 30a to 30c in units called stripes (for example, approximately 64 KiB to 512 KiB). At this time, stripes at the same address on each of the physical drives 30a to 30c are treated as one set and are called a stripe group STG.

[0016] In a RAID5 configuration, one piece of parity data exists in each stripe group. In the example shown in Figure 3, the stripe group STG has stripes of data0, data1, and parity. The parity data is the result of calculating the exclusive OR (XOR) of the data on each physical drive. In the stripe group STG shown in Figure 3, the parity is the exclusive OR of data0 and data1. Therefore, even if one of the physical drives fails, it is possible to restore the data on the failed physical drive from the data on the remaining physical drives and the parity data. In a RAID5 configuration such as the one shown in Figure 3, when updating data, the parity data in the same stripe group must also be updated accordingly.

[0017] If a portion of the data area is released by the Trim command, an inconsistency with the parity data occurs. For example, if the RAID goes into a degraded state (one physical drive fails), the data on the failed physical drive cannot be restored. In a RAID6 configuration, two systems of parity data exist within the stripe group, making it possible to handle the failure of up to two storage devices, but just like a RAID5 configuration, the Trim command can cause inconsistencies in the parity data.

[0018] Furthermore, if a physical drive is replaced due to a failure or other reason, the RAID controller performs a rebuild on the replaced physical drive. This causes a full write to be performed on the replaced physical drive. As a result, the LBA release effect of the Trim command executed up to that point is lost on the replaced physical drive.

[0019] The controller of the embodiment improves the behavior of such a Trim command.

[0020] (Configurations of the first to fifth embodiments) Hereinafter, a computer system according to an embodiment will be described in detail with reference to the drawings. Fig. 1 is a block diagram showing the configuration of a computer system 1 according to a first embodiment. Fig. 2 is a block diagram showing the functional configuration of the computer system 1 according to the first embodiment.

[0021] 1, a computer system 1 of this embodiment includes a storage device 10, an expansion bus interface 15, and a host computer 40. The storage device 10 is connected to the host computer 40 via the expansion bus interface 15. The storage device 10 includes a RAID controller 20 and a plurality of physical drives 30 (30a, ..., 30n).

[0022] The storage device 10 is an auxiliary storage device for the host computer 40. The storage device 10 has a RAID controller 20 that receives disk I / O requests from the host computer 40, physical drives 30 on which the RAID controller 20 executes disk I / O, and an expansion bus interface 15.

[0023] The RAID controller 20 is a functional element capable of configuring a logical drive using multiple physical drives 30. The RAID controller 20 of this embodiment can control the multiple physical drives 30 so that they appear as a single logical drive to the host computer 40. The RAID controller 20 of this embodiment also provides a parity distributed recording function in block units that complies with, for example, RAID5 or RAID6. That is, data written to a logical drive is divided into multiple blocks, and the data of the divided multiple blocks and parity data calculated based on the data of the multiple blocks are distributed and recorded across multiple physical drives. This can improve the performance and fault tolerance of the storage device 10.

[0024] The physical drive 30 is a storage medium of the storage device 10. The physical drive 30 may be realized by, for example, a solid state drive (SSD) made up of a flash memory, etc. The physical drive 30 may be made up of a plurality of physical drives 30a to 30n.

[0025] The expansion bus interface 15 is an interface that connects the host computer 40 and the storage device 10. The expansion bus interface 15 can use a bus interface that complies with the PCI Express (registered trademark) standard, for example.

[0026] The host computer 40 is a computer that issues disk I / O requests. The host computer 40 has an arithmetic unit (not shown) that includes a CPU (Central Processing Unit), and a main memory device (not shown) that stores data and programs. The host computer 40 is connected to the storage device 10, and can send commands related to reading and writing data to the storage device 10. The host computer 40 has an expansion bus interface 15.

[0027] Next, the functional configuration of the computer system of the embodiment will be described in detail with reference to FIG.

[0028] As shown in FIG. 2, the RAID controller 20 includes a host interface 210, an I / O processor 220, a main memory device 230 of the I / O processor 220, and a memory device interface 240.

[0029] The host interface 210 is a bus interface that connects to the host computer 40. The host interface 210 constitutes the expansion bus interface 15. The host interface 210 can be realized by a standard such as PCI Express, for example.

[0030] The I / O processor 220 is a processor that controls the RAID controller 20. The I / O processor 220 has RAID firmware 222 and a background processing unit 223. The I / O processor 220 configures a logical drive 224.

[0031] The RAID firmware 222 is a program element that causes the I / O processor 220 to function. The RAID firmware 222 realizes RAID functions. The RAID firmware 222 can be stored in a rewritable nonvolatile memory or the like. The RAID firmware 222 may also be stored in the main storage device 230. The RAID firmware 222 can function as a command acquisition unit that can receive commands for logical drives from the host computer 40, a command issuing unit that can issue commands for physical drives, a parity generation unit that performs parity calculations, and a parity writing unit that writes the generated parity.

[0032] The background processing unit 223 is a program element that can execute processing independent of the I / O processing of the I / O processor 220. The background processing unit 223 executes processing exclusive of I / O processing. The background processing unit 223 can function as a data reading unit that reads data into a buffer, a zero data determination unit that can determine whether all data in a specified area is zero, an LBA reading unit that can read data in LBA units, and a command issuing unit that can issue a Trim command to a physical drive.

[0033] The main memory device 230 is a memory that provides a storage area necessary for the operation of the I / O processor 220. The main memory device 230 may be configured, for example, from a volatile memory. The main memory device 230 includes a buffer 231 and an IO exclusion table 232.

[0034] The buffer 231 is a memory area in which the I / O processor 220 temporarily stores data. The buffer 231 is used as a write-back cache or a read cache. The RAID firmware 222 operated by the I / O processor 220 can read from and write to the buffer 231.

[0035] The IO exclusion table 232 is a table for managing I / O processing by the RAID firmware 222 and background processing by the background processing unit 223 so that they are not executed simultaneously. By referencing the IO exclusion table 232, it is possible to determine whether the RAID firmware 222 or the background processing unit 223 is currently running.

[0036] The storage device interface 240 is an interface that connects multiple physical drives 30. The storage device interface 240 can use interface standards such as SATA (Serial Advanced Technology Attachment), SCSI (Small Computer System Interface; registered trademark), and SAS (Serial Attached SCSI). The storage device interface 240 can accommodate multiple physical drives 30. The RAID firmware 222 configures a logical RAID drive (logical drive) using the multiple physical drives 30 using known RAID technology.

[0037] As shown in FIG. 2, the host computer 40 includes a host interface 110, an operating system (OS) 120, and an application 140.

[0038] The host interface 110 is a bus interface that connects to the RAID controller 20. The host interface 110 constitutes the expansion bus interface 15. The host interface 110 can be realized by a standard such as PCI Express, for example.

[0039] The OS 120 is a program element that controls the host computer 40. The OS 120 is loaded into a main storage device (not shown) of the host computer 40, and is operated by a CPU (not shown). The OS 120 includes a file system 121 and a device driver 122.

[0040] The file system 121 is a program element that enables the OS 120 to read and write files from and to the storage device 10 .

[0041] The device driver 122 is a program element (device driver) that manages the connection path (channel) between the storage device 10 and the host computer 40. In the example shown in Fig. 2, the device driver 122 recognizes the logical drive 224 as a RAID drive. In general, the device driver 122 is incorporated into the OS 120 as standard.

[0042] The application 140 is a program element that runs on the OS 120. The application 140 can access, via the file system 121, the logical drive 224 configured by the storage device 10 as a RAID drive.

[0043] (Operation of the first embodiment) Next, the operation of the storage device of the embodiment will be described in detail with reference to Figures 4 and 5. Figure 4 is a flowchart explaining the operation of the storage device according to the first embodiment. Figure 5 is a conceptual diagram explaining the operation of the storage device according to the first embodiment.

[0044] The OS 120 of the host computer 40 issues a Trim command at a predetermined timing, specifying an LBA for the data that has become unused. The RAID controller 20 receives the Trim command from the host computer 40 to the logical drive 224 (S100). In the example shown in Fig. 5, the OS 120 issues a Trim command specifying the range of data1 in the logical drive 224.

[0045] The RAID firmware 222 issues a Trim command to the LBA on the physical drive 30 that corresponds to the LBA of the logical drive specified by the Trim command (S110). In the example shown in Fig. 5, the Trim command is issued to data1 stored in physical drive 30b.

[0046] The RAID firmware 222 creates parity data in the stripe group STG that includes the LBA specified in the Trim command (S120). The RAID firmware 222 assumes that all data in data1, the target of the Trim command, is zero, and creates parity data by calculating the exclusive OR (XOR) of data0 and data1. In the example shown in Fig. 5, in the stripe group STG that consists of data0, data1, and parity, data1 is the target of the Trim command. In other words, parity is generated based on data0 and data1, all of whose data is assumed to be zero.

[0047] The RAID firmware 222 executes a write process for the created parity data as the parity of the stripe group that is the target of the Trim command (S130). In the example shown in Fig. 5, the RAID firmware 222 writes the created parity data as the parity of the stripe group STG of the physical drive 30c.

[0048] In a typical SSD, when an LBA released by the Trim command is read, all-zero data is obtained. The storage device of this embodiment creates parity data assuming that all-zero data has been written to the LBA targeted by the Trim command. This allows the consistency of parity in a RAID configuration to be maintained.

[0049] (Second embodiment) Next, a storage device according to the second embodiment will be described with reference to Fig. 6. Fig. 6 is a flowchart illustrating the operation of a storage device according to the second embodiment. The storage device according to the second embodiment is related to the background processing of the first embodiment. In the following description, components common to the first embodiment are designated by common reference numerals, and duplicated descriptions will be omitted.

[0050] The background processing unit 223 sets the data read position to an initial position (S200). The background processing unit 223 periodically executes a process of reading data from each physical drive 30 into the buffer 231. The initial position of the data read position is the initial position in a sequence in which read processing is executed sequentially from each physical drive 30.

[0051] The background processing unit 223 refers to the IO exclusion table 232 and determines whether the RAID firmware 222 is executing disk IO (whether it is an exclusion period or not) (S210). The storage device of this embodiment performs exclusion determination individually for each storage device and for each LBA range.

[0052] If the RAID firmware 222 is currently executing disk IO (Yes in S210), the background processing unit 223 puts the processing on hold and waits (S210).

[0053] If the RAID firmware 222 is not currently performing disk IO (No in S210), the background processing unit 223 reads a predetermined range of data from the physical drive 30 into the buffer 231 (S220). The range of data to be read can be determined according to the size of the buffer 231, for example.

[0054] The background processing unit 223 determines whether or not all of the data read into the buffer 231 is zero (whether or not it is all zero) (S230).

[0055] If all data in the buffer 231 is zero (Yes in S230), the background processing unit 223 issues a Trim command to the physical drive 30, specifying the LBA of the range read into the buffer 231 (S240). This makes it possible for both the host computer 40 and the storage device 10 to recognize that the range where all data is zero is an unused area. In other words, even if the storage device 10 is rebuilt, the effect of the Trim command can be maintained.

[0056] If all data in the buffer 231 is not zero (No in S230), and if a Trim command is issued for the range read into the buffer 231 (S240), the background processing unit 223 determines whether the range read into the buffer 231 is the last position of the physical drive 30 (S250).

[0057] If the range read into the buffer 231 is not the last position of the physical drive 30 (No in S250), the background processing unit 223 sets the data read position to the position of the next read range (S260). That is, the read positions for the multiple physical drives 30 are sequentially shifted from the initial position, and data reading into the buffer 231 continues (S210).

[0058] If the range read into the buffer 231 is the last position of the physical drive 30 (Yes in S250), the background processing unit 223 sets the data read position to the initial position and continues reading data into the buffer 231 (S200).

[0059] In the storage device of this embodiment, the background processing unit 223 executes processing when the RAID firmware 222 is not executing disk IO, but this is not limited to this. The data read processing by the background processing unit 223 may be performed at any time as long as the frequency does not cause a clear performance degradation in the disk IO processing by the RAID firmware 222.

[0060] In this way, according to the storage device of the embodiment, the process of releasing storage space in the physical drive 30 is always executed, so that free space in the physical drive 30 can be released over time regardless of the timing of issuing a Trim command from the computer 40. Furthermore, freeing free space is performed when the read data is all zeros, so that parity consistency in a RAID5 configuration or RAID6 configuration can be maintained.

[0061] Furthermore, according to the storage device of this embodiment, it is determined whether or not an exclusive period is in effect before the background processing unit 223 performs a read process, thereby preventing data written before the background processing unit 223 issues a Trim command from being erased.

[0062] (Operation of the third embodiment) Next, a storage device according to a third embodiment will be described with reference to Figures 7 and 8. Figure 7 is a flowchart illustrating the operation of a storage device according to the third embodiment. Figure 8 is a schematic diagram illustrating the operation of a storage device according to the third embodiment. The storage device according to the second embodiment determines whether data read into the buffer 231 contains all zeros, but the storage device according to the third embodiment determines whether data contains all zeros in units of LBAs. In the following description, components common to the first and second embodiments are denoted by common reference numerals, and duplicate descriptions will be omitted.

[0063] The background processing unit 223 sets the data read position to an initial position (S200). The background processing unit 223 periodically executes a process of reading data from each physical drive 30 into the buffer 231. The initial position of the data read position is the initial position in a sequence in which read processing is executed sequentially from each physical drive 30.

[0064] The background processing unit 223 refers to the IO exclusion table 232 and determines whether the RAID firmware 222 is executing disk IO (whether it is an exclusion period or not) (S210). The storage device of this embodiment performs exclusion determination individually for each storage device and for each LBA range.

[0065] If the RAID firmware 222 is currently executing disk IO (Yes in S210), the background processing unit 223 puts the processing on hold and waits (S210).

[0066] If the RAID firmware 222 is not currently executing disk IO (No in S210), the background processing unit 223 reads data in a predetermined range of the physical drive 30 into the buffer 231 (S220). The range of data to be read can be determined, for example, according to the size of the buffer 231. In the example shown in Fig. 8, data in the range of LBAs LBAn to LBAn+m is read into the buffer 231.

[0067] The background processing unit 223 sets the LBA to be read first (the smallest LBA) in the range read into the buffer 231 as the read target LBA (S225). In the example shown in Fig. 8, LBAn is the first LBA.

[0068] The background processing unit 223 determines whether or not all of the data at the read target LBA among the data read into the buffer 231 is zero (whether or not it is all zero) (S235).

[0069] If all the data in the LBA to be read is zero (Yes in S235), the background processing unit 223 specifies the LBA to be read and issues a Trim command to the physical drive 30 (S242). This enables both the host computer 40 and the storage device 10 to recognize that the LBA to be read is an unused area. In other words, even if the storage device 10 is rebuilt, the effect of the Trim command can be maintained. In the example shown in Fig. 8, it is determined that the data in LBAs LBAn+1 and LBAn+3 is all zero, and a Trim command is issued.

[0070] If all data of the LBA to be read is not zero (No in S235), and if a Trim command is issued for the LBA to be read (S242), the background processing unit 223 determines whether the LBA to be read is the last position of the range read into the buffer 231 (S244).

[0071] If the read target LBA is not the last position of the range read into the buffer 231 (No in S244), the background processing unit 223 sets the read target LBA to the LBA to be read next (next LBA) (S246). The background processing unit 223 continues to determine the data of the read target LBA (S235).

[0072] If the read target LBA is the last position in the range read into the buffer 231 (Yes in S244), the background processing unit 223 determines whether the range read into the buffer 231 is the last position in the physical drive 30 (S250).

[0073] If the range read into the buffer 231 is not the last position of the physical drive 30 (No in S250), the background processing unit 223 sets the data read position to the position of the next read range (S260). That is, the read positions for the multiple physical drives 30 are sequentially shifted from the initial position, and data reading into the buffer 231 continues (S210).

[0074] If the range read into the buffer 231 is the last position of the physical drive 30 (Yes in S250), the background processing unit 223 sets the data read position to the initial position and continues reading data into the buffer 231 (S200).

[0075] According to the storage device of this embodiment, the determination of whether the data is all zeros is performed in LBA units which are smaller than the buffer size, so the granularity of the determination of whether the data is all zeros can be reduced and processing can be sped up. (Operation of the fourth embodiment) Next, a storage device according to a fourth embodiment will be described with reference to Fig. 9. Fig. 9 is a flowchart illustrating the operation of a storage device according to the fourth embodiment. The storage device according to the third embodiment issued a Trim command each time an LBA whose data was determined to be all zero was encountered, but the storage device according to the fourth embodiment issues a Trim command all at once when there are consecutive LBAs whose data was determined to be all zero. In the following description, components common to the first and second embodiments will be denoted by the same reference numerals, and duplicated descriptions will be omitted.

[0076] The background processing unit 223 sets the data read position to an initial position (S200). The background processing unit 223 periodically executes a process of reading data from each physical drive 30 into the buffer 231. The initial position of the data read position is the initial position in a sequence in which read processing is executed sequentially from each physical drive 30.

[0077] The background processing unit 223 refers to the IO exclusion table 232 and determines whether the RAID firmware 222 is executing disk IO (whether it is an exclusion period or not) (S210). The storage device of this embodiment performs exclusion determination individually for each storage device and for each LBA range.

[0078] If the RAID firmware 222 is currently executing disk IO (Yes in S210), the background processing unit 223 puts the processing on hold and waits (S210).

[0079] If the RAID firmware 222 is not currently performing disk IO (No in S210), the background processing unit 223 reads a predetermined range of data from the physical drive 30 into the buffer 231 (S220). The range of data to be read can be determined according to the size of the buffer 231, for example.

[0080] The background processing unit 223 sets the LBA (smallest LBA) to be read first in the range read into the buffer 231 as the LBA to be read (S225).

[0081] The background processing unit 223 determines whether or not all of the data at the read target LBA among the data read into the buffer 231 is zero (whether or not it is all zero) (S236).

[0082] If all of the data in the read target LBA is zero (Yes in S236), the background processing unit 223 sets the LBA next to the read target LBA as the new read target LBA (S237).

[0083] When the next LBA to the read target LBA is set as the new read target LBA, the background processing unit 223 determines whether or not all of the data in the new read target LBA is zero (whether or not it is all zero) (S238).

[0084] If all of the data in the new read target LBA is zero (Yes in S238), the background processing unit 223 sets the next LBA to the read target LBA as the new read target LBA, and continues to determine whether the data in the new read target LBA is all zero (S237, S238).

[0085] If the data of the new read target LBA is not all zero (No in S238), the background processing unit 223 issues a Trim command for the LBA whose data was all zero (S243).

[0086] If a Trim command is issued for an LBA where all the data is zero (S243), or if all the data of the LBA to be read is not zero (No in S236), the background processing unit 223 determines whether the LBA to be read is the last position of the range read into the buffer 231 (S244).

[0087] If the read target LBA is not the last position of the range read into the buffer 231 (No in S244), the background processing unit 223 sets the read target LBA to the LBA to be read next (next LBA) (S246). The background processing unit 223 continues to determine the data of the read target LBA (S236).

[0088] If the read target LBA is the last position in the range read into the buffer 231 (Yes in S244), the background processing unit 223 determines whether the range read into the buffer 231 is the last position in the physical drive 30 (S250).

[0089] If the range read into the buffer 231 is not the last position of the physical drive 30 (No in S250), the background processing unit 223 sets the data read position to the position of the next read range (S260). That is, the read positions for the multiple physical drives 30 are sequentially shifted from the initial position, and data reading into the buffer 231 continues (S210).

[0090] If the range read into the buffer 231 is the last position of the physical drive 30 (Yes in S250), the background processing unit 223 sets the data read position to the initial position and continues reading data into the buffer 231 (S200).

[0091] According to the storage device of this embodiment, Trim commands are issued collectively for LBAs where the data is all zero, thereby making it possible to speed up processing.

[0092] (Operation of the fifth embodiment) Next, a storage device according to a fifth embodiment will be described with reference to Fig. 10. Fig. 10 is a flowchart illustrating the operation of a storage device according to the fifth embodiment. When a Trim command to a logical drive is received, the storage device according to the fifth embodiment writes zero data to the corresponding area. In the following description, components common to the first to fourth embodiments are designated by common reference numerals, and duplicated descriptions will be omitted.

[0093] The OS 120 of the host computer 40 issues a Trim command to the unused data by specifying the LBA at a predetermined timing. The RAID controller 20 receives the Trim command from the host computer 40 to the logical drive 224 (S300). In the example shown in Fig. 11, the OS 120 issues a Trim command to data1 of the logical drive 224.

[0094] The RAID firmware 222 refers to the IO exclusion table 232 and determines whether or not the background processing unit 223 is currently executing disk IO (whether or not it is an exclusion period) (S310).

[0095] If the background processing unit 223 is currently executing disk IO (Yes in S310), the RAID firmware 222 puts the process on hold and waits (S310).

[0096] If the background processing unit 223 is not currently executing disk I / O (No in S310), the RAID firmware 222 issues a Write command for data "zero" to the LBA on the physical drive 30 that corresponds to the LBA of the logical drive specified by the Trim command (S320). In the example shown in Fig. 11, a Write command is issued for data1 stored in physical drive 30b.

[0097] The RAID firmware 222 creates parity data in the stripe group STG that includes the LBA specified in the Write command (S330).

[0098] The RAID firmware 222 executes a write process (S340) of the created parity data as the parity of the stripe group STG that is the target of the Write command. The creation and writing of the parity data is a normal parity generation process in the RAID firmware 222. In the example shown in Fig. 11, the RAID firmware 222 writes the created parity data as the parity of the stripe group STG of the physical drive 30c.

[0099] In a typical SSD, when an LBA released by the Trim command is read, all-zero data is returned. In this embodiment, the storage device issues a Write command to write all-zero data to the LBA targeted by the Trim command, and also generates and writes parity. This allows the consistency of parity in a RAID configuration to be maintained.

[0100] (Variation) In the storage devices according to the first to fifth embodiments, the RAID firmware 222 and background processing unit 223 execute the processing in the I / O processor 220, but this is not limiting. For example, various calculations may be executed by a DMAC function (DMAC: Direct Memory Access Controller) in the I / O processor 220 or a DMA controller in the host interface 210.

[0101] By having a DMA controller or the like take over the processing of the RAID firmware 222 and background processing unit 223, it is possible to avoid a performance degradation without placing a load on the CPU of the I / O processor 220.

[0102] Although several embodiments of the present invention have been described, these embodiments are presented as examples and are not intended to limit the scope of the invention. These novel embodiments can be embodied in various other forms, and various omissions, substitutions, and modifications can be made without departing from the spirit of the invention. These embodiments and their modifications are included within the scope and spirit of the invention, and are also included in the scope of the invention and its equivalents as defined in the claims. [Explanation of symbols]

[0103] 1...computer system, 10...storage device, 15...expansion bus interface, 20...RAID controller, 30, 30a to 30n...physical drive, 40...host computer, 110...host interface, 121...file system, 122...device driver, 140...application, 210...host interface, 220...I / O processor, 222...RAID firmware, 223...background processing unit, 224...logical drive, 230...main storage device, 231...buffer, 232...IO exclusion table, 240...storage device interface, STG...stripe group

Claims

1. A controller for controlling a RAID configuration that divides data written to a logical drive into a plurality of blocks, and distributes and records data of the divided plurality of blocks and parity data calculated based on the data of the plurality of blocks across a plurality of physical drives, a command acquisition unit that receives a first Trim command for a first area of ​​the logical drive; a command issuing unit that issues a second Trim command to a second area of ​​the plurality of physical drives that corresponds to the first area of ​​the logical drive; a parity generation unit that generates the parity data by regarding the second area where the second Trim command is issued as having zero data written therein; A controller having:

2. A controller for controlling a RAID configuration that divides data written to a logical drive into a plurality of blocks, and distributes and records data of the divided plurality of blocks and parity data calculated based on the data of the plurality of blocks across a plurality of physical drives, a command acquisition unit that receives a first Trim command for a first area of ​​the logical drive; a command issuing unit that issues a Write command of zero data to a second area of ​​the plurality of physical drives that corresponds to the first area of ​​the logical drive; a parity generation unit that generates the parity data after issuing the Write command; A controller having:

3. a buffer capable of storing data from the plurality of physical drives; a data reading unit that stores data recorded in third areas of the plurality of physical drives in the buffer; a zero data determination unit that determines whether all of the data in the third area stored in the buffer is zero, the command issuing unit issues the second Trim command to the third area of ​​the plurality of physical drives when the result of the determination is that all of the data in the third area stored in the buffer is zero; 3. The controller according to claim 1 or 2,

4. a buffer capable of storing data from the plurality of physical drives; a data reading unit that stores data recorded in third areas of the plurality of physical drives in the buffer; an LBA reading unit capable of reading LBA data in units of logical block addresses of the plurality of physical drives from the data in the third area stored in the buffer; a zero data determination unit that determines whether all data in the LBA data is zero, the command issuing unit issues the second Trim command to logical block addresses of the plurality of physical drives corresponding to the LBA data when all data of the LBA data is zero; 3. The controller according to claim 1 or 2,

5. When all consecutive LBA data in logical block address units of the plurality of physical drives are zero, the command issuing unit collectively issues the second Trim command to the logical block addresses of the plurality of physical drives corresponding to the LBA data in which all consecutive data are zero.

5. The controller according to claim 4,

6. A storage device comprising the controller according to claim 1 or 2.

Citation Information

Patent Citations

  • Storage device and rebuild method

    JP2022171202A