CN117908781A - Track group dynamic address mapping method for shingled magnetic recording hard disk - Google Patents

Track group dynamic address mapping method for shingled magnetic recording hard disk Download PDF

Info

Publication number
CN117908781A
CN117908781A CN202311794910.7A CN202311794910A CN117908781A CN 117908781 A CN117908781 A CN 117908781A CN 202311794910 A CN202311794910 A CN 202311794910A CN 117908781 A CN117908781 A CN 117908781A
Authority
CN
China
Prior art keywords
track group
data
disk
address
track
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.)
Pending
Application number
CN202311794910.7A
Other languages
Chinese (zh)
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.)
Huanghuai University
Original Assignee
Huanghuai University
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 Huanghuai University filed Critical Huanghuai University
Priority to CN202311794910.7A priority Critical patent/CN117908781A/en
Publication of CN117908781A publication Critical patent/CN117908781A/en
Pending legal-status Critical Current

Links

Landscapes

  • Signal Processing For Digital Recording And Reproducing (AREA)

Abstract

The invention discloses a track group dynamic address mapping method for a shingled magnetic recording hard disk, which is characterized in that the track group is used as a unit to manage an address space, the whole shingled magnetic disk space is divided into a plurality of track groups, each track group comprises a plurality of tracks, and each track comprises a plurality of disk blocks. The track group is sequentially divided into three continuous areas, namely a tiled log area, an isolation area and a non-tiled area. The method uses the track group as a unit to manage the address space, and specifically comprises a writing algorithm, a reading algorithm and a garbage recycling algorithm. The track group dynamic address mapping method can effectively solve the read-write amplification problem of the current shingled disk and remarkably improve the read-write performance of the shingled disk.

Description

