WO2019178845A1 - 一种存储介质垃圾回收方法、存储介质和程序产品 - Google Patents

一种存储介质垃圾回收方法、存储介质和程序产品 Download PDF

Info

Publication number
WO2019178845A1
WO2019178845A1 PCT/CN2018/080241 CN2018080241W WO2019178845A1 WO 2019178845 A1 WO2019178845 A1 WO 2019178845A1 CN 2018080241 W CN2018080241 W CN 2018080241W WO 2019178845 A1 WO2019178845 A1 WO 2019178845A1
Authority
WO
WIPO (PCT)
Prior art keywords
parameter
value
storage unit
unit
storage
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/CN2018/080241
Other languages
English (en)
French (fr)
Inventor
冯锐
贾胜迁
杨定国
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to PCT/CN2018/080241 priority Critical patent/WO2019178845A1/zh
Priority to CN201880002800.3A priority patent/CN109496300B/zh
Priority to EP18910234.6A priority patent/EP3588259B1/en
Priority to US16/577,106 priority patent/US11704239B2/en
Publication of WO2019178845A1 publication Critical patent/WO2019178845A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • G06F12/023Free address space management
    • G06F12/0238Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory
    • G06F12/0246Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory in block erasable memory, e.g. flash memory
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • G06F12/023Free address space management
    • G06F12/0253Garbage collection, i.e. reclamation of unreferenced memory
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/0802Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
    • G06F12/0891Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches using clearing, invalidating or resetting means
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/064Management of blocks
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0646Horizontal data movement in storage systems, i.e. moving data in between storage devices or systems
    • G06F3/065Replication mechanisms
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • G06F3/0679Non-volatile semiconductor memory device, e.g. flash memory, one time programmable memory [OTP]
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/10Providing a specific technical effect
    • G06F2212/1032Reliability improvement, data loss prevention, degraded operation etc
    • G06F2212/1036Life time enhancement
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/72Details relating to flash memory management
    • G06F2212/7205Cleaning, compaction, garbage collection, erase control
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0604Improving or facilitating administration, e.g. storage management
    • G06F3/0607Improving or facilitating administration, e.g. storage management by facilitating the process of upgrading existing storage systems, e.g. for improving compatibility between host and storage device

Definitions

  • the present invention relates to the field of storage, and in particular to the field of storage medium garbage collection.
  • Solid-state drives use flash memory as a storage medium, which is increasingly popular with users because of its fast startup, low noise, and low latency. And gradually began to replace the magnetic disk (magnetic disk) as the mainstream storage medium for high-end storage devices.
  • the internal package of a solid state drive includes a structure composed of a channel, a chip, a page, and a block. Among them, each block is composed of multiple pages.
  • SSD the smallest unit of reading and writing data is the page. Different from the traditional disk: SSD can't overwrite the write, which means that the page that has written the data cannot directly write the new data by overwriting; otherwise, the page must be erased before writing. Enter new data.
  • erasing data is based on block as a basic unit, and data erasure cannot be performed on a single page.
  • a first aspect provides a storage medium garbage collection method, the storage medium comprising a plurality of storage units, each storage unit having a first collection parameter, the first collection parameter being related to data in the storage unit, each The storage unit includes a plurality of read/write units, wherein: a group of storage units is selected from the plurality of storage units according to the first collection parameter, and the first collection of any two storage units in the group of storage units The value difference of the parameter is not greater than a preset value, and each storage unit in the group of storage units contains an old read/write unit, wherein the old read/write unit is a read/write unit that stores invalid data; Data in an active read/write unit and a second active read/write unit are copied to the same destination storage unit, wherein the first active read/write unit and the second active read/write unit belong to the group of storage units Different storage units, the destination storage unit being included in the plurality of storage units.
  • the storage medium may be a flash medium or a stacked magnetic recording (SMR) medium.
  • Applying the scheme can, to a certain extent, converge the data in the storage medium to different storage units according to the length of time existing in the medium. Further, as the number of times the solution is executed, the effect of convergence is more obvious. The stratification of the data according to "age" is achieved.
  • the possibility that the block of aging data is garbage collected is relatively low, so the possibility that the block of aging data is erased in the future is reduced, and the life of the block in which the aging data is located is guaranteed.
  • the blocks of the younger age data tend to concentrate a large number of old pages, so the possibility of being garbage collected is relatively high.
  • the old pages do not need to perform data migration during the garbage collection process. Therefore, garbage collection of the blocks of the younger data does not need to migrate too much data, thereby reducing the computing resources and bandwidth resources of the storage device due to large data migration; After the recycling, the old pages all become blank pages, so that the garbage collected in the old age data can obtain more available storage space.
  • the method further includes: deleting, in the group of storage units, the remaining valid read/write units except the first valid read/write unit and the second effective read/write unit The data is copied to a storage unit outside the group of storage units; all data in the group of storage units is erased.
  • the storage space in the storage medium can be released by erasing the storage unit for subsequent data storage.
  • the value of the first recovery parameter of the storage unit where the first valid read/write unit is located is a first parameter value
  • the second valid read/write unit The first collection parameter value of the storage unit in which it is located is the second parameter value.
  • the first possible implementation manner may further include: determining, according to the first parameter value, the second parameter value, and an original value of the first recovery parameter of the destination storage unit, The value of the first recovery parameter of the destination storage unit is configured as a third parameter value.
  • the second possible implementation manner of the first aspect wherein: the storage medium performs multiple garbage collections at multiple time points in the past, the A parameter value, the second parameter value, and an original value of the first recovery parameter of the destination storage unit are determined by a plurality of time points in the past when garbage collection is performed.
  • the scheme further introduces how the value of the new first recovery parameter is calculated.
  • the third possible implementation manner of the first aspect wherein: the first parameter value, the second parameter value, and the destination storage unit
  • the original values of the first recovery parameters respectively represent three identical or different time points within the plurality of time points, and the third parameter values are compared by the three identical or different time points. Decide.
  • the scheme further introduces how the value of the new first recovery parameter is calculated.
  • the third possible implementation manner of the first aspect wherein: the data storage location in the destination storage unit is based on the write time, from the beginning of the storage unit The write position begins to be written in order.
  • the data copied from the first valid read/write unit is stored in the first location
  • the data copied from the second active read/write unit is stored in the second location.
  • the first location is closer to the first write location of the destination storage unit than the second location.
  • the solution further introduces the storage rule of the data in the storage unit after the host (or other computer) writes the data to the storage medium.
  • the method further includes: performing multiple garbage collections at a plurality of time points in the past, the first parameter value And the second parameter value and the original value of the first recovery parameter of the destination storage unit are determined by the number of times garbage collection is performed in the past.
  • This scheme describes the calculation method of the original value of the first recovery parameter: it can be determined by the number of times garbage collection is performed in the past.
  • the fourth possible implementation manner of the first aspect wherein: the third parameter value is according to the first parameter value, the second parameter The value and the original value of the first recovery parameter of the destination storage unit and a fixed increment decision.
  • This scheme introduces a method of calculating the third parameter value, that is, adding a fixed increment (for example, increasing a fixed value of 1, or increasing a fixed value of 10, or increasing a fixed value of -0.5).
  • the method further includes: deleting the first valid read/write unit and the In addition to the second active read/write unit, the data in the remaining valid read/write units is copied to the storage unit outside the set of storage units, wherein the storage unit other than the set of storage units includes the target storage unit; The three parameter value configures a value of the first reclamation parameter of the target storage unit; and erases all data in the set of storage units.
  • the program describes that the data in the remaining valid read and write units (such as valid pages) will also be copied. Complete replication of all valid data in this storage unit. In order to erase the entire memory unit.
  • the method of the first aspect further includes: the group of storage units selected according to the first collection parameter includes a storage unit; and the data unit in the storage unit Migrate to a storage unit selected for wear level.
  • the program introduces a further application based on garbage collection: data migration can be performed according to wear level and data age to achieve the technical effect of wear leveling.
  • the first recovery parameter includes a second collection parameter, where the storage unit of the first effective read/write unit is located
  • the value of the second recovery parameter is a seventh parameter value
  • the value of the second recovery parameter of the storage unit where the second effective read/write unit is located is an eighth parameter value
  • the first aspect scheme further includes: Determining, by the seventh parameter value, the eighth parameter value, and the original value of the second recovery parameter of the destination storage unit, configuring a value of the second collection parameter of the destination storage unit as a ninth parameter a value; wherein the value of the second reclamation parameter is related to a time point at which the storage unit performs garbage collection.
  • the program introduces the new parameter of the second recycling parameter and the calculation principle of the parameter.
  • the tenth possible implementation manner of the first aspect further comprising: the group of storage units selected according to the first recovery parameter and the second recovery parameter a storage unit; migrating the data unit in the storage unit to a storage unit selected according to the degree of wear.
  • This scenario describes how to apply the second recovery parameter to wear leveling.
  • the first storage unit may be selected from the plurality of storage units according to the first recovery parameter, where the first storage unit includes An old read/write unit; the data of the valid read/write unit in the first storage unit is migrated to the second storage unit, and the second unit here has an idle read/write unit.
  • This scenario describes data replication for single-storage garbage collection, and the replication described in the first aspect (which can be called data replication in multi-storage garbage collection) can be performed side-by-side.
  • the replication described in the first aspect (which can be called data replication in multi-storage garbage collection) can be performed side-by-side.
  • performing data copying of the multi-storage unit garbage collection for the storage unit whose first recovery parameter is greater than the threshold and performing data copying of the single storage unit garbage collection for the storage unit whose first recovery parameter is greater than the threshold.
  • the value of the first recovery parameter of the first storage unit is a fourth parameter value
  • the value of the first recovery parameter of the second storage unit is a fifth parameter value
  • the method further includes: according to the The fourth parameter value and the fifth parameter value are configured to configure a value of the first recovery parameter of the destination storage unit as a sixth parameter value.
  • the program introduces the update plan of the first recovery parameter value in the single storage unit garbage collection copy operation.
  • a storage medium hardware comprising a media controller and a plurality of storage units, each storage unit having a first recycling parameter, the first recycling parameter being related to data in the storage unit, each The storage unit includes a plurality of read/write units, wherein the media controller can perform the first aspect described above, and various possible implementations of the first aspect.
  • a program product such as a hard disk, a USB flash drive, an optical disk, and the like.
  • Program product includes program code for running the storage medium for management.
  • the first aspect described above, as well as the various possible implementations of the first aspect, can be performed by running the program code in the program product.
  • FIG. 1 is an embodiment of a solid state hard disk structure diagram.
  • FIG. 2 is a flow chart embodiment of storage medium garbage collection.
  • Figure 3 is a schematic illustration of an embodiment of a single piece of garbage collection process.
  • FIG. 4 is a schematic diagram of an embodiment of a multi-block garbage collection process.
  • the present application mainly introduces an SSD as an example, but the idea of the present application is equally applicable to other flash-based storage media. And also applicable to other storage media that cannot overwrite writes (overwrite writes refer to newly written data directly overwriting old data in the storage medium), such as shingled magnetic recording (SMR) media, and blocks in flash media are equivalent to SMR
  • SMR shingled magnetic recording
  • block and zone are collectively referred to as storage unit, and a section of storage space in the page and zone is collectively referred to as a read-write unit. Since the principle is the same, for the sake of brevity, only the flash will be described as an example.
  • the page in the block may be in one of the following three situations: First, the page stores valid data, and the page for this state can be Set the valid tag to mark, which is called the valid page; the second, the page stores invalid data, the invalid data is no longer needed data is relative to the valid data, or is the host (host In addition to SSDs, computers, servers, storage controllers, etc. that communicate with SSDs) "delete" data.
  • Pages in this state can be marked by setting stale tags, referred to as stale pages (or "invalid" Page "); third, there is no data stored in the page, the page of this state, referred to as blank page, blank page can be saved into new data in the future, blank page is marked by setting clean label or empty label, or Mark by patching the label.
  • stale pages or "invalid" Page "
  • blank page can be saved into new data in the future, blank page is marked by setting clean label or empty label, or Mark by patching the label.
  • garbage collection you need to migrate valid data to other blocks; for stale pages and blank pages, you do not need to perform data migration. For blocks that have been garbage collected, all pages become blank pages. In other words, garbage collection can release the storage space occupied by invalid data and provide it to the host for reuse.
  • the present embodiment refers to data stored in each valid page as one data unit, unless otherwise specified. If a data unit has not been deleted in the past garbage collection (for SSD, the deletion of the data unit of a page means that the state of the page storing the data unit is stale), then the data Unit updates are infrequent and are less likely to be deleted in the future. Furthermore, as the number of times the block in which the data unit is located is garbage collected, the probability that the data unit will be deleted in the future is lower. This situation can be visually understood as the age of the data unit is getting older. .
  • the majority of the data units can be aggregated into different blocks according to different age groups.
  • the more garbage collection times performed in this embodiment the more obvious the degree of convergence.
  • the data units in the block are generally stable, and the probability of occurrence of stale blocks in the future is relatively small. Therefore, the probability of garbage collection in the blocks of old data units is also changed.
  • Small in general, the SSD uses the number of stale blocks to be greater than a predetermined threshold as a condition for triggering garbage collection).
  • the remaining blocks are clustered with relatively old data units. For blocks composed mainly of younger data units, there is a greater possibility of a large number of old pages, so the block is relatively large. The possibility of garbage collection is relatively high.
  • the data units are aggregated into different blocks by age group.
  • the block where the old data unit is located is less likely to be garbage collected, so the possibility that the block of the old data unit is erased in the future is reduced, and the life of the block in which the old data unit is located is guaranteed.
  • the blocks of the younger data units tend to concentrate on a large number of old pages, so the possibility of being garbage collected is relatively high.
  • the old pages do not need to perform data migration during the garbage collection process.
  • garbage collection of the blocks of the young data units does not need to migrate too many data units, thereby reducing the computing resources and bandwidth resources of the storage devices due to the migration of a large number of data units;
  • the old pages all become blank pages, so that the garbage collected in the block of the younger data unit can obtain more available storage space.
  • the number of garbage-removed blocks in the SSD is generally reduced.
  • this embodiment sets a recovery parameter for the block, which may be one or a set of numbers or symbols.
  • the recovery parameter includes a first recovery parameter that approximates the age change of the data unit in the block by updating the value of the first recovery parameter in the garbage collection. If the data in the block has not been garbage collected, the value of the first collection parameter of the block is the initial value (the initial value is, for example, 0); if the data in the block has been garbage collected, the data is moved out before the garbage collection occurs.
  • the value of the first recovery parameter of the block of the unit, and the value of the first recovery parameter of the block moved into the data unit before the garbage collection occurs jointly determine the first recovery parameter of the block moved into the data unit after the garbage collection occurs value.
  • copying data units (valid data) in one or more blocks to another block or blocks for convenience of introduction, the block that copies the data unit is called the source block, and the block that is copied into the data unit Called the destination block).
  • the value of the first recovery parameter of the destination block is updated, and the value of the updated first recovery parameter is determined by the original value of the first recovery parameter of the destination block and the value of the first recovery parameter of the source block.
  • An optional method is: the original value of the first recovery parameter of the destination block, and the value of the first recovery parameter of the source block are all positive numbers, and the new value of the first recovery parameter of the destination block is determined by the maximum value, for example, This maximum value is added to a fixed positive number (for example, 1); or, alternatively, the original value of the first recovery parameter of the destination block and the value of the first recovery parameter of the source block are all negative.
  • the new value of the first recovery parameter of the block is determined by the minimum value plus a fixed negative number.
  • there may be other schemes such as the original value of the first recovery parameter of the destination block, the value of the first recovery parameter of the source block multiplied by a constant, plus or minus a fixed value, as the first of the destination block.
  • the new value of the first recovery parameter of one block can be interpreted as: in the valid data stored in this block, each valid data corresponds in the past because The number of times of garbage collection (the number of migrations with valid data is allowed to be 0). After garbage collection, the new value of the first collection parameter is the maximum of these times.
  • the first collection parameters of the plurality of blocks may statistically reflect the age of the data units in the plurality of blocks as a whole.
  • this embodiment allows for a few exceptions, that is, there may be a block in which the first recovery parameter of the block does not correctly reflect the age of the data unit in the block, and such an exception may somewhat degrade the technical effect of the present invention.
  • the implementation of the technical effects of the embodiments of the present invention is not prevented.
  • FIG. 1 shows a structural diagram of a solid state hard disk 10 in which a solid state hard disk 10 communicates with a host 20.
  • the solid state hard disk includes a solid state hard disk controller 11, a cache 12 connected to the solid state hard disk 11 (for example, a random access memory RAM), and a plurality of packages, and the solid state hard disk controller 11 is connected by a channel and a packet, each of which has Block, block is the minimum erasing unit, block 1, block 2, block 3, block 4, block 5, block 6, block 7 and block 8 provide physical storage space for the solid state hard disk 20, each block consists of Composed of multiple pages, the page is the minimum read/write unit.
  • the SSD controller 11 may have components such as a cache interface, a processor, and a flash controller.
  • the cache interface communicates with the cache 12, the processor executes computer instructions, and the flash controller controls the blocks.
  • Figure 2 illustrates the process of data migration between blocks in order to perform garbage collection.
  • the entire garbage collection process (including the steps depicted in FIG. 2) may be performed by the solid state drive 10 of FIG. 1, and in particular by computer instructions in the cache 12 running by the SSD controller 11. After the SSD is run, computer instructions are loaded into the cache 12. Prior to the SSD operation, the previous computer instructions may be stored in a non-volatile storage medium, such as firmware in the firmware of the host network card.
  • Step 21 The SSD controller acquires the number of stale pages in each block in the storage medium, and the block whose old page exceeds the garbage collection threshold needs to perform garbage collection.
  • the SSD is composed of a controller and a storage medium, and the controller communicates with the storage medium to manage the storage medium, such as flash memory particles.
  • the number of stale pages is pre-stored in the cache and updated periodically, so the SSD controller can directly obtain the number of stale pages from the cache; or, directly by the SSD controller Query the number of pages in each block with stale tags set to get the number of stale pages in each block.
  • Step 22 For a block whose stale page exceeds the stale threshold, the SSD controller queries the value of the first reclaim parameter of each block.
  • the value of the first reclamation parameter can be stored in some blocks or in the cache of the SSD.
  • the single storage unit of step 23 (as described above, the storage unit is a "block” in the flash in this embodiment) garbage collection; for the first The block in which the value of the recovery parameter is greater than or equal to the threshold of the first recovery parameter is performed, and the multiple storage unit of step 24 (the storage unit in this embodiment is a "block") is garbage collected.
  • step 22 and step 21 either step may be performed before the other step. It can also be performed in two steps at the same time, that is, the value of the first collection parameter of the block is queried while querying the number of stale pages of the block.
  • Step 23 Perform single-block garbage collection on each block in which the value of the first recovery parameter is smaller than the threshold of the first recovery parameter. The value of the first reclamation parameter of the destination block is updated.
  • the source block of a single garbage collection is called the first block
  • the destination block is called the second block. Then, this step can be described as: migrating the data of the valid read/write unit in the first storage unit to the second storage unit, the first storage unit includes the old read/write unit, and the second unit has the idle read/write unit. .
  • garbage is collected in a single block as a granularity.
  • data units of two or more source blocks are not copied into at least one destination block.
  • FIG. 3 is a schematic diagram of a single garbage collection process.
  • Block 1 has 5 pages (here is just an example. In practice, a block can have more pages, for example: the size of a block is 256KB, and the size of a page is 4KB.)
  • Block 1 has data 1 and data 2 Data units, data 1 and data 2 are stored on page 1 and page 2, respectively; in addition, pages 2 and 4 of block 1 store stale pages, and page 5 is a blank page.
  • the controller of the SSD copies the two data units of data 1 and data 2 to block 2, the data 1 and the data 2 are copied to the page where the block 2 is located, and the page where the original data (data 3) of the block 2 is located is stored.
  • the positional relationships in the media are adjacent, and the pages where Data 1 and Data 2 are located are also adjacent.
  • the pages in which data 1 and data 2 are located maintain the relative positional relationship in block 1, that is, in block 1, the number of pages on which data 1 is located is smaller than the number of pages on which data 2 is located, and in block 2, The number of the page where the data 1 is located is smaller than the number of the page where the data 2 is located.
  • the blank block can be copied as a destination block.
  • the page number is consecutive between two pages. Taking FIG. 3 as an example, page 3 is adjacent to page 1 and page 2.
  • the size of the page number describes the positional relationship of the page. For example, before the migration, the page number of the page where the data 1 is located (page 1) (block 1, the number of the middle page 1 is 1) is smaller than the page number of the page where the data 2 is located (page 3) (page 1, page The number of 3 is 3); after data 1 and data 2 are migrated to block 2, the page number of the page (page 2) where data 1 is located (in block 2, the number of page 2 is 2) is also smaller than the page where data 2 is located. Page number of (page 3) (in block 2, number 3 of page 3). It can be seen that before and after the migration, the page number of the page where the data 1 is located is kept smaller than the page number of the page where the data 2 is located, and this positional relationship is maintained.
  • the SSD After the SSD receives the data of the host, the SSD specifically how to store the data into the block page regularly. For example, for the same block, the data received by the host first is written to the page with the smaller page number in the block, and the data received after the host is written to the page with the larger page number; or vice versa, the data received first is written. The page with the larger page number in the block is entered, and the data received after the page is written to the page with the smaller page number.
  • This kind of law is related to the manufacturing process of SSD manufacturers. Therefore, SSDs produced by the same manufacturer often follow the same rules. In this case, the chronological order in which the data unit is written to the block can be known from the page number.
  • the write time of the data in the page with the small page number is No later than the data in the page with a large page number.
  • the sequence described in this embodiment merely describes the positional relationship between the two pages in the storage medium, and does not relate to whether or not there are other pages between the two pages.
  • first write position we use the title of "first write position" to describe the order of use of blank pages in a block: when writing data to a block, data is written sequentially from the first write position of the block until all idle The read/write unit is used up. The time point at which the block near the first write position writes data is not later than the time point at which the block write data is far from the first write position.
  • some or all of the data units maintain the sequence, so the ordering relationship from the page where the data unit is located can still roughly reflect the chronological order in which the data units are written by the host to the SSD.
  • the host writes the data 1 to the block 1 no later than the time when the host writes the data 2 to the block 1, so the number of the page where the data 1 is located is smaller than the number of the page where the data 2 is located.
  • the number of pages on which data 1 is located is smaller than the number of pages on which data 2 is located.
  • this rule continues to be maintained in the destination block 2 of FIG. 3: in the same block, the page number has a correspondence with the time sequence in which the host writes data to the SSD.
  • This step also includes updating the value of the first recycling parameter.
  • the value of the first recovery parameter is related to the number of times the data unit in the SSD is copied due to garbage collection.
  • the value of the first recovery parameter of the destination block may be determined by the value of the first recovery parameter of the source block; further, the first recovery parameter of the destination block The value can be determined by the value of the first reclamation parameter of the source block and a fixed increment, for example a fixed increment of one.
  • the initial value of the first recovery parameter of the block is, for example, 0 (which may of course be other numbers), it means that the valid data in the block has not been garbage collected.
  • the update of the data life of the destination block of garbage collection specifically includes two cases.
  • the value of the parameter is +1.
  • the value of the new first recovery parameter of the destination block is determined by the value of the first recovery parameter of the source block and the value of the original first recovery parameter of the destination block. For example, the maximum value of +1 is used as the value of the new first recovery parameter of the destination block.
  • the value of the first recovery parameter may have other update methods.
  • Step 24 Perform multiple pieces of garbage collection on the plurality of blocks whose first recovery parameter has a value greater than the first recovery parameter threshold. The value of the first reclamation parameter of the destination block is updated.
  • a plurality of blocks whose first recovery parameter has a value smaller than the first recovery parameter threshold are used as a garbage collection group, and the data units of the blocks in the same group are copied into the destination block, and the same group source
  • the number of destination blocks of a block may be one or more. In other words, valid data of two or more source blocks are collectively copied into at least one destination block.
  • garbage collections are garbage collections that span multiple source blocks, they can also be called cross-block garbage collection.
  • a single destination block is used to accommodate the replicated data.
  • two or more destination blocks are used to accommodate the copied data, and each time a destination block is filled, the next destination block is used to continue to be stored.
  • the copied data is stored until all copied data is stored in the destination block. The data for all source blocks within the group can then be erased.
  • each group has at least two source blocks. It is important to emphasize that grouping is not an essential step.
  • the scenario to be described in this step is that multiple blocks use the same one or more destination blocks in the garbage collection process. Compared to multiple garbage collections, a single garbage collection is equivalent to having only one source block per garbage collection group.
  • the source block and the destination block for the single garbage collection are respectively referred to as the first source block and the first destination block, unless otherwise specified;
  • the source block and the destination block are respectively referred to as a second source block and a second destination block.
  • the number of second source blocks is plural.
  • multiple pieces of garbage collection can be understood as: after the garbage collection process, in one or more second destination blocks, there are data units copied from the plurality of second source blocks.
  • the data units of the plurality of second source blocks are copied to the same second destination block, and the second destination block may have multiple, for example, all the involved in the multiple garbage collection. Or part of the second destination block.
  • the data units from the same second source block are not completely contiguous.
  • the specific operation method is, for example, copying data units in at least two second source blocks into the same second destination block. If the data units in the at least two second source blocks are successively copied into the same second destination block one by one, the data units from the same second source block are not consecutive.
  • the embodiment further provides a more specific multi-block garbage collection solution: in the garbage collection process, the data units of the valid pages of the plurality of second source blocks are alternately copied into the at least one second destination block; And, a plurality of valid pages of the same second source block are copied in the host storage order.
  • the method of rotating replication may not be used.
  • data units of multiple valid pages may be copied in parallel to improve the efficiency of data unit migration, as long as the state after the completion of the replication can satisfy the relationship. can.
  • FIG. 4 in which block 3, block 4, and block 5 are second source blocks, and block 6 is a second destination block.
  • Block 3, block 4, and block 5 respectively copy the data units of an unreplicated valid page to block 6, which are data 4, data 6, and data 9, respectively; then, block 3, block 4 take turns to the next one.
  • the copied valid pages (data 5 and data 7) are copied to block 6, since the data units of all valid pages of block 5 have been copied in the previous round, block 5 is no longer involved in the current round of copying;
  • An unreplicated data unit (i.e., data 8) is copied to block 6. Since all of the data units of block 4 and block 5 have been copied in the previous round, blocks 4 and 5 no longer participate in the current round of copying.
  • the host storage order is to first store a page with a small page number, and then store a page with a large page number (that is, the order from top to bottom in FIG. 4). Therefore, for block 3, the copy data 4 is located first above, and the data 5 located below is copied; similarly, for block 4, the order of copying is data 6, data 7, and data 8.
  • the new first recovery of the second destination block is configured according to the value of the first recovery parameter of each second source block and the original value of the first recovery parameter of the second destination block.
  • the maximum value +1 of the first recovery parameter is only an example, and the value of the first recovery parameter may also have other update manners, specifically refer to step 23.
  • the second destination block is a blank block before the garbage collection, the original value of the first recovery parameter may not be considered.
  • the migrated data unit is first filled with a second destination block, and then the remaining second destination block is continued to be filled.
  • the value of the first recovery parameter of the first target block that is first filled is calculated in the same manner as the number of the second destination block described above.
  • the value of the first recovery parameter of each second destination block in the remaining second destination block may be calculated using the same calculation method as the first destination block that is first filled; or may not be recalculated, but The value of the first recovery parameter of the second destination block that is first filled is the same.
  • this embodiment only introduces the case where the number of the second destination blocks is only one.
  • the value of the first recovery parameter of the updated block 6 is determined by the values of the first recovery parameters of block 3, block 4, and block 5. If block 6 originally has a data unit (not shown), then the value of the first recovery parameter of the updated block 6 is recovered from the value of the first recovery parameter of block 3, block 4, block 5, and block 6 The value of the parameter is determined. For example, the maximum of the values of these first recycling parameters plus a fixed increment, for example, a fixed increment.
  • the first recovery parameter value of one second source block is the first parameter value
  • the first recovery parameter value of the other second source block is the second parameter value.
  • the method further includes: said said second destination block according to said first parameter value, said second parameter value, and said original value of said first recovery parameter of said second destination block
  • the value of a recycle parameter is updated to the third parameter value.
  • the source block of this garbage collection may play the role of the destination block in the garbage collection (single piece of garbage collection or multiple pieces of garbage collection) that occurred in the past.
  • the same rule is used to configure the value of the first collection parameter of the destination block of the last garbage collection.
  • the source block of garbage collection that occurred in the past may be the destination block of garbage collection (single piece of garbage collection or multiple pieces of garbage collection) earlier. We can see that this is a process that can be traced back and forth, and can be traced back to the block where garbage collection has not occurred.
  • the block involved includes a plurality of second source blocks and at least one second destination block.
  • the value of the first recovery parameter can also be continuously traced back. Therefore, the values of their first recovery parameters can be described as: determined by the multiple points in time during which the SSD performed garbage collection. For similar reasons, the value of the first reclamation parameter for each of these blocks can be described as being determined by the number of times the SSD has performed garbage collection in the past. The two ways of describing the value of the first recovery parameter apply equally to a single piece of garbage collection.
  • garbage collection of a small number of blocks can obtain the same available storage space in the prior art that a large number of blocks need to be garbage collected.
  • the aforementioned first recovery parameter is mainly used to approximate the age change of the data unit in the block.
  • the first recovery parameter can be understood as: at least one data unit (valid data) is stored in the storage unit, and for each data unit, copying has occurred in the past due to garbage collection (the number of times of copying is not 0), or There is no copying due to garbage collection (the number of times is 0), and among the number of times corresponding to each data unit, the maximum number of times is taken as the first collection parameter of this storage unit.
  • the recycling parameter may further include a second recycling parameter.
  • the value of the second reclamation parameter may describe the point in time at which the data unit in the block was first migrated due to multi-storage unit garbage collection.
  • the second reclamation parameter may have no value or an initial value (eg, 0) before multiple pieces of garbage collection. Data units are migrated for a variety of reasons, such as migrations that perform single-block garbage collection, or migrations that occur outside of garbage collection, for which the value of the second reclamation parameter is not recorded.
  • Example: The value of the second recovery parameter can be described as 17:40 on January 28, 2018.
  • the value of the reclamation parameter is the initial value (initial value such as 0, or empty).
  • the second source block and the second destination block have a total of four, and the values of the second recovery parameters are: empty, empty, empty, and empty, and the current time value of multiple garbage collection is 2018 1 At 17:50 on the 28th of the month, after the multiple garbage collection, the value of the second recovery parameter of the second destination block is updated to 17:50 on January 28, 2018.
  • the value of the second collection parameter of any one of the second source block and the second destination block is not an initial value before the current multi-block garbage collection, then the earliest time point is used as the second destination block.
  • the value of the recovery parameter is 17.
  • Example 1 The total number of second source blocks and second destination blocks is four, and the values of their second recovery parameters are: empty, empty, empty, and 17:40 on January 28, 2018, then the second purpose The value of the second recovery parameter of the block is 17:40 on January 28, 2018.
  • Example 2 There are 4 second source blocks and 2nd destination blocks. The values of their second recovery parameters are: 00:00 on January 1, 2015, vacant, empty, and January 28, 2018. 40, then the value of the second recovery parameter of the second destination block is 00:00 on January 1, 2015.
  • the value of the recovery time point is determined.
  • the values of the multiple garbage collection time points of the destination block of the single garbage collection are determined in the same manner.
  • the second recovery parameter can reflect the degree of newness of the data unit in the block to some extent.
  • the second recycling parameter is used together with the first recycling parameter to more accurately reflect the oldness of the data unit in the block.
  • the second recovery parameter is optional, and even if the parameter is not compared only by comparing the first recovery parameter with the first recovery parameter threshold, the purpose of classifying the block has been achieved. Statistically, the age of the data unit of the block of "the first recovery parameter exceeds the first recovery parameter threshold" of the data unit of the block > "the first recovery parameter does not exceed the first recovery parameter threshold”.
  • step 23 is an optional step, and even if step 23 is not performed, only performing step 24 can also obtain beneficial technical effects. If step 23 is not performed, then step 24 does not need to determine the value of the first reclamation parameter, directly to the number of stale pages (the blocks in which the source blocks in steps 23 and 24 are older than the stale threshold) exceed the stale threshold. Execute multiple pieces of garbage collection.
  • step 25 data migration is performed. Migrating data units in older blocks of data units into heavily worn blocks; and/or migrating data units in younger blocks of data units into slightly worn blocks.
  • the judgment standard of the degree of wear can be set by the system. For example, the degree of wear can be determined according to one or more relevant parameters. When the degree of wear (or related parameters) exceeds a certain threshold (or reaches a certain range), the degree of wear can be judged as Serious, otherwise it is judged to be not serious (or slight). That is, the storage unit is selected according to the first recovery parameter, and the data unit in the selected storage unit is migrated to the storage unit selected according to the degree of wear.
  • the threshold is 100 times, then blocks with more than 100 erases are heavily worn blocks, and blocks with less than 100 erases are used. It is a slightly worn block of data.
  • the first recovery parameter threshold is, for example, 20, and according to this step 25, the data unit in the block with severe wear (the number of erasures is greater than 100) can be migrated to the block whose value of the first recovery parameter is greater than 20.
  • the value of the first recovery parameter is used as a basis for determining the age of the block.
  • the first recovery parameter and the second recovery parameter are used together as a basis for determining the age of the block.
  • the first recovery parameter threshold is 20, and the second recovery parameter threshold is January 13, 2018. Then, according to this step 25, the data unit in the block with severe wear (the first recovery parameter is greater than 20 and the number of erasures is greater than 100) can be migrated to the second recovery parameter in the block earlier than January 13, 2018.
  • the value of the parameter for example, one of the following rules: (1) the first data unit with a large recovery parameter value, the data unit whose age is older than the first recovery parameter value; (2) the higher the first recovery parameter.
  • rule (3) the second data element of the early recovery parameter is older than the data unit of the second recovery parameter value.
  • a feasible embodiment is as follows: (1) The SSD controller selects M blocks with severe wear according to the degree of wear; copies the data units in the M blocks to other data units with blank pages, and wipes In addition to the contents of the M blocks; (2) calculate the total number of free pages in the M blocks; (3) select N blocks according to the storage space that the M blocks can provide, and the data owned by the N blocks
  • the unit is an older data unit in the SSD. For example, from the block whose first recovery parameter exceeds the threshold of the first recovery parameter, the N value of the second recovery parameter is selected to be earlier, and the N blocks have Q.
  • the rule (1) is used as a criterion for selecting a source data unit for garbage collection.
  • the rule (2) may be used as a criterion to select a source data unit for garbage collection, for example, the step of selecting a group of storage units from the plurality of storage units according to the first collection parameter is updated to Selecting a group of storage units from the plurality of storage units according to the first collection parameter and the second collection parameter (eg, selecting from a plurality of data units whose first recovery parameter is higher than a first recovery parameter threshold)
  • the second recovery parameter belongs to a data unit of a certain time period, and is used as a group of source storage units for garbage collection. For the sake of space, no specific introduction is made here.
  • the present invention also provides an embodiment of a program product, the program product comprising program code, the program code being executable to manage a storage medium (including a storage unit), the storage medium comprising a plurality of storage units, each storage unit having a first recycling parameter, the first recycling parameter being associated with data in the storage unit, each storage unit comprising a plurality of read and write units, the program product including at least one component operable to perform the various method steps described above.
  • a program in the storage medium may be executed by the storage medium (eg, the media controller) or by a computer device in communication with the storage medium to manage the storage unit.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Memory System (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

提供一种存储介质垃圾回收技术。存储介质例如固态硬盘,所述固态硬盘包括多个块,每个存储拥有回收参数,所述回收参数与所述块中的数据相关,每个块包括多个页:根据所述回收参数从所述多个块中选择一个组块,在该组块中任意两个块的所述回收参数的值的差值不大于预设值;把该组块中的第一有效页和第二有效页中的数据复制到同一个目的块中,以便进行垃圾回收。

Description

一种存储介质垃圾回收方法、存储介质和程序产品 技术领域
本发明涉及存储领域,特别涉及存储介质垃圾回收领域。
背景技术
固态硬盘(solid-state drives,SSD)使用闪存(flash)作为存储介质,以其启动快、低噪音以及时延低等优点,日益受到用户的喜爱。并逐渐开始取代磁盘(magnetic disk)成为高端存储设备的主流存储介质。固态硬盘的内部封装中,包括通道、芯片、页(page)和块(Block)组成的结构。其中,每个block由多个页组成。
在SSD中,读写数据的最小单位是页。与传统的磁盘不同的是:SSD无法覆盖写,也就是说已经写了数据的页无法通过覆盖的方式直接写入新的数据;反之,必须先对页进行“擦除”操作以后,才能写入新数据。而SSD中,对数据进行擦除是以block作为基本单位的,无法对单个页进行数据擦除。
在SSD领域,当某个block中存储无效数据的页数量达到阈值时,可以将block中的有效数据复制至其他block、然后对block进行擦除,以便重新利用被无效数据占用的页,这个过程被称为垃圾回收(garbage collection,GC)。垃圾回收可以把被无效数据占用的存储空间重新利用起来,然而对block进行擦除会降低block的寿命,也就是说block的擦除次数是有限的。因此,如何尽量减少垃圾回收的次数,是需要解决的问题。
发明内容
第一方面,提供一种存储介质垃圾回收方法,所述存储介质包括多个存储单元,每个存储单元拥有第一回收参数,所述第一回收参数与所述存储单元中的数据相关,每个存储单元包括多个读写单元,其中:根据所述第一回收参数从所述多个存储单元中选择一组存储单元,在该组存储单元中任意两个存储单元的所述第一回收参数的值差不大于预设值,该组存储单元中的每一个存储单元含有陈旧读写单元,其中,陈旧读写单元是存储有无效数据的读写单元;把该组存储单元中的第一有效读写单元和第二有效读写单元中的数据复制到同一个目的存储单元,其中,所述第一有效读写单元和所述第二有效读写单元分属于该组存储单元中的不同的存储单元,所述目的存储单元包含于所述多个存储单元。存储介质可以是闪存(flash)介质,或者叠瓦式磁记录(SMR)介质。
应用该方案可以在一定程度上:把存储介质中的数据按照存在于介质中的时间长短,汇聚到不同的存储单元。更进一步的,随着该方案被执行的次数越多,汇聚的效果越明显。实现了数据按照“年龄”的分层。
老龄数据所在块被垃圾回收的可能性比较低,因此老龄数据所在块未来被擦除的可能性降低,老龄数据所在的块的寿命得到了保证。而低龄数据所在块往往集中了大量陈旧页,因此被垃圾回收的可能性比较高。并且陈旧页在垃圾回收过程中不需要执行数据迁移,因此对低龄数据所在块进行垃圾回收不需要迁移太多数据,减少了因为大量数据迁移而占用存储设备的运算资源和带宽资源;此外,垃圾回收后陈旧页全部成为空白页,因此对低龄数据所在的块垃圾回收后可以获得较多的可用存储空间。并且,低龄数据和老龄数据分离到到不同的存储单元后,总体上减少了SSD中被垃圾回收的块的数量。需要说明的是,“老龄”和“低 龄”只是一个相对的概念,“老龄”数据在存储介质中存在的时间早于“低龄”数据在存储介质中存在的时间。
在第一方面的第一种可能实现方式中,还包括:把该组存储单元中,除所述第一有效读写单元和所述第二有效读写单元外,余下的有效读写单元中的数据复制到该组存储单元之外的存储单元;擦除该组存储单元中所有的数据。
在数据迁移完成后,通过对存储单元进行擦除可以释放出存储介质中的存储空间,以供后续的数据存储。
在第一方面的第二种可能实现方式中,其中:所述第一有效读写单元所在的存储单元的所述第一回收参数的值是第一参数值,所述第二有效读写单元所在的存储单元的所述第一回收参数值是第二参数值。在这种情况下,第一种可能实现方式中可以进一步包括:根据所述第一参数值、所述第二参数值以及所述目的存储单元的所述第一回收参数的原有值,把所述目的存储单元的所述第一回收参数的值配置为第三参数值。
在进行数据复制后,需要对第一回收参数的值更新,该方案介绍了新的第一回收参数的值如何进行获得。
在第一方面的第三种可能实现方式中,在第一方面的第二种可能实现方式的基础上,其中:所述存储介质在过去多个时间点分别执行多次垃圾回收,所述第一参数值、所述第二参数值以及所述目的存储单元的所述第一回收参数的原有值由过去执行垃圾回收的多个时间点决定。
该方案在第一方面的第二种可能实现方式的基础上,进一步介绍了新的第一回收参数的值如何计算。
在第一方面的第四种可能实现方式中,在第一方面的第三种可能实现方式的基础上,其中:所述第一参数值、所述第二参数值以及所述目的存储单元的所述第一回收参数的原有值分别代表所述多个时间点内三个相同或不同的时间点,所述第三参数值是由所述三个相同或不同的时间点之间的比较决定。
该方案在第一方面的第三种可能实现方式的基础上,更进一步介绍了新的第一回收参数的值如何计算。
在第一方面的第五种可能实现方式中,在第一方面的第三种可能实现方式的基础上,其中:该目的存储单元中的数据存储位置是依写入时间,从存储单元的首写位置开始按顺序写入,在该目的存储单元中,复制自所述第一有效读写单元的数据储存于第一位置,复制自所述第二有效读写单元的数据储存于第二位置,所述第一位置比所述第二位置更靠近该目的存储单元的首写位置。
该方案在第一方面的第三种可能实现方式的基础上,更进一步介绍了主机(或者其他计算机)把数据写入存储介质后,数据在存储单元中的存储规律。
在第一方面的第六种可能实现方式中,在第一方面的第二种可能实现方式的基础上,进一步包括:在过去多个时间点分别执行多次垃圾回收,所述第一参数值、所述第二参数值以及所述目的存储单元的所述第一回收参数的原有值由过去执行垃圾回收的次数决定。
该方案介绍了所述第一回收参数的原有值的计算方法:可以由过去执行垃圾回收的次数决定。
在第一方面的第七种可能实现方式中,在第一方面的第四种可能实现方式的基础上,其 中:所述第三参数值是根据所述第一参数值、所述第二参数值以及所述目的存储单元的所述第一回收参数的原有值以及一个固定增量决定。
该方案介绍了所述第三参数值的一种计算方法,也就是增加固定增量(例如增加固定的值1,或者增加固定的值10,或者增加固定的值-0.5)的方式。
在第一方面的第八种可能实现方式中,在第一方面的第二种可能实现方式的基础上,还可以包括:把该组存储单元中,除所述第一有效读写单元和所述第二有效读写单元外,余下的有效读写单元中的数据复制到该组存储单元之外的存储单元,其中,该组存储单元之外的存储单元包括目标存储单元;根据所述第三参数值配置所述目标存储单元的所述第一回收参数的值;以及,擦除该组存储单元中所有的数据。
该方案介绍了余下的有效读写单元(例如有效页)中的数据也会被复制。完成该存储单元中所有有效数据的复制。以便对整个存储单元进行擦除。
在第一方面的第九种可能实现方式中,在第一方面方案的基础上还包括:按照第一回收参数选择的该组存储单元含某存储单元;把所述某存储单元中的数据单元迁移到按照磨损程度选择的存储单元之中。
该方案介绍了基于垃圾回收的进一步应用:可以按照磨损程度和数据年龄进行数据迁移,实现磨损均衡的技术效果。
在第一方面的第十种可能实现方式中,在第一方面方案的基础上,其中:该第一回收参数含第二回收参数,所述第一有效读写单元所在的存储单元的所述第二回收参数的值是第七参数值,所述第二有效读写单元所在的存储单元的所述第二回收参数的值是第八参数值,所述第一方面方案还包括:根据所述第七参数值、所述第八参数值以及所述目的存储单元的所述第二回收参数的原有值,把所述目的存储单元的所述第二回收参数的值配置为第九参数值;其中,所述第二回收参数的值与所述存储单元执行垃圾回收的时间点有关。
该方案介绍了第二回收参数这一新的参数,以及该参数的计算原则。
在第一方面的第十一种可能实现方式中,在第一方面的第十种可能实现方式的基础上,进一步还包括:按照第一回收参数和第二回收参数选择的该组存储单元含某存储单元;把所述某存储单元中的数据单元迁移到按照磨损程度选择的存储单元之中。
该方案介绍了如何把第二回收参数用于磨损均衡。
在第一方面的第十二种可能实现方式中,在第一方面的基础上,可以根据所述第一回收参数从所述多个存储单元中选择第一存储单元,该第一存储单元含有陈旧读写单元;把第一存储单元中有效读写单元的数据迁移到第二存储单元,所述第二此处单元有空闲读写单元。
该方案介绍了单存储单元垃圾回收的数据复制,和第一方面所介绍的复制(可以称为多存储单元存垃圾回收中的数据复制)可以并列执行。例如在同一个存储介质中:对第一回收参数大于阈值的存储单元,执行多存储单元垃圾回收的数据复制,对第一回收参数大于阈值的存储单元,执行单存储单元垃圾回收的数据复制。
在第一方面的第十三种可能实现方式中,在第一方面的第十二种可能实现方式的基础上。所述第一存储单元的所述第一回收参数的值是第四参数值,所述第二存储单元的所述第一回收参数的值是第五参数值;所述方法进一步包括:根据所述第四参数值、所述第五参数值,把所述目的存储单元的所述第一回收参数的值配置为第六参数值。
该方案介绍了:在单存储单元垃圾回收的复制操作中,第一回收参数值的更新方案。
第二方面,提供一种存储介质硬件,存储介质包括介质控制器和多个存储单元,每个存储单元拥有第一回收参数,所述第一回收参数与所述存储单元中的数据相关,每个存储单元包括多个读写单元,其中,所述介质控制器,可以执行上述第一方面、以及第一方面的各个可能实现。
第三方面,提供一种程序产品,该程序产品例如是硬盘、U盘和光盘等。程序产品。程序产品包括程序代码,运行所述程序代码用于对存储介质进行管理。通过运行该程序产品中的程序代码,可以执行上述第一方面、以及第一方面的各个可能实现。
附图说明
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的图作简单地介绍,下面描述中的图仅仅是本发明的一些实施例,还可以根据这些图获得其他的图。
图1是固态硬盘结构图的实施例。
图2是存储介质垃圾回收的流程图实施例。
图3是一个单块垃圾回收过程实施例的示意图。
图4是一个多块垃圾回收过程实施例的示意图。
具体实施方式
下面将结合实施例中的图,对实施例的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本说明的一部分实施例,而不是全部的实施例。基于这些实施例所获得的所有其他实施例,都属于本说明保护的范围。例如本申请主要以SSD为例进行介绍,然而本申请的思想同样适用于其他基于闪存(flash)的存储介质。以及还适用于其他无法覆盖写(覆盖写是指新写入的数据直接覆盖存储介质中的旧数据)的存储介质,例如叠瓦式磁记录(SMR)介质,闪存介质中的block相当于SMR介质中的区域(zone),闪存的页相当于zone中的一段存储空间。其中,block和zone统称为存储单元,页和zone中的一段存储空间,统称为读写单元。由于原理相同,为了简洁,下面仅以flash为例进行说明。
在对块(block)进行垃圾回收(garbage collection,GC)前,块中的页可能处于下面三种情况中的一种:第一种,页中存储了有效数据,对这种状态的页可以设置有效(valid)标签来进行标记,简称为有效页;第二种,页中存储有无效数据,无效数据是不再需要的数据是相对于有效数据而言的,或者说是被主机(主机包括SSD之外,与SSD通信的计算机、服务器、存储控制器等设备)“删除”的数据,这种状态的页可以通过设置陈旧(stale)标签来进行标记,简称为陈旧页(或者“无效页”);第三种,页中没有存储数据,这种状态的页,简称为空白页,空白页可以在将来被存入新的数据,空白页通过设置clean标签或者empty标签进行标记,或者通过补设置标签进行标记。其中,在进行垃圾回收时,需要把有效数据迁移到其他块;对于陈旧页和空白页,不需要执行数据迁移。对于被执行了垃圾回收的块,所有页都成为空白页。也就是说,垃圾回收可以把无效数据占用的存储空间释放出来,重新提供给主机使用。
为了方便介绍,在没有特别说明的情况下,本实施例把每个有效页中所存储的数据称为一个数据单元。如果一个数据单元在过去多次垃圾回收中都没有发生过删除(对SSD来说,某个页的数据单元发生删除,意味着把存储这个数据单元的页的状态设置为陈旧),那么这个 数据单元更新不频繁,在未来也被删除的可能性也比较低。更进一步的,随着这个数据单元所在的块被垃圾回收的次数越多,这个数据单元在未来被删除的可能性越低,这种情况可以形象的理解为数据单元年龄越来越“老”。与之相反,对于未经历过垃圾回收或者经历过的垃圾回收次数很少的数据单元,未来被删除的可能性相对比较高,可以认为这样的数据单元比较“年轻”。这里的“删除”实际上也包括了“修改”的情况,因为在SSD中,修改数据单元的具体做法是:删除原数据单元,把新数据单元写入新的存储位置,因此,可以把“修改”视为删除的一种特例,不做单独介绍。
应用本实施例后,可以把多数数据单元按照年龄段的不同汇聚到不同的块中,按照本实施例执行的垃圾回收次数越多,汇聚的程度越明显。对于主要由年龄较老的数据单元所构成的块而言,块中的数据单元总体上比较稳定,将来出现陈旧块的几率相对较小,因此老龄数据单元集中的块发生垃圾回收的几率也变小(一般情况下,SSD把陈旧块的数量大于某个预设的阈值作为触发垃圾回收的条件)。相应的,在老龄数据单元汇聚后一些块中后,余下的块中就聚集了相对低龄的数据单元,对于主要由低龄的数据单元组成的块,出现大量陈旧页的可能性比较大,因此块发生垃圾回收的可能性比较大。
基于本实施例的方案,数据单元按年龄段被汇聚到不同的块中。老龄数据单元所在块被垃圾回收的可能性比较低,因此老龄数据单元所在块未来被擦除的可能性降低,老龄数据单元所在的块的寿命得到了保证。而低龄数据单元所在块往往集中了大量陈旧页,因此被垃圾回收的可能性比较高。并且陈旧页在垃圾回收过程中不需要执行数据迁移,因此对低龄数据单元所在块进行垃圾回收不需要迁移太多数据单元,减少了因为大量数据单元迁移而占用存储设备的运算资源和带宽资源;此外,垃圾回收后陈旧页全部成为空白页,因此对低龄数据单元所在的块垃圾回收后可以获得较多的可用存储空间。并且,低龄数据单元和老龄数据单元分层后,总体上减少了SSD中被垃圾回收的块的数量。
识别出数据单元的年龄是本实施例需要解决的问题之一。为了能识别出数据单元的年龄,本实施例给块设置回收参数,回收参数可以是一个或一组数字或符号。回收参数包括第一回收参数,通过在垃圾回收中对第一回收参数的值进行更新来近似的反映块中数据单元的年龄变化。如果块中的数据没有发生过垃圾回收,那么这个块的第一回收参数的值是初始值(初始值例如是0);如果块中的数据发生过垃圾回收,在垃圾回收发生前迁出数据单元的块的第一回收参数的值,以及在垃圾回收发生前迁入数据单元的块的第一回收参数的值,共同决定了垃圾回收发生后迁入数据单元的块的第一回收参数的值。
例如,把一个或多个块中的数据单元(有效数据)复制到另外的一个或多个块中(为了方便介绍,把复制出数据单元的块称为源块,把复制入数据单元的块称为目的块)。目的块的第一回收参数的值会进行更新,更新后的第一回收参数的值由:目的块的第一回收参数的原值、源块的第一回收参数的值决定。其中,一种可选的方式是:目的块的第一回收参数的原值、源块的第一回收参数的值都是正数,目的块第一回收参数的新值由其中最大值决定,例如这个最大值加上固定的正数(例如1);或者,另外一种可选的方式是:目的块的第一回收参数的原值、源块的第一回收参数的值都是负数,目的块第一回收参数的新值由其中最小值加上固定的负数。当然,还可以有其他方案,例如目的块的第一回收参数的原值、源块的第一回收参数的值乘以一个常数后再加上或者减去一个固定值,作为目的块的第一回收参数的新的值。在初始值是0,固定的正数是1的情况下,一个块的第一回收参数的新的值可以被 解读为:本块中所存储的有效数据中,各个有效数据对应有在过去因为垃圾回收而被迁移的次数(允许有有效数据的迁移次数是0),在垃圾回收后,第一回收参数的新的值是这些次数中的最大值。
需要说明的是,在SSD中,多个块的第一回收参数在统计上可以整体上反映这多个块中数据单元的年龄。但是,本实施例允许存在少数例外的情况,也就是可能存在这样的块:块的第一回收参数没有正确反映这个块中数据单元的年龄,这种例外可能会一点程度上降低本发明技术效果,但是不会阻止本发明实施例技术效果的实现。
图1介绍了固态硬盘10的结构图,固态硬盘10和主机20通信。固态硬盘内部包括固态硬盘控制器11、和固态硬盘11连接的缓存12(例如是随机存储存储器RAM),以及多个包(package),固态硬盘控制器11通过通道和包连接,每个包拥有块(block),块是最小擦除单位,块1、块2、块3、块4、块5、块6、块7和块8为固态硬盘20提供物理上的存储空间,每个块由多个页(page)组成,页是最小读/写单位。当然,固态硬盘20中还可以有更多的包/块,图1中未示出。固态硬盘控制器11内部可以有:缓存接口、处理器、闪存控制器等组件。缓存接口和缓存12通信,处理器执行计算机指令,闪存控制器对块进行控制。
图2介绍了为了执行垃圾回收,在块之间进行数据迁移的过程。整个垃圾回收过程(包括图2中描述的步骤在内)可以由图1中的固态硬盘10执行,具体而言可以是由固态硬盘控制器11运行缓存12中的计算机指令执行。在SSD运行后,计算机指令被加载在缓存12中。在SSD运行之前,之前计算机指令可以存储在非易失性存储介质中,例如固化在主机网卡的固件(firmware)中。
步骤21、SSD控制器获取存储介质中各个块中陈旧页的数量,陈旧页超过垃圾回收阈值的块需要执行垃圾回收。
SSD由控制器和存储介质组成,控制器和存储介质通信,对存储介质进行管理,存储介质例如闪存颗粒。
获取陈旧页的数量有多种方式,例如:陈旧页的数量预存在缓存中,并且定期进行更新,那么SSD控制器可以从所述缓存中直接获得陈旧页的数量;或者,由SSD控制器直接查询各个块中设置了陈旧标签的页的数量,从而获得各个块中陈旧页的数量。
步骤22、对于陈旧页超过陈旧阈值的块,SSD控制器查询各个块的第一回收参数的值。第一回收参数的值可以存储在某些块中,也可以存储在SSD的缓存中。
对于第一回收参数的值小于第一回收参数阈值的块,执行步骤23的单存储单元(如前所述,在本实施例中存储单元是flash中的“块”)垃圾回收;对于第一回收参数的值大于或者等于第一回收参数阈值的块,执行步骤24的多存储单元(本实施例中的存储单元是“块”)垃圾回收。
需要说明的是,在步骤22和步骤21中,可以任一个步骤比另外一个步骤先执行。也可以两个步骤同时执行,即:在查询块陈旧页数量的同时查询块的第一回收参数的值。
步骤23、对第一回收参数的值小于第一回收参数阈值的各个块,执行单块垃圾回收。对目的块的第一回收参数的值进行更新。
如果把单块垃圾回收的源块称为第一块,目的块称为第二块。那么本步骤可以描述为:把第一存储单元中有效读写单元的数据迁移到第二存储单元,所述第一存储单元含有陈旧读写单元,所述第二此处单元有空闲读写单元。
在单块垃圾回收中,以单个块作为粒度进行垃圾回收。换句话说,在一次垃圾回收操作中,不会把两个或者两个以上的源块的数据单元复制到至少一个目的块中。
图3是一个单块垃圾回收过程的示意图。块1拥有5个页(这里只是举例,实际情况下,一个块可以有更多的页,例如:一个块的大小是256KB,一个页的大小是4KB。)块1拥有数据1和数据2两个数据单元,数据1和数据2分别存储在页1和页2;此外,块1的页2和页4存储了陈旧页,页5是空白页。SSD的控制器把数据1和数据2这两个数据单元复制到块2,数据1和数据2复制到块2后所在的页,与块2原有的数据(数据3)所在的页在存储介质中的位置关系相邻,并且,数据1和数据2所在的页也相邻。此外,数据1和数据2所在的页保持了在块1中的相对位置关系,也就是说,在块1中,数据1所在页的编号小于数据2所在页的编号,在块2中,保持了数据1所在页的编号小于数据2所在页的编号。复制完成后,对块1进行擦除,擦除后的块1中所有页都成为空白页。被擦除的块中没有有效数据,因此它的第一回收参数的值重置为初始值(例如0)。在本实施例中,作为目的块的块2中已有数据3。在其他实施方式中,可以把空白块作为目的块进行数据单元复制。页编号连续的两个页之间相邻。以图3为例,页3和页1、页2相邻。页编号的大小描述页的位置关系。例如:在迁移前,数据1所在的页(页1)的页编号(块1,中页1的编号是1)小于和数据2所在的页(页3)的页编号(块1中,页3的编号是3);在数据1和数据2迁移到块2后,数据1所在的页(页2)的页编号(块2中,页2的编号是2)同样小于数据2所在的页(页3)的页编号(块2中,页3的编号3)。可以看出,在迁移前后,数据1所在页的页编号保持了小于数据2所在页的页编号,这一的位置关系得以保持。
SSD收到主机的数据后,SSD具体如何把数据存入块的页有规律可循。例如,对同一个块而言,主机先收到的数据写入块中页编号较小的页,主机后收到的数据写入页编号较大的页;或者反之,先收到的数据写入块中页编号较大的页,后收到的数据写入页编号较小的页。这种规律和SSD厂商的制作工艺有关,因此,同一个厂商生产的SSD往往依照相同的规律。这样的话,从页编号就可以知道数据单元被写入块的时间先后顺序,如果主机先收到数据写入块中页编号较小的页,那么页编号小的页中的数据的写入时间不晚于页编号大的页中的数据。本实施例所说的顺序只是描述两个页之间的在存储介质中的前后位置关系,并不涉及到这两个页之间是否间隔有其他页。为了方便理解,我们都使用“首写位置”这一称号对块中空白页的利用顺序进行描述:向块中写入数据时,从块的首写位置开始按顺序写入数据,直至所有空闲读写单元被用完位置。靠近首写位置的块写入数据的时间点不晚于远离首写位置的块写入数据的时间点。
在目的块中,数据单元的部分或者全部保持这种先后顺序,因此从数据单元所在页的排序关系,依然可以大致反映出数据单元被主机写入所述SSD的时间先后顺序。以图3为例,主机把数据1写入块1中的时间不晚于主机把数据2写入块1的时间,因此数据1所在的页的编号小于数据2所在的页的编号。在把数据1和数据2复制到块2后,数据1所在的页的编号小于数据2所在的页的编号。简言之,在图3的目的块2中继续保持这个规律:同一个块中,页编号与主机把数据写入SSD的时间顺序存在对应关系。
复制完成后,擦除块1中的所有数据,擦除后,从页1到页5都是空白页。
本步骤还包括对第一回收参数的值进行更新。第一回收参数的值由所述SSD中的数据单元由于垃圾回收而被复制的次数相关。
具体而言,如果在垃圾回收前目的块没有有效数据,那么:目的块的第一回收参数的值可以由源块的第一回收参数的值决定;更进一步的,目的块的第一回收参数的值可以由源块的第一回收参数的值和一个固定增量决定,固定增量例如是1。例如,第一回收参数的值都是不小于0的整数,目的块的第一回收参数的值被更新的原则是“目的块的第一回收参数的值=源块的第一回收参数值+1”。块的第一回收参数的初始值例如是0(当然也可以是其他数字)时,表示块中的有效数据未发生过垃圾回收。在执行垃圾回收后,对第一回收参数的值加1,成为0+1=1;如果把前一次垃圾回收的扮演目的块的块作为源块,再次执行单块垃圾回收,对那么对再次执行单块垃圾回收的目的块而言,第一回收参数的值是1+1=2。
另外,如果在垃圾回收前目的块存在有效数据,那么,目的块的多块垃圾回收的第一回收参数的值,由源块的第一回收参数的值以及所述目的块的多块垃圾回收第一回收参数的值共同决定,单块垃圾回收和多块垃圾回收均是如此。例如,在单块垃圾回收和多块垃圾回收中,目的块的第一回收参数的值=max(源块的第一回收参数的值,目的第一回收参数的值)+固定值。:例如,在垃圾回收前,源块的第一回收参数的值是5,目的块的第一回收参数的值是3;那么,在垃圾回收之后,目的块第一回收参数的值是:max(5,3)+1=6。因此,目的块的第一回收参数的值会被更新为6。
综合来看,对垃圾回收的目的块的数据寿命进行更新具体包括两种情况。其一种情况:如果在垃圾回收后,所述目的块中所有有效页的数据单元全部来自所述源块,那么垃圾回收之后,目的块的第一回收参数的值是源块的第一回收参数的值+1。其二种情况:如果在垃圾回收后,所述目的块中的数据单元除了来源于所述源块,在所述目的块中原本存在其他数据单元。那么,目的块的新的第一回收参数的值,由源块的第一回收参数的值和目的块原第一回收参数的值确定。例如,以二者的最大值+1,作为目的块的新的第一回收参数的值。
通常来说,寿命越长的块中的数据,经历过的垃圾回收次数越多,在未来被删除/改写的几率越低。
以第一种情况为例,第一回收参数的值还可以有其他更新方式。例如第一回收参数都是不大于0的数字,第一回收参数的值的更新原则是“目的块的第一回收参数的值=源块的第一回收参数的值-5”。那么,如果当前源块的第一回收参数的值是-6,目的块的第一回收参数的值就变为-6-5=-11。此外,还可以有更多实现方案,例如:所有第一回收参数的值都是不小于0的数,并且“目的块的第一回收参数的值=源块的第一回收参数的值*1.01+3”。
步骤24、对第一回收参数的值大于第一回收参数阈值的多个块,执行多块垃圾回收。对目的块的第一回收参数的值进行更新。
在多块垃圾回收中,把多个第一回收参数的值小于第一回收参数阈值的块作为一个垃圾回收组,把同一个组内的块的数据单元复制到目的块中去,同一组源块的目的块的数量可以是一个或者多个。换句话说,把两个或者两个以上的源块的有效数据共同复制到至少一个目的块中。当垃圾回收组的数量不止一个时,由于各个垃圾回收组的操作方式相同,因此在没有特别声明的情况下,下面仅以其中一组为例进行介绍。
由于多块垃圾回收是跨越多个源block的垃圾回收,因此也可以称为跨块垃圾回收。
当单个目的块足以容纳全部的被复制数据时,使用单个目的块来容纳被复制的数据。当单个目的块的空白页难以容纳全部的被复制数据时,使用两个或者更多个目的块来容纳被复制的数据,每当一个目的块被装满后,使用下一个目的块继续存储被复制的数据,直至所有 被复制的数据都被存储到目的块中。然后,可以擦除组内的所有源块的数据。
和步骤23所描述的单块垃圾回收不同的是,本步骤中,每一个组拥有的源块的数量至少是2个。需要特别强调的是,分组并不是必须的步骤,本步骤所欲描述的场景是:多个块在垃圾回收过程中,使用了相同的一个或者多个目的块。和多块垃圾回收相比,单块垃圾回收相当于每一垃圾回收组拥有的源块只有一个。
为了和步骤22的单块垃圾回收进行区分,后续在没有特别说明的情况下,把单块垃圾回收的源块、目的块分别称为第一源块和第一目的块;把多块垃圾回收的源块、目的块分别称为第二源块和第二目的块,在一次多块垃圾回收中,第二源块的数量是多个。
其中,多块垃圾回收可以理解为:在垃圾回收过程中后,在一个或者多个第二目的块中,存在复制自多个第二源块的数据单元。或者说,在垃圾回收过程中,把多个第二源块的数据单元复制到同一个第二目的块,这样的第二目的块可以有多个,例如本次多块垃圾回收所涉及的全部或者部分第二目的块。此外,在这一个或者多个第二目的块中,来自同一个第二源块的数据单元不完全连续。具体操作方法例如是:把至少2个第二源块中的数据单元复制到同一个第二目的块中。如果这至少2个第二源块中的数据单元逐个轮流复制到同一个第二目的块中,那么来自同一个第二源块的数据单元不连续。
本实施例还提供了一种更具体的多块垃圾回收的方案:在垃圾回收过程中,把多个第二源块中有效页的数据单元轮流复制到所述至少一个第二目的块中;并且,对同一个第二源块的多个有效页,按照主机存储顺序进行复制。当然,在其他实施例中,也可以不采用轮流复制的方式,例如可以多个有效页的数据单元并行复制以提高数据单元迁移的效率,只要能够使得复制完成后的状态满足符合这样的关系即可。为了更方便理解这种实施方式,可以参照图4,图4中,块3、块4和块5是第二源块,块6是第二目的块。块3、块4、块5分别把一个未复制的有效页的数据单元复制到块6,这些数据单元分别是数据4、数据6和数据9;然后,块3、块4轮流把下一个未复制的有效页(数据5和数据7)复制到块6,由于块5所有的有效页的数据单元在上一轮已经完成复制,因此块5不再参与本轮复制;接着,块4把下一个未复制的数据单元(也就是数据8)复制到块6,由于块4和块5的所有数据单元在上一轮已经完成复制,因此块4和块5不再参与本轮复制。此外,从图4中还可以看出:同一个块中,页编号由上至下逐渐增加,数据4在数据5的上方;数据6在数据7的上方,数据7在数据8的上方;在块6中,这样的位置关系得到保留。本实施例中,主机存储顺序是先存储页编号小的页,再存储页编号大的页(也就是图4中由上至下的顺序)。因此,对于块3而言,先位于上方的复制数据4,后复制位于下方的数据5;类似的,对于块4而言,复制的顺序依次是数据6、数据7、数据8。
对于第二目的块的数量只有一个的情况,根据各个第二源块的第一回收参数的值以及第二目的块第一回收参数的原有值,配置第二目的块的新的第一回收参数的值。例如由它们的第一回收参数的值最大值+1(如前所述,可以使用公司目的块的第一回收参数的值=max(源块的第一回收参数的值,目的第一回收参数的值)+固定值),作为块的新的第一回收参数的值。这里第一回收参数的最大值+1只是举例,第一回收参数的值还可以有其他更新方式,具体参照步骤23。当然,如果在本次垃圾回收前第二目的块是空白块,那么可以不用考虑第一回收参数的原有值。对于第二目的块的数量不止一个的情况,被迁移的数据单元先装满一个第二目的块,再继续填充余下的第二目的块。这个首先被装满的第二目的块的第一回收参数 的值的计算方法,与前述第二目的块的数量只有一个情况下所使用的计算方法相同。而余下的第二目的块中每一个第二目的块的第一回收参数的值,可以使用和这个首先被装满的第二目的块相同的计算方法进行计算;也可以不重新计算,而是保持和这个首先被装满的第二目的块的第一回收参数的值相同。为了简洁,本实施例仅以第二目的块的数量只有一个的情况为例进行介绍。
以图4为例,那么更新后的块6的第一回收参数的值,由块3、块4和块5的第一回收参数的值决定。如果块6原本存在数据单元(未图示),那么更新后的块6的第一回收参数的值,由块3、块4、块5的第一回收参数的值和块6原第一回收参数的值决定。例如这些第一回收参数的值中的最大值加上一个固定增量,固定增量例如是1。
如果一个第二源块的所述第一回收参数的值是第一参数值,另外一个第二源块的第一回收参数值是第二参数值。所述方法进一步包括:根据所述第一参数值、所述第二参数值以及所述第二目的块的所述第一回收参数的原有值,把所述第二目的块的所述第一回收参数的值更新为第三参数值。
需要注意的是,本次垃圾回收的源块可能是在过去所发生的垃圾回收(单块垃圾回收或者多块垃圾回收)中扮演的是目的块的角色。而在过去发生的垃圾回收中,遵循同样的规则对上一次垃圾回收的目的块的第一回收参数的值进行配置。类似的,过去发生的垃圾回收的源块,可能是在更早之前的垃圾回收(单块垃圾回收或者多块垃圾回收)的目的块。我们可以看出,这是一个可以不断往前追溯的过程,一直可以追溯到未发生过垃圾回收的块为止。在执行本次垃圾回收时,涉及到的块包括多个第二源块和至少一个第二目的块,对于这些块中的每一个块而言,第一回收参数的值同样可以不断往前追溯,因此,它们的第一回收参数的值均可以描述为:由所述SSD过去执行垃圾回收的多个时间点决定。基于类似的原因,这些块中的每一个块的第一回收参数的值可以描述为:由所述SSD过去执行垃圾回收的次数决定。这两种描述第一回收参数的值的方式同样适用于单块垃圾回收。
在执行了多块垃圾回收后,SSD中的数据单元得到一定程度的分层:一部分块中年龄较老的数据单元比较集中,还有一部分块中年龄较年轻的数据单元比较集中。由此就具有了前述的多个技术效果,例如对少量块进行垃圾回收,就可以获得现有技术中需要对大量块进行垃圾回收同样多的可用存储空间。
前述第一回收参数主要用于近似的反映块中数据单元的年龄变化。第一回收参数可以被理解为:存储单元中存储有至少一个数据单元(有效数据),对每个数据单元而言,在过去因为垃圾回收而发生过复制(复制的次数不为0),或者没有因为垃圾回收而发生过复制(次数是0),在各个数据单元所对应的次数中,把最大的次数作为这个存储单元的第一回收参数。可选的,所述回收参数还可以进一步包括第二回收参数。
第二回收参数的值可以描述块中的数据单元首次因为多存储单元垃圾回收而被迁移的时间点。在多块垃圾回收之前,第二回收参数可以没有值,或者是初始值(例如0)。数据单元被迁移的原因有多种,例如执行单块垃圾回收而发生的迁移,或者垃圾回收之外的原因发生的迁移,对于这些迁移不会记录第二回收参数的值。举例:第二回收参数的值的描述方式可以是2018年1月28日17:40。
如果在本次多块垃圾回收之前,所述第二源块、所述第二目的块均没有发生过多块垃圾回收,那么所有所述第二目的块和所述第二目的块的第二回收参数的值是初始值(初始值例 如0,或者为空)。举例:第二源块、第二目的块一共有4个,它们的第二回收参数的值分别是:空、空、空和空,而当前多块垃圾回收的时间点的值是2018年1月28日17:50,那么本次多块垃圾回收之后,第二目的块的第二回收参数的值更新为2018年1月28日17:50。
如果在本次多块垃圾回收之前,所述第二源块、第二目的块中任意一个块的第二回收参数的值不是初始值,那么以其中最早的时间点作为第二目的块的第二回收参数的值。举例1:第二源块、第二目的块的总数量是4个,它们的第二回收参数的值分别是:空、空、空和2018年1月28日17:40,那么第二目的块的第二回收参数的值是2018年1月28日17:40。举例2:第二源块、第二目的块一共有4个,它们的第二回收参数的值分别是:2015年1月1日00:00、空、空和2018年1月28日17:40,那么第二目的块的第二回收参数的值是2015年1月1日00:00。
由以上两个例子可以看出,在某次垃圾回收过程中,目的块的多块垃圾回收时间点的值,由源块的多块垃圾回收时间点的值、所述目的块的多块垃圾回收时间点的值确定。单块垃圾回收的目的块的多块垃圾回收时间点的值依照同样的方法确定。
第二回收参数可以一定程度上反映块中数据单元的新旧程度。第二回收参数和第一回收参数配合使用,可以更加准确的反映块中数据单元的新旧程度。在SSD经过多长垃圾回收的积累后,在SSD中,块的数据单元的寿命规律是:“第一回收参数的值超过第一回收参数阈值,且第二回收参数的值较早”的块中的数据单元的年龄>“第一回收参数的值超过第一回收参数阈值,且第二回收参数的值较晚”的块中的数据单元的年龄>“第一回收参数的值不超过第一回收参数的阈值”的块中的数据单元的年龄。当然,正如前面所描述的,这是一个统计上的结果,至少会有一定数量的块符合这一规律,但是本实施例允许有一部分块不符合这一规律。实际上,只要有一部分块符合这一规律,那么已经一定程度上对SSD中的数据进行了更合理的分布,可以实现本发明实施例所欲达到的技术效果。
需要说明的是,第二回收参数是可选的,即使没有这个参数仅仅通过对第一回收参数与第一回收参数阈值进行比较,就已经实现了对块进行分类的目的。在统计上,“第一回收参数超过第一回收参数阈值”的块的数据单元的年龄>“第一回收参数不超过第一回收参数阈值”的块的数据单元的年龄。
需要特别说明的是,步骤23是可选步骤,即使不执行步骤23,仅执行步骤24同样可以获得有益的技术效果。如果不执行步骤23,那么步骤24不需要判断第一回收参数的值,直接对陈旧页数量(步骤23和步骤24中涉及的源块都是陈旧页大于陈旧阈值的块)超过陈旧阈值的块执行多块垃圾回收即可。
步骤25,进行数据迁移。把数据单元的年龄较老的块中的数据单元迁移到磨损严重的块中;和/或,把数据单元的年龄较年轻的块中的数据单元迁移到磨损轻微的块中。磨损程度的判断标准可以由系统设定,例如磨损程度可根据一个或多个相关参数决定,当磨损程度(或相关参数)超过某个阈值(或者达到某个范围)时,磨损程度可判断为严重,反之则判断为不严重(或者说轻微)。也就是按照第一回收参数选择存储单元,把选择的存储单元中的数据单元迁移到按照磨损程度选择的存储单元之中。
下面以把年龄较老的块中的数据单元迁移到磨损严重的块中进行举例:阈值为100次,那么擦除次数超过100次的块就是磨损严重的块,擦除次数不足100次的块是磨损轻微的数据块。第一回收参数阈值例如为20,那么按照本步骤25,磨损严重(擦除次数大于100)的 块中的数据单元,可以迁移到第一回收参数的值大于20的块中。这种实施方式中,以第一回收参数的值作为判断块的年龄的依据。可选的,在另外一种方式中,以第一回收参数和第二回收参数共同作为判断块的年龄的依据。例如:第一回收参数阈值是20、第二回收参数阈值是2018年1月13日。那么按照本步骤25,对于磨损严重(第一回收参数大于20,并且擦除次数大于100)的块中的数据单元,可以迁移到第二回收参数早于2018年1月13日的块中。
如何判断块中数据单元的年龄,如步骤24的描述,至少有两种方式:一种是使用第一回收参数的值进行判断;另外一种是使用第一回收参数和第二回收参数这两个参数的值,例如如下规则中的一种:(1)第一回收参数值大的数据单元,年龄老于第一回收参数值小的数据单元;(2)对于第一回收参数均高于第一回收参数阈值的两个数据单元,第二回收参数早的数据单元,年龄老于第二回收参数值晚的数据单元。
在一些情况下,还有规则(3):第二回收参数早的数据单元,年龄老于第二回收参数值晚的数据单元。
因此,一种可行的实施例方式是:(1)SSD控制器按照磨损程度,选择磨损严重的M个块;把这M个块中的数据单元复制到其他有空白页的数据单元,并擦除这M个块的内容;(2)计算出这M个块中空闲页的总数P;(3)按照这M个块所能提供的存储空间选择N个块,这N个块拥有的数据单元是SSD中年龄较老的数据单元,例如:从第一回收参数超过第一回收参数阈值的块中,选择第二回收参数的值比较早的N个块,这N个块中拥有Q个有效页,Q≤P;(4)把这Q个有效页迁入M个块中去。
需要特别说明的是,在前述垃圾回收的方案中,介绍了使用规则(1)作为选择垃圾回收的源数据单元的标准。实际上,也可以使用第规则(2)作为判断标准来选择垃圾回收的源数据单元,例如把根据所述第一回收参数从所述多个存储单元中选择一组存储单元的步骤,更新为根据所述第一回收参数和所述第二回收参数,从所述多个存储单元中选择一组存储单元(例如从第一回收参数高于第一回收参数阈值的多个数据单元中,选择第二回收参数同属于某一个时间段的数据单元,作为一组垃圾回收的一组源存储单元),唯为了篇幅借鉴,此处不再做具体介绍。
本发明还提供一种程序产品的实施例,程序产品包括程序代码,运行所述程序代码可以对存储介质(包括存储单元)进行管理,所述存储介质包括多个存储单元,每个存储单元拥有第一回收参数,所述第一回收参数与所述存储单元中的数据相关,每个存储单元包括多个读写单元,所述程序产品包括至少一个组件可操作用于执行上述各个方法步骤。存储介质中的程序可以被所述存储介质(例如所述介质控制器)所执行;或者被与存储介质通信的计算机设备执行,对存储单元进行管理。

Claims (32)

  1. 一种存储介质垃圾回收方法,所述存储介质包括多个存储单元,每个存储单元拥有回收参数,所述回收参数包括第一回收参数,所述第一回收参数与所述存储单元中的数据相关,每个存储单元包括多个读写单元,其特征在于:
    根据所述第一回收参数从所述多个存储单元中选择一组存储单元,在该组存储单元中任意两个存储单元的所述第一回收参数的值差不大于预设值,该组存储单元中的每一个存储单元含有陈旧读写单元,其中,陈旧读写单元是存储有无效数据的读写单元;
    把该组存储单元中的第一有效读写单元和第二有效读写单元中的数据复制到同一个目的存储单元,其中,所述第一有效读写单元和所述第二有效读写单元分属于该组存储单元中的不同的存储单元,所述目的存储单元包含于所述多个存储单元。
  2. 根据权利要求1所述的存储介质垃圾回收方法,其中:
    所述第一有效读写单元所在的存储单元的所述第一回收参数的值是第一参数值,所述第二有效读写单元所在的存储单元的所述第一回收参数值是第二参数值;
    所述方法进一步包括:
    根据所述第一参数值、所述第二参数值以及所述目的存储单元的所述第一回收参数的原有值,把所述目的存储单元的所述第一回收参数的值配置为第三参数值。
  3. 根据权利要求2所述的存储介质垃圾回收方法,其中:
    所述存储介质在过去多个时间点分别执行多次垃圾回收,所述第一参数值、所述第二参数值以及所述目的存储单元的所述第一回收参数的原有值由过去执行垃圾回收的多个时间点决定。
  4. 根据权利要求3所述的存储介质垃圾回收方法,其中:
    所述第一参数值、所述第二参数值以及所述目的存储单元的所述第一回收参数的原有值分别代表所述多个时间点内三个相同或不同的时间点,所述第三参数值是由所述三个相同或不同的时间点之间的比较决定。
  5. 根据权利要求3所述的存储介质垃圾回收方法,其中:
    该目的存储单元中的数据存储位置是依写入时间,从存储单元的首写位置开始按顺序写入,在该目的存储单元中,复制自所述第一有效读写单元的数据储存于第一位置,复制自所述第二有效读写单元的数据储存于第二位置,所述第一位置比所述第二位置更靠近该目的存储单元的首写位置。
  6. 根据权利要求2所述的存储介质垃圾回收方法,其中:
    在过去多个时间点分别执行多次垃圾回收,所述第一参数值、所述第二参数值以及所述目的存储单元的所述第一回收参数的原有值由过去执行垃圾回收的次数决定。
  7. 根据权利要求4所述的存储介质垃圾回收方法,其中:
    所述第三参数值是根据所述第一参数值、所述第二参数值以及所述目的存储单元的所述第一回收参数的原有值以及一个固定增量决定。
  8. 根据权利要求2所述的存储介质垃圾回收方法,其中,所述方法还包括:
    把该组存储单元中,除所述第一有效读写单元和所述第二有效读写单元外,余下的有效读写单元中的数据复制到该组存储单元之外的存储单元,其中,该组存储单元之外的存储单元包括目标存储单元;
    根据所述第三参数值配置所述目标存储单元的所述第一回收参数的值;以及
    擦除该组存储单元中所有的数据。
  9. 根据权利要求1所述的存储介质垃圾回收方法,其中,
    根据所述第一回收参数从所述多个存储单元中选择第一存储单元,该第一存储单元含有陈旧读写单元;
    把第一存储单元中有效读写单元的数据迁移到第二存储单元,所述第二此处单元有空闲读写单元。
  10. 根据权利要求9所述的存储介质垃圾回收方法,其中:
    所述第一存储单元的所述第一回收参数的值是第四参数值,所述第二存储单元的所述第一回收参数的值是第五参数值;
    所述方法进一步包括:
    根据所述第四参数值、所述第五参数值,把所述目的存储单元的所述第一回收参数的值配置为第六参数值。
  11. 根据权利要求1所述的存储介质垃圾回收方法,其中,所述方法还包括:
    按照第一回收参数选择的该组存储单元含某存储单元;
    把所述某存储单元中的数据单元迁移到按照磨损程度选择的存储单元之中。
  12. 根据权利要求1所述的存储介质垃圾回收方法,其中,该回收参数含第二回收参数,所述第一有效读写单元所在的存储单元的所述第二回收参数的值是第七参数值,所述第二有效读写单元所在的存储单元的所述第二回收参数的值是第八参数值,所述方法还包括:
    根据所述第七参数值、所述第八参数值以及所述目的存储单元的所述第二回收参数的原有值,把所述目的存储单元的所述第二回收参数的值配置为第九参数值;
    其中,所述第二回收参数的值与所述存储单元执行垃圾回收的时间点有关。
  13. 根据权利要求11所述的存储介质垃圾回收方法,其中,
    按照第一回收参数和第二回收参数选择的该组存储单元含某存储单元,所述方法还包括:
    把所述某存储单元中的数据单元迁移到按照磨损程度选择的存储单元之中。
  14. 根据权利要求1所述的存储介质垃圾回收方法,还包括:
    把该组存储单元中,除所述第一有效读写单元和所述第二有效读写单元外,余下的有效读写单元中的数据复制到该组存储单元之外的存储单元;
    擦除该组存储单元中所有的数据。
  15. 一种存储介质,存储介质包括介质控制器和多个存储单元,每个存储单元拥有回收参数,所述回收参数包括第一回收参数,所述第一回收参数与所述存储单元中的数据相关,每个存储单元包括多个读写单元,其特征在于,所述介质控制器用于:
    根据所述第一回收参数从所述多个存储单元中选择一组存储单元,在该组存储单元中任意两个存储单元的所述第一回收参数的值差不大于预设值,该组存储单元中的每一个存储单元含有陈旧读写单元,其中,陈旧读写单元是存储有无效数据的读写单元;
    把该组存储单元中的第一有效读写单元和第二有效读写单元中的数据复制到同一个目的存储单元,其中,所述第一有效读写单元和所述第二有效读写单元分属于该组存储单元中的不同的存储单元,所述目的存储单元包含于所述多个存储单元。
  16. 根据权利要求15所述的存储介质,其中:
    所述第一有效读写单元所在的存储单元的所述第一回收参数的值是第一参数值,所述第二有效读写单元所在的存储单元的所述第一回收参数值是第二参数值;
    所述介质控制器还用于:
    根据所述第一参数值、所述第二参数值以及所述目的存储单元的所述第一回收参数的原有值,把所述目的存储单元的所述第一回收参数的值配置为第三参数值。
  17. 根据权利要求16所述的存储介质,其中:
    所述存储控制器在过去多个时间点分别执行多次垃圾回收,所述第一参数值、所述第二参数值以及所述目的存储单元的所述第一回收参数的原有值由过去执行垃圾回收的多个时间点决定。
  18. 根据权利要求17所述的存储介质,其中:
    所述第一参数值、所述第二参数值以及所述目的存储单元的所述第一回收参数的原有值分别代表所述多个时间点内三个相同或不同的时间点,所述第三参数值是由所述三个相同或不同的时间点之间的比较决定。
  19. 根据权利要求17所述的存储介质,其中,所述介质控制器用于指示:
    在该目的存储单元中的数据存储位置是依写入时间,从存储单元的首写位置开始按顺序写入,在该目的存储单元中,复制自所述第一有效读写单元的数据储存于第一位置,复制自所述第二有效读写单元的数据储存于第二位置,所述第一位置比所述第二位置更靠近该目的存储单元的首写位置。
  20. 根据权利要求16所述的存储介质,其中,所述介质控制器还用于:
    在过去多个时间点分别执行多次垃圾回收,所述第一参数值、所述第二参数值以及所述目的存储单元的所述第一回收参数的原有值由过去执行垃圾回收的次数决定。
  21. 根据权利要求18所述的存储介质,其中:
    所述第三参数值是根据所述第一参数值、所述第二参数值以及所述目的存储单元的所述第一回收参数的原有值以及一个固定增量决定。
  22. 根据权利要求16所述的存储介质,其中,所述介质控制器还用于:
    把该组存储单元中,除所述第一有效读写单元和所述第二有效读写单元外,余下的有效读写单元中的数据复制到该组存储单元之外的存储单元,其中,该组存储单元之外的存储单元包括目标存储单元;
    根据所述第三参数值配置所述目标存储单元的所述第一回收参数的值;以及
    擦除该组存储单元中所有的数据。
  23. 根据权利要求15所述的存储介质垃圾回收方法,其中,
    根据所述第一回收参数从所述多个存储单元中选择第一存储单元,该第一存储单元含有陈旧读写单元;
    把第一存储单元中有效读写单元的数据迁移到第二存储单元,所述第二此处单元有空闲读写单元。
  24. 根据权利要求23所述的存储介质垃圾回收方法,其中:
    所述第一存储单元的所述第一回收参数的值是第四参数值,所述第二存储单元的所述第一回收参数的值是第五参数值;
    所述方法进一步包括:
    根据所述第四参数值、所述第五参数值,把所述目的存储单元的所述第一回收参数的值配置为第六参数值。
  25. 根据权利要求15所述的存储介质,其中,所述介质控制器还用于:
    按照第一回收参数选择的该组存储单元含某存储单元;
    把所述某存储单元中的数据单元迁移到按照磨损程度选择的存储单元之中。
  26. 根据权利要求15所述的存储介质,其中,该回收参数含第二回收参数,所述第一有效读写单元所在的存储单元的所述第二回收参数的值是第七参数值,所述第二有效读写单元所在的存储单元的所述第二回收参数的值是第八参数值;
    所述介质控制器还用于:
    根据所述第七参数值、所述第八参数值以及所述目的存储单元的所述第二回收参数的原有值,把所述目的存储单元的所述第二回收参数的值配置为第九参数值;
    其中,所述第二回收参数的值与所述存储单元执行垃圾回收的时间点有关。
  27. 根据权利要求15所述的存储介质,其中,
    按照第一回收参数和第二回收参数选择的该组存储单元含某存储单元,所述介质控制器还用于:
    把所述某存储单元中的数据单元迁移到按照磨损程度选择的存储单元之中。
  28. 根据权利要求15所述的存储介质,所述介质控制器还用于:
    把该组存储单元中,除所述第一有效读写单元和所述第二有效读写单元外,余下的有效读写单元中的数据复制到该组存储单元之外的存储单元;
    擦除该组存储单元中所有的数据。
  29. 一种程序产品,包括程序代码,运行所述程序代码用于对存储介质进行管理,所述存储介质包括多个存储单元,每个存储单元拥有回收参数,所述回收参数包括第一回收参数,所述第一回收参数与所述存储单元中的数据相关,每个存储单元包括多个读写单元,所述程序产品包括至少一个组件可操作用于:
    根据所述第一回收参数从多个存储单元中选择一组存储单元,在该组存储单元中任意两个存储单元的所述第一回收参数的值差不大于预设值,该组存储单元中的每一个存储单元含有陈旧读写单元,其中,陈旧读写单元是存储有无效数据的读写单元;
    把该组存储单元中的第一有效读写单元和第二有效读写单元中的数据复制到同一个目的存储单元,其中,所述第一有效读写单元和所述第二有效读写单元分属于该组存储单元中的不同的存储单元,所述目的存储单元包含于所述多个存储单元。
  30. 根据权利要求31所述的程序产品,其中:
    所述第一有效读写单元所在的存储单元的所述第一回收参数的值是第一参数值,所述第二有效读写单元所在的存储单元的所述第一回收参数值是第二参数值;
    所述至少一个组件进一步可操作用于:
    根据所述第一参数值、所述第二参数值以及所述目的存储单元的所述第一回收参数的原有值,把所述目的存储单元的所述第一回收参数的值配置为第三参数值。
  31. 根据权利要求30所述的所述的程序产品,其中:
    所述存储介质在过去多个时间点分别执行多次垃圾回收,所述第一参数值、所述第二参数值以及所述目的存储单元的所述第一回收参数的原有值由过去执行垃圾回收的多个时间点 决定。
  32. 根据权利要求29所述的所述的程序产品,其中,该回收参数含第二回收参数,所述第一有效读写单元所在的存储单元的所述第二回收参数的值是第七参数值,所述第二有效读写单元所在的存储单元的所述第二回收参数的值是第八参数值,所述至少一个组件进一步可操作用于:
    根据所述第七参数值、所述第八参数值以及所述目的存储单元的所述第二回收参数的原有值,把所述目的存储单元的所述第二回收参数的值配置为第九参数值;
    其中,所述第二回收参数的值与所述存储单元执行垃圾回收的时间点有关。
PCT/CN2018/080241 2018-03-23 2018-03-23 一种存储介质垃圾回收方法、存储介质和程序产品 Ceased WO2019178845A1 (zh)

Priority Applications (4)

Application Number Priority Date Filing Date Title
PCT/CN2018/080241 WO2019178845A1 (zh) 2018-03-23 2018-03-23 一种存储介质垃圾回收方法、存储介质和程序产品
CN201880002800.3A CN109496300B (zh) 2018-03-23 2018-03-23 一种存储介质垃圾回收方法、存储介质和程序产品
EP18910234.6A EP3588259B1 (en) 2018-03-23 2018-03-23 Garbage collection method for storage media, storage medium, and program product
US16/577,106 US11704239B2 (en) 2018-03-23 2019-09-20 Garbage collection method for storage medium, storage medium, and program product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2018/080241 WO2019178845A1 (zh) 2018-03-23 2018-03-23 一种存储介质垃圾回收方法、存储介质和程序产品

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US16/577,106 Continuation US11704239B2 (en) 2018-03-23 2019-09-20 Garbage collection method for storage medium, storage medium, and program product

Publications (1)

Publication Number Publication Date
WO2019178845A1 true WO2019178845A1 (zh) 2019-09-26

Family

ID=65713853

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/080241 Ceased WO2019178845A1 (zh) 2018-03-23 2018-03-23 一种存储介质垃圾回收方法、存储介质和程序产品

Country Status (4)

Country Link
US (1) US11704239B2 (zh)
EP (1) EP3588259B1 (zh)
CN (1) CN109496300B (zh)
WO (1) WO2019178845A1 (zh)

Families Citing this family (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102422032B1 (ko) * 2017-08-16 2022-07-19 에스케이하이닉스 주식회사 메모리 시스템 및 메모리 시스템의 동작 방법
CN111078138A (zh) * 2019-11-08 2020-04-28 深圳市金泰克半导体有限公司 固态硬盘垃圾回收方法和系统
CN110928852B (zh) * 2019-12-09 2022-12-02 Oppo广东移动通信有限公司 一种垃圾回收方法、装置及计算机可读存储介质
CN111930517B (zh) * 2020-09-18 2023-07-14 北京中科立维科技有限公司 一种高性能自适应垃圾收集方法和计算机系统
US11475954B2 (en) 2020-11-15 2022-10-18 Macronix International Co., Ltd. Fast interval read setup for 3D NAND flash
CN112817879B (zh) * 2021-01-11 2023-04-11 成都佰维存储科技有限公司 垃圾回收方法、装置、可读存储介质及电子设备
US11488657B1 (en) * 2021-04-19 2022-11-01 Macronix International Co., Ltd. Fast interval read setup for 3D memory
US11803326B2 (en) 2021-04-23 2023-10-31 Macronix International Co., Ltd. Implementing a read setup burst command in 3D NAND flash memory to reduce voltage threshold deviation over time
US11385839B1 (en) 2021-04-27 2022-07-12 Macronix International Co., Ltd. Implementing a read setup in 3D NAND flash memory to reduce voltage threshold deviation over time
US11809314B2 (en) * 2021-11-21 2023-11-07 Silicon Motion, Inc. Method and apparatus for performing access control of memory device with aid of multi-stage garbage collection management
CN114281249B (zh) * 2021-11-30 2023-07-25 长江存储科技有限责任公司 闪存颗粒的改进方法、闪存颗粒、存储器和电子设备
CN116841453B (zh) 2022-03-25 2026-04-24 中移(苏州)软件技术有限公司 一种数据回收方法、系统、装置及计算机可读存储介质
CN116775507B (zh) * 2023-08-23 2023-10-20 四川云海芯科微电子科技有限公司 固态硬盘控制器垃圾回收中的硬件加速选块方法及装置
CN120225996A (zh) * 2023-08-28 2025-06-27 荣耀终端股份有限公司 一种内存回收方法及电子设备
CN120386742A (zh) * 2024-01-26 2025-07-29 戴尔产品有限公司 用于数据回收的方法、设备和计算机程序产品
US12373341B1 (en) 2024-03-27 2025-07-29 International Business Machines Corporation Garbage collection for storage in which high-performance volumes reside
US20250307138A1 (en) * 2024-03-27 2025-10-02 International Business Machines Corporation Garbage collection at a storage device based on input/output access patterns at the storage device
CN121300715A (zh) * 2025-12-12 2026-01-09 珠海妙存科技有限公司 一种垃圾回收方法、电子设备以及存储介质

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105892941A (zh) * 2016-03-30 2016-08-24 联想(北京)有限公司 垃圾回收方法、垃圾回收装置和电子设备
CN107544754A (zh) * 2017-07-28 2018-01-05 紫光华山信息技术有限公司 一种垃圾回收法及装置

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8880775B2 (en) * 2008-06-20 2014-11-04 Seagate Technology Llc System and method of garbage collection in a memory device
CN102289412B (zh) 2011-09-07 2013-08-14 上海交通大学 固态硬盘的静态磨损均衡方法及系统
CN102841850B (zh) 2012-06-19 2016-04-20 记忆科技(深圳)有限公司 减小固态硬盘写放大的方法及系统
CN103902465B (zh) * 2014-03-19 2017-02-08 华为技术有限公司 一种固态硬盘垃圾回收的方法、系统和固态硬盘控制器
JP6414852B2 (ja) * 2015-12-14 2018-10-31 東芝メモリ株式会社 メモリシステムおよび制御方法
CN107484427B (zh) * 2016-04-07 2020-11-06 华为技术有限公司 用于处理存储设备中分条的方法和存储设备
KR102553170B1 (ko) * 2016-06-08 2023-07-10 에스케이하이닉스 주식회사 메모리 시스템 및 메모리 시스템의 동작 방법
CN106681935A (zh) * 2016-12-29 2017-05-17 郑州云海信息技术有限公司 一种固态硬盘垃圾回收方法

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105892941A (zh) * 2016-03-30 2016-08-24 联想(北京)有限公司 垃圾回收方法、垃圾回收装置和电子设备
CN107544754A (zh) * 2017-07-28 2018-01-05 紫光华山信息技术有限公司 一种垃圾回收法及装置

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP3588259A4 *

Also Published As

Publication number Publication date
US11704239B2 (en) 2023-07-18
EP3588259A4 (en) 2020-05-20
EP3588259A1 (en) 2020-01-01
US20200012598A1 (en) 2020-01-09
CN109496300B (zh) 2021-11-19
EP3588259B1 (en) 2021-06-23
CN109496300A (zh) 2019-03-19

Similar Documents

Publication Publication Date Title
WO2019178845A1 (zh) 一种存储介质垃圾回收方法、存储介质和程序产品
US10915442B2 (en) Managing block arrangement of super blocks
US11740801B1 (en) Cooperative flash management of storage device subdivisions
US10430084B2 (en) Multi-tiered memory with different metadata levels
TWI425357B (zh) 用來進行區塊管理之方法以及記憶裝置及控制器
US9665442B2 (en) Smart flushing of data to backup storage
CN107608908B (zh) 用于数据储存装置的磨损平均方法
US10580495B2 (en) Partial program operation of memory wordline
US10482969B2 (en) Programming to a correctable amount of errors
CN116881177A (zh) 固态存储驱动器阵列中的工作负荷自适应超额配置
US8738876B2 (en) Method for performing block management, and associated memory device and controller thereof
JP2008015769A (ja) ストレージシステム及び書き込み分散方法
CN115114180A (zh) 在快闪存储器中进行耗损平衡操作的方法和相关控制器以及储存系统
KR20200068941A (ko) 메모리 시스템 내 저장된 데이터를 제어하는 방법 및 장치
CN104298465A (zh) 固态储存装置中的区块分组方法
JP2019169101A (ja) 電子機器、コンピュータシステム、および制御方法
WO2015029102A1 (ja) ストレージ装置及び階層制御方法
CN110674056B (zh) 一种垃圾回收方法及装置
WO2019119833A1 (zh) 存储管理方法、装置、固态硬盘及可读存储介质
CN110658995A (zh) 一种固态硬盘及其配置数据管理方法、装置及存储介质
JP6531574B2 (ja) ストレージ装置、ストレージ装置制御プログラム及びストレージ装置制御方法
CN118778908A (zh) 一种虚拟块的管理方法以及应用了该方法的存储设备
CN106021124B (zh) 一种数据的存储方法及存储系统
CN115933964A (zh) 寿命周期感知的持久性存储
CN102637146B (zh) 用来进行区块管理的方法、记忆装置及其控制器

Legal Events

Date Code Title Description
ENP Entry into the national phase

Ref document number: 2018910234

Country of ref document: EP

Effective date: 20190924

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18910234

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE