WO2019015479A1 - 在固态硬盘的ftl实现数据拷贝的方法、***及固态硬盘 - Google Patents

在固态硬盘的ftl实现数据拷贝的方法、***及固态硬盘 Download PDF

Info

Publication number
WO2019015479A1
WO2019015479A1 PCT/CN2018/094548 CN2018094548W WO2019015479A1 WO 2019015479 A1 WO2019015479 A1 WO 2019015479A1 CN 2018094548 W CN2018094548 W CN 2018094548W WO 2019015479 A1 WO2019015479 A1 WO 2019015479A1
Authority
WO
WIPO (PCT)
Prior art keywords
address
mapping table
copy
ladest
pasrc
Prior art date
Application number
PCT/CN2018/094548
Other languages
English (en)
French (fr)
Inventor
江松
杨庆
Original Assignee
深圳大普微电子科技有限公司
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 深圳大普微电子科技有限公司 filed Critical 深圳大普微电子科技有限公司
Publication of WO2019015479A1 publication Critical patent/WO2019015479A1/zh
Priority to US16/711,418 priority Critical patent/US20200117368A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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; CALCULATING OR 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; CALCULATING OR 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/0866Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches for peripheral storage systems, e.g. disk cache
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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/061Improving I/O performance
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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/0614Improving the reliability of storage systems
    • G06F3/0616Improving the reliability of storage systems in relation to life time, e.g. increasing Mean Time Between Failures [MTBF]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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; CALCULATING OR 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; CALCULATING OR 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/7201Logical to physical mapping or translation of blocks or pages
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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; CALCULATING OR 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/7211Wear leveling

Definitions

  • the present application relates to the field of solid state hard disk technologies, and in particular, to a method, a system, and a solid state hard disk for realizing data copying in an FTL of a solid state hard disk.
  • SSD Solid State Drives
  • flash translation layer Flash translation layer
  • the existing SSDs cannot meet the data replication requirements of the existing applications and system programs, and require the CPU and memory on the host to participate in physical copying of data, including actual readout from the SSD and to the SSD.
  • Write
  • Physical data replication causes excessive copying, which wastes the read/write bandwidth of the SSD and the CPU
  • To ensure data persistence and consistency After the write operation, the SSD is often issued with the FLUSH command, but the FL USH command is very exhausting, which will degrade the performance of the SSD, and the write operation to the SSD will shorten the life of the SSD.
  • the technical problem to be solved by the present application is to provide a method, a system, and a solid state hard disk for realizing data copying in a FTL of a solid state hard disk, which greatly reduces unnecessary write operations in the solid state hard disk, thereby reducing the copy space. It extends the life of the solid state drive and improves data reliability.
  • a method for implementing data copying in an FTL of a solid state drive comprising: [0011]
  • the modifying the address mapping table and the reverse address mapping table according to the copy-free copy command, completing the copy-free copy of the data includes:
  • FTL searches the address mapping table to determine whether the target logical address LAdest has been mapped to a physical address PAdest, and if not, finds the physical address P Asrc corresponding to the source logical address LAsrc on the address mapping table, and The physical address PAsrc is used as the physical address of the target logical address LAdest, that is, (LAdest, PAsrc) is written into the address mapping table; if so, the flash page on the physical address PAdest is discarded, and the source is found on the address mapping table.
  • the physical address PAsrc corresponding to the logical address LAsrc, and the physical address PAsrc is taken as the physical address of the target logical address LAdest, that is, (LAdest, PAsrc) is written into the address mapping table;
  • the non-copy copy command sent by the receiving software to the SSD is specifically: the receiving software sends a copy-free copy command sent to the SSD through an operating system call.
  • mapping from the physical address PAdest to the plurality of logical addresses LAi constitutes a reverse address mapping table, and the reverse address mapping table is maintained.
  • the N is called the mapping count
  • the FTL is in the garbage. Collecting, static wear balance, if the logical address or physical address involved is in the reverse address mapping table, the address mapping table and the reverse address mapping table are updated accordingly.
  • a system for implementing data copying in an FTL of a solid state drive comprising: [0020] a mapping table maintenance module, maintaining an address mapping table of a logical address LA to a physical address PA;
  • the mapping from the physical address PAde st to the plurality of logical addresses LAi constitutes a reverse address mapping table, and the reverse address mapping table is maintained, and N is called a mapping count;
  • the command receiving module is configured to receive a copy-free copy command sent by the software to the SSD, where the copy-free copy command includes the copied source logical address LAsr C , the target logical address LAdest, and the number of data blocks M to be copied;
  • a modification module configured to modify the address mapping table and the reverse address mapping table according to the copy-free copy command, to point the target logical address LAdest to the physical address to which the source logical address LAsrc is mapped, to complete the dataless Copy the copy.
  • modification module is specifically configured to:
  • the physical address PAsrc corresponding to the logical address LAsrc, and the physical address P Asrc is taken as the physical address of the target logical address LAdest, that is, (LAdest, PAsrc) is written into the address mapping table;
  • the non-copy copy command sent by the receiving software to the SSD is specifically: the receiving software calls the non-copy copy command sent to the SSD through an operating system call.
  • the modifying module is further configured to: perform garbage collection, static wear balancing, and if the logical address or physical address involved is in the reverse address mapping table, then the address mapping table and the reverse address The mapping table is updated accordingly.
  • the third aspect provides a solid state hard disk, and the FTL of the solid state hard disk is used to perform the following steps:
  • the mapping of LAi constitutes a reverse address mapping table, and the reverse address mapping table is maintained, and N is called a mapping count.
  • the modifying the address mapping table and the reverse address mapping table according to the copy-free copy command to complete the copy-free copy of the data includes:
  • FTL searches the address mapping table to determine whether the target logical address LAdest has been mapped to a physical address PAdest, and if not, finds the physical address P Asrc corresponding to the source logical address LAsrc on the address mapping table, and The physical address PAsrc is used as the physical address of the target logical address LAdest, that is, (LAdest, PAsrc) is written into the address mapping table; if so, the flash page on the physical address PAdest is discarded, and the source is found on the address mapping table.
  • the physical address PAsrc corresponding to the logical address LAsrc, and the physical address PAsrc is taken as the physical address of the target logical address LAdest, that is, (LAdest, PAsrc) is written into the address mapping table;
  • the present application maintains an address mapping table of a logical address LA to a physical address PA, and a mapping of a physical address PAdest and a plurality of logical addresses LAi.
  • the reverse address mapping table composed of the relationship, when the SSD needs to be copied, according to the source logical address LAsrc, the target logical address LAdest, and the number of data blocks to be copied in the copy-free copy command, the address mapping table and the reverse address
  • the mapping table is modified to point the copied logical address to the source logically
  • the physical logical address to which the address is mapped can be, so that the access to the target logical address will obtain the same data as the source logical address, and the data does not need to be physically copied, thereby greatly reducing the unnecessary write operation in the solid state hard disk, thereby Reduces copy space, extends the life of SSDs, and increases data reliability.
  • FIG. 1 is a flow chart of a method for implementing an embodiment of a method for copying data in an FTL of a solid state drive provided in an embodiment of the present application.
  • FIG. 2 is a flowchart of a method for implementing another method for implementing data copying in an FTL of a solid state drive according to an embodiment of the present application.
  • FIG. 3 is a structural block diagram of an embodiment of a system for implementing data copying in an FTL of a solid state drive according to an embodiment of the present application.
  • FIG. 1 is a flowchart of a method of a first embodiment of a method for implementing data copying of an FTL of a solid state drive provided in an embodiment of the present application.
  • the method includes steps S101 to S103, as follows:
  • the mapping to multiple logical addresses LAi constitutes a reverse address mapping table, and the reverse address mapping table is maintained, and N is called a mapping count.
  • Step S102 Receive a copy-free copy command sent by the software to the SSD, where the copy-free copy command includes the copied source logical address LAsrc, the target logical address LAdest, and the number of data blocks to be copied M, M is a positive integer. .
  • the software includes an application in the host and system software in the operating system.
  • the copy-free copy command sent by the receiving software to the SSD is specifically:
  • the receiving software sends a copy-free copy command to the SSD through an operating system call, which is for the application, and the application needs to copy through the operating system call.
  • the copy command is sent to the FTL.
  • Step S103 Modify the address mapping table and the reverse address mapping table according to the copy-free copy command to point the target logical address LAdest to the physical address to which the source logical address LAsrc is mapped, to complete the copy-free copy of the data. .
  • step S103: modifying the address mapping table and the reverse address mapping table according to the copy-free copy command, and completing the copy-free copy of the data includes:
  • Step S1031 The FTL searches the address mapping table to determine whether the target logical address LAdest has been mapped to a physical address PAdest, and if not, finds the physical address PAsrc corresponding to the source logical address LAsrc on the address mapping table. And the physical address PAsrc is taken as the physical address of the target logical address LAdest, that is, (LAdest, PAsrc) is written into the address mapping table; if so, the flash page on the physical address PAdest is discarded (if it is a physical page address, The flash page on the physical page address is invalidated. It should be noted that the flash does not support direct page modification or deletion.
  • the physical address PAsrc corresponding to the source logical address LAsrc is detected on the address mapping table, and the physical address PAsrc is used as the physical address of the target logical address LAdest, that is, (LAdest, PAsrc) is written Said in the address mapping table.
  • the reverse address mapping table cannot be lost due to an accident such as a sudden power failure, and it is necessary to use an ultra-capacitor or a limited power of the battery to write back urgently after an accident occurs. Considering that limited power can only be written back in a small amount of data, and the DRAM capacity in the SSD is limited, the reverse address mapping table needs to be limited to a certain size. To this end, the reverse address mapping table can be narrowed by adopting the following two methods. : (1) Write it back periodically to ensure that the size of the dirty page in the DRAM is within the allowable range; (2) Periodically count the entry with the mapping count of 1 from the opposite Remove from the address mapping table. If necessary, logical pages associated with physical pages with map counts N ⁇ 1 are written to different physical pages, respectively, thereby reducing their mapping count to 1 and being deleted.
  • Step S1032 According to the number of data blocks M to be copied, (LAdest+l, PAsrc+l), (LAdest+2, PAsrc+2), (LAdest+M-1, PAsrc+M-1) Write to the address mapping table to complete a copy-free copy of the data.
  • FIG. 2 is a flowchart of a method for implementing another method for implementing data copying in an FTL of a solid state drive according to an embodiment of the present application.
  • the mapping from the physical address PAdest to the plurality of logical addresses LAi constitutes a reverse address mapping table, and the reverse address mapping table is maintained.
  • the method further includes step S104: the FTL is performing garbage collection and static wear balancing. If the logical address or physical address involved is in the reverse address mapping table, the address mapping table and the reverse address mapping table are updated accordingly. In this way, when the mapping relationship between the logical address and the physical address changes, the address mapping table and the reverse address mapping table can be updated to ensure the accuracy of data replication.
  • the FTL maintains an address mapping table of a logical block address LBA to a physical block address PBA; the FTL searches the address mapping table to determine whether the target block address LBAdest has been mapped to a physical block address PBAdest, if not Finding the physical address PB Asrc of the source address LB Asrc corresponding to the target block address LBAdest on the address mapping table, and using the physical address PB Asrc as the physical block address of the target logical block address LB Ad est, ie (LBAdest, PBAsrc) is written in the address mapping table; if so, the flash block on the physical block address PBAdest is discarded, and the physical block of the source logical block address LB Asrc corresponding to the target logical block address LBAdest is found on the address mapping table.
  • N> 1 the physical block address PBAdest and the logical block address LB Ai mapping relationship constitute a reverse address mapping table, N is called the mapping count, each physical block address PBAdest in the reverse address mapping table maintains a The map counts N.
  • the copied source data and the target data are the same, and the data is not used as a physical copy, and only the mapping relationship of the address may be modified.
  • the specific method is: pointing the target logical address of the copy
  • the physical logical address to which the source logical address is mapped can be, so that the access to the target logical address will obtain the same data as the source logical address, and the function has a copy effect.
  • S SD read or write
  • this unit is usually called a block.
  • data is also read and written from its internal flash memory in a certain data unit. This unit is usually called a page. These two units may not be the same size, but they do not affect our design. So for the sake of understanding, they can be considered as big.
  • a zero-copy-free copy-free copy command can be provided to an application through an operating system call, and a large number of various applications and system programs can be greatly improved using this operating system call or no copy copy command.
  • Performance replace the physical copy of the original data read and written in the two steps on the solid state disk with a system call or copy-free copy command without copy copy.
  • the copy-free copy command can be applied to the following application scenarios: 1. Log operation in the database or file system; 2. File write operation in OverlayFS/UnionFS supporting the Container virtual execution environment; 3. De-fragmentation operation of the SSD disk; 4 Add or reduce block operations in files; 5.
  • Implement block-level de-duplication software Using a copy-free copy can greatly improve the performance of the software. In addition to providing I/O performance, it also greatly reduces unnecessary write operations in the SSD flash memory, thereby greatly extending the life of the SSD memory and improving data reliability. Sex.
  • the embodiment maintains an address mapping table of a logical address LA to a physical address PA, and a reverse address mapping table composed of a mapping relationship between a physical address PAdest and a plurality of logical addresses LAi.
  • the address mapping table and the reverse address mapping table are modified according to the source logical address LAsr C , the target logical address LAdest, and the number of data blocks to be copied in the copy-free copy command, and the copy is copied.
  • the target logical address points to the physical logical address to which the source logical address is mapped, so that the access to the target logical address will obtain the same data as the source logical address, and the data does not need to be physically copied, which greatly improves the I/O. Performance greatly reduces unnecessary write operations in SSDs, which reduces copy space, extends SSD life, and improves data reliability.
  • FIG. 3 is a FTL implementation number of a solid state drive provided in a specific embodiment of the present application.
  • the command receiving module 20 is configured to receive a copy-free copy command sent by the software to the SSD, where the copy-free copy command includes the copied source logical address LAsr C , the target logical address LAdest, and the number of data blocks to be copied. , M is a positive integer.
  • the software includes an application in the host and system software in the operating system.
  • the copy-free copy command sent by the receiving software to the SSD is specifically: The receiving software sends a copy-free copy command to the SSD through an operating system call, which is for the application, and the application needs to copy through the operating system call.
  • the copy command is sent to the F TL.
  • the modifying module 30 is configured to modify the address mapping table and the reverse address mapping table according to the copy-free copy command to point the target logical address LAdest to the physical address to which the source logical address LAsrc is mapped, and complete the data No copy copy.
  • the modifying module 30 is specifically configured to: find the address mapping table to determine whether the target logical address LAdest has been mapped to a physical address PAdest, and if not, find the source on the address mapping table.
  • the physical address PAsrc corresponding to the logical address LAsrc, and the physical address PAsrc as the physical address of the target logical address LAdest, that is, (LAdest, PAsrc) is written into the address mapping table; if so, the flash page on the physical address PAdest is invalidated
  • Asrc+M-1 is written into the address mapping table to complete a copy-free copy of the data.
  • the modifying module 30 is further configured to: perform garbage collection, static wear balancing, and if the logical address or physical address involved is in the reverse address mapping table, The reverse address mapping table is updated accordingly.
  • the system for implementing data copying in the FTL of the solid state drive provided by the embodiment maintains an address mapping table of a logical address LA to a physical address PA, and a physical address PAdest and multiple logics.
  • the reverse address mapping table consisting of the mapping relationship of the address LAi. When the SSD needs to be copied, the address mapping is performed according to the source logical address LAsr C , the target logical address LAdest, and the number of data blocks to be copied in the copy-free copy command.
  • the table and the reverse address mapping table are modified, and the target logical address of the copy is pointed to the physical logical address to which the source logical address is mapped, so that the access to the target logical address obtains the same data as the source logical address, and the data is not A physical copy is required, which greatly improves I/O performance, greatly reduces unnecessary write operations in the SSD, thereby reducing copy space, extending the life of the SSD, and improving data reliability.
  • the embodiment of the present application further provides a solid state hard disk, and the FTL of the solid state hard disk is used to perform steps S101 to S103 in the foregoing method embodiment, as follows:
  • Step S102 Receive a copy-free copy command sent by the software to the SSD, where the copy-free copy command includes the copied source logical address LAsr C , the target logical address LAdest, and the number of data blocks to be copied M, M is positive Integer.
  • Step S103 Modify the address mapping table and the reverse address mapping table according to the copy-free copy command to point the target logical address LAdest to the physical address to which the source logical address LAsrc is mapped, to complete the copy-free copy of the data. .
  • step S103 modifying the address mapping table and the reverse address mapping table according to the copy-free copy command, completing the copy-free copy of the data, including step S1031 to step S1032, as follows: :
  • Step S1031 The FTL searches the address mapping table to determine whether the target logical address LAdest has been mapped to a physical address PAdest, and if not, finds the physical address PAsrc corresponding to the source logical address LAsrc on the address mapping table.
  • the physical address PAsrc is taken as the physical address of the target logical address LAdest, That is, (LAdest, PAsrc) is written into the address mapping table; if so, the flash page on the physical address PAdest is discarded, the physical address PAsrc corresponding to the source logical address LAsrc is detected on the address mapping table, and the physical The address PAsrc is the physical address of the target logical address LAdest, that is, (LAdest, PA src) is written into the address mapping table.
  • Step S1032 According to the number of data blocks to be copied, M, (LAdest+l, PAsrc+l), (LAdest)
  • PAsrc+2 PAsrc+2
  • LAdest+M-1 PAsrc+M-1
  • PAsrc+M-1 PAsrc+M-1
  • the solid state hard disk provided in this embodiment is also used to perform other steps and contents of the embodiment of the foregoing method.
  • a description of the solid state hard disk please refer to the foregoing method embodiment.
  • the SSD provided by this embodiment maintains an address mapping table of a logical address LA to a physical address PA, and a reverse address mapping table composed of a mapping relationship between a physical address PAdest and a plurality of logical addresses LAi.
  • the address mapping table and the reverse address mapping table are modified according to the source logical address LAs rc, the target logical address LAdest, and the number of data blocks to be copied in the copy-free copy command, and the copy will be copied.
  • the target logical address points to the physical logical address to which the source logical address is mapped, so that access to the target logical address will obtain the same data as the source logical address, and the data does not need to be physically copied, which greatly improves the I/O performance. , greatly reducing unnecessary write operations in the SSD, thereby reducing the copy space, extending the life of the SSD, and improving data reliability.

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)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)
  • Signal Processing For Digital Recording And Reproducing (AREA)
  • Memory System (AREA)

Abstract

本申请公开在固态硬盘的FTL实现数据拷贝的方法、***及固态硬盘。该方法包括:维护一张逻辑地址LA到物理地址PA的地址映射表;对成为拷贝目标的物理地址PAdest维护一个数组或链表,这些从物理地址PAdest到多个逻辑地址LAi的映射组成一个反向地址映射表,维护该反向地址映射表;接收软件发送给固态硬盘的无复制拷贝命令,该无复制拷贝命令包括拷贝的源逻辑地址LAsrc、目标逻辑地址LAdest、和需要拷贝的数据块数量;根据无复制拷贝命令对地址映射表和反向地址映射表进行修改,以将目标逻辑地址LAdest指向源逻辑地址LAsrc映射到的物理地址,完成对数据的无复制拷贝。本申请能大大减少固态硬盘中不必要的写操作,降低拷贝时间,延长固态硬盘的使用寿命,提高数据可靠性。

Description

[0001] 本申请是以申请号为 201710591084.4、 申请日为 2017年 7月 19日的中国专利申请 为基础, 并主张其优先权, 该申请的全部内容在此作为整体引入本申请中。
[0002] 技术领域
[0003] 本申请涉及固态硬盘技术领域, 尤其涉及一种在固态硬盘的 FTL实现数据拷贝 的方法、 ***及固态硬盘。
[0004] 背景技术
[0005] 固态硬盘 (Solid State Drives, SSD) 的 FTL (Flash translation layer, 闪存转换 层) 是固态硬盘的设计核心, 目前的固态硬盘中的 FTL不提供支持内部数据复制 命令的实现, 更不提供零数据复制的支持, 它只直接支持 READ、 WRITE. 和 T RIM等基本的命令, 相应地, 它只实现了地址映射、 垃圾回收、 数据读写和磨损 平衡等基本的功能。
[0006] 现有的固态硬盘对现有的应用和***程序大量使用的数据复制需求无法满足, 需要主机上的 CPU和内存参与数据的物理复制, 包括实际从固态硬盘的读出和到 固态硬盘的写入。 但是这种做法存在着两个不足: (一) 物理的数据复制导致 复制耗吋过长, 浪费了固态硬盘的读写带宽和 CPU的吋间; (二) 为了保证数据 的持久性和一致性, 在写操作之后往往要想固态硬盘发出 FLUSH命令, 但是 FL USH命令很耗吋, 会降低固态硬盘的性能, 而且对固态硬盘的写操作会导致固 态硬盘的寿命缩短。
[0007] 申请内容
[0008] 本申请所要解决的技术问题在于提供了一种在固态硬盘的 FTL实现数据拷贝的 方法、 ***及固态硬盘, 大大地减少了固态硬盘中不必要的写操作, 从而降低 了拷贝吋间、 延长了固态硬盘的使用寿命、 提高了数据可靠性。
[0009] 为解决上述技术问题, 本申请采用以下技术方案:
[0010] 一方面, 提供了一种在固态硬盘的 FTL实现数据拷贝的方法, 该方法包括: [0011] FTL维护一张逻辑地址 LA到物理地址 PA的地址映射表; 对成为拷贝目标的物 理地址 PAdest维护一个数组或链表, 以记录映射到物理地址 PAdest的一个或多个 逻辑地址 LAi, 其中 i=l、 2、 3...... N, N≥l, 这些从物理地址 PAdest到多个逻辑 地址 LAi的映射组成一个反向地址映射表, 维护该反向地址映射表, N称为映射 计数;
[0012] 接收软件发送给固态硬盘的无复制拷贝命令, 所述无复制拷贝命令包括拷贝的 源逻辑地址 LAsrc、 目标逻辑地址 LAdest、 和需要拷贝的数据块数量 M;
[0013] 根据所述无复制拷贝命令对地址映射表和反向地址映射表进行修改, 以将目标 逻辑地址 LAdest指向源逻辑地址 LAsrc映射到的物理地址, 完成对数据的无复制 拷贝。
[0014] 其中, 所述根据所述无复制拷贝命令对地址映射表和反向地址映射表进行修改 , 完成对数据的无复制拷贝包括:
[0015] FTL査找所述地址映射表判断目标逻辑地址 LAdest是否已映射到一个物理地址 PAdest上, 若否, 在所述地址映射表上査出源逻辑地址 LAsrc对应的的物理地址 P Asrc , 并将物理地址 PAsrc作为目标逻辑地址 LAdest的物理地址, 即将 (LAdest , PAsrc) 写入地址映射表中; 若是, 将在物理地址 PAdest上的闪存页作废掉, 在所述地址映射表上査出源逻辑地址 LAsrc对应的的物理地址 PAsrc, 并将物理地 址 PAsrc作为目标逻辑地址 LAdest的物理地址, 即将 (LAdest, PAsrc) 写入所述 地址映射表中;
[0016] 根据需要拷贝的数据块数量 M, 将 (LAdest+l, PAsrc+l)、 (LAdest+2, PAsrc+2) 、 ......、 (LAdest+M-1 , PAsrc+M-1)写入所述地址映射表中, 完成对数据的无复 制拷贝。
[0017] 其中, 接收软件发送给固态硬盘的无复制拷贝命令具体为: 接收软件通过一个 操作***调用发送给固态硬盘的无复制拷贝命令。
[0018] 其中, 在所述这些从物理地址 PAdest到多个逻辑地址 LAi的映射组成一个反向 地址映射表, 维护该反向地址映射表, N称为映射计数之后还包括: FTL在进行 垃圾收集、 静态磨损平衡吋, 若涉及的逻辑地址或物理地址在所述反向地址映 射表中, 则对地址映射表和反向地址映射表进行相应的更新。 [0019] 第二方面, 提供了一种在固态硬盘的 FTL实现数据拷贝的***, 该***包括: [0020] 映射表维护模块, 维护一张逻辑地址 LA到物理地址 PA的地址映射表; 对成为 拷贝目标的物理地址 PAdest维护一个数组或链表, 以记录映射到物理地址 PAdest 的一个或多个逻辑地址 LAi, 其中 i=l、 2、 3...... N, N≥l, 这些从物理地址 PAde st到多个逻辑地址 LAi的映射组成一个反向地址映射表, 维护该反向地址映射表 , N称为映射计数;
[0021] 命令接收模块, 用于接收软件发送给固态硬盘的无复制拷贝命令, 所述无复制 拷贝命令包括拷贝的源逻辑地址 LAsrC、 目标逻辑地址 LAdest、 和需要拷贝的数 据块数量 M;
[0022] 修改模块, 用于根据所述无复制拷贝命令对地址映射表和反向地址映射表进行 修改, 以将目标逻辑地址 LAdest指向源逻辑地址 LAsrc映射到的物理地址, 完成 对数据的无复制拷贝。
[0023] 其中, 所述修改模块具体用于:
[0024] 査找所述地址映射表判断目标逻辑地址 LAdest是否已映射到一个物理地址 PAde st上, 若否, 在所述地址映射表上査出源逻辑地址 LAsrc对应的的物理地址 PAsrc , 并将物理地址 PAsrc作为目标逻辑地址 LAdest的物理地址, 即将 (LAdest, PA src) 写入地址映射表中; 若是, 将在物理地址 PAdest上的闪存页作废掉, 在所 述地址映射表上査出源逻辑地址 LAsrc对应的的物理地址 PAsrc, 并将物理地址 P Asrc作为目标逻辑地址 LAdest的物理地址, 即将 (LAdest, PAsrc) 写入所述地 址映射表中;
[0025] 根据需要拷贝的数据块数量 M, 将 (LAdest+l, PAsrc+l)、 (LAdest+2, PAsrc+2) 、 ......、 (LAdest+M-1 , PAsrc+M-1)写入所述地址映射表中, 完成对数据的无复 制拷贝。
[0026] 其中, 接收软件发送给固态硬盘的无复制拷贝命令具体为: 接收软件通过一个 操作***调用发送给固态硬盘的无复制拷贝命令。
[0027] 其中, 所述修改模块还用于: 在进行垃圾收集、 静态磨损平衡吋, 若涉及的逻 辑地址或物理地址在所述反向地址映射表中, 则对地址映射表和反向地址映射 表进行相应的更新。 [0028] 第三方面提供了一种固态硬盘, 该固态硬盘的 FTL用于执行以下步骤:
[0029] 维护一张逻辑地址 LA到物理地址 PA的地址映射表; 对成为拷贝目标的物理地 址 PAdest维护一个数组或链表, 以记录映射到物理地址 PAdest的一个或多个逻辑 地址 LAi, 其中 i=l、 2、 3...... N, N≥l, 这些从物理地址 PAdest到多个逻辑地址
LAi的映射组成一个反向地址映射表, 维护该反向地址映射表, N称为映射计数
[0030] 接收软件发送给固态硬盘的无复制拷贝命令, 所述无复制拷贝命令包括拷贝的 源逻辑地址 LAsrc、 目标逻辑地址 LAdest、 和需要拷贝的数据块数量 M;
[0031] 根据所述无复制拷贝命令对地址映射表和反向地址映射表进行修改, 以将目标 逻辑地址 LAdest指向源逻辑地址 LAsrc映射到的物理地址, 完成对数据的无复制 拷贝。
[0032] 其中, 所述根据所述无复制拷贝命令对地址映射表和反向地址映射表进行修改 , 完成对数据的无复制拷贝包括:
[0033] FTL査找所述地址映射表判断目标逻辑地址 LAdest是否已映射到一个物理地址 PAdest上, 若否, 在所述地址映射表上査出源逻辑地址 LAsrc对应的的物理地址 P Asrc , 并将物理地址 PAsrc作为目标逻辑地址 LAdest的物理地址, 即将 (LAdest , PAsrc) 写入地址映射表中; 若是, 将在物理地址 PAdest上的闪存页作废掉, 在所述地址映射表上査出源逻辑地址 LAsrc对应的的物理地址 PAsrc, 并将物理地 址 PAsrc作为目标逻辑地址 LAdest的物理地址, 即将 (LAdest, PAsrc) 写入所述 地址映射表中;
[0034] 根据需要拷贝的数据块数量 M, 将 (LAdest+l, PAsrc+l)、 (LAdest+2, PAsrc+2) 、 ......、 (LAdest+M-1 , PAsrc+M-1)写入所述地址映射表中, 完成对数据的无复 制拷贝。
[0035] 与现有技术相比, 本申请的有益效果为: 本申请通过维护一张逻辑地址 LA到 物理地址 PA的地址映射表、 以及一张由物理地址 PAdest与多个逻辑地址 LAi的映 射关系组成的反向地址映射表, 当固态硬盘需要拷贝的吋候, 根据无复制拷贝 命令中的源逻辑地址 LAsrc、 目标逻辑地址 LAdest、 和需要拷贝的数据块数量对 地址映射表和反向地址映射表进行修改, 将拷贝的目标逻辑地址指向源逻辑地 址映射到的物理逻辑地址即可, 这样对该目标逻辑地址的访问就会获得和源逻 辑地址一样的数据, 数据不需要作物理拷贝, 大大地减少了固态硬盘中不必要 的写操作, 从而降低了拷贝吋间、 延长了固态硬盘的使用寿命、 提高了数据可 靠性。
[0036] 附图说明
[0037] 为了更清楚地说明本申请实施例中的技术方案, 下面将对本申请实施例描述中 所需要使用的附图作简单的介绍, 显而易见地, 下面描述中的附图仅仅是本申 请的一些实施例, 对于本领域普通技术人员来讲, 在不付出创造性劳动的前提 下, 还可以根据本申请实施例的内容和这些附图获得其他的附图。
[0038] 图 1是本申请具体实施方式中提供的一种在固态硬盘的 FTL实现数据拷贝的方 法的实施例的方法流程图。
[0039] 图 2是本申请具体实施方式中提供的一种在固态硬盘的 FTL实现数据拷贝的 方法的另一实施例的方法流程图。
[0040] 图 3是本申请具体实施方式中提供的一种在固态硬盘的 FTL实现数据拷贝的系 统的实施例的结构框图。
[0041] 具体实施方式
[0042] 为使本申请解决的技术问题、 采用的技术方案和达到的技术效果更加清楚, 下 面将结合附图对本申请实施例的技术方案作进一步的详细描述, 显然, 所描述 的实施例仅仅是本申请一部分实施例, 而不是全部的实施例。 基于本申请中的 实施例, 本领域技术人员在没有作出创造性劳动前提下所获得的所有其他实施 例, 都属于本申请保护的范围。
[0043] 下面结合附图 1~2对本申请实施例提供的一种在固态硬盘的 FTL实现数据拷贝 的方法作进一步的详细描述。 请参考图 1, 其是本申请具体实施方式中提供的一 种在固态硬盘的 FTL实现数据拷贝的方法的第一实施例的方法流程图。 如图 1所 示, 在一些实施例中, 该方法包括步骤 S101〜步骤 S103, 具体如下:
[0044] 步骤 S 101 : FTL维护一张逻辑地址 LA到物理地址 PA的地址映射表; 对成为拷 贝目标的物理地址 PAdest维护一个数组或链表, 以记录映射到物理地址 PAdest的 一个或多个逻辑地址 LAi, 其中 i=l、 2、 3...... N, N≥l, 这些从物理地址 PAdest 到多个逻辑地址 LAi的映射组成一个反向地址映射表, 维护该反向地址映射表, N称为映射计数。
[0045] 步骤 S102: 接收软件发送给固态硬盘的无复制拷贝命令, 所述无复制拷贝命令 包括拷贝的源逻辑地址 LAsrc、 目标逻辑地址 LAdest、 和需要拷贝的数据块数量 M, M为正整数。
[0046] 在一些实施例中, 所述软件包括主机中的应用程序和操作***中的***软件。
接收软件发送给固态硬盘的无复制拷贝命令具体为: 接收软件通过一个操作系 统调用发送给固态硬盘的无复制拷贝命令, 这是针对应用程序来说的, 应用程 序需要通过操作***调用把无复制拷贝命令发送给 FTL。
[0047] 步骤 S103: 根据所述无复制拷贝命令对地址映射表和反向地址映射表进行修改 , 以将目标逻辑地址 LAdest指向源逻辑地址 LAsrc映射到的物理地址, 完成对数 据的无复制拷贝。
[0048] 在一些优选的实施例中, 步骤 S103: 根据所述无复制拷贝命令对地址映射表和 反向地址映射表进行修改, 完成对数据的无复制拷贝包括:
[0049] 步骤 S1031 : FTL査找所述地址映射表判断目标逻辑地址 LAdest是否已映射到 一个物理地址 PAdest上, 若否, 在所述地址映射表上査出源逻辑地址 LAsrc对应 的的物理地址 PAsrc, 并将物理地址 PAsrc作为目标逻辑地址 LAdest的物理地址, 即将 (LAdest, PAsrc) 写入地址映射表中; 若是, 将在物理地址 PAdest上的闪 存页作废掉 (若为物理页地址, 则将在物理页地址上的闪存页作废掉, 需要说 明的是闪存不支持直接的页修改或刪除。 只能先标记该页为无用页, 以后再以 更大的数据单位擦除, 擦除以后该位置才可重新写) , 在所述地址映射表上査 出源逻辑地址 LAsrc对应的的物理地址 PAsrc, 并将物理地址 PAsrc作为目标逻辑 地址 LAdest的物理地址, 即将 (LAdest, PAsrc) 写入所述地址映射表中。
[0050] 反向地址映射表不能因为突然掉电等事故原因丢失, 需要用超级电容或电池的 有限电力在事故发生后紧急写回。 考虑到有限电力只能讲少量的数据写回, 并 且 SSD内的 DRAM容量有限, 反向地址映射表需要限制在一定的大小以内, 为此 , 可通过采取以下两种方法缩小反向地址映射表: (1) 定期将其写回, 确保在 DRAM中的脏页的大小在容许的范围内; (2) 定期将映射计数为 1的表项从反 向地址映射表中刪除。 如果有必要, 将与映射计数 N≥l的物理页相联的逻辑页分 别写到不同的物理页上, 从而将它们的映射计数降成 1并被刪除。
[0051] 步骤 S1032: 根据需要拷贝的数据块数量 M, 将 (LAdest+l, PAsrc+l)、 (LAdest +2, PAsrc+2)、 、 (LAdest+M-1 , PAsrc+M-1)写入所述地址映射表中, 完成 对数据的无复制拷贝。
[0052] 图 2是本申请具体实施方式中提供的一种在固态硬盘的 FTL实现数据拷贝的方 法的另一实施例的方法流程图, 如图 2所示, 作为一个实施例, 在所述这些从物 理地址 PAdest到多个逻辑地址 LAi的映射组成一个反向地址映射表, 维护该反向 地址映射表, N称为映射计数之后还包括步骤 S104: FTL在进行垃圾收集、 静态 磨损平衡吋, 若涉及的逻辑地址或物理地址在所述反向地址映射表中, 则对地 址映射表和反向地址映射表进行相应的更新。 这样当逻辑地址与物理地址的映 射关系发生变化吋, 能及吋对地址映射表和反地址映射表进行更新, 以保证后 续实现数据复制吋的准确性。
[0053] 作为一个实施例 FTL维护一张逻辑块地址 LBA到物理块地址 PBA的地址映射表 ; FTL査找所述地址映射表判断目标块地址 LBAdest是否已映射到一个物理块地 址 PBAdest上, 若否, 在所述地址映射表上査出与目标块地址 LBAdest对应的源 地址 LB Asrc的物理地址 PB Asrc, 并将物理地址 PB Asrc作为目标逻辑块地址 LB Ad est的物理块地址, 即将 (LBAdest, PBAsrc) 写入地址映射表中; 若是, 将在物 理块地址 PBAdest上的闪存块作废掉, 在所述地址映射表上査出与目标逻辑块地 址 LBAdest对应的源逻辑块地址 LB Asrc的物理块地址 PBAsrc, 并将物理块地址 P BAsrc作为目标逻辑块地址 LBAdest的物理块地址, 即将 (LBAdest, PBAsrc) 写 入表中; 对成为拷贝目标的物理块地址 PBAdest维护一个数组或链表, 以记录映 射到物理块地址 PBAdest的一个或多个逻辑块地址 LBAi, 其中 i=l、 2、 3...... N,
N> 1, 物理块地址 PBAdest与多个逻辑块地址 LB Ai的映射关系组成一个反向地址 映射表, N称为映射计数, 每个在反向地址映射表中的物理块地址 PBAdest都维 护一个映射计数N。
[0054] 在本实施例中, 拷贝的源数据和目标数据是一样的, 数据不用作物理拷贝, 只 需修改有关地址的映射关系就可以, 具体作法是: 将拷贝的目标逻辑地址指向 源逻辑地址映射到的物理逻辑地址即可, 这样对该目标逻辑地址的访问就会获 得和源逻辑地址一样的数据, 从功能上看就有了拷贝的效果。 需要澄清的是, S SD的使用 (读或写) 是一定的数据大小为读写单位 (比如 4KB) 为单位的, 这 个单位通常称为块。 在 SSD的内部管理中也是以一定的数据单位从其内部的闪存 读写数据的, 这个单位通常称为页。 这两个单位可能不一样大, 但不影响我们 的设计。 所以为理解方便, 可以认为它们一样大。
[0055] 在一些实施例中, 零数据复制的无复制拷贝命令可以通过一个操作***调用提 供给应用程序, 大量的各种应用和***程序可以使用这个操作***调用或无复 制拷贝命令极大地提高性能, 将原来的由读写两个步骤实现的数据在固态硬盘 上的物理拷贝替换成一个无复制拷贝的***调用或无复制拷贝命令就可以。 无 复制拷贝命令可应用于以下应用场景: 1.数据库或文件***中日志操作; 2.在支 持 Container虚拟执行环境的 OverlayFS/UnionFS中文件写操作; 3.固态硬盘全盘的 去碎片化操作; 4.在文件中增加或减少块的操作; 5.实现块级别的去冗余的软 件。 使用无复制拷贝可以大大提高软件的性能, 除了提供 I/O性能外, 还大大减 少了固态硬盘闪存内的不必要的写操作, 从而大大地延长了固态硬盘存储器的 使用寿命和提高数据的可靠性。
[0056] 综上所述, 本实施例通过维护一张逻辑地址 LA到物理地址 PA的地址映射表、 以及一张由物理地址 PAdest与多个逻辑地址 LAi的映射关系组成的反向地址映射 表, 当固态硬盘需要拷贝的吋候, 根据无复制拷贝命令中的源逻辑地址 LAsrC、 目标逻辑地址 LAdest、 和需要拷贝的数据块数量对地址映射表和反向地址映射表 进行修改, 将拷贝的目标逻辑地址指向源逻辑地址映射到的物理逻辑地址即可 , 这样对该目标逻辑地址的访问就会获得和源逻辑地址一样的数据, 数据不需 要作物理拷贝, 大大地提高了 I/O性能, 大大地减少了固态硬盘中不必要的写操 作, 从而降低了拷贝吋间、 延长了固态硬盘的使用寿命、 提高了数据可靠性。
[0057] 以下是本申请具体实施方式中提供的一种在固态硬盘的 FTL实现数据拷贝的系 统的实施例, ***的实施例基于上述的方法的实施例实现, 在***中未尽的描 述, 请参考前述方法的实施例。
[0058] 请参考图 3, 其是本申请具体实施方式中提供的一种在固态硬盘的 FTL实现数 据拷贝的***的实施例的结构方框图。 如图 3所示, 该***包括:
[0059] 映射表维护模块 10, 维护一张逻辑地址 LA到物理地址 PA的地址映射表; 对成 为拷贝目标的物理地址 PAdest维护一个数组或链表, 以记录映射到物理地址 PAd est的一个或多个逻辑地址 LAi, 其中 i=l、 2、 3...... N, N≥l, 这些从物理地址 PA dest到多个逻辑地址 LAi的映射组成一个反向地址映射表, 维护该反向地址映射 表, N称为映射计数。
[0060] 命令接收模块 20, 用于接收软件发送给固态硬盘的无复制拷贝命令, 所述无复 制拷贝命令包括拷贝的源逻辑地址 LAsrC、 目标逻辑地址 LAdest、 和需要拷贝的 数据块数量 M, M为正整数。 在一些实施例中, 所述软件包括主机中的应用程序 和操作***中的***软件。 接收软件发送给固态硬盘的无复制拷贝命令具体为 : 接收软件通过一个操作***调用发送给固态硬盘的无复制拷贝命令, 这是针 对应用程序来说的, 应用程序需要通过操作***调用把无复制拷贝命令发送给 F TL。
[0061] 修改模块 30, 用于根据所述无复制拷贝命令对地址映射表和反向地址映射表进 行修改, 以将目标逻辑地址 LAdest指向源逻辑地址 LAsrc映射到的物理地址, 完 成对数据的无复制拷贝。
[0062] 在一些实施例中, 修改模块 30具体用于: 査找所述地址映射表判断目标逻辑地 址 LAdest是否已映射到一个物理地址 PAdest上, 若否, 在所述地址映射表上査出 源逻辑地址 LAsrc对应的的物理地址 PAsrc, 并将物理地址 PAsrc作为目标逻辑地 址 LAdest的物理地址, 即将 (LAdest, PAsrc) 写入地址映射表中; 若是, 将在 物理地址 PAdest上的闪存页作废掉, 在所述地址映射表上査出源逻辑地址 LAsrc 对应的的物理地址 PAsrc, 并将物理地址 PAsrc作为目标逻辑地址 LAdest的物理地 址, 即将 (LAdest, PAsrc) 写入所述地址映射表中; 根据需要拷贝的数据块数 量 M, 将 (LAdest+l, PAsrc+l)、 (LAdest+2, PAsrc+2)、 、 (LAdest+M-1 , P
Asrc+M-1)写入所述地址映射表中, 完成对数据的无复制拷贝。
[0063] 在一些实施例中, 修改模块 30还用于: 在进行垃圾收集、 静态磨损平衡吋, 若 涉及的逻辑地址或物理地址在所述反向地址映射表中, 则对地址映射表和反向 地址映射表进行相应的更新。 [0064] 综上所述, 本实施例提供的在固态硬盘的 FTL实现数据拷贝的***通过维护一 张逻辑地址 LA到物理地址 PA的地址映射表、 以及一张由物理地址 PAdest与多个 逻辑地址 LAi的映射关系组成的反向地址映射表, 当固态硬盘需要拷贝的吋候, 根据无复制拷贝命令中的源逻辑地址 LAsrC、 目标逻辑地址 LAdest、 和需要拷贝 的数据块数量对地址映射表和反向地址映射表进行修改, 将拷贝的目标逻辑地 址指向源逻辑地址映射到的物理逻辑地址即可, 这样对该目标逻辑地址的访问 就会获得和源逻辑地址一样的数据, 数据不需要作物理拷贝, 大大地提高了 I/O 性能, 大大地减少了固态硬盘中不必要的写操作, 从而降低了拷贝吋间、 延长 了固态硬盘的使用寿命、 提高了数据可靠性。
[0065] 本申请实施例还提供了一种固态硬盘, 该固态硬盘的 FTL用于执行上述方法实 施例中的步骤 S101~步骤 S103, 具体如下:
[0066] 步骤 S 101 : 维护一张逻辑地址 LA到物理地址 PA的地址映射表; 对成为拷贝目 标的物理地址 PAdest维护一个数组或链表, 以记录映射到物理地址 PAdest的一个 或多个逻辑地址 LAi, 其中 i=l、 2、 3...... N, N≥l, 这些从物理地址 PAdest到多 个逻辑地址 LAi的映射组成一个反向地址映射表, 维护该反向地址映射表, N称 为映射计数。
[0067] 步骤 S102: 接收软件发送给固态硬盘的无复制拷贝命令, 所述无复制拷贝命令 包括拷贝的源逻辑地址 LAsrC、 目标逻辑地址 LAdest、 和需要拷贝的数据块数量 M, M为正整数。
[0068] 步骤 S103: 根据所述无复制拷贝命令对地址映射表和反向地址映射表进行修改 , 以将目标逻辑地址 LAdest指向源逻辑地址 LAsrc映射到的物理地址, 完成对数 据的无复制拷贝。
[0069] 在一些优选的实施例中, 步骤 S103: 根据所述无复制拷贝命令对地址映射表和 反向地址映射表进行修改, 完成对数据的无复制拷贝包括步骤 S1031-步骤 S1032 , 具体如下:
[0070] 步骤 S1031 : FTL査找所述地址映射表判断目标逻辑地址 LAdest是否已映射到 一个物理地址 PAdest上, 若否, 在所述地址映射表上査出源逻辑地址 LAsrc对应 的的物理地址 PAsrc, 并将物理地址 PAsrc作为目标逻辑地址 LAdest的物理地址, 即将 (LAdest, PAsrc) 写入地址映射表中; 若是, 将在物理地址 PAdest上的闪 存页作废掉, 在所述地址映射表上査出源逻辑地址 LAsrc对应的的物理地址 PAsrc , 并将物理地址 PAsrc作为目标逻辑地址 LAdest的物理地址, 即将 (LAdest, PA src) 写入所述地址映射表中。
[0071] 步骤 S1032: 根据需要拷贝的数据块数量 M, 将 (LAdest+l, PAsrc+l)、 (LAdest
+2, PAsrc+2)、 、 (LAdest+M-1 , PAsrc+M-1)写入所述地址映射表中, 完成 对数据的无复制拷贝。
[0072] 本实施例提供的固态硬盘还用于执行上述的方法的实施例的其他步骤和内容, 在固态硬盘中未尽的描述, 请参考前述方法的实施例。
[0073] 本实施例提供的固态硬盘通过维护一张逻辑地址 LA到物理地址 PA的地址映射 表、 以及一张由物理地址 PAdest与多个逻辑地址 LAi的映射关系组成的反向地址 映射表, 当固态硬盘需要拷贝的吋候, 根据无复制拷贝命令中的源逻辑地址 LAs rc、 目标逻辑地址 LAdest、 和需要拷贝的数据块数量对地址映射表和反向地址映 射表进行修改, 将拷贝的目标逻辑地址指向源逻辑地址映射到的物理逻辑地址 即可, 这样对该目标逻辑地址的访问就会获得和源逻辑地址一样的数据, 数据 不需要作物理拷贝, 大大地提高了 I/O性能, 大大地减少了固态硬盘中不必要的 写操作, 从而降低了拷贝吋间、 延长了固态硬盘的使用寿命、 提高了数据可靠 性。
[0074] 以上结合具体实施例描述了本申请的技术原理。 这些描述只是为了解释本申请 的原理, 而不能以任何方式解释为对本申请保护范围的限制。 基于此处的解释 , 本领域的技术人员不需要付出创造性的劳动即可联想到本申请的其它具体实 施方式, 这些方式都将落入本申请的保护范围之内。
技术问题
问题的解决方案
发明的有益效果

