Disclosure of Invention
The application aims to provide a garbage recycling method and system in a full flash memory array, the full flash memory array and a computer readable storage medium, which can avoid host IO waiting and further do not influence service response.
In order to solve the above technical problem, the present application provides a garbage recycling method in a full flash memory array, including:
when judging that the initial LP mapping mapped to the first space does not exist according to the mapping relation information corresponding to the first space in the full flash memory array, deleting HP mapping relation information in the mapping relation information;
inquiring whether LP mapping mapped to the first space exists according to the mapping relation information;
and if so, migrating the data in the first space to a second space, and establishing mapping relation information corresponding to the second space.
Preferably, after deleting the HP mapping relationship information in the mapping relationship information, the method further includes:
judging whether the writing of the data identical to the data into the full flash memory array by the host IO is finished or not according to a counting result corresponding to the number of the host IOs; the moment corresponding to the data written by the host IO is before the moment corresponding to the HP mapping relation information deleted;
and if yes, the step of inquiring whether the LP mapping mapped to the first space exists according to the mapping relation information is executed.
Preferably, the migrating the data in the first space to a second space, and establishing mapping relationship information corresponding to the second space includes:
after the data is read from the first space, the data is written into the second space;
and establishing LP mapping relation information corresponding to the second space.
Preferably, the garbage collection method in the full flash memory array further includes:
if the LP mapping mapped to the first space does not exist, completing recycling of the first space.
The application also provides a rubbish recovery system in full flash memory storage array, is applied to full flash memory storage array, includes:
the HP mapping relation information deleting module is used for deleting HP mapping relation information in the mapping relation information when judging that the initial LP mapping mapped to the first space does not exist according to the mapping relation information corresponding to the first space in the full flash memory array;
the LP mapping query module is used for querying whether LP mapping mapped to the first space exists according to the mapping relation information;
and the data migration module is used for migrating the data in the first space to a second space and establishing mapping relation information corresponding to the second space if the LP mapping mapped to the first space exists.
Preferably, the garbage collection system in the full flash memory array further includes:
the writing completion judging module is used for judging whether the writing of the data which is the same as the data into the full flash memory array by the host IO is completed or not according to a counting result corresponding to the number of the host IOs; the moment corresponding to the data written by the host IO is before the moment corresponding to the HP mapping relation information deleted;
the LP mapping query module is specifically configured to query whether LP mapping mapped to the first space exists according to the mapping relationship information when the host IO completes writing of data identical to the data into the full flash memory array.
Preferably, the data migration module includes:
the read-write unit is used for reading the data from the first space and then writing the data into the second space;
and the mapping relation information establishing unit is used for establishing the LP mapping relation information corresponding to the second space.
Preferably, the garbage collection system in the full flash memory array further includes:
a recycle completion module for completing recycle of the first space if the LP mapping mapped to the first space does not exist.
The present application further provides a full flash memory array, comprising:
a memory and a processor; the memory is used for storing a computer program, and the processor is used for implementing the steps of the garbage collection method in the full flash memory array when executing the computer program.
The present application further provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the computer program implements the steps of the garbage collection method in the full flash memory array.
The application provides a garbage recycling method in a full flash memory array, which comprises the following steps: when judging that the initial LP mapping mapped to the first space does not exist according to the mapping relation information corresponding to the first space in the full flash memory array, deleting HP mapping relation information in the mapping relation information; inquiring whether LP mapping mapped to the first space exists according to the mapping relation information; and if so, migrating the data in the first space to a second space, and establishing mapping relation information corresponding to the second space.
In the method, after the full flash memory array judges that the initial LP mapping mapped to the first space does not exist according to the mapping relation information, the HP mapping relation information in the mapping relation information is deleted. And then, after the LP mapping mapped to the first space is inquired according to the mapping relation information, the data in the first space is transferred to a second space, and the mapping relation information corresponding to the second space is established. The LP mapping mapped to the first space is found out through query, which shows that the same data is written by the host IO when the HP mapping relationship information is deleted, and the host IO does not need to wait until the HP mapping relationship information is deleted. Therefore, host IO waiting can be avoided, and further the response of the service is not influenced. In addition, the method reduces the possibility of multiple copies of the same data, so that the writing amount of the data is not increased, and the IO performance and the deduplication rate of the system are relatively improved; in addition, the method deletes the HP mapping, so that the complex processing after deleting the HP mapping is avoided, the implementation is relatively simple, and the complexity is reduced. The application also provides a garbage recycling system in the full flash memory array, the full flash memory array and a computer readable storage medium, which all have the beneficial effects and are not repeated herein.
Detailed Description
The core of the application is to provide a garbage recycling method in a full flash memory array, which can avoid waiting for host IO and further does not influence the response of the service. At the other core of the present application, a garbage collection system in a full flash memory array, a full flash memory array and a computer readable storage medium are provided.
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The way for dealing with the mutual exclusion problem in the related art is that the GC often marks the hash value of the data when deleting the HP mapping, and the host IO finds that the GC marks the hash value: after the host IO waits for the GC to delete the HP mapping, the data is written to a new position, and then the rest of the write requests generate a new LP mapping relation to be mapped to the position. However, this approach may cause host IO to wait, which may affect the response of the service. According to the embodiment of the application, when the HP mapping relation information is deleted in the full flash memory array, data are written by the host IO, the host IO does not need to wait until the HP mapping relation information is deleted, and therefore host IO waiting can be avoided, and further the response of a service is not affected. Therefore, an execution subject of the embodiment of the present application is a full flash memory array, specifically referring to fig. 1, fig. 1 is a flowchart of a garbage collection method in the full flash memory array provided in the embodiment of the present application, where the garbage collection method in the full flash memory array specifically includes:
s101, deleting HP mapping relation information in the mapping relation information when judging that the initial LP mapping mapped to the first space does not exist according to the mapping relation information corresponding to the first space in the full flash memory array.
Full flash storage arrays are stand-alone storage arrays or devices that are composed entirely of solid-state storage media, and these systems are used to enhance the performance of environments that may contain disk arrays, or to replace all conventional hard disk storage arrays. The brand parameters of the full flash memory array are not particularly limited, and can be set by those skilled in the art according to practical situations, such as dell Equal Logic PS 6210S. Further, the capacity of the full flash memory array and the IOPS (input/output per second) are not particularly limited. The first space is a space for storing data in the full flash memory array, and the number and the size of the space for storing data in the full flash memory array are not particularly limited, and should be set by a person skilled in the art according to actual conditions.
The mapping relationship information generally includes initial LP mapping relationship information and HP mapping relationship information, and the existence form of the mapping relationship information is not particularly limited, and should be set by a person skilled in the art according to actual situations, and generally exists in the form of a mapping table. Accordingly, the initial LP map information and the HP map information are both typically present in the form of mapping tables. According to the mapping relation information corresponding to the first space in the full flash memory array, it is judged that the initial LP mapping mapped to the first space does not exist, namely the data in the first space is invalid, but the hash value calculated by using the data and the first space still have a mapping relation, namely HP mapping, so that the HP mapping relation information in the mapping relation information needs to be deleted before the first space is recovered, namely the HP mapping is deleted.
S102, whether the LP mapping mapped to the first space exists is inquired according to the mapping relation information.
And after deleting the HP mapping relation information in the mapping relation information, the full-flash memory array inquires whether the LP mapping mapped to the first space exists according to the mapping relation information. Specifically, whether the mapping relationship information includes the LP mapping relationship information is queried, and there are two cases: LP mapping relation information exists in the mapping relation information; the LP mapping relationship information does not exist in the mapping relationship information. For the former case, that is, there is an LP mapping mapped to the first space, which indicates that the host IO is ready to write the same data as the data in the first space in a certain space of the full flash memory array in the process of deleting the HP mapping relationship information in the mapping relationship information. Because the full flash memory array usually starts the deduplication function to improve the space utilization rate, that is, for the same data, only one copy of the data is saved in the full flash memory array, so that the possibility that the same copy of the data exists in multiple copies is reduced, the write-in amount of the data is not increased, and the IO performance and the deduplication rate of the system are relatively improved. In the process of deleting the HP mapping relation information, the data in the first space still exists, so that the data does not need to be written in the certain space, and the LP mapping is directly established with the first space. For the latter case, it is explained that in the process of deleting the HP mapping relationship information, the data in the first space is still invalid data without the LP mapping mapped to the first space.
S103, if the LP mapping mapped to the first space exists, the data in the first space is migrated to a second space, and mapping relation information corresponding to the second space is established.
If there is an LP mapping to the first space, it indicates that the data in the first space is valid data. However, the full flash memory array still continues to recycle the first space, so that the data in the first space is migrated to the second space, and mapping relationship information corresponding to the second space is established. The second space is also in the full flash memory array, and the size of the second space is not particularly limited on the premise of storing the data, and should be set by those skilled in the art according to actual conditions.
In addition, if there is no LP map mapped to the first space, the full flash memory array performs corresponding operations, and the specific operations are not limited in detail, and usually complete the reclamation of the first space. Fig. 2 shows a complete process of the garbage collection method in the full flash memory array, and fig. 2 is a complete flowchart of the garbage collection method in the full flash memory array according to the embodiment of the present application. As can be seen from the figure, when it is determined that there is no initial LP mapping mapped to the first space according to the mapping relationship information corresponding to the first space in the full flash memory array, the HP mapping relationship information in the mapping relationship information is deleted; inquiring whether LP mapping mapped to the first space exists according to the mapping relation information; if so, migrating the data in the first space to a second space, and establishing mapping relation information corresponding to the second space; if not, the first space is recycled.
In this embodiment, after the full flash memory array determines that there is no initial LP mapping mapped to the first space according to the mapping relationship information, the HP mapping relationship information in the mapping relationship information is deleted. And then, after the LP mapping mapped to the first space exists according to the mapping relation information, the data in the first space is transferred to a second space, and the mapping relation information corresponding to the second space is established. The LP mapping mapped to the first space is found out through query, which shows that the same data is written by the host IO when the HP mapping relationship information is deleted, and the host IO does not need to wait until the HP mapping relationship information is deleted. Therefore, host IO waiting can be avoided, and further the response of the service is not influenced. In addition, the method reduces the possibility of multiple copies of the same data, so that the writing amount of the data is not increased, and the IO performance and the deduplication rate of the system are relatively improved; in addition, the method deletes the HP mapping, so that the complex processing after deleting the HP mapping is avoided, the implementation is relatively simple, and the complexity is reduced. Further, for the mutual exclusion problem between the background service and the foreground service, the influence on the foreground service can be reduced in a similar manner. Background services and foreground services are not specifically limited, and background services generally refer to services that a host cannot feel, such as garbage collection; foreground traffic generally refers to traffic that a host may experience, such as how fast host IO writes data.
Based on the foregoing embodiment, in this embodiment, after deleting the HP mapping relationship information in the mapping relationship information, the method further includes: judging whether the writing of the data identical to the data into the full flash memory array by the host IO is finished or not according to the counting result corresponding to the number of the host IO; the time corresponding to the data writing start of the host IO is before the time corresponding to the deletion of the HP mapping relation information; if yes, the step of inquiring whether the LP mapping mapped to the first space exists according to the mapping relation information is executed. Here, the data written by the host IO is the same as the data in the first space, that is, the hash value corresponding to the data is the same, and here, the number of the host IO and the obtaining process of the number are not specifically limited, and usually, the number of the host IO needs to be counted in advance. Further, a count is made of this number, which is decremented by 1 until zero each time a host IO write data is completed.
Judging whether the writing of the data identical to the data into the full flash memory array by the host IO is finished according to the counting result corresponding to the number of the host IO, wherein the two conditions are as follows: if the counting result is not zero, the writing of the data into the full flash memory array by the host IO is not completed; and if the counting result is zero, the host IO writes the data into the full flash memory array to complete the data writing. For the former case, the full flash memory array waits for the host IO to complete writing data into the full flash memory array; for the latter case, the full flash storage array performs the step of querying whether there is an LP map mapped to the first space according to the mapping relationship information. Waiting for the host IO to write the same data before the time corresponding to the HP mapping information deletion is completed is to prevent such a situation from occurring: and querying that the LP mapping mapped to the first space does not exist according to the mapping relation information, and actually, the LP mapping mapped to the first space exists as a result. Because the LP mapping to the first space may be being generated at the time of the query, i.e., the query may not be able to query the LP mapping to the first space too early.
Based on the foregoing embodiment, in this embodiment, migrating data in the first space to the second space, and establishing mapping relationship information corresponding to the second space generally includes: after data is read from the first space, the data is written into the second space; and establishing LP mapping relation information corresponding to the second space. The mapping relationship information corresponding to the second space at least includes LP mapping relationship information corresponding to the second space, and the existence of the LP mapping relationship information means that the LP mapping mapped to the second space exists, which means that the data in the second space is valid data, and thus the second space is not recycled by garbage. In addition, the mapping relationship information may further include HP mapping relationship information corresponding to the second space.
In the following, a garbage collection system, a full flash memory array, and a computer readable storage medium in the full flash memory array provided in the embodiments of the present application are introduced, and the garbage collection system, the full flash memory array, and the computer readable storage medium in the full flash memory array described below and the garbage collection method in the full flash memory array described above may be referred to correspondingly.
Referring to fig. 3, fig. 3 is a block diagram illustrating a garbage collection system in a full flash memory array according to an embodiment of the present disclosure; this rubbish recovery system in full flash memory storage array includes:
the HP mapping relationship information deleting module 301 is configured to delete HP mapping relationship information in mapping relationship information when it is determined that there is no initial LP mapping mapped to a first space in the full flash memory array according to mapping relationship information corresponding to the first space;
the LP mapping query module 302 is configured to query whether an LP mapping mapped to the first space exists according to the mapping relationship information;
the data migration module 303 is configured to, if there is an LP mapping mapped to the first space, migrate data in the first space to the second space, and establish mapping relationship information corresponding to the second space.
Based on the above embodiment, the garbage collection system in the full flash memory array generally further includes:
the writing completion judging module is used for judging whether the writing of the data identical to the data into the full flash memory array by the host IO is completed according to the counting result corresponding to the number of the host IO; the time corresponding to the data writing start of the host IO is before the time corresponding to the deletion of the HP mapping relation information;
the LP mapping query module is specifically configured to query whether LP mapping mapped to the first space exists according to the mapping relationship information when the host IO completes writing of data identical to the data into the full flash memory array.
Based on the above embodiments, the data migration module generally includes:
the read-write unit is used for reading data from the first space and then writing the data into the second space;
and the mapping relation information establishing unit is used for establishing the LP mapping relation information corresponding to the second space.
Based on any of the above embodiments, the garbage collection system in the full flash memory array further generally includes:
and the recovery completion module is used for completing the recovery of the first space if the LP mapping mapped to the first space does not exist.
The present application further provides a full flash memory array, comprising:
a memory and a processor; the memory is used for storing a computer program, and the processor is used for implementing the steps of the garbage collection method in the full flash memory array according to any embodiment when executing the computer program.
The present application further provides a computer-readable storage medium, in which a computer program is stored, and when the computer program is executed by a processor, the steps of the garbage collection method in the full flash memory array according to any of the above embodiments are implemented.
The computer-readable storage medium may include: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The embodiments are described in a progressive manner in the specification, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. For the system provided by the embodiment, the description is relatively simple because the system corresponds to the method provided by the embodiment, and the relevant points can be referred to the method part for description.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The garbage collection method in the full flash memory array, the garbage collection system in the full flash memory array, and the computer readable storage medium provided by the present application are described in detail above. The principles and embodiments of the present application are explained herein using specific examples, which are provided only to help understand the method and the core idea of the present application. It should be noted that, for those skilled in the art, it is possible to make several improvements and modifications to the present application without departing from the principle of the present application, and such improvements and modifications also fall within the scope of the claims of the present application.