Track group dynamic address mapping method for shingled magnetic recording hard disk
Technical Field
The invention belongs to the technical field of computer storage equipment, and particularly relates to a track group dynamic address mapping method for a shingled magnetic recording hard disk.
Background
With the rapid development of new technologies such as artificial intelligence, big data, internet of things and the like, the data is explosively increased, and great challenges are provided for the capacity requirement of a storage system. How to meet the storage requirements of such large amounts of data is one of the serious problems faced by storage technology practitioners. Although solid state disks are increasingly used in storage systems to improve system performance, on the one hand, because of the limitation factors such as cost and lifetime, and on the other hand, mechanical hard disks still have advantages such as high capacity and low cost, so that solid state disks still cannot completely replace conventional mechanical hard disks. In the foreseeable future, solid state disks and mechanical hard disks will still be the two primary storage media in a storage system.
In order to further increase the storage capacity of conventional magnetic disks, new hard disk technologies different from conventional perpendicular magnetic recording are introduced by the major disk manufacturers' Seagate and western data race, including shingled magnetic recording hard disks (also called shingled disks), thermally assisted magnetic recording hard disks, microwave assisted magnetic recording hard disks, and the like. Among these new hard disk technologies, shingled disks are the most mature and most commercially available hard disk technology. The shingled magnetic disk is not fundamentally different from the traditional mechanical magnetic disk in hardware technology, and the magnetic track overlapping technology is adopted, so that the storage capacity can be improved by at least about 2.5 times under the same technical condition of the magnetic disk hardware, the magnetic disk capacity can be greatly improved in a very economical way, and the future storage system requirement can be met.
FIG. 1 shows a track layout of a conventional mechanical disk and shingled disk. There is a large enough space between each track in a conventional mechanical disk, and reading from and writing to each track does not affect the data on adjacent tracks, thus supporting random writing operations on the disk. In contrast, writing to any one track of a shingled disk destroys the data on the next track in the "shingled direction" due to the allowed overlap between tracks. Therefore, sequential writing to overlapping tracks must be performed in one direction (the watt direction), otherwise the just written data will be corrupted. When random writing modifies certain track data, the adjacent track data in the tile direction needs to be read, saved and written back for updating, thus a large amount of read-write amplification in the disk is caused, and the disk performance is reduced. To limit the amount of additional data read/write per update, the shingled disk is internally divided into fixed-size track groups (bands), and the disk space is managed in track groups, with tracks within the same track group being written sequentially only. To mask the write-limited nature of shingled disks, currently, a persistent cache of a certain size is typically used inside the shingled disk to absorb the newly written data, converting random write requests into sequential write requests along the shingled direction. When new data is written, the disk first detects whether the track group corresponding to the write request (according to the address mapping relationship) has been allocated with a buffer. If not, the buffer space is allocated, and then the data is written into the allocated persistent buffer space. If the persistent cache is not used, any track modification in a track group is to read the whole track group into the memory, update the content of the track group in the memory and write the whole track group back to the disk. This "read-modify-write-back" operation can produce a significant amount of read-write amplification, affecting disk performance. Assuming that a track group contains 10 tracks, when one of the tracks needs to be updated, 10 track data needs to be read and 10 track data is written back, resulting in a read-write magnification of 20. In general, the larger the track group, the larger the read-write magnification. To support persistent caching, an address mapping relationship module is maintained within the shingled disk to indicate whether the current track data is in persistent caching or on disk. This mapping module is called a "tile conversion layer" similar to the "flash conversion layer" in solid state disks. When processing a read request, the shingled disk first checks the shingled translation layer to determine if the requested data is in the cache. If the data is in the cache, returning the data in the cache, otherwise, reading the target track and returning the data.
Compared with the traditional mechanical hard disk, the shingled disk has a huge capacity advantage, can greatly reduce the construction cost of an enterprise data center, is becoming more and more concerned by the storage industry, and is mainly limited in large-scale application at present because of the performance problem caused by read-write amplification. Thus, there is a need for a track group dynamic address mapping method for shingled magnetic recording hard disks.
Disclosure of Invention
In order to solve the defects in the prior art, the invention aims to provide a track group dynamic address mapping method for a shingled magnetic recording hard disk, which can effectively solve the problem of read-write amplification of the current shingled magnetic disk and obviously improve the read-write performance of the shingled magnetic disk.
In order to achieve the above purpose, the technical scheme adopted by the invention is as follows:
A track group dynamic address mapping method for a shingled magnetic recording hard disk divides the whole shingled disk space into a plurality of track groups, each track group comprises a plurality of tracks, and each track comprises a plurality of disk blocks; sequentially dividing the track group into three continuous areas, namely a tiling log area, an isolation area and a non-tiling area;
The tiled log area is used as a log area of the track group, and a write request and a data update request of a host to the track group are sequentially written into the log area; the isolation area occupies the last-to-last magnetic track of the magnetic track group and is used for preventing the last magnetic track of the write log area from damaging magnetic track group metadata of the non-tiling area; the non-tiled area occupies the track at the rearmost of the track group and is used for storing the track group metadata;
The method takes a track group as a unit to manage an address space, and specifically comprises a writing algorithm, a reading algorithm and a garbage recycling algorithm; the writing algorithm is used for describing the operation steps when the host sends out a data writing request; the reading algorithm is used for describing the operation steps when the host sends out a data reading request; the garbage collection algorithm is used for garbage collection of the track group.
Further, the track group metadata comprises a mapping relation table supporting track group dynamic address mapping, a current position of a log pointer, the number of valid data blocks and the total number of data blocks;
the mapping relation table is used for establishing a dynamic mapping relation from a logical address to a physical address of a disk block in the track group;
the current position of the log pointer is used for pointing to a disk block which can be written with data next in a track group log area and represents the physical position allocated in the future of the next write request;
The number of the effective data blocks refers to the number of the physical disk blocks which are effectively mapped currently in the track group log area, namely the number of the disk blocks which are effectively stored in the track group log area;
The total number of data blocks refers to the total number of disk blocks included in the track group log area, but does not include disk bad blocks.
The log area of the track group is assumed to contain N disk blocks in total, and the physical addresses of the N disk blocks in the track group are sequentially 0,1, & gt, N-1, the logical address space of the track group is 0,1, & gt, N-1, and the mapping relation table contains N mapping pairs < LBA (X), PBA (Y) >; wherein, LBA (X), 0< = LBA (X) < = N-1, refer to the logical address in the logical address space of the track group; PBA (Y), -1< = PBA (X) < = N-1, which is a physical address to which logical address LBA (X) is dynamically mapped;
When the track group is free, the initial state of the mapping relation table is { <0, -1>, <1, -1>,., < N-1, -1> }, i.e., all logical addresses are mapped to-1 in sequence; when writing or updating the disk block with the logical address of LBA (X) in the track group, writing new data to the current position of the write pointer of the log area, and recording the physical address PBA (Y) of the disk block corresponding to the current position of the write pointer; the logical address LBA (X) new mapping < LBA (X), PBA (Y) > is then updated into the track group mapping table.
The mapping pairs < LBA (X), PBA (Y) > in the mapping relation table are orderly arranged from small to large in the size of LBA (X).
The writing algorithm specifically comprises the following steps:
When a host sends a data writing request, an existing in-disc address conversion mechanism of the shingled disc system can convert a disc logic address of the data writing request into a track block address; the track group block address includes track group number BA (Z) and disk block logical address LBA (X) in the track group, and the specific operation steps are as follows:
1) Reading the current position of a log pointer from a non-tiled area of a track group BA (Z), wherein the physical address of a disk block at the current position of the log pointer is PBA (Y);
2) Writing the data of the data writing request into a disk block with a physical address of PBA (Y) in a log area of a track group BA (Z);
3) Moving the current position of the log pointer forward to point to the next disk block;
4) Writing new mapping relation < LBA (X), PBA (Y) > of logical address LBA (X) into mapping relation table of track group BA (Z);
5) If the write data request is to write a new data block instead of updating the existing data, increasing the number of valid data blocks in the non-tiled area of track group PBA (Y) by 1;
6) And returning a write operation ending signal to the upper layer software.
The reading algorithm comprises the following steps:
When a host sends a data reading request, the existing in-disc address conversion mechanism of the shingled disc system can convert the disc logical address of the data reading request into a track block address, and the specific operation steps of the reading algorithm are as follows:
1) Reading a mapping relation table from a non-tiled area of a track group BA (Z), reading a value corresponding to a logic address LBA (X) from the mapping relation table, if the value is-1, returning an error signal to upper software, and ending, otherwise, setting the value as an effective physical address, and setting the physical address as PBA (Y);
2) And reading data in the disk block with the physical address of PBA (Y) in the log area of the track group BA (Z), and returning the data to upper software to finish.
The garbage collection algorithm comprises the following steps:
When garbage collection is required for the track group with the number of BA (Z), the specific operation steps of the garbage collection algorithm are as follows:
1) Reading a mapping relation table in a non-tiling area of the track group BA (Z) into a memory, calculating the number of mapping pairs with physical addresses not being-1 in the memory mapping relation table, and marking the number as m;
2) Creating an array of length m in memory, each element of the array being a blank record comprising two data items, an address for storing a logical address of a disk block and a data block for storing disk block data read from a log area of the track group;
3) Sequentially reading disk blocks in a log area of the track group BA (Z) from the head until the current position of the log pointer; for each read disk block, if the physical address PBA (Y) of the read disk block is recorded as < LBA (X), PBA (Y) >, writing the LBA (X) and the data read from the disk block into the address and the data block of the blank record of the memory array respectively, otherwise discarding the read data;
4) Ordering the elements in the memory array from small to large according to the address items, and ensuring that the elements in the memory array are arranged according to the ascending order of the addresses;
5) Positioning a write pointer to the head of the track group BA (Z) log area, and starting to write back data sequentially;
6) After all the data blocks in the memory array are written into the log area, the current position of the write pointer is recorded, and the current position of the log pointer in the non-tiling area of the track group BA (Z) is updated to be the current position of the write pointer;
7) Writing the memory mapping relation table update into the mapping relation table in the non-tiling area of the track group BA (Z);
8) And deleting the memory mapping table and the memory array and ending.
The step 5) in the garbage collection algorithm is specifically as follows: writing data blocks in the memory array into a track group BA (Z) log area sequentially from the first element of the memory array; for each data block written, the address LBA (X) of the data block within the memory array is written and the physical address PBA (Y) written to the log area is written, and then the mapping pair < LBA (X), PBA (Y) > update is written into the memory mapping table.
The invention has the beneficial effects that:
1. the invention converts the data writing or data updating operation of the shingled disk into the sequential writing operation of the track group log area, effectively solves the problem of reading and writing amplification caused by the data updating of the traditional shingled disk, and obviously improves the reading and writing performance of the shingled disk.
2. The invention adds a layer of dynamic address mapping relation in the track group, and does not change the address mapping relation from the upper host to the disk, so that the original upper software system is not required to be modified. Meanwhile, the hardware structure of the disk is not required to be changed, and software for realizing the invention is only required to be added on the tile conversion layer of the shingled disk.
3. The track group garbage collection mechanism provided by the invention has low cost, garbage collection is not on the data read-write path of the host, and the read-write performance of the system is not affected.
4. The invention supports the mapping relation table of the track group dynamic address mapping and other metadata only occupies the last track of the track group, and the metadata storage cost is small.
Drawings
FIG. 1 is a schematic diagram of track structures of a conventional disk and a shingled disk;
FIG. 2 is a diagram of a track group based dynamic address mapping scheme in accordance with the present invention;
FIG. 3 is a diagram of the track group metadata content organization of the present invention.
Detailed Description
The principles and features of the present invention are described below with reference to the drawings, the examples are provided for illustration only and are not intended to limit the scope of the invention.
Current shingled disk systems employ static address mapping within a track group, and the logical address of a disk block within a track group is its physical address within that track group. Such static address mapping cannot avoid a "read-modify-write-back" operation when it is necessary to update the data that has been written.
The invention provides a track group dynamic address mapping method for a shingled magnetic recording hard disk, which uses a track group as a unit to carry out address space allocation management, and the mapping relation between the original magnetic disk logical address and the track group is kept unchanged. As shown in FIG. 2, the original mapping relationship from the disk logical address to the track group is realized by the existing in-disk address conversion mechanism, which establishes the mapping between the disk logical address to the disk block logical address in the track group. The logical address of the disk is the logical number of the disk blocks contained in the disk, and if the disk contains N disk blocks, the logical number of the disk blocks is from 0 to N-1. The present invention employs dynamic address mapping within each track group, that is, the logical address of a disk block within a track group is not necessarily the physical address of the disk block within that track group.
The method divides the overall shingled disk space into a plurality of track groups, each track group comprising a plurality of tracks, each track comprising a plurality of disk blocks.
Assuming that a track group contains n+1 (T 0,T1,…,TN) tracks, the first N-1 (T 0-TN-2) tracks serve as a log area into which new data is written sequentially when writing data blocks within the track group. After the data is written into the log area, the new mapping is updated into the mapping table on the last track T N. The penultimate track T N-1 remains free as a safe isolation region for the last track T N.
The disk block is a data read-write basic unit of the disk, and the host accesses the data block from the disk by taking the disk block as a unit. The invention divides the track group into three continuous areas in sequence, namely a tiling log area, an isolation area and a non-tiling area.
The tiled log area serves as a log area for the track group to which write requests and data update requests by the host are sequentially written. The isolation region is between the tiled log region and the non-tiled region, occupies the next-to-last track of the track group, and prevents the last track of the write log region from damaging the track group metadata of the non-tiled region. The non-tiled area occupies the last track of the track group for storing track group metadata.
Assuming a track group size of 64MB, each track is 64KB, and each disk block is 4KB. Each track group contains 16K (64 MB/4 KB) disk blocks and therefore 14 bits are required to represent the group physical block address. The set of physical block addresses refers to the physical addresses of the disk blocks within the track set. If the group physical block address is expressed in two bytes, the space required for the mapping relationship table in one track group is 32KB (16 K×2B). Plus some other metadata information, a track of 64KB is sufficient to store track component data. The non-tiled area can occupy only the last track in the track group that supports random write operations.
As shown in FIG. 3, the track group metadata includes a mapping relationship table supporting track group dynamic address mapping, a current position of a log pointer, a number of valid data blocks, and a total number of data blocks.
The mapping relation table is used for establishing a dynamic mapping relation from a logical address to a physical address of a disk block in the track group. The current position of the log pointer is used to point to the next writable disk block in the track group log area, indicating the physical location to which the next write request will be allocated in the future. The number of valid data blocks refers to the number of physical disk blocks in the track group log area that are currently being effectively mapped, i.e., the number of disk blocks in the track group log area that currently store valid data. The total number of data blocks refers to the total number of disk blocks included in the track group log area, but does not include disk bad blocks.
Assuming that the log area of the track group contains N disk blocks in total, the physical addresses of the N disk blocks in the track group are sequentially 0, 1.
Wherein LBA (X) (0 < = LBA (X) < = N-1) refers to a logical address in the logical address space of the track group; PBA (Y) (-1 < = PBA (X) < = N-1) is the physical address to which the logical address LBA (X) is dynamically mapped. Mapping pairs < LBA (X) > in the mapping table, PBA (Y) > are ordered from small to large in the size of LBA (X).
The track space within the same track group is used as a log area, thus ensuring that the track space is written sequentially. This method only changes the mapping relationship of the data blocks within each track group, while the relationship of the disk logical address mapping to the track group remains unchanged.
When the track group is free, the initial state of the mapping relation table is { <0, -1>, <1, -1>,.+ -, < N-1, -1> }, i.e., all logical addresses are mapped to-1 in sequence. When writing or updating the disk block with the logical address of LBA (X) in the track group, writing new data to the current position of the write pointer of the log area, and recording the physical address PBA (Y) of the disk block corresponding to the current position of the write pointer (0 < = PBA (Y) < = N-1); the logical address LBA (X) new mapping < LBA (X), PBA (Y) > is then updated into the track group mapping table.
The mapping table is stored on the last track of the set of tracks to support a random update operation of the mapping. Because the invention positions the operation of writing the new data block or updating the old data block to the current writing pointer position of the log area, the operation does not destroy the existing data, thereby effectively avoiding the read-write amplification problem caused by the need of the read-modify-write-back operation when the data of the traditional shingled disk is updated. The mapping relation table supporting the track group dynamic address mapping and other metadata only occupy the last track of the track group, and the metadata storage cost is low.
The track group dynamic address mapping method is used for carrying out address space management by taking a track group as a unit, and specifically comprises a writing algorithm, a reading algorithm and a garbage recycling algorithm.
The write algorithm is used to describe the steps of operation when the host issues a write data request. When a write data request is issued by a host, the disk logical address of the write data request is converted to a track chunk address by an existing in-disk address conversion mechanism of the shingled disk system (BLBA). The track group block address includes a track group number and a disk block logical address (LBA) within the track group. Assuming that the track group number of the write data request is BA (Z) and the logical address of the disk block in the track group is LBA (X), the operation steps of the write algorithm are as follows:
1) Reading the current position of a log pointer from a non-tiled area of a track group BA (Z), wherein the physical address of a disk block at the current position of the log pointer is PBA (Y);
2) Writing the data of the data writing request into a disk block with a physical address of PBA (Y) in a log area of a track group BA (Z);
3) Moving the current position of the log pointer forward to point to the next disk block;
4) Writing new mapping relation < LBA (X), PBA (Y) > of logical address LBA (X) into mapping relation table of track group BA (Z);
5) If the write data request is to write a new data block instead of updating the existing data, increasing the number of valid data blocks in the non-tiled area of track group PBA (Y) by 1;
6) And returning a write operation ending signal to the upper layer software.
The invention converts the data writing or data updating operation of the shingled disk into the sequential writing operation of the track group log area, effectively solves the problem of reading and writing amplification caused by the data updating of the traditional shingled disk, and obviously improves the reading and writing performance of the shingled disk.
The read algorithm is used to describe the steps of operation when the host issues a read data request. When a read data request is issued by a host, the disk logical address of the read data request is converted to a track chunk address by the existing in-disk address conversion mechanism of the shingled disk system (BLBA). The track group block address includes a track group number and a disk block logical address (LBA) within the track group.
Assuming that the track group number of the read data request is BA (Z) and the logical address of the disk block in the track group is LBA (X), the read algorithm operates as follows:
1) Reading a mapping relation table from a non-tiled area of a track group BA (Z), reading a value corresponding to a logic address LBA (X) from the mapping relation table, if the value is-1, returning an error signal to upper software, and ending, otherwise, setting the value as an effective physical address, and setting the physical address as PBA (Y);
2) And reading data in the disk block with the physical address of PBA (Y) in the log area of the track group BA (Z), and returning the data to upper software to finish.
In addition to maintaining the track group dynamic address mapping relationship, the invention provides a garbage collection algorithm suitable for the track group to be used as a log area. The garbage collection algorithm operates on track group units for track group garbage collection. This garbage collection mechanism is much less costly than conventional persistent cache flush operations because it only requires reading valid data blocks within a track group and then sequentially writing back to the log area from the head, garbage collection is not on the host's data read-write path, and does not affect the system's read-write performance.
When garbage collection is required for track group number BA (Z), the garbage collection algorithm operates as follows:
1) Reading a mapping relation table in a non-tiling area of the track group BA (Z) into a memory, calculating the number of mapping pairs with physical addresses not being-1 in the memory mapping relation table, and marking the number as m;
2) Creating an array of length m in memory, each element of the array being a blank record comprising two data items, an address for storing a logical address of a disk block and a data block for storing disk block data read from a log area of the track group;
3) Sequentially reading disk blocks in a log area of the track group BA (Z) from the head until the current position of the log pointer; for each read disk block, if the physical address PBA (Y) of the read disk block is recorded as < LBA (X), PBA (Y) >, writing the LBA (X) and the data read from the disk block into the address and the data block of the blank record of the memory array respectively, otherwise discarding the read data;
4) Ordering the elements in the memory array from small to large according to the address items, and ensuring that the elements in the memory array are arranged according to the ascending order of the addresses;
5) The write pointer is positioned to the head of the track group BA (Z) log area, starting to write back data sequentially. Specifically, starting from the first element of the memory array, writing the data blocks in the memory array into the track group BA (Z) log area in sequence; for each written data block, address LBA (X) of the data block in the memory array and physical address PBA (Y) written to the log area are recorded, and then mapping pair < LBA (X), PBA (Y) > update is written into the memory mapping table;
6) After all the data blocks in the memory array are written into the log area, the current position of the write pointer is recorded, and the current position of the log pointer in the non-tiling area of the track group BA (Z) is updated to be the current position of the write pointer;
7) Writing the memory mapping relation table update into the mapping relation table in the non-tiling area of the track group BA (Z);
8) And deleting the memory mapping table and the memory array and ending.
The garbage collection algorithm operation provided by the invention can be performed in the background, so that the garbage collection operation is ensured not to be on the path of a host computer for reading and writing a disk, and the reading and writing performance of the disk is not affected. The garbage collection algorithm only relates to sequential reading and writing of the shingled disk, so that the problem of reading and writing amplification is avoided, and the garbage collection cost is low. In practical implementation, the garbage collection time can be selected according to the utilization rate of the track group.
Assuming that the track group contains a total number of data blocks, and a number of valid data blocks, w and u, respectively, the current usage of the track group may be denoted as u/w. u/w may be used as a reference whether to trigger garbage collection. When the log area is used up quickly (the current position of the log pointer is close to the tail of the track group) and the utilization rate of the track group is low, the track group is repeatedly modified, namely, the write operation access to the track group shows better space locality, and garbage collection should be performed on the track group. Otherwise, the actual occupancy rate of the upper layer application to the track group is high, and the whole track group basically contains valid application data.
It should be noted that using the shingled disk of the present invention may reduce disk utilization, but this is controllable and does not offset the capacity advantage of the shingled disk because once a track group is quickly full and the utilization is not very high (a threshold, such as 90%, may be set), the system automatically initiates the garbage collection process to collect space for the track group in the background. In addition, shingled disks employing the present invention may increase the seek overhead of a read operation, however, such read operation overhead may be well controlled and eliminated.
Firstly, in the invention, the extra reading operation seeking cost is mainly caused by the fact that the upper layer application presents better space locality to the writing operation access of the track group, and the garbage collection of the track group is automatically triggered in the situation, after garbage collection, the physical addresses of the data in the track group are orderly arranged according to the order of the logical addresses, thereby being more beneficial to the sequential reading operation. Second, the present invention does not preclude the use of persistent caching mechanisms or other caching mechanisms to improve disk read performance.
It is apparent that the above-described embodiments are only some embodiments of the present application, but not all embodiments, and the preferred embodiments of the present application are shown in the drawings, which do not limit the scope of the patent claims. This application may be embodied in many different forms, but rather, embodiments are provided in order to provide a thorough and complete understanding of the present disclosure. Although the application has been described in detail with reference to the foregoing embodiments, it will be apparent to those skilled in the art that modifications may be made to the embodiments described in the foregoing description, or equivalents may be substituted for elements thereof. All equivalent structures made by the content of the specification and the drawings of the application are directly or indirectly applied to other related technical fields, and are also within the scope of the application.