Claims

权利要求书
[权利要求 1] 一种在固态硬盘的 FTL实现数据拷贝的方法, 其特征在于, 该方法包 括:
FTL维护一张逻辑地址 LA到物理地址 PA的地址映射表; 对成为拷贝 目标的物理地址 PAdest维护一个数组或链表, 以记录映射到物理地址
PAdest的一个或多个逻辑地址 LAi, 其中 i=l、 2、 3 N, N≥l, 这 些从物理地址 PAdest到多个逻辑地址 LAi的映射组成一个反向地址映 射表, 维护该反向地址映射表, N称为映射计数; 接收软件发送给固态硬盘的无复制拷贝命令, 所述无复制拷贝命令包 括拷贝的源逻辑地址 LAsrC、 目标逻辑地址 LAdest、 和需要拷贝的数 据块数量 M;
根据所述无复制拷贝命令对地址映射表和反向地址映射表进行修改, 以将目标逻辑地址 LAdest指向源逻辑地址 LAsrc映射到的物理地址, 完成对数据的无复制拷贝。
[权利要求 2] 根据权利要求 1所述的一种在固态硬盘的 FTL实现数据拷贝的方法, 其特征在于, 所述根据所述无复制拷贝命令对地址映射表和反向地址 映射表进行修改, 完成对数据的无复制拷贝包括:
FTL査找所述地址映射表判断目标逻辑地址 LAdest是否已映射到一个 物理地址 PAdest上, 若否, 在所述地址映射表上査出源逻辑地址 LAsr c对应的的物理地址 PAsrc, 并将物理地址 PAsrc作为目标逻辑地址 LA dest的物理地址, 即将 (LAdest, PAsrc) 写入地址映射表中; 若是, 将在物理地址 PAdest上的闪存页作废掉, 在所述地址映射表上査出源 逻辑地址 LAsrc对应的的物理地址 PAsrc, 并将物理地址 PAsrc作为目 标逻辑地址 LAdest的物理地址, 即将 (LAdest, PAsrc) 写入所述地 址映射表中;
根据需要拷贝的数据块数量 M, 将 (LAdest+l, PAsrc+l)、 (LAdest+2 , PAsrc+2)、 、 (LAdest+M-1 , PAsrc+M-1)写入所述地址映射表 中, 完成对数据的无复制拷贝。
[权利要求 3] 根据权利要求 1所述的一种在固态硬盘的 FTL实现数据拷贝的方法, 其特征在于, 接收软件发送给固态硬盘的无复制拷贝命令具体为: 接 收软件通过一个操作***调用发送给固态硬盘的无复制拷贝命令。
[权利要求 4] 根据权利要求 1所述的一种在固态硬盘的 FTL实现数据拷贝的方法, 其特征在于, 在所述这些从物理地址 PAdest到多个逻辑地址 LAi的映 射组成一个反向地址映射表, 维护该反向地址映射表, N称为映射计 数之后还包括: FTL在进行垃圾收集、 静态磨损平衡吋, 若涉及的逻 辑地址或物理地址在所述反向地址映射表中, 则对地址映射表和反向 地址映射表进行相应的更新。
[权利要求 5] —种在固态硬盘的 FTL实现数据拷贝的***, 其特征在于, 该***包 括:
映射表维护模块, 维护一张逻辑地址 LA到物理地址 PA的地址映射表 ; 对成为拷贝目标的物理地址 PAdest维护一个数组或链表, 以记录映 射到物理地址 PAdest的一个或多个逻辑地址 LAi, 其中 i=l、 2、 3......
N, N≥l, 这些从物理地址 PAdest到多个逻辑地址 LAi的映射组成一个 反向地址映射表, 维护该反向地址映射表, N称为映射计数; 命令接收模块, 用于接收软件发送给固态硬盘的无复制拷贝命令, 所 述无复制拷贝命令包括拷贝的源逻辑地址 LAsrC、 目标逻辑地址 LAde st、 和需要拷贝的数据块数量 M;
修改模块, 用于根据所述无复制拷贝命令对地址映射表和反向地址映 射表进行修改, 以将目标逻辑地址 LAdest指向源逻辑地址 LAsrc映射 到的物理地址, 完成对数据的无复制拷贝。
[权利要求 6] 根据权利要求 5所述的一种在固态硬盘的 FTL实现数据拷贝的***, 其特征在于, 所述修改模块具体用于:
査找所述地址映射表判断目标逻辑地址 LAdest是否已映射到一个物理 地址 PAdest上, 若否, 在所述地址映射表上査出源逻辑地址 LAsrc对 应的的物理地址 PAsrc, 并将物理地址 PAsrc作为目标逻辑地址 LAdest 的物理地址, 即将 (LAdest, PAsrc) 写入地址映射表中; 若是, 将 在物理地址 PAdest上的闪存页作废掉, 在所述地址映射表上査出源逻 辑地址 LAsrc对应的的物理地址 PAsrc, 并将物理地址 PAsrc作为目标 逻辑地址 LAdest的物理地址, 即将 (LAdest, PAsrc) 写入所述地址 映射表中;
根据需要拷贝的数据块数量 M, 将 (LAdest+l, PAsrc+l)、 (LAdest+2 , PAsrc+2)、 、 (LAdest+M-1 , PAsrc+M-1)写入所述地址映射表 中, 完成对数据的无复制拷贝。
[权利要求 7] 根据权利要求 5所述的一种在固态硬盘的 FTL实现数据拷贝的***, 其特征在于, 所述接收软件发送给固态硬盘的无复制拷贝命令具体为 : 接收软件通过一个操作***调用发送给固态硬盘的无复制拷贝命令
[权利要求 8] 根据权利要求 5所述的一种在固态硬盘的 FTL实现数据拷贝的***, 其特征在于, 所述修改模块还用于: 在进行垃圾收集、 静态磨损平衡 吋, 若涉及的逻辑地址或物理地址在所述反向地址映射表中, 则对地 址映射表和反向地址映射表进行相应的更新。
[权利要求 9] 一种固态硬盘, 其特征在于, 所述固态硬盘的 FTL用于执行以下步骤 维护一张逻辑地址 LA到物理地址 PA的地址映射表; 对成为拷贝目标 的物理地址 PAdest维护一个数组或链表, 以记录映射到物理地址 PAd est的一个或多个逻辑地址 LAi, 其中 i=l、 2、 3...... N, N≥l, 这些从 物理地址 PAdest到多个逻辑地址 LAi的映射组成一个反向地址映射表 , 维护该反向地址映射表, N称为映射计数;
接收软件发送给固态硬盘的无复制拷贝命令, 所述无复制拷贝命令包 括拷贝的源逻辑地址 LAsrc、 目标逻辑地址 LAdest、 和需要拷贝的数 据块数量 M;
根据所述无复制拷贝命令对地址映射表和反向地址映射表进行修改, 以将目标逻辑地址 LAdest指向源逻辑地址 LAsrc映射到的物理地址, 完成对数据的无复制拷贝。 [权利要求 10] 根据权利要求 9所述的一种固态硬盘, 其特征在于, 所述根据所述无 复制拷贝命令对地址映射表和反向地址映射表进行修改, 完成对数据 的无复制拷贝包括:
FTL査找所述地址映射表判断目标逻辑地址 LAdest是否已映射到一个 物理地址 PAdest上, 若否, 在所述地址映射表上査出源逻辑地址 LAsr c对应的的物理地址 PAsrc, 并将物理地址 PAsrc作为目标逻辑地址 LA dest的物理地址, 即将 (LAdest, PAsrc) 写入地址映射表中; 若是, 将在物理地址 PAdest上的闪存页作废掉, 在所述地址映射表上査出源 逻辑地址 LAsrc对应的的物理地址 PAsrc , 并将物理地址 PAsrc作为目 标逻辑地址 LAdest的物理地址, 即将 (LAdest, PAsrc) 写入所述地 址映射表中;
根据需要拷贝的数据块数量 M, 将 (LAdest+l, PAsrc+l)、 (LAdest+2 , PAsrc+2)、 、 (LAdest+M-1 , PAsrc+M-1)写入所述地址映射表 中, 完成对数据的无复制拷贝。
PCT/CN2018/094548 2017-07-19 2018-07-04 在固态硬盘的ftl实现数据拷贝的方法、***及固态硬盘 WO2019015479A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US16/711,418 US20200117368A1 (en) 2017-07-19 2019-12-11 Method for achieving data copying in ftl of solid state drive, system and solid state drive

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710591084.4 2017-07-19
CN201710591084.4A CN107391391B (zh) 2017-07-19 2017-07-19 在固态硬盘的ftl实现数据拷贝的方法、***及固态硬盘

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US16/711,418 Continuation US20200117368A1 (en) 2017-07-19 2019-12-11 Method for achieving data copying in ftl of solid state drive, system and solid state drive

Publications (1)

Publication Number Publication Date
WO2019015479A1 true WO2019015479A1 (zh) 2019-01-24

Family

ID=60335828

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/094548 WO2019015479A1 (zh) 2017-07-19 2018-07-04 在固态硬盘的ftl实现数据拷贝的方法、***及固态硬盘

Country Status (3)

Country Link
US (1) US20200117368A1 (zh)
CN (1) CN107391391B (zh)
WO (1) WO2019015479A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113168291A (zh) * 2019-06-24 2021-07-23 西部数据技术公司 用于在传统ssd和开放沟道ssd之间切换而没有数据丢失的方法

Families Citing this family (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107391391B (zh) * 2017-07-19 2019-05-14 深圳大普微电子科技有限公司 在固态硬盘的ftl实现数据拷贝的方法、***及固态硬盘
WO2019127212A1 (zh) * 2017-12-28 2019-07-04 华为技术有限公司 一种数据写入的方法及固态硬盘阵列
CN108021515A (zh) * 2017-12-29 2018-05-11 苏州大学 Mlc nand闪存关键数据的存储方法、固态硬盘和计算机
WO2020052216A1 (zh) * 2018-09-12 2020-03-19 华为技术有限公司 一种***垃圾回收方法和固态硬盘中的垃圾回收方法
CN110895513A (zh) * 2018-09-12 2020-03-20 华为技术有限公司 一种***垃圾回收方法和固态硬盘中的垃圾回收方法
KR20200095103A (ko) 2019-01-31 2020-08-10 에스케이하이닉스 주식회사 데이터 저장 장치 및 그 동작 방법
KR20200117256A (ko) * 2019-04-03 2020-10-14 에스케이하이닉스 주식회사 컨트롤러, 이를 포함하는 메모리 시스템 및 메모리 시스템의 동작 방법
CN114064522A (zh) * 2019-05-09 2022-02-18 北京忆芯科技有限公司 一种计算机
CN111597159A (zh) * 2020-07-27 2020-08-28 成都智明达电子股份有限公司 一种提高ext4文件***读写速率的方法
CN113742255B (zh) * 2021-08-26 2023-08-08 合肥康芯威存储技术有限公司 一种无效标记命令的处理方法、***及数据存储设备
US11977783B2 (en) * 2021-10-28 2024-05-07 Silicon Motion, Inc. Method and apparatus for performing data access control of memory device with aid of predetermined command
CN114780448A (zh) * 2022-05-18 2022-07-22 苏州忆联信息***有限公司 数据快速拷贝的方法、装置、计算机设备及存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1560746A (zh) * 2004-02-27 2005-01-05 中国人民解放军国防科学技术大学 基于操作***反向页表的页迁移和复制方法
CN101533337A (zh) * 2009-05-05 2009-09-16 成都市华为赛门铁克科技有限公司 固态硬盘数据管理方法及设备
CN102622307A (zh) * 2012-02-27 2012-08-01 记忆科技(深圳)有限公司 硬盘数据的操作方法和硬盘控制器
US20140108752A1 (en) * 2012-10-16 2014-04-17 International Business Machines Corporation Managing updates and copying data in a point-in-time copy relationship expressed as source logical addresses and target logical addresses
CN107391391A (zh) * 2017-07-19 2017-11-24 深圳大普微电子科技有限公司 在固态硬盘的ftl实现数据拷贝的方法、***及固态硬盘

Family Cites Families (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1130516A1 (en) * 2000-03-01 2001-09-05 Hewlett-Packard Company, A Delaware Corporation Address mapping in solid state storage device
US20060174074A1 (en) * 2005-02-03 2006-08-03 International Business Machines Corporation Point-in-time copy operation
US8769350B1 (en) * 2011-09-20 2014-07-01 Advent Software, Inc. Multi-writer in-memory non-copying database (MIND) system and method
CN102830942B (zh) * 2012-06-28 2016-06-22 记忆科技(深圳)有限公司 固态硬盘磁盘阵列映射的方法及其固态硬盘
CN103530062B (zh) * 2012-07-03 2016-12-21 群联电子股份有限公司 数据存储方法、存储器控制器与存储器存储装置
CN102866955A (zh) * 2012-09-14 2013-01-09 记忆科技(深圳)有限公司 一种闪存数据管理方法及***
CN103064765B (zh) * 2012-12-28 2015-12-02 华为技术有限公司 数据恢复方法、装置及集群存储***
CN104281538B (zh) * 2013-07-03 2019-05-31 联想(北京)有限公司 一种存储设备的扩容及快照方法和存储设备
CN103473266A (zh) * 2013-08-09 2013-12-25 记忆科技(深圳)有限公司 固态硬盘及其删除重复数据的方法
CN103678166A (zh) * 2013-08-16 2014-03-26 记忆科技(深圳)有限公司 一种采用固态硬盘作为计算机高速缓存的实现方法及***
US9841927B2 (en) * 2013-09-23 2017-12-12 Red Hat Israel, Ltd Remote direct memory access with copy-on-write support
CN105988723A (zh) * 2015-02-12 2016-10-05 中兴通讯股份有限公司 一种快照处理方法及装置
CN105912277B (zh) * 2016-04-29 2018-12-18 上海交通大学 在虚拟机镜像中实现文件***单写日志的方法
CN106598493A (zh) * 2016-11-30 2017-04-26 郑州云海信息技术有限公司 一种固态硬盘地址映射表管理方法

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1560746A (zh) * 2004-02-27 2005-01-05 中国人民解放军国防科学技术大学 基于操作***反向页表的页迁移和复制方法
CN101533337A (zh) * 2009-05-05 2009-09-16 成都市华为赛门铁克科技有限公司 固态硬盘数据管理方法及设备
CN102622307A (zh) * 2012-02-27 2012-08-01 记忆科技(深圳)有限公司 硬盘数据的操作方法和硬盘控制器
US20140108752A1 (en) * 2012-10-16 2014-04-17 International Business Machines Corporation Managing updates and copying data in a point-in-time copy relationship expressed as source logical addresses and target logical addresses
CN107391391A (zh) * 2017-07-19 2017-11-24 深圳大普微电子科技有限公司 在固态硬盘的ftl实现数据拷贝的方法、***及固态硬盘

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113168291A (zh) * 2019-06-24 2021-07-23 西部数据技术公司 用于在传统ssd和开放沟道ssd之间切换而没有数据丢失的方法

Also Published As

Publication number Publication date
US20200117368A1 (en) 2020-04-16
CN107391391B (zh) 2019-05-14
CN107391391A (zh) 2017-11-24

Similar Documents

Publication Publication Date Title
WO2019015479A1 (zh) 在固态硬盘的ftl实现数据拷贝的方法、***及固态硬盘
US11341117B2 (en) Deduplication table management
JP6709245B2 (ja) 適応持続性システム、方法、インタフェース
US20240020003A1 (en) Hardware accessible memory fabric
US7822939B1 (en) Data de-duplication using thin provisioning
US10133511B2 (en) Optimized segment cleaning technique
US9009437B1 (en) Techniques for shared data storage provisioning with thin devices
US7949637B1 (en) Storage management for fine grained tiered storage with thin provisioning
US9645932B1 (en) Persistent metadata cache
CN102598020B (zh) 用于改进的数据去重的装置、***及方法
US9589008B2 (en) Deduplication of volume regions
US8924664B2 (en) Logical object deletion
US9342256B2 (en) Epoch based storage management for a storage device
US9396207B1 (en) Fine grained tiered storage with thin provisioning
EP3168737A2 (en) Distributed multimode storage management
US9778860B2 (en) Re-TRIM of free space within VHDX
US20130275653A1 (en) Multi-tier storage using multiple file sets
JP2015521310A (ja) 効率的なデータオブジェクトストレージ及び検索
KR20130066639A (ko) 데이터 이용가능성의 마운트타임 조정
US11995318B2 (en) Deallocated block determination
EP3436973A1 (en) File system support for file-level ghosting
US10853257B1 (en) Zero detection within sub-track compression domains
US11263132B2 (en) Method and system for facilitating log-structure data organization
US10922003B1 (en) Realizing host-assisted device-level data deduplication on solid-state data storage devices with embedded non-volatile memory
Ni et al. Leveraging ssd's flexible address mapping to accelerate data copy operations

Legal Events

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

Ref document number: 18834948

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18834948

Country of ref document: EP

Kind code of ref document: A1