CN111857586A - SSD Trim optimization method, system, terminal and storage medium - Google Patents

SSD Trim optimization method, system, terminal and storage medium Download PDF

Info

Publication number
CN111857586A
CN111857586A CN202010675647.XA CN202010675647A CN111857586A CN 111857586 A CN111857586 A CN 111857586A CN 202010675647 A CN202010675647 A CN 202010675647A CN 111857586 A CN111857586 A CN 111857586A
Authority
CN
China
Prior art keywords
data blocks
block
data
ssd
data block
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.)
Withdrawn
Application number
CN202010675647.XA
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.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202010675647.XA priority Critical patent/CN111857586A/en
Publication of CN111857586A publication Critical patent/CN111857586A/en
Withdrawn legal-status Critical Current

Links

Images

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/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0608Saving storage space on storage systems
    • 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

Abstract

The invention provides an SSD Trim optimization method, a system, a terminal and a storage medium, comprising the following steps: arranging a superblock on an SSD, the superblock comprising a plurality of data blocks; creating an information structure body for the super block, wherein the information structure body stores the states of all data blocks under the super block; and after triggering garbage collection, reading the data block states in all the information structure bodies, positioning invalid data blocks according to the data block states, and collecting the invalid data blocks. The method reduces the memory waste caused by the trim table, and also reduces the influence on the performance of the SSD when the trim table is updated from time to time in the trim process.

Description

SSD Trim optimization method, system, terminal and storage medium
Technical Field
The invention belongs to the technical field of storage, and particularly relates to an SSD Trim optimization method, a SSD Trim optimization system, an SSD Trim optimization terminal and a SSD Trim optimization storage medium.
Background
Without trim, host cannot immediately know when deleting data of the SSD, but can only find the SSD when waiting for the next write operation to the data blocks. The Trim is a new ATA instruction in the SSD, and the Host sends the instruction to the SSD to tell the SSD that the data lost by the Trim is invalid. Therefore, the SSD can be used for recovering the data boldly during recovery, and the garbage recovery efficiency of the SSD is improved.
The existing SSD and host basically support the trim function, generally speaking, the traditional method is to set a trim bitmap table in the SSD to record whether each data block is trim, when trim occurs, the corresponding trim map is updated constantly, a garbage recovery module in the SSD reads the corresponding bitmap table firstly when garbage recovery is carried out, and when the corresponding bit is found to be set, the data block is used as garbage data and is directly recovered.
But the trim bitmap table generates waste to the memory and also increases the SSD cost.
Disclosure of Invention
In view of the above-mentioned deficiencies of the prior art, the present invention provides an SSD Trim optimization method, system, terminal and storage medium to solve the above-mentioned technical problems.
In a first aspect, the present invention provides an SSD Trim optimization method, including:
arranging a superblock on an SSD, the superblock comprising a plurality of data blocks;
creating an information structure body for the super block, wherein the information structure body stores the states of all data blocks under the super block;
and after triggering garbage collection, reading the data block states in all the information structure bodies, positioning invalid data blocks according to the data block states, and collecting the invalid data blocks.
Further, the information structure body stores the states of all data blocks under the super block, including:
opening corresponding bits for all data blocks under the super block in the structure body;
setting a default value of a corresponding bit of the data block to 1;
and updating the corresponding bit of the data block of the Trim to 0.
Further, the locating the invalid data block according to the data block status includes:
and screening out the data block with the corresponding bit of 0 as an invalid data block.
In a second aspect, the present invention provides an SSD Trim optimization system, comprising:
a packet management unit configured to arrange a superblock on an SSD, the superblock including a plurality of data blocks;
the information storage unit is configured to create an information structure body for the super block, and the information structure body stores the states of all data blocks under the super block;
and the data recovery unit is configured to read the data block states in all the information structures after triggering garbage recovery, locate invalid data blocks according to the data block states, and recover the invalid data blocks.
Further, the information holding unit includes:
the bit opening module is configured to open corresponding bits for all data blocks under the super block in the structure body;
A default setting module configured to set a default value of a corresponding bit of the data block to 1;
and the bit updating module is configured to update the corresponding bit of the data block of the Trim to 0.
Further, the data recovery unit includes:
and the invalid positioning module is configured to screen out the data block with the corresponding bit of 0 as an invalid data block.
In a third aspect, a terminal is provided, including:
a processor, a memory, wherein,
the memory is used for storing a computer program which,
the processor is used for calling and running the computer program from the memory so as to make the terminal execute the method of the terminal.
In a fourth aspect, a computer storage medium is provided having stored therein instructions that, when executed on a computer, cause the computer to perform the method of the above aspects.
The beneficial effect of the invention is that,
according to the SSD Trim optimization method, the SSD Trim optimization system, the SSD Trim optimization terminal and the SSD Trim optimization storage medium, the data blocks of the SSD are arranged and managed, and the states of the data blocks are kept in the information structure body, so that the Trim function without a Trim table is realized. The method reduces the memory waste caused by the trim table, and also reduces the influence on the performance of the SSD when the trim table is updated from time to time in the trim process.
In addition, the invention has reliable design principle, simple structure and very wide application prospect.
Drawings
In order to more clearly illustrate the embodiments or technical solutions in the prior art of the present invention, the drawings used in the description of the embodiments or prior art will be briefly described below, and it is obvious for those skilled in the art that other drawings can be obtained based on these drawings without creative efforts.
FIG. 1 is a schematic flow diagram of a method of one embodiment of the invention.
FIG. 2 is a schematic block diagram of a system of one embodiment of the present invention.
Fig. 3 is a schematic structural diagram of a terminal according to an embodiment of the present invention.
Detailed Description
In order to make those skilled in the art better understand the technical solution of the present invention, the technical solution in the embodiment of the present invention will be clearly and completely described below with reference to the drawings in the embodiment of the present invention, and it is obvious that the described embodiment is only a part of the embodiment of the present invention, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The following explains key terms appearing in the present invention.
SSD:Solid State Drives
L2P:Logical to physical
superblock: recording the whole information of filesystems, including the total amount, usage amount and residual amount of inode/block, and the format and related information of the file system
Block: data block
FIG. 1 is a schematic flow diagram of a method of one embodiment of the invention. The execution subject in fig. 1 may be an SSD Trim optimization system.
As shown in fig. 1, the method 100 includes:
step 110, arranging a super block on the SSD, wherein the super block comprises a plurality of data blocks;
step 120, creating an information structure body for the super block, wherein the information structure body stores the states of all data blocks under the super block;
and step 130, after triggering garbage collection, reading the data block states in all the information structures, positioning invalid data blocks according to the data block states, and collecting the invalid data blocks.
Specifically, the SSD Trim optimization method includes:
s1, arranging a super block on the SSD, wherein the super block comprises a plurality of data blocks.
The SSD includes a plurality of data blocks, and the present embodiment manages the plurality of data blocks in super block units. I.e. a plurality of data blocks are grouped, a group of data blocks comprises N data blocks, and the N data blocks are arranged into a logical super block. In other embodiments of the present application, all data blocks of the SSD may also be arranged as one superblock.
And S2, creating an information structure body for the superblock, wherein the information structure body stores the states of all data blocks under the superblock.
Creating a superblock info structure at the basic information storage address of each superblock, and storing the state of the block in the superblock info structure. The basic information also includes information such as the number of PEs and VDFC.
Wherein the state of block is represented as follows:
for example, in the raid of 15+1, a super block is composed of 16 physical data blocks (15 blocks are used as data blocks +1 blocks are used for parity blocks), and 16 bits (bits) are opened in the super block, so that one bit corresponds to one data block.
In this embodiment, the default value of the corresponding bit of the valid data block is set to 1, and when the host issues the trim, if the trim loses a certain whole physical data block, the bit of the data block is synchronously updated in the structural body of the super block, and the bit is updated to 0.
And S3, after triggering garbage collection, reading the data block states in all the information structures, positioning invalid data blocks according to the data block states, and collecting the invalid data blocks.
When garbage collection is triggered, corresponding superblock information is read from a memory or a flash according to an original mechanism, bit information corresponding to a data block of the superblock is read out sequentially at the moment, an invalid data block with a bit of 0 is screened out, and the invalid data block is directly collected without data moving.
As shown in fig. 2, the system 200 includes:
a packet management unit 210 configured to arrange a super block on the SSD, the super block including a plurality of data blocks;
an information saving unit 220, configured to create an information structure for the super block, where the information structure saves the states of all data blocks under the super block;
and the data recovery unit 230 is configured to read the data block states in all the information structures after triggering garbage recovery, locate an invalid data block according to the data block states, and recover the invalid data block.
Optionally, as an embodiment of the present invention, the information saving unit includes:
the bit opening module is configured to open corresponding bits for all data blocks under the super block in the structure body;
a default setting module configured to set a default value of a corresponding bit of the data block to 1;
and the bit updating module is configured to update the corresponding bit of the data block of the Trim to 0.
Optionally, as an embodiment of the present invention, the data recovery unit includes:
and the invalid positioning module is configured to screen out the data block with the corresponding bit of 0 as an invalid data block.
Fig. 3 is a schematic structural diagram of a terminal 300 according to an embodiment of the present invention, where the terminal 300 may be used to execute the SSD Trim optimization method according to the embodiment of the present invention.
The terminal system 300 may include: a processor 310, a memory 320, and a communication unit 330. The components communicate via one or more buses, and those skilled in the art will appreciate that the architecture of the servers shown in the figures is not intended to be limiting, and may be a bus architecture, a star architecture, a combination of more or less components than those shown, or a different arrangement of components.
The memory 320 may be used for storing instructions executed by the processor 310, and the memory 320 may be implemented by any type of volatile or non-volatile storage terminal or combination thereof, such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The executable instructions in memory 320, when executed by processor 310, enable terminal 300 to perform some or all of the steps in the method embodiments described below.
The processor 310 is a control center of the storage terminal, connects various parts of the entire electronic terminal using various interfaces and lines, and performs various functions of the electronic terminal and/or processes data by operating or executing software programs and/or modules stored in the memory 320 and calling data stored in the memory. The processor may be composed of an Integrated Circuit (IC), for example, a single packaged IC, or a plurality of packaged ICs connected with the same or different functions. For example, the processor 310 may include only a Central Processing Unit (CPU). In the embodiment of the present invention, the CPU may be a single operation core, or may include multiple operation cores.
A communication unit 330, configured to establish a communication channel so that the storage terminal can communicate with other terminals. And receiving user data sent by other terminals or sending the user data to other terminals.
The present invention also provides a computer storage medium, wherein the computer storage medium may store a program, and the program may include some or all of the steps in the embodiments provided by the present invention when executed. The storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM) or a Random Access Memory (RAM).
Therefore, the invention realizes the trim function without trim tables by arranging and managing the data blocks of the SSD and keeping the state of the data blocks in the information structure body. The invention reduces the memory waste caused by the trim table, and also reduces the influence on the performance of the SSD when the trim table is updated from time to time in the trim process.
Those skilled in the art will readily appreciate that the techniques of the embodiments of the present invention may be implemented as software plus a required general purpose hardware platform. Based on such understanding, the technical solutions in the embodiments of the present invention may be embodied in the form of a software product, where the computer software product is stored in a storage medium, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and the like, and the storage medium can store program codes, and includes instructions for enabling a computer terminal (which may be a personal computer, a server, or a second terminal, a network terminal, and the like) to perform all or part of the steps of the method in the embodiments of the present invention.
The same and similar parts in the various embodiments in this specification may be referred to each other. Especially, for the terminal embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant points can be referred to the description in the method embodiment.
In the embodiments provided in the present invention, it should be understood that the disclosed system and method can be implemented in other ways. For example, the above-described system embodiments are merely illustrative, and for example, the division of the units is only one logical functional division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, systems or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
Although the present invention has been described in detail by referring to the drawings in connection with the preferred embodiments, the present invention is not limited thereto. Various equivalent modifications or substitutions can be made on the embodiments of the present invention by those skilled in the art without departing from the spirit and scope of the present invention, and these modifications or substitutions are within the scope of the present invention/any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (8)

1. A SSD Trim optimization method, comprising:
arranging a superblock on an SSD, the superblock comprising a plurality of data blocks;
creating an information structure body for the super block, wherein the information structure body stores the states of all data blocks under the super block;
And after triggering garbage collection, reading the data block states in all the information structure bodies, positioning invalid data blocks according to the data block states, and collecting the invalid data blocks.
2. The method of claim 1, wherein the information structure maintains the state of all data blocks under the superblock, including:
opening corresponding bits for all data blocks under the super block in the structure body;
setting a default value of a corresponding bit of the data block to 1;
and updating the corresponding bit of the data block of the Trim to 0.
3. The method of claim 2, wherein locating invalid data blocks according to a data block status comprises:
and screening out the data block with the corresponding bit of 0 as an invalid data block.
4. An SSD Trim optimization system, comprising:
a packet management unit configured to arrange a superblock on an SSD, the superblock including a plurality of data blocks;
the information storage unit is configured to create an information structure body for the super block, and the information structure body stores the states of all data blocks under the super block;
and the data recovery unit is configured to read the data block states in all the information structures after triggering garbage recovery, locate invalid data blocks according to the data block states, and recover the invalid data blocks.
5. The system according to claim 4, wherein the information holding unit comprises:
the bit opening module is configured to open corresponding bits for all data blocks under the super block in the structure body;
a default setting module configured to set a default value of a corresponding bit of the data block to 1;
and the bit updating module is configured to update the corresponding bit of the data block of the Trim to 0.
6. The system of claim 5, wherein the data recovery unit comprises:
and the invalid positioning module is configured to screen out the data block with the corresponding bit of 0 as an invalid data block.
7. A terminal, comprising:
a processor;
a memory for storing instructions for execution by the processor;
wherein the processor is configured to perform the method of any one of claims 1-3.
8. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1-3.
CN202010675647.XA 2020-07-14 2020-07-14 SSD Trim optimization method, system, terminal and storage medium Withdrawn CN111857586A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010675647.XA CN111857586A (en) 2020-07-14 2020-07-14 SSD Trim optimization method, system, terminal and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010675647.XA CN111857586A (en) 2020-07-14 2020-07-14 SSD Trim optimization method, system, terminal and storage medium

Publications (1)

Publication Number Publication Date
CN111857586A true CN111857586A (en) 2020-10-30

Family

ID=72983910

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010675647.XA Withdrawn CN111857586A (en) 2020-07-14 2020-07-14 SSD Trim optimization method, system, terminal and storage medium

Country Status (1)

Country Link
CN (1) CN111857586A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116860179A (en) * 2023-08-31 2023-10-10 合肥康芯威存储技术有限公司 Storage device, data processing method for storage device, computer apparatus, and medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107632942A (en) * 2017-08-29 2018-01-26 记忆科技(深圳)有限公司 A kind of method that solid state hard disc realizes LBA rank TRIM orders
CN109725847A (en) * 2017-10-30 2019-05-07 东芝存储器株式会社 Storage system and control method

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107632942A (en) * 2017-08-29 2018-01-26 记忆科技(深圳)有限公司 A kind of method that solid state hard disc realizes LBA rank TRIM orders
CN109725847A (en) * 2017-10-30 2019-05-07 东芝存储器株式会社 Storage system and control method

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116860179A (en) * 2023-08-31 2023-10-10 合肥康芯威存储技术有限公司 Storage device, data processing method for storage device, computer apparatus, and medium

Similar Documents

Publication Publication Date Title
CN102750317B (en) Method and device for data persistence processing and data base system
CN103019888B (en) Backup method and device
US9292434B2 (en) Method and apparatus for restoring flash translation layer (FTL) in non-volatile storage device
CN109947596A (en) PCIE device failure system delay machine processing method, device and associated component
CN113568566B (en) Method for seamless migration of simple storage service by index object, main device and storage server
CN109508148B (en) Metadata reconstruction method and device and computer readable storage medium
CN113626256B (en) Virtual machine disk data backup method, device, terminal and storage medium
JP2017079053A (en) Methods and systems for improving storage journaling
CN108694231A (en) Using NVM and by multiple log recording buffers come ahead log recording
CN107665098B (en) Information processing method, storage device, and computer storage medium
CN104462612A (en) Method and device for monitoring database information
CN112182010B (en) Dirty page refreshing method and device, storage medium and electronic equipment
CN103268294A (en) Operation method of access data and data processing equipment
CN109710185A (en) Data processing method and device
CN109918318A (en) SSD metadata management method, device, equipment and readable storage medium storing program for executing
CN110019063A (en) Method, terminal device and the storage medium of calculate node data disaster tolerance playback
CN111857586A (en) SSD Trim optimization method, system, terminal and storage medium
CN110737504A (en) deep learning model training fault-tolerant method, system, terminal and storage medium
CN113419897A (en) File processing method and device, electronic equipment and storage medium thereof
CN114924914B (en) Disk partition table information backup and recovery method and system
CN115061858B (en) Data persistence method and device, computer equipment and storage medium
WO2022156369A1 (en) Storage block management information synchronous recording method and system, and terminal and storage medium
CN109164988A (en) Processor-based virtual machine snapshot method and system
CN106371770B (en) Method for writing data and device
CN115359828A (en) Server firmware refreshing method, device, terminal and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WW01 Invention patent application withdrawn after publication

Application publication date: 20201030

WW01 Invention patent application withdrawn after publication