Claims (8)

1. A track group dynamic address mapping method for a shingled magnetic recording hard disk is characterized in that: dividing the whole shingled disk space into a plurality of track groups, wherein each track group comprises a plurality of tracks, and each track comprises a plurality of disk blocks; sequentially dividing the track group into three continuous areas, namely a tiling log area, an isolation area and a non-tiling area;
The tiled log area is used as a log area of the track group, and a write request and a data update request of a host to the track group are sequentially written into the log area; the isolation area occupies the last-to-last magnetic track of the magnetic track group and is used for preventing the last magnetic track of the write log area from damaging magnetic track group metadata of the non-tiling area; the non-tiled area occupies the track at the rearmost of the track group and is used for storing the track group metadata;
The method takes a track group as a unit to manage an address space, and specifically comprises a writing algorithm, a reading algorithm and a garbage recycling algorithm; the writing algorithm is used for describing the operation steps when the host sends out a data writing request; the reading algorithm is used for describing the operation steps when the host sends out a data reading request; the garbage collection algorithm is used for garbage collection of the track group.
2. The track group dynamic address mapping method for a shingled magnetic recording hard disk according to claim 1 wherein: the track group metadata comprises a mapping relation table supporting track group dynamic address mapping, a current position of a log pointer, the number of effective data blocks and the total number of data blocks;
the mapping relation table is used for establishing a dynamic mapping relation from a logical address to a physical address of a disk block in the track group;
the current position of the log pointer is used for pointing to a disk block which can be written with data next in a track group log area and represents the physical position allocated in the future of the next write request;
The number of the effective data blocks refers to the number of the physical disk blocks which are effectively mapped currently in the track group log area, namely the number of the disk blocks which are effectively stored in the track group log area;
The total number of data blocks refers to the total number of disk blocks included in the track group log area, but does not include disk bad blocks.
3. The track group dynamic address mapping method for a shingled magnetic recording hard disk according to claim 2 wherein: the log area of the track group is assumed to contain N disk blocks in total, and the physical addresses of the N disk blocks in the track group are sequentially 0, 1..N-1, the logical address space of the track group is 0, 1..N-1, and the mapping relation table contains N mapping pairs < LBA (X), PBA (Y) >; wherein, LBA (X), 0< = LBA (X) < = N-1, refer to the logical address in the logical address space of the track group; PBA (Y), -1< = PBA (X) < = N-1, which is a physical address to which logical address LBA (X) is dynamically mapped;
When the track group is free, the initial state of the mapping relation table is { <0, -1>, <1, -1>,., < N-1, -1> }, i.e., all logical addresses are mapped to-1 in sequence; when writing or updating the disk block with the logical address of LBA (X) in the track group, writing new data to the current position of the write pointer of the log area, and recording the physical address PBA (Y) of the disk block corresponding to the current position of the write pointer; the logical address LBA (X) new mapping < LBA (X), PBA (Y) > is then updated into the track group mapping table.
4. The track group dynamic address mapping method for a shingled magnetic recording hard disk according to claim 3 wherein: the mapping pairs < LBA (X), PBA (Y) > in the mapping relation table are orderly arranged from small to large in the size of LBA (X).
5. The track group dynamic address mapping method for a shingled magnetic recording hard disk according to claim 1 wherein: the writing algorithm includes:
When a host sends a data writing request, an existing in-disc address conversion mechanism of the shingled disc system can convert a disc logic address of the data writing request into a track block address; the track group block address includes track group number BA (Z) and disk block logical address LBA (X) in the track group, and the specific operation steps are as follows:
1) Reading the current position of a log pointer from a non-tiled area of a track group BA (Z), wherein the physical address of a disk block at the current position of the log pointer is PBA (Y);
2) Writing the data of the data writing request into a disk block with a physical address of PBA (Y) in a log area of a track group BA (Z);
3) Moving the current position of the log pointer forward to point to the next disk block;
4) Writing new mapping relation < LBA (X), PBA (Y) > of logical address LBA (X) into mapping relation table of track group BA (Z);
5) If the write data request is to write a new data block instead of updating the existing data, increasing the number of valid data blocks in the non-tiled area of track group PBA (Y) by 1;
6) And returning a write operation ending signal to the upper layer software.
6. The track group dynamic address mapping method for a shingled magnetic recording hard disk according to claim 1 wherein: the reading algorithm comprises the following steps:
When a host sends a data reading request, the existing in-disc address conversion mechanism of the shingled disc system can convert the disc logical address of the data reading request into a track block address, and the specific operation steps of the reading algorithm are as follows:
1) Reading a mapping relation table from a non-tiled area of a track group BA (Z), reading a value corresponding to a logic address LBA (X) from the mapping relation table, if the value is-1, returning an error signal to upper software, and ending, otherwise, setting the value as an effective physical address, and setting the physical address as PBA (Y);
2) And reading data in the disk block with the physical address of PBA (Y) in the log area of the track group BA (Z), and returning the data to upper software to finish.
7. The track group dynamic address mapping method for a shingled magnetic recording hard disk according to claim 1 wherein: the garbage collection algorithm comprises the following steps:
When garbage collection is required for the track group with the number of BA (Z), the specific operation steps of the garbage collection algorithm are as follows:
1) Reading a mapping relation table in a non-tiling area of the track group BA (Z) into a memory, calculating the number of mapping pairs with physical addresses not being-1 in the memory mapping relation table, and marking the number as m;
2) Creating an array of length m in memory, each element of the array being a blank record comprising two data items, an address for storing a logical address of a disk block and a data block for storing disk block data read from a log area of the track group;
3) Sequentially reading disk blocks in a log area of the track group BA (Z) from the head until the current position of the log pointer; for each read disk block, if the physical address PBA (Y) of the read disk block is recorded as < LBA (X), PBA (Y) >, writing the LBA (X) and the data read from the disk block into the address and the data block of the blank record of the memory array respectively, otherwise discarding the read data;
4) Ordering the elements in the memory array from small to large according to the address items, and ensuring that the elements in the memory array are arranged according to the ascending order of the addresses;
5) Positioning a write pointer to the head of the track group BA (Z) log area, and starting to write back data sequentially;
6) After all the data blocks in the memory array are written into the log area, the current position of the write pointer is recorded, and the current position of the log pointer in the non-tiling area of the track group BA (Z) is updated to be the current position of the write pointer;
7) Writing the memory mapping relation table update into the mapping relation table in the non-tiling area of the track group BA (Z);
8) And deleting the memory mapping table and the memory array and ending.
8. The track group dynamic address mapping method for a shingled magnetic recording hard disk of claim 7, wherein: the step 5) in the garbage collection algorithm is specifically as follows: writing data blocks in the memory array into a track group BA (Z) log area sequentially from the first element of the memory array; for each data block written, the address LBA (X) of the data block within the memory array is written and the physical address PBA (Y) written to the log area is written, and then the mapping pair < LBA (X), PBA (Y) > update is written into the memory mapping table.
CN202311794910.7A 2023-12-25 2023-12-25 Track group dynamic address mapping method for shingled magnetic recording hard disk Pending CN117908781A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311794910.7A CN117908781A (en) 2023-12-25 2023-12-25 Track group dynamic address mapping method for shingled magnetic recording hard disk

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311794910.7A CN117908781A (en) 2023-12-25 2023-12-25 Track group dynamic address mapping method for shingled magnetic recording hard disk

Publications (1)

Publication Number Publication Date
CN117908781A true CN117908781A (en) 2024-04-19

Family

ID=90690124

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311794910.7A Pending CN117908781A (en) 2023-12-25 2023-12-25 Track group dynamic address mapping method for shingled magnetic recording hard disk

Country Status (1)

Country Link
CN (1) CN117908781A (en)

Similar Documents

Publication Publication Date Title
US20240126433A1 (en) Method of controlling nonvolatile semiconductor memory
US8756382B1 (en) Method for file based shingled data storage utilizing multiple media types
JP3697149B2 (en) How to manage cache memory
US8898371B2 (en) Accessing logical-to-physical address translation data for solid state disks
US7761655B2 (en) Storage system and method of preventing deterioration of write performance in storage system
US5420983A (en) Method for merging memory blocks, fetching associated disk chunk, merging memory blocks with the disk chunk, and writing the merged data
US20100325352A1 (en) Hierarchically structured mass storage device and method
US10061704B2 (en) Systems and methods for managing cache of a data storage device
US20110161557A1 (en) Distributed media cache for data storage systems
US9804786B2 (en) Sector translation layer for hard disk drives
US20100293337A1 (en) Systems and methods of tiered caching
CN107924291B (en) Storage system
WO2015076354A1 (en) Storage device, method, and program
CN103838853B (en) Mixed file system based on different storage media
CN105955664B (en) A kind of reading/writing method of watt record conversion layer based on segment structure
US10394493B2 (en) Managing shingled magnetic recording (SMR) zones in a hybrid storage device
US10152236B2 (en) Hybrid data storage device with partitioned local memory
US20100070733A1 (en) System and method of allocating memory locations
CN114356246B (en) Storage management method and device for SSD internal data, storage medium and SSD device
US20140258591A1 (en) Data storage and retrieval in a hybrid drive
CN117908781A (en) Track group dynamic address mapping method for shingled magnetic recording hard disk
CN111580752B (en) Data storage method, device, computer program and storage medium
US11275684B1 (en) Media read cache
US11263132B2 (en) Method and system for facilitating log-structure data organization
JPS6154547A (en) Data processing system with 3-level hierarchical memory

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication