Solid state drive, garbage collection and control method, device, system and storage medium
By introducing a GC control interface in a solid state hard disk (SSD), the host side allows the host to control the garbage collection (GC) operation of the SSD and perform time-sharing scheduling, the problem of reducing the performance of SSD single GB is solved, and the SSD single is improved GB performance effect.
Patent Information
- Application Number
- CN202010162420.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-03-10
- Publication Date
- 2025-02-25
- Estimated Expiration
- 2040-03-10
AI Technical Summary
The background traffic generated by existing solid-state drives (SSDs) in garbage collection (GC) operations reduces the bandwidth of IO read and write operations, resulting in a single GB performance of SSDs.
By introducing a GC control interface in the SSD, the host side can flexibly control the GC operations inside the SSD, and perform time-sharing scheduling of GC operations and IO read and write operations, reducing the impact of GC background traffic on IO read and write operations.
It effectively reduces the impact of GC background traffic on the IO read and write operations of the SSD, ensuring that the bus inside the SSD is exclusive to the IO read and write operations, thereby improving the single GB performance of the SSD.
Smart Images

Figure CN113377278B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a solid-state hard disk, a garbage collection and control method, a device, a system, and a storage medium. Background Art
[0002] Solid State Drive (SSD), commonly known as SSD, is a type of hard disk made using a solid-state electronic storage chip array. Compared with traditional hard disks, it has the advantages of higher speed, lower power consumption, and lower noise, and is therefore becoming increasingly popular.
[0003] Garbage Collection (GC) is an important operation inside SSD. Simply put, the GC process is to migrate all valid data in several physical blocks to a new block, and then erase these blocks to generate available blocks.
[0004] The GC operation of existing SSDs will bring about obvious write amplification problems, which will become background traffic inside the SSD. The GC background traffic will reduce the bandwidth of the SSD's IO read and write operations, causing the SSD's single GB performance to become lower and lower. Summary of the invention
[0005] Multiple aspects of the present application provide a solid-state drive, garbage collection and control method, device, system and storage medium to provide a new GC solution, reduce the impact of GC background traffic on SSD IO read and write operations, and provide conditions for improving the single GB performance of the SSD.
[0006] An embodiment of the present application provides a solid-state drive (SSD), which provides a garbage collection (GC) control interface for a host side, and includes a controller and a storage medium controlled by the controller; the controller is used to obtain a GC command issued by the host side based on the GC control interface, and perform a GC operation on the storage medium according to the GC command.
[0007] An embodiment of the present application also provides a garbage collection (GC) method, which is applicable to a controller of a solid-state drive (SSD), wherein the SSD provides a GC control interface facing the host side; the method comprises: obtaining a GC command issued by the host side based on the GC control interface; and performing a GC operation on the storage medium of the SSD according to the GC command.
[0008] An embodiment of the present application also provides a garbage collection (GC) control method, which is applicable to a host side, wherein a solid state drive (SSD) is mounted on the host side, and the SSD provides a GC control interface facing the host side; the method comprises: determining the GC control interface provided by the SSD; based on the GC control interface, issuing a GC command to the SSD to control the SSD to perform a GC operation.
[0009] An embodiment of the present application also provides a computer device, which has a solid-state drive (SSD) mounted thereon, and the SSD provides a garbage collection (GC) control interface facing the computer device. The computer device also includes a non-solid-state drive type storage medium and a processor; the non-solid-state drive type storage medium stores a GC control program; the processor executes the GC control program and can issue GC commands to the SSD through the GC control interface to control the SSD to perform GC operations.
[0010] An embodiment of the present application also provides a storage system based on a solid state drive (SSD), comprising a host and an SSD mounted on the host; the SSD provides a GC control interface facing the host; the host can issue GC commands to the SSD based on the GC control interface; the SSD comprises: a controller and a storage medium controlled by the controller; wherein the controller is used to obtain the GC command issued by the host based on the GC control interface, and perform GC operations on the storage medium according to the GC command.
[0011] An embodiment of the present application also provides a cloud storage system, including multiple SSDs deployed in a distributed manner; each SSD provides a GC control interface to an upper-level application end that can access it; the upper-level application end can issue GC commands to the SSD it needs to access based on the GC control interface; each SSD includes a controller and a storage medium controlled by the controller; wherein the controller is used to obtain the GC command issued by the upper-level application end based on the GC control interface, and perform GC operations on the storage medium according to the GC command.
[0012] The embodiment of the present application also provides a computer-readable storage medium storing a computer program. When the computer program is executed by a controller, the controller implements the steps in the garbage collection method provided in the embodiment of the present application.
[0013] The embodiment of the present application also provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the processor implements the steps in the garbage collection method provided in the embodiment of the present application.
[0014] In the embodiment of the present application, the SSD provides a GC control interface to the host side. Based on the GC control interface, the host side has the opportunity to control the GC operation inside the SSD, which provides conditions for improving the single GB performance of the SSD. If the host side needs to ensure the performance of IO read and write operations, the GC operation and IO read and write operations can be time-sharing scheduled to reduce the impact of GC background traffic on the IO read and write operations of the SSD, ensure that the bus inside the SSD is exclusively used for IO read and write operations, and improve the single GB performance of the SSD. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0016] Figure 1a A schematic diagram of the structure of an SSD provided for an exemplary embodiment of the present application;
[0017] Figure 1b A schematic diagram of the structure of another SSD provided for an exemplary embodiment of the present application;
[0018] Figure 1c A schematic diagram of the simplified internal structure of an SSD implemented with NAND Flash and the scheduling relationship between IO operations and GC operations provided by an exemplary embodiment of the present application;
[0019] Figure 1d This is a simplified diagram of the internal structure of an existing SSD and the scheduling relationship between IO operations and GC operations;
[0020] Figure 2 A schematic diagram of the structure of a computer device provided for an exemplary embodiment of the present application;
[0021] Figure 3 A schematic diagram of a storage system based on an SSD according to an exemplary embodiment of the present application;
[0022] Figure 4 A schematic flow chart of a GC method provided for an exemplary embodiment of the present application;
[0023] Figure 5 A schematic flow chart of a GC control method provided for an exemplary embodiment of the present application. DETAILED DESCRIPTION
[0024] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in combination with the specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.
[0025] In the prior art, the GC background traffic of the SSD will reduce the bandwidth of the IO read and write operations of the SSD, causing the single GB performance of the SSD to become lower and lower. In response to this technical problem, in an embodiment of the present application, the SSD provides a GC control interface to the host side. Based on the GC control interface, the host side can flexibly control the GC operation inside the SSD, which provides conditions for improving the single GB performance of the SSD. If the host side needs to ensure the performance of IO read and write operations, the GC operation and IO read and write operations can be time-sharing scheduled to reduce the impact of the GC background traffic on the IO read and write operations of the SSD, ensure that the bus inside the SSD is exclusively for IO read and write operations, and improve the single GB performance of the SSD.
[0026] The technical solutions provided by various embodiments of the present application are described in detail below in conjunction with the accompanying drawings.
[0027] Figure 1a The schematic diagram of the structure of an SSD provided by the exemplary embodiment of the present application. The SSD 10 provided by the embodiment of the present application can be any hard disk made of a solid-state electronic storage chip array. Figure 1a As shown, the structure of the SSD 10 includes: a controller 11 and a storage medium 12 controlled by the controller 11 .
[0028] The storage medium 12 is a solid-state storage unit of the SSD 10, which provides physical storage space to the outside and is mainly responsible for data storage tasks. The storage medium 12 can be implemented by a dynamic random access memory (DRAM) or a flash memory (Flash) chip. Furthermore, when the storage medium 12 is implemented by a Flash chip, the storage medium 12 can be implemented by NAND Flash or NOR Flash. Figure 1a In the figure, the storage medium 12 is illustrated as NAND Flash, but it is not limited to this.
[0029] The physical space management method of the storage medium 12 may be different depending on the implementation form. Optionally, taking paging management as an example, the physical space of the storage medium 12 may be divided into multiple physical pages (Physics Page), and the read and write operations are performed in units of physical pages, while the erase operation may be performed in units of physical blocks (Physics Block). Among them, a physical block may include multiple physical pages.
[0030] Among them, the controller 11 is the main control chip of the SSD 10, that is, the brain, which can execute the corresponding program in the firmware algorithm of the SSD 10, and can at least realize the following functions: error checking and correction (ECC), wear leveling, bad block management, garbage collection, communication with the host side (such as a computer), and data encryption, etc.
[0031] The controller 11 and the storage medium 12 are interconnected via an internal data access bus. The controller 11 writes data to the storage medium 12 via the data access bus, and can also read data from the storage medium 12 via the data access bus. For example, the controller 11, as a mediator between the storage medium 12 and the host end 20 mounted by the SSD 10, can write the data of the host end 20 into the storage medium 12 according to the IO write request of the host end 20, and can also read data from the storage medium according to the IO read request of the host end 20 and return it to the host end 20.
[0032] For SSD 10, a certain interface protocol can be used to communicate with the host end 20 mounted thereon. In this embodiment, the interface protocol supported by SSD 10 is not limited, and it can support various interface protocols such as NVMe (NVM Express), SATA-2, SATA-3, SAS, MSATA, PCIE, NGFF or CFast. Among them, the host end 20 can be any computer device that needs storage resources. For example, the host end 20 can be a terminal device such as a desktop computer, a laptop computer, a tablet computer, a smart phone, a game console, an MP3 player, a camera, a camera, a television or a smart speaker. For another example, the host end 20 can be a server device such as some conventional servers, cloud servers or server arrays. For another example, the host end 20 can also be some edge computing devices, such as street lights, signal lights or traffic monitoring equipment. Traffic monitoring equipment can include but is not limited to various cameras or electronic eyes. The host end 20 can use SSD 10 to store the data it generates, and can also read the data it needs from SSD 10, that is, the host end 20 can perform IO read and write operations on SSD 10. The object that triggers the host end 20 to perform IO read and write operations on the SSD 10 may be a program running on the host end 20 or a hardware module on the host end 20. In either case, the host end 20 may be regarded as an upper layer application end of the SSD 10.
[0033] During the use of SSD 10, storage medium 12 generates garbage data. Taking NAND Flash as an example, the SSD uses an append write method to record data in NAND Flash. This data recording method generates a large amount of garbage data. In order to ensure the effective use of storage medium 12 (i.e., data storage space), it is necessary to clean up the garbage data and merge the valid data in some physical blocks. This data sorting process is called the GC process.
[0034] GC is an important operation inside the SSD. In existing SSDs, the GC operation is performed by the SSD controller in the background. A large number of GC operations will generate data write amplification, which will become background traffic inside the SSD. These background traffic will compete with the host's IO read and write operations on the SSD, that is, the background traffic will share the data access bus of the SSD's internal storage medium (such as NAND Flash) with the IO read and write operations, which will affect the overall performance of the host's IO read and write operations and cause IO quality of service (QoS) problems on the host. In particular, when the SSD is in a steady state, the GC operation needs to be executed all the time, and it will compete with the host's IO read and write requests for the data access bus of the storage medium (such as NAND Flash), resulting in the IO read and write requests being unable to obtain sufficient bandwidth, thereby affecting the single GB performance of the SSD.
[0035] The SSD 10 provided in this embodiment is different from the existing SSD. The GC function of the SSD 10 is divided into two parts: a GC execution unit 112 and a GC control interface 111; the GC execution unit 112 is an execution layer, which is controlled by a GC command from the GC control interface 111. The GC control interface 111 is provided to the host side for the host side to send a GC command to the controller 11. The GC execution unit 112 is a logical unit, and its function can be implemented by the controller 11 executing the corresponding code in the firmware algorithm, and is mainly used to perform GC operations on the storage medium 12 according to the GC command. Assuming that the storage medium 12 is erased in units of physical blocks, the process of performing a GC operation refers to the process of migrating all valid data in several physical blocks to a new physical block, and then erasing these physical blocks to generate available physical blocks.
[0036] In this embodiment, the SSD 10 provides its GC control interface 111 to the host 20, so that the host 20 has the opportunity to control the GC operation inside the SSD. For the host 20, a GC command can be issued to the SSD 10 based on the GC control interface 111 to control the SSD 10 to perform the GC operation. For the controller 11, the GC command issued by the host 20 based on the GC control interface can be received, and the GC operation can be performed on the storage medium 12 according to the GC command.
[0037] In this embodiment, the format and content of the GC command are not limited, and any command format and content that can instruct the controller 11 to perform a GC operation on the storage medium 12 are applicable to the embodiment of the present application. For example, the host end 20 can carry GC control parameters in the GC command; the controller 11 parses the GC control parameters from the GC command, and performs GC operations on the storage medium 12 according to the GC control parameters. Among them, the GC control parameters can be any control parameters related to the execution of GC operations. For example, GC control parameters include but are not limited to: the execution time, execution duration, execution object, etc. of the GC operation. The execution time refers to the time to start executing the GC operation. The execution duration refers to the length of time the GC operation needs to be executed, such as 30 seconds, 20 seconds, 1 minute, etc. The execution object refers to the object targeted by the GC operation, which can be one or more physical blocks in the storage medium 12.
[0038] Furthermore, for the host side 20, since it has the opportunity to control the GC operation inside the SSD 10, if it needs to ensure the performance of its IO read and write operations on the SSD 10, it can use the opportunity to control the GC operation inside the SSD 10 to time-share the GC operation and the IO read and write operation. In this way, during the execution of the IO read and write operation, it can ensure that the data access bus of the storage medium 12 is exclusively used by the IO read and write operation, reduce the impact of the GC operation on the IO read and write operation, and enable the IO read and write operation to obtain better performance, thereby improving the single GB performance of the SSD 10. Among them, the host side 20 performs time-share scheduling on the GC operation and the IO read and write operation, which means that the execution time of the GC operation indicated by the GC command is different from the execution time of the IO read and write operation. In other words, within a time slot, the processor 11 either executes an IO read and write operation or a GC operation.
[0039] In the embodiment of the present application, the specific implementation method of the host end 20 sending GC commands to the SSD 10 through the GC control interface 111 is not limited. Optionally, the host end 20 can send GC commands to the SSD 10 through the GC control interface according to the locally configured GC policy to schedule GC operations. The GC policy can be to perform GC operations periodically or to perform GC operations at a fixed point. In addition, the host end 20 can also send GC commands to the SSD 10 through the GC control interface in combination with IO read and write requirements to schedule GC operations. For example, IO read and write requests can be avoided, that is, in the absence of IO read and write requests, GC commands are sent to the SSD 10 through the GC control interface to schedule GC operations.
[0040] Further optionally, the host end 20 sends a GC command to the SSD 10 through the GC control interface 111, and when scheduling the GC operation, the GC scheduling parameters inside the SSD 10 may also be referred to. Based on this, the controller 11 is also used to provide the GC scheduling parameters inside the SSD 10 to the host end 20. Among them, the GC scheduling parameters refer to some parameters that have an impact on the GC operation, such as information including physical available space in the storage medium 12.
[0041] In an optional embodiment, the SSD 10 can provide a logical storage space and a physical storage space to the outside, and establish a mapping relationship between the logical storage space and the physical storage space. The physical storage space is provided by the storage medium 12. The logical storage space is visible to the user, and the physical storage space is not perceived by the user. However, the GC scheduling is for the physical storage space provided by the storage medium 12. Therefore, the information of the physical available space in the storage medium 12 needs to be provided to the host end 20 (such as the user) so that the host end 20 can determine whether the GC operation needs to be scheduled. For example, when the size of the physical available space is less than the set space threshold, the GC operation can be scheduled.
[0042] In the embodiment of the present application, the controller 11 is not limited to the implementation method of providing the GC scheduling parameters to the host end 20. In an optional embodiment, Figure 1b As shown, the SSD 10 may further include: a first queue 13. The first queue 13 can be read and written by the controller 11 and the host end 20, and is a medium for interaction between the controller 11 and the host end 20. Based on this, the controller 11 can write the GC scheduling parameters inside the SSD 10 into the first queue 13; the host end 20 can read the GC scheduling parameters written by the controller 11 from the first queue 13, thereby achieving the purpose of providing the GC scheduling parameters to the host end 20.
[0043] Further, if Figure 1bAs shown, the first queue 13 of this embodiment includes: a first submission queue 131 and a first completion queue 132. The first submission queue 131 is updated by the host end 20, that is, the host end 20 can write data to the first submission queue 131. For the controller 11, data cannot be written to the first submission queue 131, but data can be read from the first submission queue 131. The first completion queue 132 is updated by the controller 11, that is, the controller 11 can write data to the first completion queue 132. For the host end 20, data cannot be written to the first completion queue 132, but data can be read from the first completion queue 132.
[0044] Based on the above, the controller 11 can write the GC scheduling parameters into the first completion queue 132 to provide the GC scheduling parameters to the host side 20. For the host side 20, the GC scheduling parameters can be read from the first completion queue 132, and then a GC command can be generated according to the GC scheduling parameters. Further, the host side 20 can write the GC command into the first submission queue 131 to issue the GC command to the controller 11. The controller 11 reads the GC command from the first submission queue 131 and performs a GC operation on the storage medium 12 according to the GC command.
[0045] Further, after executing the GC operation, the controller 11 may also write the execution result of the GC operation into the first completion queue 132 to report to the host end 20. The host end 20 may also read the execution result of the GC operation from the first completion queue 132. The execution result of the GC operation includes: success or failure, etc.
[0046] In addition to scheduling GC operations for the SSD 10, the host 20 can also initiate IO read and write requests to the SSD 10 according to IO read and write requirements. Figure 1b As shown, the SSD 10 also includes: a second queue 14. The second queue 14 can be read and written by the controller 11 and the host 20. Among them, the host 20 can write the IO read and write request into the second queue 14 to submit the IO read and write request to the SSD 10. The controller 11 can read the IO read and write request issued by the host 20 from the second queue 14; then, perform the IO read and write operation on the storage medium 12 according to the IO read and write request. Among them, the IO read and write request includes an IO read request and an IO write request. Of course, the IO read request and the IO write request can exist at the same time, or only one of them can exist.
[0047] Further, if Figure 1bAs shown, the second queue 14 includes: a second submission queue 141 and a second completion queue 142. The second submission queue 141 can be updated by the host end 20, that is, the host end 20 can write data to the second submission queue 141. For the controller 11, data can be read from the second submission queue 141, but data cannot be written to the second submission queue 141. The second completion queue 142 can be updated by the controller 11, that is, the controller 11 can write data to the second completion queue 142. For the host end 20, data can be read from the second completion queue 142, but data cannot be written to the second completion queue 142.
[0048] Based on the above, the host end 20 can write the IO read and write request into the second submission queue 141 to submit the IO read and write request to the SSD 10. For the controller 11, the IO read and write request can be read from the second submission queue 141, and the IO read and write operation can be performed on the storage medium according to the IO read and write request. Further, the controller 11 can also write the execution result of the IO read and write operation into the second completion queue 142 to report to the host end 20. The host end 20 can also read the execution result of the IO read and write operation from the second completion queue 142.
[0049] Furthermore, in order to ensure or improve the service quality of the IO read operation, the controller 11 may adopt a read priority scheduling strategy, which ensures that the IO read request is scheduled first, thereby ensuring the service quality of the IO read request. Based on this, when there are both IO read requests and IO write requests in the second submission queue 141, the controller 11 may preferentially read the IO read request from the second submission queue 141, and perform the IO read operation on the storage medium 12 according to the IO read request.
[0050] In the embodiment of the present application, the positions of the first queue 13 and the second queue 14 are not limited. Figure 1b As shown, the first queue 13 and the second queue 14 are both located on the host side 20. Further optionally, the first queue 13 and the second queue 14 may occupy the memory in the host side 20. In addition, the first queue 13 and the second queue 14 may also be located on the SSD 10 side. For example, the first queue 13 and the second queue 14 may be located in the storage medium 12 of the SSD 10. Further, in the case where the SSD 10 includes a cache chip, the first queue 13 and the second queue 14 may also occupy the space of the cache chip and be located in the cache chip. It should be noted that for the SSD 10, the cache chip is an optional chip.
[0051] In an optional embodiment, the SSD 10 adopts the NVMe protocol, and the storage medium 12 is implemented by NAND Flash. The internal structure of the SSD 10 implemented by NAND Flash and the scheduling relationship between the IO operation and the GC operation are as follows: Figure 1c As shown. Figure 1c As shown, the SSD 10 can be simply divided into the following parts: a control path part, a data path part, a GC execution unit, and multiple data resource blocks; wherein the GC execution unit and the data path part access the data resource blocks through the NAND Flash bus (Bus) of the backend. Among them, the Control Path part mainly implements the function of the GC control interface of the embodiment of the present application.
[0052] NAND Flash uses paging management to manage its physical storage space. The physical storage space of NAND Flash is divided into multiple physical pages. Read and write operations are performed in units of physical pages, and erase operations are performed in units of physical blocks. A physical block contains multiple physical pages. Figure 1c In the data resource block, the physical block storing data is called a data resource block. The host side may need to write new data to these data resource blocks, or may initiate a GC operation for these data resource blocks. In addition, the SSD provided in this embodiment includes SSD logical space, logical write space, NAND Flash space and NAND Flash write space. The SSD logical space is a logical space visible to the user, and the logical write space is a space that the user has written to. The NAND Flash space is the physical space actually provided by the SSD, and the NAND Flash write space is the physical space that is actually exhausted. The NAND Flash space is not perceived by the user, and the user can only perceive the logical space. The scheduling of GC operations is for the NAND Flash space, so the GC control interface needs to provide the information of the NAND Flash free space (Free Space) to the host side (i.e., the upper application side of the SSD 10), so as to realize GC scheduling at the upper application level.
[0053] In the above embodiment, SSD 10 adopts NVMe protocol. Under NVMe protocol, SSD 10 includes Admin Submission Queue (Admin SQ for short), Admin Completion Queue (Admin CQ for short), IO Submission Queue (IO SQ for short) and IO Completion Queue (IO CQ for short). Among them, Admin SQ, Admin CQ, IO SQ and IO CQ can be implemented as the first submission queue, the first completion queue, the second submission queue and the second completion queue in the above embodiment of the present application respectively. Admin SQ and Admin CQ can be collectively referred to as Admin Queue; IO SQ and IO CQ can be collectively referred to as IO Queue.
[0054] Among them, Admin SQ is used to store various management commands that the host side wants to send to SSD 10; Admin CQ is used to store the completion response generated by executing the management commands sent by the host side in SSD 10, for example, it can be the execution results of various management commands. The GC control interface can write the information of NAND Flash free space (Free Space) into Admin CQ as GC scheduling parameters; the host side reads the GC scheduling parameters such as the information of NAND Flash free space (Free Space) from Admin CQ, and generates GC commands according to the GC scheduling parameters; writes the GC commands into Admin SQ; the GC control interface reads the GC commands from Admin SQ; and controls the GC execution unit 112 to perform GC operations on NAND Flash through NAND Flash Bus according to the GC commands. Figure 1c In the Admin Queue, Admin CQ and Admin SQ are not distinguished, but are uniformly illustrated as command queues (Admin Queue). That is, SSD 10 can provide NAND Flash free space (FreeSpace) information to the host through Admin Queue; the host can access the GC control interface inside SSD 10 through the Admin Queue provided by SSD 10, so that the GC execution unit inside SSD 10 can be flexibly controlled at the software level, such as Figure 1c shown.
[0055] Among them, IO SQ is used to store IO commands that the host side wants to send to SSD 10, such as IO read and write requests; IO CQ is used to store the completion response generated by SSD 10 executing IO commands, such as the results of IO read and write operations. The host side can write IO read and write requests into IO SQ, and perform IO read and write on the data resource block through the Backend NANDFlash Bus according to the IO read and write requests in the data path. Figure 1c In the diagram, IO CQ and IO SQ are not distinguished, but are uniformly illustrated as IO queues (IO Queues).
[0056] In this embodiment, by providing a GC control interface to the host side, the host side can perform time-sharing scheduling for GC operations and IO operations, that is, within a time slot, there will only be IO operations or GC operations, and during the execution of IO operations, the NAND Flash Bus inside the SSD 10 can be fully used for IO operations, and GC operations will not interfere with IO operations, which can greatly improve the throughput bandwidth of IO operations and improve the single GB bandwidth visible to users. This is different from Figure 1d The scheduling relationship between the IO operation and the GC operation in the existing SSD is shown in FIG. Figure 1d As shown in the figure, in the existing SSD, IO operations and GC operations share the backend NAND Flash Bus, and GC operations will compete with IO operations for the NAND Flash Bus. Although they can be scheduled according to the read-first IO scheduling method, the IO service quality of read operations can be guaranteed to a certain extent. However, when the SSD is in a steady state, the background GC unit will always be in a working state, and will always compete with IO read and write requests for the backend NAND Flash Bus bandwidth, resulting in IO read and write requests unable to obtain sufficient bandwidth, thereby affecting the single GB performance of the SSD.
[0057] Further, if Figure 1c As shown in the figure, in order to improve the IO service quality of read requests, a read priority based IO scheduler can be used on the Data Path to handle the competition between IO read and write requests, that is, IO read requests are scheduled first, which can improve the IO read and write bandwidth while ensuring the service quality of read IO requests.
[0058] In each embodiment of the present application, the host side does not limit the implementation method of generating GC commands according to GC scheduling parameters. In an optional embodiment, the host side can generate GC commands based on GC scheduling parameters alone. For example, the host side can determine whether the free space is sufficient (for example, whether it is greater than the set space threshold) based on the information of NAND Flash free space in the GC scheduling parameters; if not, it is determined that GC scheduling is required to generate new available space, and then a GC command can be generated. In another optional embodiment, the host side can also generate GC commands based on GC scheduling parameters and IO read and write requirements at the same time. In this optional implementation, the host side can schedule GC operations and IO read and write operations in a time-sharing manner, that is, the GC operations indicated by the GC command and the IO read and write operations are executed in different time periods. Among them, the time periods supported by different SSDs will be different. A time period can be a time slot supported by the SSD, but is not limited to this.
[0059] Furthermore, an implementation method of generating a GC command based on both the GC scheduling parameters and the IO read / write requirements includes: determining whether the SSD needs to perform a GC operation based on the GC scheduling parameters; if it is determined that the SSD needs to perform a GC operation, determining the execution time of the GC operation based on the execution time of the IO read / write operation; wherein the execution time of the GC operation and the execution time of the IO read / write operation are in different time periods (e.g., time slots); then, generating a GC command based on the execution time of the GC operation; and writing the GC command into the Admin SQ (i.e., the first queue) to control the SSD to perform the GC operation.
[0060] In this embodiment, the SSD provides a GC control interface to the host, so that the host has the opportunity to control the GC operation inside the SSD. Based on this, with the cooperation of the SSD and the host, when the performance of IO read and write operations needs to be guaranteed, the GC operation and IO read and write operations can be time-sharing scheduled to reduce the impact of GC background traffic on the IO read and write operations of the SSD, ensure that the bus inside the SSD is exclusively used for IO read and write operations, and improve the single GB performance of the SSD.
[0061] In addition to the above-mentioned SSD, the embodiment of the present application also provides a computer device 21, such as Figure 2 As shown, the computer device 21 is mounted with an SSD 22 , and the SSD 22 provides a GC control interface facing the computer device 21 . The computer device 21 also includes: a non-SSD storage medium 23 and a processor 24 .
[0062] In this embodiment, the SSD 22 is mounted on the computer device 21, but the mounting method between the SSD 22 and the computer device 21 is not limited. Optionally, the SSD 22 can be fixedly installed in the hard disk position on the computer device 21, or can be inserted in the computer device 21 in a plug-in manner, or can be externally connected to the computer device 21. Among them, the SSD 22 can be used as a cache of a low-speed storage medium on the computer device 21, and can also be used as the final storage space of the computer device 21.
[0063] The non-SSD type storage medium 23 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, magnetic disk or optical disk.
[0064] The non-SSD type storage medium 23 can be configured to store computer programs, such as a GC control program, and can be configured to store various other data to support operations on the computer device. Examples of such data include instructions for any application or method operating on the computer device, contact data, phone book data, messages, pictures, videos, etc. Among them, the GC control program can be an application, program code, plug-in or SDK, etc.
[0065] The processor 24 is coupled to the non-SSD storage medium 23, executes the GC control program in the non-SSD storage medium 23, and can send a GC command to the SSD 22 through the GC control interface provided by the SSD 22 to the computer device 21, so as to control the SSD 22 to perform a GC operation. For the SSD 22, the GC command sent by the processor 24 can be received to perform a GC operation on the storage medium of the SSD 22. For the implementation structure, related functions and operations of the SSD 22, please refer to the description of the SSD 10 in the above embodiment, and this embodiment focuses on the related functions and operations of the computer device 21.
[0066] In an optional embodiment, the SSD 22 further includes a first queue, and the first queue is readable and writable by the processor 24 and the SSD 22. Optionally, the first queue of the SSD 22 is located in a non-SSD storage medium 23. Further, the non-SSD storage medium 23 includes a memory of the computer device 21, and the first queue of the SSD 22 may be located in the memory of the computer device 21. In this case, the processor 24 may specifically write the GC command to the first queue, so that the controller of the SSD 22 can read the GC command from the first queue.
[0067] Further optionally, the SSD 22 may also provide the GC scheduling parameters inside the SSD 22 to the processor 24 through the GC control interface, for example, the GC scheduling parameters may be written into the first queue for reading by the processor 24. Based on this, the processor 24 is further configured to: read the GC scheduling parameters inside the SSD 22 from the first queue; further, generate a GC command according to the GC scheduling parameters; and write the GC command into the first queue according to the GC control interface to control the SSD 22 to perform the GC operation.
[0068] Further optionally, the first queue includes: a first submission queue and a first completion queue. The first completion queue is used for writing GC scheduling parameters to the SSD 22. The processor 24 is specifically configured to: read the GC scheduling parameters from the first completion queue, and after generating a GC command, specifically write the GC command into the first submission queue.
[0069] Further optionally, when generating a GC command, the processor 24 may generate the GC command specifically according to the GC scheduling parameters and the IO read / write requirements; wherein the execution time of the GC operation indicated by the GC command is different from the execution time of the IO read / write operation, that is, the two operations are executed in time-sharing.
[0070] Furthermore, the processor 24 is specifically used to: determine whether the SSD 22 needs to perform a GC operation according to the GC scheduling parameters; when it is determined that the SSD 22 needs to perform a GC operation, determine the execution time of the GC operation according to the execution time of the IO read and write operations; generate a GC command according to the execution time of the GC operation; and write the GC command into the first queue (specifically, it can be written into the first submission queue).
[0071] Optionally, the time when the GC command is written into the first queue may reflect the execution time of the GC operation, or the execution time of the GC operation may be carried in the GC command.
[0072] Further optionally, the controller of the SSD 22 may also write the execution result of the GC operation into the first completion queue. The processor 24 is further configured to read the execution result of the GC operation from the first completion queue.
[0073] In an optional embodiment, the SSD 22 further includes: a second queue. The second queue can be read and written by the SSD 22 and the processor 24. Optionally, the second queue of the SSD 22 is located in a non-SSD storage medium. Further, the non-SSD storage medium 23 includes a memory of the computer device 21, and the second queue of the SSD 22 can be located in the memory of the computer device 21. Based on this, the processor 24 can write an IO read and write request to the second queue according to the IO read and write requirements to control the SSD to perform IO read and write operations; further, the execution result of the IO read and write operation written by the SSD can also be read from the second queue.
[0074] Further optionally, the second queue includes: a second submission queue and a second completion queue. The second completion queue can be used for the SSD to write the execution result of the IO read and write operation. Based on this, the processor 24 is specifically used to: write the IO read and write request to the second submission queue, and read the IO operation execution result from the second completion queue.
[0075] In an optional embodiment, the SSD 22 adopts the NVMe protocol. In this case, the first submission queue, the first completion queue, the second submission queue and the second completion queue can be Admin SQ, Admin CQ, IO SQ and IO CQ, but are not limited thereto.
[0076] In addition to the above-mentioned computer device, the embodiment of the present application also provides a storage system 30 based on SSD. Figure 3 As shown, the storage system 30 includes: a host 31 and an SSD 32 mounted on the host 31; the SSD 32 provides a GC control interface for the host 31. The host 31 can issue a GC command to the SSD 32 based on the GC control interface. The SSD 32 of this embodiment includes: a controller and a storage medium controlled by the controller. The controller is used to obtain the GC command issued by the host based on the GC control interface, and perform GC operations on the storage medium of the SSD 32 according to the GC command. Various data are stored in the storage medium. The host 31 can be regarded as the upper application end of the SSD 32.
[0077] Regarding the function and working principle of the host 31, reference may be made to the relevant description of the host end 20 and the computer device 21 in the aforementioned embodiment; similarly, the function and working principle of the SSD 32 may also be referred to the relevant description of the SSD 10 in the aforementioned embodiment, which will not be repeated here.
[0078] The storage system provided in this embodiment can be applied to various application scenarios, such as data center scenarios. Taking the data center scenario as an example, the storage system of this embodiment can be implemented as a cloud storage system. As a core component of cloud computing, the cloud storage system can provide high-performance and highly reliable data storage capabilities for various upper-level application terminals. The cloud storage system includes: multiple SSDs deployed in a distributed manner, and the multiple SSDs can provide data storage services to upper-level application terminals using the cloud storage system. In the design of a cloud storage system, the random write bandwidth of the SSD is an important consideration. As the capacity of the SSD increases further, the single GB performance becomes lower and lower. If the random write bandwidth of the SSD cannot be expanded, the single GB performance will not be able to meet the design requirements of the cloud storage business.
[0079] Based on the above considerations, in the cloud storage system of this embodiment, each SSD provides a GC control interface to the upper-layer application end that can access it; the upper-layer application end can issue GC commands to the SSD it needs to access based on the GC control interface; each SSD includes: a controller and a storage medium controlled by the controller; wherein the controller is used to obtain the GC command issued by the upper-layer application end based on the GC control interface, and perform GC operations on the storage medium according to the GC command. The upper-layer application end refers to a user who has the authority to use the SSD and can perform GC control on the SSD, for example, it can be various applications (such as user applications, system applications), devices, chips or modules. Among them, the host end that can mount the SSD in the above embodiment is a type of upper-layer application end of the SSD.
[0080] Regarding the process of the upper-layer application end performing GC control on the SSD it needs to access through the GC control interface, reference may be made to the relevant description on the host or computer device in the aforementioned embodiment, which will not be repeated here.
[0081] Among them, the functions and working principles of the SSD can be found in the description of the aforementioned embodiments, which will not be repeated here.
[0082] In the cloud storage system of this embodiment, through the GC control interface and GC scheduling parameters provided by the SSD, the cloud storage system can control the GC execution time inside the SSD, so that the GC operation and IO read and write operation can be time-sharing scheduled at the upper application layer, so that the IO read and write operation can run in the best random write performance state of the SSD, so as to achieve the purpose of improving the single GB performance for the upper application end. For example, for many SSDs, their steady-state performance is about 500MB / s, and the upper limit of the performance that can be improved by adjusting the OP of the SSD is about 1GB / s. The best performance of the SSD can exceed 2GB / s. In this embodiment, the random write performance of the SSD can be close to the best performance.
[0083] In addition to the above embodiments, the present application also provides a GC method for SSD. The SSD includes a controller and a storage medium controlled by the controller, and its structure is as follows: Figure 1a Or as shown in 1b. Optionally, the storage medium may be, but is not limited to, NAND Flash. The SSD may be mounted on the host side and is responsible for providing storage services for the host side. The GC method is mainly executed by the controller in the SSD, such as Figure 4 As shown, the method includes:
[0084] 41. Obtain the GC command issued by the host based on the GC control interface provided by the SSD;
[0085] 42. Perform GC operation on the storage medium of the SSD according to the above GC command.
[0086] In an optional embodiment, before obtaining the GC command issued by the host based on the GC control interface, the method further includes: writing the GC scheduling parameters inside the SSD into the first queue of the SSD to provide the GC scheduling parameters to the host. The GC scheduling parameters refer to some parameters that affect the GC operation, such as information about the physical available space in the storage medium of the SSD.
[0087] In an optional embodiment, the first queue of the SSD includes: a first submission queue and a first completion queue. The first submission queue is updated by the host side, that is, the host side can write data to the first submission queue, such as a GC command. For the controller, data cannot be written to the first submission queue, but data can be read from the first submission queue. The first completion queue is updated by the controller, that is, the controller can write data to the first completion queue. For the host side, data cannot be written to the first completion queue, but data can be read from the first completion queue.
[0088] Based on the above, obtaining the GC command issued by the host based on the GC control interface includes: reading the GC command written by the host from the first submission queue. Accordingly, writing the GC scheduling parameters inside the SSD into the first queue of the SSD includes: writing the GC scheduling parameters into the first completion queue to provide the GC scheduling parameters to the host. The host can also read the execution result of the GC operation from the first completion queue. The execution result of the GC operation includes: success or failure, etc.
[0089] Furthermore, after executing the GC operation, the method further includes: writing the execution result of the GC operation into the first completion queue to report to the host end.
[0090] In an optional embodiment, in addition to scheduling GC operations for the SSD, the host side can also initiate IO read and write requests to the SSD based on IO read and write requirements. The SSD also includes: a second queue. The second queue can be read and written by the controller and the host side. Among them, the host side can write the IO read and write requests to the second queue to submit the IO read and write requests to the SSD. The controller can read the IO read and write requests issued by the host side from the second queue; then, perform IO read and write operations on the storage medium according to the IO read and write requests. Among them, the IO read and write requests include IO read requests and IO write requests. Of course, the IO read requests and IO write requests can exist at the same time, or only one of them can exist.
[0091] Further, the second queue includes: a second submission queue and a second completion queue. The second submission queue can be updated by the host, that is, the host can write data to the second submission queue. For the controller, data can be read from the second submission queue, but data cannot be written to the second submission queue. The second completion queue can be updated by the controller, that is, the controller can write data to the second completion queue. For the host, data can be read from the second completion queue, but data cannot be written to the second completion queue.
[0092] Based on the above, the host can write the IO read / write request into the second submission queue to submit the IO read / write request to the SSD. The method also includes the following steps:
[0093] Read the IO read and write request sent by the host from the second submission queue of the SSD;
[0094] Performing IO read and write operations on the storage medium of the SSD according to the IO read and write request; and
[0095] The execution result of the IO read and write operation is written into the second completion queue of the SSD to be reported to the host side.
[0096] Further optionally, an implementation of reading the IO read and write requests sent by the host from the second submission queue of the SSD includes: when there are both IO read requests and IO write requests in the second submission queue, preferentially reading the IO read requests from the second queue.
[0097] In this embodiment, the SSD provides a GC control interface to the host side. Based on the GC control interface, the host side has the opportunity to control the GC operation inside the SSD, which provides conditions for improving the single GB performance of the SSD. If the host side needs to ensure the performance of IO read and write operations, the GC operation and IO read and write operations can be time-sharing scheduled to reduce the impact of GC background traffic on the IO read and write operations of the SSD, ensure that the bus inside the SSD is exclusively used for IO read and write operations, and improve the single GB performance of the SSD.
[0098] Accordingly, the embodiment of the present application further provides a computer-readable storage medium storing a computer program, which can achieve the above-mentioned Figure 4 The steps in the method embodiment are shown.
[0099] Figure 5 A flow chart of a GC control method provided by an exemplary embodiment of the present application. The method can be executed by a host or computer device mounted with an SSD, wherein the SSD includes a controller and a storage medium controlled by the controller, and its structure is as follows: Figure 1aOr as shown in 1b. Optionally, the storage medium may be, but is not limited to, NAND Flash. The SSD may be mounted on the host side and is responsible for providing storage services for the host side. Figure 5 As shown, the GC control method includes:
[0100] 51. Determine the GC control interface provided by SSD;
[0101] 52. Based on the GC control interface, send GC commands to the SSD to control the SSD to perform GC operations.
[0102] In an optional embodiment, based on the GC control interface, a GC command is sent to the SSD, including: reading the GC scheduling parameters inside the SSD from the first queue of the SSD; generating a GC command according to the GC scheduling parameters; and writing the GC command into the first queue according to the GC control interface to control the SSD to perform GC operations.
[0103] Further optionally, an implementation of generating a GC command according to the GC scheduling parameters includes: generating a GC command according to the GC scheduling parameters and IO read and write requirements; wherein the GC operation indicated by the GC command and the IO read and write operation are executed in different time periods.
[0104] Further optionally, the above-mentioned generating a GC command according to the GC scheduling parameters and the IO read and write requirements includes: determining whether the SSD needs to perform a GC operation according to the GC scheduling parameters; if the GC operation needs to be performed, determining the execution time of the GC operation according to the execution time of the IO read and write operations; wherein the execution time of the GC operation and the execution time of the IO read and write operations are in different time periods; generating a GC command according to the execution time of the GC operation; and writing the GC command into the first queue to control the SSD to perform the GC operation.
[0105] For detailed description of each step provided in this embodiment, please refer to the description in the aforementioned embodiment, which will not be repeated here.
[0106] Accordingly, the embodiment of the present application further provides a computer-readable storage medium storing a computer program, which can achieve the above-mentioned Figure 5 The steps in the method embodiment are shown.
[0107] It should be noted that the execution subject of each step of the method provided in the above embodiment can be the same device, or the method can be executed by different devices. For example, the execution subject of step 41 to step 42 can be device A; for another example, the execution subject of step 41 can be device A, and the execution subject of step 42 can be device B; and so on.
[0108] In addition, in some of the processes described in the above embodiments and the accompanying drawings, multiple operations that appear in a specific order are included, but it should be clearly understood that these operations may not be executed in the order in which they appear in this article or executed in parallel, and the sequence numbers of the operations, such as 41, 42, etc., are only used to distinguish between different operations, and the sequence numbers themselves do not represent any execution order. In addition, these processes may include more or fewer operations, and these operations may be executed in sequence or in parallel. It should be noted that the descriptions of "first", "second", etc. in this article are used to distinguish different messages, devices, modules, etc., do not represent the order of precedence, and do not limit the "first" and "second" to be different types.
[0109] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0110] The present invention is described with reference to the flowchart and / or block diagram of the method, device (system), and computer program product according to the embodiment of the present invention. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the process and / or box in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device produce a device for implementing the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.
[0111] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device that implements the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.
[0112] These computer program instructions may also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, whereby the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.
[0113] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0114] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0115] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0116] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0117] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.
Claims
1. A solid state drive (SSD), the SSD providing a garbage collection (GC) control interface to a host side, the SSD comprising a controller and a storage medium controlled by the controller; The controller is used to obtain a GC command issued by the host end based on the GC control interface, parse GC control parameters from the GC command, and perform a GC operation on the storage medium according to the GC control parameters, wherein the GC control parameters include: The execution time, execution duration, and execution object of the GC operation; The execution time of the GC operation indicated by the GC command is different from the execution time of the IO read and write operation performed by the controller on the storage medium.
2. The SSD according to claim 1, further comprising: A first queue; the first queue can be read and written by the controller and the host; The controller is further used to write the GC scheduling parameters inside the SSD into the first queue to provide the GC scheduling parameters to the host end.
3. The SSD according to claim 2, wherein the GC scheduling parameters include: Information about the physical available space in the storage medium.
4. The SSD according to claim 2, wherein the first queue comprises: A first submission queue and a first completion queue; the first submission queue can be used by the host to write GC commands; The controller is specifically used for: writing the GC scheduling parameters into the first completion queue to provide the GC scheduling parameters to the host side; and reading the GC command from the first submission queue, and performing a GC operation on the storage medium according to the GC command. 5 . The SSD according to claim 4 , wherein the controller is further configured to: write the execution result of the GC operation into the first completion queue to report to the host end.
6. The SSD according to any one of claims 2 to 5, further comprising: A second queue; the second queue can be read and written by the controller and the host; The controller is further used to: read the IO read / write request sent by the host from the second queue, and perform the IO read / write operation on the storage medium according to the IO read / write request.
7. The SSD according to claim 6, wherein the second queue comprises: A second submission queue and a second completion queue; the second submission queue can be used by the host to write IO read and write requests; The controller is specifically used to: read the IO read / write request from the second submission queue, perform IO read / write operations on the storage medium according to the IO read / write request; and write the execution result of the IO read / write operation into the second completion queue to report to the host end.
8. According to the SSD of claim 7, when there are IO read requests and IO write requests in the second submission queue at the same time, the controller is specifically used to: preferentially read the IO read request from the second submission queue, and perform the IO read operation on the storage medium according to the IO read request. 9 . The SSD according to claim 6 , wherein the first queue and the second queue are located in a memory of the host.
10. A garbage collection (GC) method, applicable to a controller of a solid state drive (SSD), wherein the SSD is provided with a GC control interface facing a host side; The SSD includes a controller and a storage medium controlled by the controller, and the method includes: Obtaining a GC command issued by the host based on the GC control interface; GC control parameters are parsed from the GC command, and GC operations are performed on the storage medium according to the GC control parameters, wherein the GC control parameters include: execution time, execution duration, and execution object of the GC operation; the execution time of the GC operation indicated by the GC command is different from the execution time of the controller performing IO read and write operations on the storage medium.
11. The method according to claim 10, before obtaining the GC command issued by the host based on the GC control interface, further comprises: The GC scheduling parameters inside the SSD are written into the first queue of the SSD to provide the GC scheduling parameters to the host end.
12. The method according to claim 11, wherein the GC scheduling parameters include: Information about the physical available space in the storage medium.
13. The method according to claim 11, wherein the first queue comprises: A first submission queue and a first completion queue; The first submission queue is available for the host to write GC commands; The obtaining of the GC command issued by the host end based on the GC control interface includes: reading the GC command written by the host end from the first submission queue; The writing of the GC scheduling parameters inside the SSD into the first queue of the SSD includes: writing the GC scheduling parameters into the first completion queue to provide the GC scheduling parameters to the host end.
14. The method according to claim 13, after performing the GC operation, further comprises: The execution result of the GC operation is written into the first completion queue to be reported to the host end.
15. The method according to claim 10, further comprising: Reading the IO read / write request sent by the host from the second submission queue of the SSD; Execute an IO read / write operation on the storage medium according to the IO read / write request; as well as The execution result of the IO read and write operation is written into the second completion queue of the SSD to report to the host end.
16. The method according to claim 15, reading the IO read / write request sent by the host from the second submission queue of the SSD, comprises: When there are both IO read requests and IO write requests in the second submission queue, the IO read requests are preferentially read from the second submission queue.
17. A garbage collection (GC) control method, applicable to a host end, wherein a solid state drive (SSD) is mounted on the host end, and the SSD provides a GC control interface facing the host end; The SSD includes a controller and a storage medium controlled by the controller, and the method includes: Determine a GC control interface provided by the SSD; Based on the GC control interface, a GC command is issued to the SSD to control the SSD to perform a GC operation; wherein the controller parses GC control parameters from the GC command, and performs a GC operation on the storage medium according to the GC control parameters, the GC control parameters including: an execution time, an execution duration, and an execution object of the GC operation; the execution time of the GC operation indicated by the GC command is different from the execution time of the controller performing an IO read and write operation on the storage medium.
18. The method according to claim 17, based on the GC control interface, sending a GC command to the SSD, comprising: Reading GC scheduling parameters inside the SSD from the first queue of the SSD; Generate a GC command according to the GC scheduling parameters; According to the GC control interface, the GC command is written into the first queue to control the SSD to perform a GC operation.
19. The method according to claim 18, generating a GC command according to the GC scheduling parameter, comprising: A GC command is generated according to the GC scheduling parameters and the IO read / write requirements; wherein the GC operation indicated by the GC command and the IO read / write operation are executed in different time periods.
20. The method according to claim 19, generating a GC command according to the GC scheduling parameters and IO read / write requirements, comprising: Determining whether the SSD needs to perform a GC operation according to the GC scheduling parameters; In the case where a GC operation needs to be performed, the execution time of the GC operation is determined according to the execution time of the IO read and write operations; wherein the execution time of the GC operation and the execution time of the IO read and write operations are in different time periods; Generate a GC command according to the execution time of the GC operation; The GC command is written into the first queue to control the SSD to perform a GC operation.
21. A computer device, mounted with a solid state drive (SSD), wherein the SSD provides a garbage collection (GC) control interface facing the computer device, and the computer device further comprises a non-solid state drive storage medium and a processor; The non-solid state drive storage medium stores a GC control program; the processor executes the GC control program and can send a GC command to the SSD through the GC control interface to control the SSD to perform a GC operation, parse a GC control parameter from the GC command, and perform a GC operation on the storage medium according to the GC control parameter, wherein the GC control parameter includes: The execution time, execution duration, and execution object of the GC operation; The execution time of the GC operation indicated by the GC command is different from the execution time of the IO read and write operation performed by the controller on the storage medium.
22. The computer device of claim 21, wherein the non-SSD storage medium comprises a first queue of the SSD, the first queue being readable and writable by the processor and the SSD; The processor is also used to: read the GC scheduling parameters inside the SSD written by the SSD from the first queue; generate a GC command according to the GC scheduling parameters; and write the GC command into the first queue according to the GC control interface to control the SSD to perform GC operations.
23. The computer device of claim 22, wherein the first queue comprises: A first submission queue and a first completion queue; the first completion queue is used for the SSD to write the GC scheduling parameters; The processor is specifically configured to: read the GC scheduling parameter from the first completion queue, and write the GC command into the first submission queue.
24. The computer device according to claim 22, wherein the processor is specifically configured to: generate a GC command according to the GC scheduling parameters and IO read / write requirements; wherein: The execution time of the GC operation indicated by the GC command is different from the execution time of the IO read and write operations.
25. The computer device according to claim 24, wherein the processor is specifically configured to: Determining whether the SSD needs to perform a GC operation according to the GC scheduling parameters; When GC operation is required, the execution time of GC operation is determined according to the execution time of IO read and write operations; Generate a GC command according to the execution time of the GC operation; The GC command is written into the first queue.
26. The computer device according to claim 24, wherein the non-solid state hard disk storage medium further comprises: a second queue of the SSD; The processor is further configured to: write an IO read / write request to the second queue according to IO read / write requirements to control the SSD to perform IO read / write operations; and read from the second queue the execution result of the IO read / write operation written by the SSD.
27. The computer device of claim 26, wherein the second queue comprises: A second submission queue and a second completion queue; the second completion queue can be used for the SSD to write the execution result of the IO read and write operation; The processor is specifically configured to: write the IO read / write request into the second submission queue; and read the execution result of the IO read / write operation from the second completion queue.
28. A storage system based on a solid state drive (SSD), comprising a host and an SSD mounted on the host; the SSD is provided with a GC control interface facing the host; The host may send a GC command to the SSD based on the GC control interface; The SSD includes a controller and a storage medium controlled by the controller; wherein, The controller is used to obtain a GC command issued by the host based on the GC control interface, parse GC control parameters from the GC command, and perform a GC operation on the storage medium according to the GC control parameters, wherein the GC control parameters include: an execution time, an execution duration, and an execution object of the GC operation; The execution time of the GC operation indicated by the GC command is different from the execution time of the IO read and write operation performed by the controller on the storage medium.
29. A cloud storage system, comprising a plurality of SSDs deployed in a distributed manner; each SSD provides a GC control interface to an upper-layer application end that can access it; The upper layer application end may issue a GC command to the SSD that it needs to access based on the GC control interface; Each SSD includes a controller and a storage medium controlled by the controller; wherein, The controller is used to obtain a GC command issued by the upper-layer application end based on the GC control interface, parse a GC control parameter from the GC command, and perform a GC operation on the storage medium according to the GC control parameter, wherein the GC control parameter includes: an execution time, an execution duration, and an execution object of the GC operation; The execution time of the GC operation indicated by the GC command is different from the execution time of the IO read and write operation performed by the controller on the storage medium.
30. A computer-readable storage medium storing a computer program, which, when executed by a controller, causes the controller to implement the steps of the method according to any one of claims 10 to 16.
31. A computer-readable storage medium storing a computer program, which, when executed by a processor, causes the processor to implement the steps of the method according to any one of claims 17 to 20.
Citation Information
Patent Citations
Solid state disk garbage collection task management method, controller and solid state disk
CN109726137A
Solid state disk and computer equipment
CN110515547A