CN111324296A - Data processing method, controller, storage device and storage system - Google Patents

Data processing method, controller, storage device and storage system Download PDF

Info

Publication number
CN111324296A
CN111324296A CN201811571773.XA CN201811571773A CN111324296A CN 111324296 A CN111324296 A CN 111324296A CN 201811571773 A CN201811571773 A CN 201811571773A CN 111324296 A CN111324296 A CN 111324296A
Authority
CN
China
Prior art keywords
read
request
write
erase
mode
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.)
Granted
Application number
CN201811571773.XA
Other languages
Chinese (zh)
Other versions
CN111324296B (en
Inventor
吴黎明
刘国霞
唐吉卓
张颇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to EP19899326.3A priority Critical patent/EP3879393A4/en
Priority to PCT/CN2019/081221 priority patent/WO2020124867A1/en
Publication of CN111324296A publication Critical patent/CN111324296A/en
Priority to US17/347,041 priority patent/US11954332B2/en
Application granted granted Critical
Publication of CN111324296B publication Critical patent/CN111324296B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0683Plurality of storage devices
    • G06F3/0688Non-volatile semiconductor memory arrays
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/08Error detection or correction by redundancy in data representation, e.g. by using checking codes
    • G06F11/10Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's
    • G06F11/1076Parity data used in redundant arrays of independent storages, e.g. in RAID systems
    • 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
    • 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
    • G06F3/0611Improving I/O performance in relation to response time
    • 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/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0655Vertical data movement, i.e. input-output transfer; data movement between one or more hosts and one or more storage devices
    • G06F3/0659Command handling arrangements, e.g. command buffers, queues, command scheduling
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0706Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment
    • G06F11/0727Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment in a storage system, e.g. in a DASD or network based storage system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0751Error or fault detection not based on redundancy
    • G06F11/0754Error or fault detection not based on redundancy by exceeding limits
    • G06F11/0757Error or fault detection not based on redundancy by exceeding limits by exceeding a time limit, i.e. time-out, e.g. watchdogs
    • 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
    • G06F12/0868Data transfer between cache memory and other subsystems, e.g. storage devices or host systems
    • 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/0888Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches using selective caching, e.g. bypass
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/10Providing a specific technical effect
    • G06F2212/1016Performance improvement
    • G06F2212/1024Latency reduction
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/21Employing a record carrier using a specific recording technology
    • G06F2212/214Solid state disk
    • 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/7208Multiple device management, e.g. distributing data over multiple flash devices

Abstract

The embodiment of the invention provides a data processing method, a controller, a storage device and a storage system. In the scheme, the controller adds the execution time of the IO request to the IO request, the execution time is used for indicating that the storage device finishes processing the IO request before the execution time is reached, and the controller sends the IO request added with the execution time to the storage device. And when the storage equipment receives the IO request, the IO request can be executed according to the execution time of the IO request. By adopting the method of the embodiment of the invention, the urgent IO request can be processed in time, and the delay is avoided.

Description

Data processing method, controller, storage device and storage system
Technical Field
The present application relates to the field of storage, and in particular, to a method, a controller, a storage device, and a storage system for processing data stored in the storage device.
Background
In the prior art, a solid State Storage Device (SSD) executes IO requests for accessing the same Die in the SSD according to the order in which the IO requests reach the Die. And if a block (block) in the Die needs to be erased, adding an erasing request for erasing the block into a queue of the to-be-processed request corresponding to the Die. For example, if a write request and an erase request are queued ahead of a read request in a queue of pending requests, the SSD first performs a write operation corresponding to the write request, then performs an erase operation corresponding to the erase request, and finally performs a read operation corresponding to the read request. However, the time consumed by the write operation and the erase operation is much longer than that consumed by the read operation, so that for an urgent read request, the read request must be executed until the previous write request or erase request is executed, which easily causes a delay in the read operation. In addition, for IO requests generated by some operations inside the SSD, for example, operations such as garbage collection and polling, the time consumed by the operations corresponding to the IO requests generated by the operations is longer, and the delay impact on other relatively urgent IO requests, for example, a read request, is larger.
Disclosure of Invention
The invention provides a data processing method, a controller, a storage device and a storage system, which are used for increasing execution time in an IO request, so that the storage device executes the IO request according to the execution time in the IO request when executing the IO request, and thus, the urgent IO request is processed in time.
A first aspect of the invention provides a method of data processing, performed by a controller, the controller being in communication with a storage device. The controller and the storage device can be a memory and a storage device in a storage array, and can also be a memory and a storage device in a server. When the controller executes the method, the execution time of the IO request is added to the IO request, and then the IO request is sent to the storage device, wherein the execution time is used for indicating that the storage device finishes processing the IO request before the execution time is reached.
By increasing the execution time in the IO request, the storage device executes the IO request according to the execution time in the IO request when executing the IO request, so that the urgent IO request is processed in time.
In an optional embodiment of the first aspect, the controller further adds a timeout indication flag in the IO request. And the timeout indication mark is used for indicating whether to return an error message when the storage device exceeds the execution time and the IO request is not processed by the storage device, and the error message is used for indicating the IO request execution error.
Therefore, when the IO request is not completed within the execution time of the IO request, the controller can be notified in time, and the controller can determine a new processing policy for the IO request in time, such as rereading or writing a new location.
In an optional embodiment of the first aspect, the controller may determine a type of the IO request, for example, an externally generated IO request, an IO request corresponding to an internal key service, or an IO request corresponding to an array background service, and then determine an execution time of the IO request according to the determined type of the IO request.
By setting different execution times for different types of IO requests, IO requests that need to be processed urgently can be processed preferentially.
In a first optional embodiment of the first aspect, different execution durations are not preset for each type of IO request in the controller, and then when an execution time is set for a received IO request, the storage device may execute the IO request according to the completion time of the IO request by using the current time plus the execution duration set for the type to which the IO request belongs.
A second aspect of the invention provides a method of data processing, performed by a storage device. After the storage device obtains the IO request, because the IO request includes an execution time indicating that the storage device completes processing the IO request before the execution time is reached, the storage device may execute the IO request according to the execution time of the IO request.
By increasing the execution time in the IO request, the storage device executes the IO request according to the execution time in the IO request when executing the IO request, so that the urgent IO request is processed in time.
In an optional embodiment of the second aspect, the storage device includes a plurality of storage blocks, and after the storage device obtains the IO request, the storage block accessed by the IO request is determined, then the IO request is placed in a queue of the to-be-processed requests corresponding to the storage blocks according to the execution time, and then the IO request is executed according to the execution time of the IO request in the queue.
By setting the queue of the pending requests for each storage block, the pending requests can be managed by the storage array according to the execution time of the IO requests.
In an optional embodiment of the second aspect, the storage device includes a plurality of storage areas, each storage area is composed of at least one storage block, the IO request is a write request, when the storage device determines a storage block accessed by the IO request, a storage area not executing an erase operation is first selected from the plurality of storage areas, and then the storage block accessed by the IO request is determined according to the selected storage area.
Because the execution time of the write request and the execution time of the erase request are both longer, the write request and the erase request can be executed in different storage areas separately through the method, and therefore the probability that the urgent IO request is processed in time is increased.
In an alternative embodiment of the second aspect, each memory block includes a plurality of sub-blocks, the sub-blocks being the smallest unit for performing the erase operation, and each memory area includes two modes, a read + write mode and a read + erase mode, the memory area being set to the read + write mode when the memory area is used for writing data, and the memory area being set to the read + erase mode when the memory area is used for performing the erase operation. When the memory block selects a memory area which is not currently used for executing an erasing operation from the plurality of memory areas, firstly selecting a memory area in the read + write mode from the plurality of memory areas; judging whether the number of the idle sub-blocks in the selected storage area is lower than a threshold value or not; when the number of the idle sub-blocks in the selected storage area is lower than a threshold value, setting the mode of the storage area to be a read + erase mode; judging whether a storage area which is not in a read + write mode and a read + erase mode exists or not; when a memory area which is not in the read + write mode and the read + erase mode exists, the memory area which is not in the read + write mode and the read + erase mode is used as a memory area which is not used for executing the erase operation. And when the number of the free sub-blocks in the selected storage area is not lower than the threshold value, taking the selected storage area in the read + write mode as the storage area which is not subjected to the erasing operation.
In this way, when the storage device selects a storage area that is not currently executing an erase operation, if the number of free sub-blocks (blocks) of the selected storage area is lower than a threshold, which indicates that too little space in the storage area is available for writing data, write efficiency is affected, so that the storage area can be erased for later use, and a new storage area is newly selected for the IO request.
In another optional embodiment of the second aspect, the memory device, when selecting a memory area which is not currently performing an erase operation from the plurality of memory areas, first selects a memory area in the read + write mode from the plurality of memory areas; judging whether the read-write pressure borne by the selected storage area exceeds a threshold value; when the read-write pressure born by the selected storage area exceeds a threshold value, judging whether the storage area which is not in a read + write mode or a read + erase mode exists; and when the memory areas which are not in the read + write mode and the read + erase mode exist, selecting the memory areas which are not in the read + write mode and the read + erase mode as the memory areas which are not used for executing the erase operation. And when the read-write pressure born by the selected storage area does not exceed the threshold value, the selected storage area is taken as the storage area which does not execute the erasing operation.
When the selected storage area is in the selected storage area, the storage area with low read-write pressure can be selected to write data by judging whether the read-write pressure exceeds the threshold value, so that the data is prevented from being written into the storage area with high read-write pressure, and the write efficiency is further prevented from being influenced.
In an optional embodiment of the second aspect, the memory area further comprises a read + write + erase mode, and in the read + write + erase mode, a read operation, a write operation, and an erase operation can be performed in the memory area. When the storage areas which are not in the read + write mode and the read + erase mode do not exist, the storage device converts all modes of the storage areas into the read + write + erase mode.
By converting the mode of the storage area and simultaneously performing read-write erasing, the situation that data cannot be normally written when the storage equipment cannot find a proper storage area for IO is avoided.
In an alternative embodiment of the second aspect of the present invention, each memory block includes a plurality of sub-blocks, the sub-blocks being the minimum unit for performing the erase operation, and each memory area includes two modes, a read + write mode and a read + erase mode, the memory area is set to the read + write mode when the memory area is used for writing data, and the memory area is set to the read + erase mode when the memory area is used for performing the erase operation. The storage device selects a storage area in which to-be-written data is written by executing the following method, firstly, the storage area in a read + write mode is selected, whether the number of blank sub-blocks in the selected storage area is lower than a threshold value or not is judged, and if the number of blank sub-blocks in the selected storage area is lower than the threshold value, the mode of the storage area is converted into a read + erase mode; judging whether a storage area which is not in a read + write mode and a read + erase mode exists in a storage area of the SSD, if so, taking the storage area as a storage area which is not used for executing an erase operation, and if not, switching all the storage areas in the SSD into the read + write + erase mode by the disk processor 1021; and if the pressure of the storage area currently in the read + write mode is not large, the storage area is determined to be a storage area for writing the write request, and if the pressure of the storage area currently in the read + write mode is too large, the disk processor 1021 switches all the storage areas in the SSD into a read + write + erase mode.
In an optional embodiment of the second aspect, the queue of the pending request corresponding to each memory block is a linked list group. And each storage block corresponds to a read chain table group and a write chain table group, the read chain table group is used for mounting the read request according to the execution time of the read request in the IO request, and the write chain table group is used for mounting the write request according to the execution time of the write request in the IO request.
By mounting the read request and the write request in different linked lists, the efficiency of scheduling execution of the IO request can be improved.
In an optional embodiment of the second aspect, the read linked list group and the write linked list group respectively include a plurality of linked lists, each linked list represents a time range, the time ranges of two adjacent linked lists are consecutive, and the storage device may determine a time range to which the execution time of the read request or the write request belongs; and mounting the read request or the write request under a linked list corresponding to the time range.
By dividing a plurality of time ranges and mounting the IO request on a linked list corresponding to the time range in which the execution time falls, the speed of searching the IO request can be increased, and the efficiency of scheduling and executing the IO request is improved.
In an optional embodiment of the second aspect, the storage area further includes at least one disk-level chain table group, the chain table group corresponding to the storage block is a block-level chain table group, each disk-level chain table group includes a plurality of disk-level chain tables, each disk-level chain table represents a time range, the time range is a current time plus a preset time length, the time ranges of two adjacent disk-level chain tables are consecutive, the at least one disk-level chain table group and the block-level chain table group form different levels, and the block-level chain table group is a chain table group of the lowest level, where a sum of the time ranges represented by all chain tables of the chain table group of the next level is a time range represented by the first chain table of the chain table group of the previous level.
By dividing the multi-level linked list, the length of the whole linked list can be reduced, the time precision represented by the linked list is provided, and the efficiency of scheduling and executing the IO request is improved.
In an optional embodiment of the second aspect of the present invention, the storage device divides a write request or an erase request that needs to be executed into a plurality of fragments; after executing a fragment, determining whether an urgent read request needs to be processed, wherein the urgent read request is a read request with the execution time earlier than the execution time of the write request or the erase request; and if an urgent read request needs to be processed, suspending the execution of the write request or the erase request and executing the urgent read request.
In an optional embodiment of the second aspect of the present invention, the storage device divides a write request or an erase request that needs to be executed into a plurality of fragments; after executing a fragment, determining whether an urgent read request needs to be processed, wherein the urgent read request is a read request of which the execution time is earlier than the current time plus the execution time of the next fragment plus the execution time of the read request; and if an urgent read request needs to be processed, suspending the execution of the write request or the erase request and executing the urgent read request.
In an optional embodiment of the second aspect of the present invention, the storage device divides a write request or an erase request that needs to be executed into a plurality of fragments; after executing a fragment, determining whether an urgent read request needs to be processed, wherein the execution time of the read request is earlier than the execution time of the next fragment plus the execution duration of x read requests executed in series, and x is the maximum number of read requests allowed to be executed in series when the execution of a write request or an erase request is suspended; and if an urgent read request needs to be processed, suspending the execution of the write request or the erase request and executing the urgent read request.
By fragmenting the write request or the erase request, and after one fragment is not executed, the situation that whether an urgent IO request needs to be processed exists can be seen, and if the urgent IO request exists, the urgent IO request is executed, so that the urgent IO request cannot be processed in time when the write request or the erase request which consumes a long time is executed.
A third aspect of the present invention provides a data processing method applied to a storage device, where the storage device includes a plurality of storage areas. The storage device receives a write request, wherein the write request carries data to be written, and then a storage area which is not subjected to erasing operation is selected from the plurality of storage areas; and writing the data to be written into the selected storage area.
Because the execution time of the write request and the execution time of the erase request are both longer, the write request and the erase request can be executed in different storage areas separately through the method, and therefore the probability that the urgent IO request is processed in time is increased.
In an optional embodiment of the third aspect, the storage device includes multiple storage areas, each storage area is composed of at least one storage block, the IO request is a write request, when the storage device determines a storage block accessed by the IO request, a storage area not executing an erase operation is first selected from the multiple storage areas, and then the storage block accessed by the IO request is determined according to the selected storage area.
Because the execution time of the write request and the execution time of the erase request are both longer, the write request and the erase request can be executed in different storage areas separately through the method, and therefore the probability that the urgent IO request is processed in time is increased.
In an alternative embodiment of the third aspect, each memory block includes a plurality of sub-blocks, the sub-blocks being the smallest unit for performing the erase operation, and each memory area includes two modes, a read + write mode and a read + erase mode, the memory area is set to the read + write mode when the memory area is used for writing data, and the memory area is set to the read + erase mode when the memory area is used for performing the erase operation. When the memory block selects a memory area which is not currently used for executing an erasing operation from the plurality of memory areas, firstly selecting a memory area in the read + write mode from the plurality of memory areas; judging whether the number of the idle sub-blocks in the selected storage area is lower than a threshold value or not; when the number of the idle sub-blocks in the selected storage area is lower than a threshold value, setting the mode of the storage area to be a read + erase mode; judging whether a storage area which is not in a read + write mode and a read + erase mode exists or not; when a memory area which is not in the read + write mode and the read + erase mode exists, the memory area which is not in the read + write mode and the read + erase mode is used as a memory area which is not used for executing the erase operation. And when the number of the free sub-blocks in the selected storage area is not lower than the threshold value, taking the selected storage area in the read + write mode as the storage area which is not subjected to the erasing operation.
In this way, when the storage device selects a storage area that is not currently executing an erase operation, if the number of free sub-blocks (blocks) of the selected storage area is lower than a threshold, which indicates that too little space in the storage area is available for writing data, write efficiency is affected, so that the storage area can be erased for later use, and a new storage area is newly selected for the IO request.
In another optional embodiment of the third aspect, the storage device, when selecting a storage area which is not currently performing an erase operation from the plurality of storage areas, first selects a storage area in the read + write mode from the plurality of storage areas; judging whether the read-write pressure borne by the selected storage area exceeds a threshold value; when the read-write pressure born by the selected storage area exceeds a threshold value, judging whether the storage area which is not in a read + write mode or a read + erase mode exists; and when the memory areas which are not in the read + write mode and the read + erase mode exist, selecting the memory areas which are not in the read + write mode and the read + erase mode as the memory areas which are not used for executing the erase operation. And when the read-write pressure born by the selected storage area does not exceed the threshold value, the selected storage area is taken as the storage area which does not execute the erasing operation.
When the selected storage area is in the selected storage area, the storage area with low read-write pressure can be selected to write data by judging whether the read-write pressure exceeds the threshold value, so that the data is prevented from being written into the storage area with high read-write pressure, and the write efficiency is further prevented from being influenced.
In an optional embodiment of the third aspect, the storage area further includes a read + write + erase mode, and in the read + write + erase mode, a read operation, a write operation, and an erase operation can be performed in the storage area. When the storage areas which are not in the read + write mode and the read + erase mode do not exist, the storage device converts all modes of the storage areas into the read + write + erase mode.
By converting the mode of the storage area and simultaneously performing read-write erasing, the situation that data cannot be normally written when the storage equipment cannot find a proper storage area for IO is avoided.
In an optional embodiment of the third aspect, the storage device further receives a read request, where the read request and the write request include an execution time, and the execution time is used to instruct the storage device to process the read request or the write request before the execution time arrives; and executing the read request or the write request according to the execution time of the read request or the write request.
A fourth aspect of the present invention provides a controller including a plurality of functional modules, each of which performs the same function as each of the steps of the data processing method provided in the first aspect.
A fifth aspect of the present invention provides a storage device including a plurality of functional modules, each of which performs the same function as each of the steps in the data processing method provided in the second aspect.
A sixth aspect of the present invention provides a storage device including a plurality of functional modules, each of which performs the same function as each of the steps in the data processing method provided in the third aspect.
A seventh aspect of the present invention provides a data processing system comprising the various controllers provided in the first aspect and the second aspect and providing the various storage devices.
An eighth aspect of the present invention provides a controller, where the controller includes a processor and a storage unit, where the storage unit stores program instructions, and the processor executes the program instructions in the storage unit to execute the data processing method provided in the first aspect.
An eighth aspect of the present invention provides a storage device, which includes a processor and a storage unit, wherein the storage unit stores program instructions, and the processor executes the program instructions in the storage unit to execute the data processing method provided in the second aspect or the third aspect.
In a ninth aspect, there is provided a storage medium having computer program code stored therein, which when run on a computer causes the computer to perform the method of the first or second or third aspect.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below.
Fig. 1 is a hardware configuration diagram of a server according to an embodiment of the present invention.
Fig. 2 is a hardware structure diagram of a storage device according to an embodiment of the present invention.
Fig. 3 is a schematic diagram of constructing a storage area by using storage blocks in a storage device as granularity in the embodiment of the present invention.
Fig. 4 is a flowchart of a method for processing an IO request by a controller in a server according to an embodiment of the present invention.
Fig. 5 is a flowchart of processing a received write request by a storage device according to an embodiment of the present invention.
Fig. 6 is a flowchart of a method for determining a storage area to be written with data of a write request according to an embodiment of the present invention.
FIG. 7 is a diagram illustrating a first linked list group for mounting an IO request according to an embodiment of the present invention.
Fig. 8 is a schematic diagram of a second mid-chain table group for mounting an IO request according to an embodiment of the present invention.
Fig. 9 is a flowchart of processing a received read request by a storage device according to an embodiment of the present invention.
FIG. 10 is a functional block diagram of a controller according to an embodiment of the present invention.
Fig. 11 is a functional block diagram of a memory device in an embodiment of the present invention.
Fig. 12 is a schematic diagram of a read IO request in an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments.
Fig. 1 is a hardware configuration diagram of a server 100 according to an embodiment of the present invention. The server 100 includes a controller 101, a plurality of storage devices 102, a memory 103, an interface 104, and a bus 105. The controller 101, the storage device 102 and the interface 104 are connected to the bus 105, and the controller 101 accesses the storage device 102 through the bus 105. The interface 104 is used for connecting a host (not shown) and transmitting an IO request received from the host to the controller 101 for processing. The memory 103 includes an application (not shown) executed by the controller 101, and by executing the application, the controller 101 may manage the storage device 102 or enable the server 100 to provide services to the outside. In the embodiment of the present invention, the server 100 may be a storage array, and the storage device 102 may be an SSD.
As shown in fig. 2, a block diagram of the storage device 102 in the server 100 is shown. The storage devices 102 in the server 100 have the same configuration, and one of them will be described as an example.
Each storage device 102 includes a disk processor 1021, a cache 1022, and a physical storage space made up of a plurality of Nand flash 1023. The disk processor 1021 is configured to receive an IO request sent by the controller 101, and execute the IO request to access data from the physical storage space. The cache 1022 is used for storing an application program executed by the disk processor 1021, and by executing the application program, the disk processor 1021 can access and manage data in the storage area 1023.
In the embodiment of the invention, the physical storage space is divided into a plurality of storage areas, each storage area is composed of at least one storage block, and the storage block is a Die constituting the Nand flash.
As shown in fig. 3, it is a schematic diagram of RAID with the storage area formed by multiple Die in Nand flash. Typically, each Nand flash includes multiple Die 1024. To ensure the reliability of data in the storage device 102, a RAID (Redundant Arrays of Independent Drives) is established in the storage device 102 with Die as the granularity. For example, each storage device 102 includes 16 Nand flash grains, each grain containing 4 Die, and if each 16 Die forms a disk array 1025, then 4 RAIDs 1025 can be constructed in the storage device 102. The number of flash granules contained in the storage device 102, the number of Die contained in each granule, and the number of Die composing RAID are all examples, and are not intended to limit the present invention. Each Die1024 includes a plurality of sub-blocks 1026, each sub-block 1026 being the smallest unit for performing an erase operation.
For the storage device 102 with low reliability requirement, it is also possible to form one storage area for each Die without forming RAID.
In the prior art, when receiving an IO request sent by a host, a controller 101 sends the IO request to a storage device 102 accessed by the IO request for processing. After the storage device 102 receives the IO request, it further determines the storage block accessed by the IO request. For IO requests accessing the same storage block, the disk processor 1021 of the storage device 120 may sequentially execute the IO requests according to the order of the IO requests accessing the Die. And if a block (block) in the Die needs to be erased, adding an erasing request for erasing the block into a queue of the to-be-processed request corresponding to the Die. For example, if the first is a write request, the second is an erase request, and the third is a read request in the queue of pending requests, the disk processor 1021 performs a write operation corresponding to the write request, then performs an erase operation corresponding to the erase request, and finally performs a read operation corresponding to the read request. However, the time consumed by the write operation and the erase operation is much longer than that consumed by the read operation, for example, the time consumed by the read operation is generally 80 μ s, the time consumed by the write operation is generally 1-3ms, and the time consumed by the erase operation is generally 3-15 ms, so that for an urgent read request, the read request must be executed until the previous write request or erase request is executed, which easily causes a delay of the read operation. In addition, for IO requests generated by some operations inside the storage device, for example, operations such as garbage collection and polling, the time consumed by the operations corresponding to the IO requests generated by these operations is longer, and then the delay impact on other relatively urgent IO requests, for example, a read request, is greater.
In the embodiment of the present invention, the controller 101 sets the execution time for the received IO request, and sends the IO request with the set execution time to the storage device 102, and the storage device 102 adjusts the execution sequence of the IO request according to the execution time of the IO request, so that the emergency IO request is processed in time, thereby avoiding the occurrence of timeout of the emergency IO request. The solution provided by the embodiment of the present invention will be described in detail below with reference to fig. 4 to 9.
Fig. 4 is a flowchart illustrating a method for increasing the execution time of the IO request by the controller 101 according to the embodiment of the present invention.
In step S401, the controller 101 determines the type of the IO request.
The types of the IO requests generally include three major types, the first type is an IO request generated outside the server 100, for example, an IO request sent by an external host to the server, the IO request generated outside the server 100 includes two types, one type is an IO request generated by the host in response to an operation of a user; the other is an IO request corresponding to a value added service of the server 100, such as snapshot, clone, copy, double live, backup, and the like. The second type is IO corresponding to key services inside the server 100, for example, reading and writing of metadata; the third type is an IO request corresponding to the array background task, such as cache disk flushing, hard disk reconstruction, garbage recovery, and the like. These three types of IO requests each include two types of requests, namely read requests and write requests.
Step S402, the controller 101 sets an execution time for the IO request according to the type of the IO request.
The controller 101 will periodically (e.g., 1 minute/1 hour/day) synchronize the system time in the server 100 to each storage device 102, which ensures that the server 100 remains synchronized with the time in each storage device 102.
In the server 100, an execution time length may be set in advance for each type of IO request, for example, the execution time lengths set for a read request and a write request generated by a host in response to an operation of a user are respectively 200 μ s and 400 μ s, the execution time lengths set for a read request and a write request generated by reading and writing metadata are respectively 200 μ s and 500 μ s, the execution time lengths set for a read request and a write request for metadata are respectively 500 μ s and 2ms, and the execution time lengths set for a read request and a write request generated when a hard disk reconfiguration is performed are respectively 10ms and 1 s. The execution time length set for the read request and the write request generated when garbage collection is executed is 10ms and 2s respectively, and similarly, the execution time length can also be set for the read request and the write request in snapshot, clone, copy, double active and backup in the value added service respectively. The execution time lengths of the various types of IO requests listed above are merely for example and are not used to limit the present invention, and in practical applications, different execution time lengths may be set for different IO requests according to actual situations.
When the controller 101 receives an IO request and identifies a type of the IO request, it obtains an execution duration set for the type of the IO request according to the type of the IO request, and then sets an execution time for the received IO request, where the set execution time is equal to the sum of the current system time of the server 100 and the obtained execution duration of the type of the IO request. By setting the execution time for each IO request, the storage device can execute the IO request according to the execution time of the IO request when executing the IO request, so that the urgent IO request can be processed in time, and a specific process for executing the IO request by the storage device according to the execution time will be described below.
It should be noted that, for a read request in the first type IO request, if data read by the read request hits in the memory 103, the data read from the memory is directly returned to the host. For a write request in the first type of IO request, the data to be written in the write request is written into the memory 103, and then a feedback instruction of completing the write is returned to the host. And when the data in the memory 103 is written into the storage device 102 subsequently, generating a new write request, wherein the generated new IO request belongs to the cache disk in the third type of IO request, and then resetting the execution time for the new IO request.
In the embodiment of the present invention, a field is added to the IO request to carry the execution time. Fig. 12 is a schematic diagram of a read request under the NVMe protocol. The read request includes 64 bytes, where Opcode is a command Identifier for identifying that the command is a read request, and further includes other parameters related to the read request, such as a Namespace Identifier (Namespace Identifier), a Metadata Pointer (Metadata Pointer), a memory address (Data Pointer) when returning Data to a disk, a Starting logical address (Starting LBA), and the like, where the above parameters are all parameters defined in an existing read command, and are not described herein again. In addition to the above parameters, there are some blank locations in the read request, for example, four bytes of the second command line, four bytes of the third command line, and four bytes of the thirteenth command line are not defined, so in the embodiment of the present invention, a byte capable of carrying the execution time may be arbitrarily selected from the blank bytes, for example, four bytes of the second command line are selected to carry the execution time.
Optionally, a field is further added in the IO request, where the field is used to carry a timeout indication flag, and the timeout indication flag is used to indicate whether to return a flag immediately when the time for completing the execution of the IO request exceeds the execution time of the IO request. Also taking fig. 12 as an example, in the Byte1 of the read command, that is, the 13 th bit (bit) of the command line 0 is blank, it is not yet defined, so the timeout indication flag can be carried by this bit. For example, when the timeout indication flag is 0, it indicates that the time for the IO request to complete execution exceeds the execution time of the IO request, and it does not need to return immediately, and when the timeout indication flag is 1, it indicates that the time for the IO request to complete execution exceeds the execution time of the IO request, it needs to return immediately. The position carrying the timeout indication mark may also be any blank position in the existing read command, and the timeout indication mark may also have different definitions, fig. 12 is only an example, and in practical application, a suitable position and a suitable mark may be selected according to practical situations.
In step S403, the controller 101 sends the IO request to the storage device 102 accessed by the IO request.
The IO request carries the LUN ID and the logical address where the data to be accessed is located, and the storage device 102 where the data to be accessed is located can be determined according to the LUN ID and the logical address.
After the storage device 102 receives the IO request, it will perform different processing on the read request and the write request, and the processing methods of the storage device on the write request and the read request will be described below.
As shown in fig. 5, a flow chart of a method for processing a write request by the storage device 102 is shown.
In step S501, the disk processor 1021 of the storage device 102 receives a write request sent by the controller 101.
Step S502, determining whether the write mode of the storage device 102 is a write-back mode.
Two writing modes are generally provided in the storage device 102, one is a write-back mode, and the other is a write-through mode, the write-back mode is that the storage device 102 writes data to be written in a write request into the cache 1022 first, after the write is completed, a feedback instruction of completing the write is returned, and then the data in the cache 1022 is written into the Nand flash1023 in a cache disk-flushing manner. The write-through mode is that the storage device 102 writes data to be written in a write request into the cache 1022 and the Nand flash1023 at the same time. When the storage device leaves a factory, a manufacturer generally sets a write mode of the storage device, generally sets a write-back mode as a default mode, and when a user subsequently needs to change the write mode of the storage device into a write-through mode, the user can modify the write mode by inputting a preset command. The write mode of the storage device can be inquired to be the write-back mode or the write-through mode by inquiring the parameter of the storage device.
In step S503, if the write mode in the storage device 102 is a write-back mode, after the disk processor 1021 writes the data to be written in the IO request into the cache 1022, it returns a write-completed feedback instruction to the controller 101.
When the data in the cache 1022 is subsequently written into the storage area, a new write request is generated, and an execution time may be set for the new write request again, where the setting of the execution time may refer to the setting of the execution time of the third type of IO request.
In step S504, the disk processor 1021 determines a storage block to which data of the write request is to be written.
The write request here may be a write request that the data to be written needs to be written into the Nand flash when it is determined in step S501 that the write mode of the storage device is not a write-back mode but a write-through mode, or may be a write request generated by a background operation of the storage device, for example, a cache disk is flushed, or a write request generated by garbage collection, and when a write request generated based on the background operation is generated in the disk of the storage device, the disk processor 1021 may also set an execution duration for the write request generated by the background operation, and the setting of the execution duration may refer to the setting of the execution duration of the third type of IO request. When the storage area is the storage area shown in fig. 3, the disk processor 1021 first determines a storage area of data to be written in the IO request, and then determines a storage block in which the data to be written is written. And when the storage area is a single storage block, the storage block in which the data to be written is written can be directly determined.
Alternatively, in the embodiment of the present invention, since the time required for the write operation and the erase operation is relatively long, the write operation and the erase operation are processed in different memory areas. Specifically, when a memory region is selected for the write request, a memory region that is performing an erase operation is not selected. Whether an erase operation is being performed in the storage area is recorded in the metadata of the storage area. This ensures that the write operation and the erase operation do not occur in the same memory area. Therefore, the situation that the write operation and the erase operation exist in one memory block at the same time, and the read request is delayed due to the fact that an urgent IO request, for example, a read request is queued behind the write request and the erase request and needs to be completed after the write operation and the erase operation are completed, is avoided.
Since the read operation can be performed in both the memory area for performing the write operation and the memory area for performing the erase operation, in the embodiment of the present invention, the memory areas have two operation modes, i.e., a read + write mode and a read + erase mode, but when the current operation mode of the memory device 102 cannot satisfy the requirement that the write operation and the erase operation are performed in the two memory areas, the operation mode of the memory areas can be switched to the conventional read + write + erase mode. Regarding the operation mode of the storage area, it is possible to record in the metadata of the storage area.
How to select a memory area for the write request where the erase operation is not performed will be described below with reference to fig. 6.
In step S601, the disk processor 1021 selects a storage area in read + write mode.
Since the operation mode of the storage area is recorded in the metadata of each storage area, the disk processor 1021 can select a storage area of read + write mode by referring to the operation mode of the storage area recorded in the metadata of each storage area.
In step S602, the disk processor 1021 determines whether the number of blank sub-blocks in the selected storage area is less than a threshold. In step S603, if the number of blank sub-blocks in the selected storage area is lower than a threshold, the disk processor 1021 converts the mode of the storage area into a read + erase mode.
As shown in fig. 3, each memory area includes a plurality of sub-blocks, which are the minimum unit for performing an erase operation, and the number of empty sub-blocks in the memory area is reduced as the memory area is continuously operated. Therefore, in the embodiment of the present invention, a minimum threshold of a blank sub-block is set for each storage area, and when the number of blank sub-blocks in a storage area is lower than the minimum threshold, data is not allowed to be written continuously, and the mode of the storage area is converted into a read + erase mode. After the mode of the storage area is converted into a read + erase mode, some sub-blocks with more invalid data are selected from the storage block to be erased, so that blank sub-blocks are released. After the erasing operation is executed, if the number of the blank sub-blocks in the storage area is larger than a certain value, the mark of the storage area in the read + erase mode can be cleared for subsequent use when a write request is received.
In step S604, the disk processor 1021 determines whether there is a storage area in the storage area of the storage device that is not in the read + write mode or the read + erase mode.
In step S605, if there is a storage area that is not in the read + write mode and the read + erase mode, the disk processor 1021 takes the storage area as a storage area where no erase operation is performed.
If the number of the blank sub-blocks in the selected storage area is lower than the threshold, the writing performance of the storage area is poor and the storage area cannot be used for writing the data to be written in the writing request, so that a new storage area needs to be selected for the data to be written, and when the new storage area is selected, the storage area which is not in a read + write mode or a read + erase mode is selected. This allows multiple storage areas to share the pressure of writing.
In step S606, if there is no storage area that is not in the read + write mode and the read + erase mode, the disk processor 1021 switches all storage areas in the storage device to the read + write + erase mode.
If there is no storage area which is not in the read + write mode or the read + erase mode, it indicates that the write pressure of the current whole storage device is relatively large, so the disk processor will remove the mark of the read + write mode or the read + erase mode marked in the metadata of each storage area, thereby restoring the storage areas to the existing read + write + erase mode, i.e. each storage area can perform the operations of reading, writing and erasing.
In step S607, if it is determined in step S602 that the number of blank blocks in the selected storage area is not less than the threshold, the disk processor 1021 determines whether the read-write pressure of the storage area currently in the read + write mode is too large.
In the embodiment of the present invention, whether the read-write pressure of the storage area is too large may be determined according to whether the read delay of the storage area is greater than a first preset value or whether the write delay is greater than a second preset value
Step S608, if the read-write pressure of the storage area currently in the read + write mode is too large, step S604 is executed.
And if the read time delay of the storage area is greater than the first preset value or the write time delay is greater than the second preset value, the read-write pressure of the storage area is considered to be too large. The first preset value is 2 times of a time delay (without interference of other requests) when the disk processor 1021 processes only one read request, and the second preset value is 2 times of a time delay (without interference of other requests) when the disk processor 1021 processes only one write request.
If the read-write pressure of the storage area currently in the read + write mode is too large, the disk processor 1021 determines that the storage area is a storage area where an erase operation is not performed.
And if the reading time delay of the storage area is not greater than the first preset value or the writing time delay is not greater than the second preset value, the reading and writing pressure of the storage area is not too large.
And writing the data to be written into the storage blocks forming the storage areas when the storage areas which do not execute the erasing operation are determined. And when the storage area only has one storage block, directly writing the data into the storage block.
It should be noted that, in other embodiments of the present invention, when the number of blank sub-blocks is determined not to be lower than the threshold in step S602, step S608 may be directly performed, that is, the storage area is used as the storage area for writing the write request, and step S607 does not need to be performed, that is, it does not need to determine whether the pressure of the storage area is too large.
In another embodiment of the present invention, after step S601 is performed, i.e. the memory area currently in the read + write mode is selected, step S607 is directly performed, i.e. it is determined whether the pressure of the memory area is too large, without performing step S602 and step S603.
Step S505, according to the execution time of the write request, placing the write request in a queue of the to-be-processed request corresponding to the storage block.
In the embodiment of the present invention, the queue of the to-be-processed request is a linked list group, but the linked list group is only an example, and any other queue that can sort IO requests according to execution time belongs to the protection scope of the present invention. The following takes the chain table group as an example to illustrate how to sort the IO requests according to the execution time.
In the embodiment of the invention, the linked list group corresponding to each storage block comprises a write linked list group and a read linked list group. In other embodiments, the linked list group corresponding to each storage block does not distinguish between a write linked list group and a read linked list group, but rather, the read request and the write request are mounted in the same linked list group.
The write chain table group and the read chain table group have the same structure, and only the write chain table group is described below as an example.
The write linked list group includes a plurality of write linked lists, the head of each write linked list represents a time range, the heads of two adjacent write linked lists have a certain time interval, the time intervals may be the same or different, and in this embodiment, the same time interval is taken as an example for explanation.
Fig. 7 is a schematic diagram of a write chain table set according to an embodiment of the present invention. And the head of the first linked list of the write linked list group is T +5ms, the time range represented by the head is T-T +5ms, wherein T represents the current system time. The head of the second linked list of the writing linked list group is T +10ms, the time range represented by the head is T +5 ms-T +10ms, and the like, and the time ranges identified by the two adjacent linked lists are different by 5 ms. Therefore, the time range in which the execution time falls can be determined according to the execution time of the write request, and the write request can be mounted under the linked list corresponding to the time range.
Optionally, in order to reduce the number of linked lists of the write linked list group and/or the read linked list group of each Die, in an embodiment of the present invention, a multi-level linked list group may be established. As shown in fig. 8, a three-level chain table group is taken as an example, wherein the first-level chain table group and the second-level chain table group are disk-level chain table groups, and the third level is a Die-level chain table group.
As shown in fig. 8, the first-level linked list group includes x linked lists, and the interval of the time range represented by the head of each linked list in the linked list group is 1s, so the number x of linked lists is determined by the maximum execution time of the write request. The time range represented by the head T +1s of the first linked list is T-T +1s, wherein T is the current system time. The time range represented by the linked list with the linked list head of T +2s is T +1 s-T +2s, and so on, the time range represented by the linked list with the linked list head of T + xs is T + x-1 s-T + xs.
The secondary chain table group is used for further dividing the time range represented by the chain table head of the first chain table in the primary chain table group into a plurality of chain tables. For example, as shown in fig. 8, in the embodiment of the present invention, the time range represented by the first linked list in the secondary linked list group is divided at a granularity of 5 ms.
The tertiary linked list is a linked list group corresponding to each Die, and the tertiary linked list group is a further division of the time range represented by the linked list head of the first linked list in the secondary linked list group, for example, a division with a granularity of 200 μ s.
When the disk processor 1021 needs to write data to be written in a write request into the storage area 1023, the write request is first mounted to the linked list corresponding to the execution time in the primary linked list group according to the execution time in the write request. For example, if the current system time T is 11h: and 25m:30s, wherein the execution time of the write request is 11h:25m:32s:66ms, the execution time of the write request is T +2s65ms, and the time range is T +2 s-T +3s, and the write request is hung in a third linked list with a head of T +3 s. As time progresses, when the current system time becomes 11h: 32s, the head of the third linked list in the primary linked list group becomes T +1s, i.e., becomes the first linked list in the primary linked list group, and the execution time of the write request mounted in the third linked list becomes T +65ms, then the disk processor 1021 mounts the write request mounted in the first linked list to each linked list in the secondary linked list group according to the execution time, for example, mounts the write request with the execution time of T +66ms to the linked list with the head of T +70 ms. Similarly, as time goes by, when the current system time T is 11h25m:32s:65ms, the head of the linked list with the head of the previous linked list T +70ms becomes T +5ms, and the write request with the execution time T +66ms also becomes T +1ms, the disk processor mounts the write request mounted at the head of the linked list T +5ms into the tertiary linked list group according to the execution time, for example, the write request with the execution time T +1ms can be mounted into the linked list with the head of the linked list T +1 ms. In this way, the disk processor 1021 may execute the write requests in the linked list according to the execution time sequence of each write request in the linked list group corresponding to the Die.
The above-mentioned write chain table and read chain table are only examples, and in concrete implementation, read requests and write requests may be mounted in one chain table without distinguishing the read chain table and the write chain table, and the disk processor may partition the read requests and the write requests according to the type of the IO requests in the chain table. .
Step S506, when it is determined that the write request cannot be executed after the execution time of the write request reaches, and the timeout indication flag carried in the write request indicates a flag that is returned immediately when the execution time of the write request exceeds the execution time of the IO request, then feedback information of the execution failure is sent to the controller 101.
In step S507, when the write request is executed before the execution time of the write request is reached, the disk processor 1021 splits the write request into a plurality of slices. In this embodiment of the present invention, the time before the execution time is reached is a current time earlier than the execution time of the write request minus the execution duration of the write request. This may ensure that the write request may be executed to completion before the execution time is reached.
Assuming that it takes 2ms to perform the write request and typically 80 μ s to perform a read request, the disk processor 1021 slices the write request at 100 μ s granularity before performing the write request.
In step S508, after the disk processor 1021 executes a write request fragment, it will determine whether there is an urgent read request in the read chain table corresponding to the storage block.
In this embodiment of the present invention, the urgent read request is a read request whose execution time is earlier than the execution time of the write request, or a read request whose execution time is earlier than the current time plus the execution duration of the next slice of the write request and the execution duration of the read request, or a read request whose execution time is earlier than the current system time plus the execution duration of the next slice plus the execution durations of x read requests, where x is the maximum number of read requests that can be executed in series when the write request is suspended for one time.
Step S509, if yes, suspending the execution of the write request, executing the read request, and continuing to execute the next fragment of the write request after the read request is executed.
Step S510, if not, continuing to execute the next fragment of the write request.
In step S511, if the write request is successfully executed, the execution result is returned to the controller 101.
Fig. 9 is a flowchart of a method for processing a read request by the storage device 102.
In step S901, the disk processor 1021 receives a read request.
In step S902, the disk processor 1021 determines whether the data to be read of the read request hits in the cache 1022.
In order to improve the read-write efficiency, the cache 1022 caches frequently accessed hot data and newly written data, so that when the disk processor receives a read request, the disk processor first caches according to a logical address carried in the read request to see whether the data to be read is stored in the cache, that is, determines whether the data to be read of the read request hits in the cache 1022.
In step S903, if the data is hit, the data to be read is returned to the controller 101.
If the data to be read is in the cache, that is, it indicates a hit in the cache, the data to be read in the cache is returned to the controller 101. Step S904, if there is no hit, determining a storage area to which the data read by the read request belongs, and further determining a storage block in which the read request is located.
If the data to be read does not hit in the cache 1022, the data to be read needs to be read from the physical storage area 1023, when the data to be read is read, a storage area where the data to be read is located is determined according to a logical address of the read request, and if the storage area is a RAID composed of a plurality of storage blocks, the storage block where the read request is located can be further determined. And if the storage area consists of one storage block, the determined storage area is the storage block.
Step S905, the read request is suspended to the queue of the to-be-processed request corresponding to the storage block.
In the embodiment of the present invention, the queue of the pending request is implemented in a form of a chain table group, and each storage block corresponds to one read chain table group and one write chain table group. The structure of the read chain table group is the same as that of the write chain table group, and reference may be specifically made to the relevant descriptions in fig. 7 and fig. 8. In the implementation of the present invention, the queue of the pending requests is just exemplified by the linked list group, but in the implementation application, other manners that the IO requests can be ordered according to the execution time are within the protection scope of the present invention.
Step S906, if the read request is executed before the execution time of the read request is reached, returning the read data to the controller after the execution of the read request is completed.
Step S907, if the read request has not been executed after the execution time of the read request is reached, and the timeout indication flag carried in the read request indicates that the current time exceeds the execution time of the read request, and the read request has not been scheduled for execution, a flag is returned immediately, then feedback information of execution failure is returned to the controller 101. The controller 101 may re-read the read request after receiving the feedback information of the execution error. If the IO request carries a flag indicating that no error is returned when the time for executing the IO request exceeds the execution time of the IO request, the storage device 102 reads the read request without processing, and when the host determines that the IO is time-out, the read request is retransmitted.
In the embodiment of the present invention, in order to enable the read request to be processed as soon as possible, if the operation mode of the storage area where the data to be read of the read request is the read + write mode, the disk processor will schedule the read request in the process of executing the write request, specifically please refer to the description of steps S507 and S508 in fig. 5.
If the operation mode of the storage area where the data to be read of the read request is in the read + erase mode, the disk processor calls the read request in the process of executing the erase operation, and the specific method is as follows: assuming that one read operation takes 80 mus and one erase operation takes 10ms, the erase operation is divided into 50 slices, each slice corresponding to 200 mus. And when the interval is 200 mu s, the disk processor judges whether the erasing operation needs to be suspended to respond to the urgent read request, if the urgent read request exists, the read request is executed, and after the urgent read request is executed, the next fragment is executed. The urgent read request is a read request with the execution time earlier than the execution time of the erase request, or a read request with the execution time earlier than the current time plus the execution duration of the next segment of the erase request, or a read request with the execution duration of the current system time plus the execution duration of the next segment of the erase request plus x read requests, wherein x is the maximum number of serial read requests allowed to be executed when the write request is executed once.
As shown in fig. 10, a schematic structural diagram of a controller provided in the embodiment of the present application is shown, and in a specific example, the controller may be the controller 101 in fig. 1.
In a specific embodiment, the controller 101 includes a type determining module 1001, a setting module 1002, and a sending module 1003. The type determining module 1001 is used to determine the type of the IO request, and please refer to the description of step S401 in fig. 4 for the manner of determining the type of the IO request by the controller and the classification of the IO request.
The setting module 1002 is configured to set an execution time for the IO request according to a type of the IO request. For a manner of setting the execution time for each IO request by the setting module 1002, refer to the related description of step S402.
Optionally, the setting module 1002 may add a field to the IO request to carry the execution time. In addition, the setting module 1002 may further add a field in the IO request, where the field is used to carry a timeout indication flag, and the timeout indication flag is used to indicate whether to return a flag immediately when the time for executing the IO request exceeds the execution time of the IO request.
The sending module 1003 is configured to send the IO request to the storage device 102 accessed by the IO request. The function executed by the sending module 1003 corresponds to step S403 in fig. 4, please refer to the related description of step S403 in fig. 4.
In other embodiments of the present invention, the controller 101 may only include the setting module 1002 and the sending module 1003.
As shown in fig. 11, a schematic structural diagram of a storage device provided in an embodiment of the present application is shown, and in a specific example, the storage device may be the storage device 102 in fig. 1 and 2.
In a specific embodiment, the storage device includes an acquisition module 1101 and an execution module 1103.
The obtaining module 1101 is configured to obtain an IO request, where the IO request may be an IO request received from the controller 101, or an IO request generated by a background operation of a storage device, such as a cache disk flushing, or an IO request generated by garbage collection. When the IO request is a write request, the obtaining module 1101 may further determine whether a write mode of the storage device 102 is a write-back mode, and if the write mode in the storage device 102 is the write-back mode, the obtaining module 1101 writes the data to be written in the IO request into the cache 1022, that is, returns a write-completed feedback instruction to the controller 101. When the IO request is a read request, the obtaining module determines whether the read request hits in the cache 1022, and if the read request hits in the cache, returns a feedback instruction of the read hit to the controller 101. For the functions performed by the acquiring module 1101, refer to the descriptions of steps S501 to S503 in fig. 5 and the descriptions of steps S901 to S903 in fig. 9.
The execution module 1104 is configured to execute the IO request according to the execution time of the IO request, when the IO request is a write request, and the execution module 1103 determines that the write request cannot be executed after the execution time of the write request reaches, and when the time out indicator carried in the write request indicates that the time for executing the write request exceeds the execution time of the IO request, the mark is returned immediately, then feedback information of the execution failure is returned to the controller 101, when the write request is executed before the execution time reaches, the write request is divided into multiple fragments, each time the execution module 1103 finishes executing one fragment of the write request, whether an urgent read request needs to be processed in a read linked list corresponding to the storage block is determined, if so, the execution of the write request is suspended, and the read request is executed, and when the read request is executed completely, continuing to execute the next fragment of the write request, if the read request is not executed completely, continuing to execute the next fragment of the write request, and if the write request is executed successfully, returning an execution result to the controller 101. The function executed by the execution module 1103 is the same as the function executed by steps S506 to 511 in fig. 5, specifically refer to steps S506 to 511 in fig. 5. When the IO request is a read request, the execution module 1103 completes the execution of the read request before the execution time of the read request is reached, and returns read data to the controller 101, and when the execution time is reached, the read request is not completed, and if a timeout indication flag carried in the IO request indicates that the time for executing the IO request exceeds the execution time of the IO request, an error flag is returned, and an execution error is returned to the controller 101. The controller 101 may re-read the read request after receiving the feedback information of the execution error. If the IO request carries a flag indicating that no error is returned when the time for executing the IO request exceeds the execution time of the IO request, the storage device 102 reads the read request without processing, and when the host determines that the IO is time-out, the read request is retransmitted. Please specifically refer to the description of steps S907 and S908 in fig. 9.
When the execution module 1104 executes the erase request, the erase request is divided into a plurality of fragments, and each time one fragment is executed, the execution module 1104 judges whether the erase operation needs to be suspended to respond to an urgent read request, if an urgent read request exists, the read request is executed, and after the urgent read request is executed, the next fragment is executed. The urgent read request is a read request with the execution time earlier than the execution time of the erase request, or a read request with the execution time earlier than the current time plus the execution duration of the next segment of the erase request, or a read request with the execution duration of the current system time plus the execution duration of the next segment of the erase request plus x read requests, wherein x is the maximum number of serial read requests allowed to be executed when the write request is executed once.
In another embodiment, the storage device further comprises a selection module 1102. The selecting module 1102 is configured to determine a storage block operated by the IO request, and when the IO request is a write request, the method for determining the operated storage block by the selecting module 1102 refers to step S504 in fig. 5 and the related description in fig. 6, and when the IO request is a read request, the related description in step S904 in fig. 9 is referred to.
In another embodiment, on the basis of the above embodiment, the storage device 102 further includes a sorting module 1103, where the sorting module is configured to insert the IO request into an IO queue corresponding to the storage block according to the execution time of the IO request after determining the storage block operated by the IO request. In the embodiment of the present invention, the IO queue is a chain table group, and please refer to the descriptions of fig. 7 and fig. 8 for the form of the chain table group. The function executed by the sorting module 1103 is the same as the function executed by step S505 in fig. 5 and step S905 in fig. 9, please refer to the related description of step S505 in fig. 5 and step S905 in fig. 9.
With continued reference to FIG. 11, the present invention provides another embodiment of a storage device, which in this embodiment includes an obtaining module 1101, a selecting module 1102, and an executing module 1104.
The obtaining module 1101 is configured to receive a write request, where the write request carries data to be written. The selecting module 1102 is configured to select a memory area that does not execute an erase operation from the plurality of memory areas, where, when the IO request is a write request, the selecting module 1102 determines a method of the operated memory block, please refer to step S504 in fig. 5 and the related description in fig. 6, and when the IO request is a read request, refer to the related description in step S904 in fig. 9. The executing module 1104 is used for writing the data to be written into the selected storage area, specifically please refer to the related descriptions of steps S506-511 in fig. 5 and steps S907 and 908 in fig. 9.
In the embodiment of the present invention, the controller 101 further includes a processor and a memory, where the memory may be a cache, and the cache is used for storing the control instruction.
The processor is used for acquiring an IO request, and adding the execution time of the IO request in the IO request, wherein the execution time is used for indicating that the storage device finishes processing the IO request before the execution time is reached; and sending the IO request to the storage equipment. The specific manner of the processor to execute the above processing may refer to the detailed description in the embodiment corresponding to fig. 4. It is understood that, in another implementation manner, the control instruction may be stored in the memory 103 of the server, and the processor may read the control instruction in the internal memory 03 and then perform the above processing.
It should be noted that the modules in the above embodiments may be implemented in software, hardware or a combination of both. When any of the above modules or units are implemented in software, which is present as computer program instructions and stored in a memory, a processor may be used to execute the program instructions and implement the above method flows. The processor may include, but is not limited to, at least one of: various computing devices that run software, such as a Central Processing Unit (CPU), a microprocessor, a Digital Signal Processor (DSP), a Microcontroller (MCU), or an artificial intelligence processor, may each include one or more cores for executing software instructions to perform operations or processing. The processor may be built in an SoC (system on chip) or an Application Specific Integrated Circuit (ASIC), or may be a separate semiconductor chip. The processor may further include necessary hardware accelerators such as Field Programmable Gate Arrays (FPGAs), PLDs (programmable logic devices), or logic circuits for implementing dedicated logic operations, in addition to the core for executing software instructions to perform operations or processes.
When the above modules or units are implemented in hardware, the hardware may be any one or any combination of a CPU, a microprocessor, a DSP, an MCU, an artificial intelligence processor, an ASIC, an SoC, an FPGA, a PLD, a dedicated digital circuit, a hardware accelerator, or a discrete device that is not integrated, which may run necessary software or is independent of software to perform the above method flows.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the appended claims.

Claims (43)

1. A method of data processing, performed by a controller, the controller in communication with a storage device, the method comprising;
adding an execution time of the IO request in the IO request, wherein the execution time is used for indicating that the storage device finishes processing the IO request before the execution time is reached;
and sending the IO request to the storage equipment.
2. The method of claim 1, wherein the method further comprises:
adding a timeout indication mark in the IO request, wherein the timeout indication mark is used for indicating whether to return a mark of error information when the execution time of the storage device is exceeded and the IO request is not processed by the storage device, and the error information is used for indicating that the IO request is executed incorrectly.
3. The method of claim 1 or 2, wherein the method further comprises:
determining the type of the IO request, and determining the execution time of the IO request according to the type of the IO request.
4. The method of claim 3, wherein the determining the execution time of the IO request according to the IO request type comprises:
determining the execution duration of the IO request according to the type of the IO request;
and adding the execution duration of the IO request to the current time of the controller to obtain the execution time of the IO request.
5. A method of data processing, performed by a storage device, the method comprising;
obtaining an IO request, wherein the IO request comprises execution time, and the execution time is used for indicating that the storage device finishes processing the IO request before the execution time is reached;
and executing the IO request according to the execution time of the IO request.
6. The method of claim 5, wherein the storage device comprises a plurality of storage blocks, the method further comprising:
after the IO request is obtained, determining a storage block accessed by the IO request;
placing the IO request in a queue of the to-be-processed request corresponding to the storage block according to the execution time; the executing the IO request according to the execution time of the IO request includes:
and executing the IO request according to the execution time of the IO request in the queue.
7. The method of claim 6, wherein the storage device comprises a plurality of storage areas, each storage area consisting of at least one storage block, wherein the IO request is a write request, and wherein determining the storage block accessed by the IO request comprises:
selecting a memory area where an erase operation is not performed from the plurality of memory areas;
and determining the storage block accessed by the IO request according to the selected storage area.
8. The method of claim 7, wherein each memory block includes a plurality of sub-blocks, the sub-blocks being a minimum unit for performing the erase operation, each memory area supporting two modes, a read + write mode and a read + erase mode, the memory area being set to the read + write mode when the memory area is used for writing data and to the read + erase mode when the memory area is used for performing an erase operation, the selecting a memory area in which an erase operation is not performed from among the plurality of memory areas includes:
selecting a memory region in the read + write mode from the plurality of memory regions;
judging whether the number of the idle sub-blocks in the selected storage area is lower than a threshold value or not;
and when the number of the free sub-blocks in the selected storage area is not lower than the threshold value, taking the selected storage area in the read + write mode as the storage area which is not subjected to the erasing operation.
9. The method of claim 8,
when the number of the idle sub-blocks in the selected storage area is lower than a threshold value, setting the mode of the storage area to be a read + erase mode;
judging whether a storage area which is not in a read + write mode and a read + erase mode exists or not;
when a memory area which is not in the read + write mode and the read + erase mode exists, the memory area which is not in the read + write mode and the read + erase mode is used as a memory area which is not used for executing the erase operation.
10. The method of claim 7, wherein each memory block includes a plurality of sub-blocks, the sub-blocks being a minimum unit for performing the erase operation, each memory block supporting two modes, a read + write mode and a read + erase mode, the memory block being set to the read + write mode when the memory block is used for writing data and to the read + erase mode when the memory block is performing an erase operation, the determining the memory block accessed by the IO request comprising:
selecting a memory region in the read + write mode from the plurality of memory regions;
judging whether the read-write pressure borne by the selected storage area exceeds a threshold value;
and when the read-write pressure borne by the selected storage area does not exceed the threshold value, taking the selected storage area as the storage area which does not execute the erasing operation.
11. The method of claim 10,
when the read-write pressure born by the selected storage area exceeds a threshold value, judging whether the storage area which is not in a read + write mode or a read + erase mode exists;
and when the memory areas which are not in the read + write mode and the read + erase mode exist, selecting the memory areas which are not in the read + write mode and the read + erase mode as the memory areas which are not used for executing the erase operation.
12. The method according to claim 9 or 11, wherein the memory area further includes a read + write + erase mode in which a read operation, a write operation, and an erase operation can be performed in the memory area;
the method further comprises the following steps:
and when the storage areas which are not in the read + write mode and the read + erase mode do not exist, the modes of the storage areas are all converted into the read + write + erase mode.
13. The method of any of claims 5 to 12, further comprising:
dividing a write request or an erase request to be executed into a plurality of fragments;
after executing a fragment, determining whether an urgent read request needs to be processed, wherein the urgent read request is a read request with the execution time earlier than that of the write request or the erase request;
and if an urgent read request needs to be processed, suspending the execution of the write request or the erase request and executing the urgent read request.
14. The method of any of claims 5 to 12, wherein a write request or an erase request to be executed is sliced into a plurality of slices;
after executing one fragment, determining whether an urgent read request needs to be processed, wherein the urgent read request is a read request with the execution time being earlier than the execution time of the next fragment plus the execution time of x read requests executed in series, and x is the maximum number of read requests allowed to be executed in series when the execution of one-time write request or erase request is suspended;
and if an urgent read request needs to be processed, suspending the write request or the erase request and executing the urgent read request.
15. A data processing system comprising:
the controller is used for adding the execution time of the IO request in the IO request, and the execution time is used for indicating that the storage device finishes processing the IO request before the execution time is reached; sending the IO request to the storage equipment;
and the storage equipment is used for receiving the IO request and executing the IO request according to the execution time of the IO request.
16. A data processing method is applied to a storage device, and is characterized in that the storage device comprises a plurality of storage areas, and the method comprises the following steps:
receiving a write request, wherein the write request carries data to be written:
selecting a memory area where an erase operation is not performed from the plurality of memory areas;
and writing the data to be written into the selected storage area.
17. The method of claim 16, wherein each memory block includes a plurality of sub-blocks, the sub-blocks being a minimum unit for performing the erase operation, each memory area supporting two modes, a read + write mode and a read + erase mode, the memory area being set to the read + write mode when the memory area is used for writing data and to the read + erase mode when the memory area is used for performing an erase operation, the selecting a memory area, from among the plurality of memory areas, for which an erase operation is not currently performed includes:
selecting a memory region in the read + write mode from the plurality of memory regions;
judging whether the number of the idle sub-blocks in the selected storage area is lower than a threshold value or not;
and when the number of the free sub-blocks in the selected storage area is not lower than the threshold value, taking the selected storage area in the read + write mode as the storage area which is not subjected to the erasing operation.
18. The method of claim 17,
when the number of the idle sub-blocks in the selected storage area is lower than a threshold value, setting the mode of the storage area to be a read + erase mode;
judging whether a storage area which is not in a read + write mode and a read + erase mode exists or not;
when a memory area which is not in the read + write mode and the read + erase mode exists, the memory area which is not in the read + write mode and the read + erase mode is used as a memory area which is not used for executing the erase operation.
19. The method of claim 16, wherein each memory block includes a plurality of sub-blocks, the sub-blocks being a minimum unit for performing the erase operation, each memory area supporting two modes, a read + write mode and a read + erase mode, the memory area being set to the read + write mode when the memory area is used for writing data and to the read + erase mode when the memory area is performing an erase operation, the selecting a memory area, from among the plurality of memory areas, for which an erase operation is not currently performed includes:
selecting a memory region in the read + write mode from the plurality of memory regions;
judging whether the read-write pressure borne by the selected storage area exceeds a threshold value;
and when the read-write pressure borne by the selected storage area does not exceed the threshold value, taking the selected storage area as the storage area which does not execute the erasing operation.
20. The method of claim 19,
when the read-write pressure born by the selected storage area exceeds a threshold value, judging whether the storage area which is not in a read + write mode or a read + erase mode exists;
and when the memory areas which are not in the read + write mode and the read + erase mode exist, selecting the memory areas which are not in the read + write mode and the read + erase mode as the memory areas which are not used for executing the erase operation.
21. The method of claim 18 or 20, wherein the memory area further includes a read + write + erase mode in which a read operation, a write operation, and an erase operation can be performed in the memory area;
the method further comprises the following steps:
and when the storage areas which are not in the read + write mode and the read + erase mode do not exist, the modes of the storage areas are all converted into the read + write + erase mode.
22. The method of any one of claims 16 to 21, further comprising:
receiving a read request, wherein the read request and the write request comprise an execution time, and the execution time is used for indicating the storage device to process the read request or the write request before the execution time is reached;
and executing the read request or the write request according to the execution time of the read request or the write request.
23. A controller in communication with a storage device, comprising;
the storage device comprises a setting module, a processing module and a processing module, wherein the setting module is used for adding the execution time of an IO request in the IO request, and the execution time is used for indicating that the storage device finishes processing the IO request before the execution time is reached;
and the sending module is used for sending the IO request to the storage equipment.
24. The controller of claim 23, wherein the setup module is further to:
adding a timeout indication mark in the IO request, wherein the timeout indication mark is used for indicating whether to return a mark of error information when the execution time of the storage device is exceeded and the IO request is not processed by the storage device, and the error information is used for indicating that the IO request is executed incorrectly.
25. The controller of claim 23 or 24, further comprising:
and the type determining module is used for determining the type of the IO request and determining the execution time of the IO request according to the type of the IO request.
26. The controller according to claim 23, wherein the type determining module, when determining the execution time of the IO request according to an IO request type, is specifically configured to:
determining the execution duration of the IO request according to the type of the IO request;
and adding the current time to the execution duration of the IO request to obtain the execution time of the IO request.
27. A storage device, comprising:
an obtaining module, configured to obtain an IO request, where the IO request includes an execution time, and the execution time is used to indicate that the storage device completes processing the IO request before the execution time is reached;
and the execution module is used for executing the IO request according to the execution time of the IO request.
28. The storage device of claim 27, wherein the storage device further comprises a plurality of storage blocks, a selection module, and a sorting module;
the selection module is used for determining the storage block accessed by the IO request after the IO request is acquired;
the sorting module is used for placing the IO request in a queue of the to-be-processed request corresponding to the storage block according to the execution time;
the execution module is specifically configured to execute the IO request according to the execution time of the IO request in the queue when the IO request is executed according to the execution time of the IO request.
29. The storage device according to claim 28, wherein the storage device includes a plurality of storage areas, each storage area is composed of at least one storage block, the IO request is a write request, and the selection module, when determining the storage block accessed by the IO request, is specifically configured to:
selecting a memory area where an erase operation is not performed from the plurality of memory areas;
and determining the storage block accessed by the IO request according to the selected storage area.
30. The memory device according to claim 29, wherein each memory block includes a plurality of sub-blocks, the sub-blocks being a minimum unit for performing the erase operation, each memory area includes two modes, a read + write mode and a read + erase mode, the memory area is set to the read + write mode when the memory area is used for writing data, and is set to the read + erase mode when the memory area is used for performing an erase operation, the selection module selects a memory area, which is not currently performing an erase operation, from among the plurality of memory areas, and is specifically configured to:
selecting a memory region in the read + write mode from the plurality of memory regions;
judging whether the number of the idle sub-blocks in the selected storage area is lower than a threshold value or not;
and when the number of the idle sub-blocks in the storage area selected by the selection module is not lower than a threshold value, taking the selected storage area in the read + write mode as a storage area which is not used for executing the erasing operation.
31. The storage device of claim 30,
when the number of the idle sub-blocks in the selected storage area is lower than a threshold value, setting the mode of the storage area to be a read + erase mode;
judging whether a storage area which is not in a read + write mode and a read + erase mode exists or not;
when a memory area which is not in the read + write mode and the read + erase mode exists, the memory area which is not in the read + write mode and the read + erase mode is used as a memory area which is not used for executing the erase operation.
32. The memory device according to claim 29, wherein each memory block includes a plurality of sub-blocks, the sub-blocks being a minimum unit for performing the erase operation, each memory area supporting two modes, a read + write mode and a read + erase mode, the memory area being set to the read + write mode when the memory area is used for writing data and to the read + erase mode when the memory area is performing an erase operation, the selection module selecting a memory area, from among the plurality of memory areas, for which no erase operation is currently performed, in particular:
selecting a memory region in the read + write mode from the plurality of memory regions;
judging whether the read-write pressure borne by the selected storage area exceeds a threshold value;
and when the read-write pressure borne by the storage area selected by the selection module does not exceed a threshold value, taking the selected storage area as the storage area which is not subjected to the erasing operation.
33. The storage device of claim 32,
when the read-write pressure born by the selected storage area exceeds a threshold value, judging whether the storage area which is not in a read + write mode or a read + erase mode exists;
and when the memory areas which are not in the read + write mode and the read + erase mode exist, selecting the memory areas which are not in the read + write mode and the read + erase mode as the memory areas which are not used for executing the erase operation.
34. The memory device according to claim 31 or 33, wherein the memory area further includes a read + write + erase mode in which a read operation, a write operation, and an erase operation can be performed in the memory area;
the selection module is further configured to:
and when the storage areas which are not in the read + write mode and the read + erase mode do not exist, the modes of the storage areas are all converted into the read + write + erase mode.
35. The storage device according to any one of claims 27 to 34, wherein the execution module, when executing the write request or the erase request, is specifically configured to:
dividing a write request or an erase request to be executed into a plurality of fragments;
after executing a fragment, determining whether an urgent read request needs to be processed, wherein the urgent read request is a read request with the execution time earlier than the current time plus the execution duration of the next fragment;
and if an urgent read request needs to be processed, suspending the execution of the write request or the erase request and executing the urgent read request.
36. The storage device according to any one of claims 27 to 35, wherein the execution module, when executing the write request or the erase request, is specifically configured to:
dividing a write request or an erase request to be executed into a plurality of fragments;
after executing one fragment, determining whether an urgent read request needs to be processed, wherein the urgent read request is a read request with the execution time being earlier than the current time plus the execution length of the next fragment plus the execution time length of x read requests executed in series, and x is the maximum number of the read requests allowed to be executed in series when the write request or the erase request is executed once in a pause;
and if an urgent read request needs to be processed, suspending the execution of the write request or the erase request and executing the urgent read request.
37. A storage device, wherein the storage device comprises a plurality of storage areas, the storage device further comprising:
an obtaining module, configured to receive a write request, where the write request carries data to be written:
a selection module for selecting a memory area, in which an erase operation is not performed, from the plurality of memory areas;
and the execution module is used for writing the data to be written into the selected storage area.
38. The memory device according to claim 37, wherein each memory block includes a plurality of sub-blocks, the sub-blocks being a minimum unit for performing the erase operation, each memory area supporting two modes, a read + write mode and a read + erase mode, the memory area being set to the read + write mode when the memory area is used for writing data and to the read + erase mode when the memory area is used for performing an erase operation, the selection module selecting a memory area in which an erase operation is not performed from among the plurality of memory areas, to be specifically configured to:
selecting a memory region in the read + write mode from the plurality of memory regions;
judging whether the number of the idle sub-blocks in the selected storage area is lower than a threshold value or not;
and when the number of the idle sub-blocks in the storage area selected by the selection module is not lower than a threshold value, taking the selected storage area in the read + write mode as a storage area which is not used for executing the erasing operation.
39. The storage device of claim 38,
when the number of the idle sub-blocks in the selected storage area is lower than a threshold value, setting the mode of the storage area to be a read + erase mode;
judging whether a storage area which is not in a read + write mode and a read + erase mode exists or not;
when a memory area which is not in the read + write mode and the read + erase mode exists, the memory area which is not in the read + write mode and the read + erase mode is used as a memory area which is not used for executing the erase operation.
40. The memory device according to claim 37, wherein each memory block includes a plurality of sub-blocks, the sub-blocks being a minimum unit for performing the erase operation, each memory area includes two modes, a read + write mode and a read + erase mode, the memory area is set to the read + write mode when the memory area is used for writing data and to the read + erase mode when the memory area is performing an erase operation, the selection module is specifically configured to, when selecting a memory area in which an erase operation is not performed from among the plurality of memory areas:
selecting a memory region in the read + write mode from the plurality of memory regions;
judging whether the read-write pressure borne by the selected storage area exceeds a threshold value;
and when the read-write pressure borne by the storage area selected by the selection module does not exceed a threshold value, taking the selected storage area as the storage area which is not subjected to the erasing operation.
41. The storage device of claim 40,
when the read-write pressure born by the selected storage area exceeds a threshold value, judging whether the storage area which is not in a read + write mode or a read + erase mode exists;
and when the memory areas which are not in the read + write mode and the read + erase mode exist, selecting the memory areas which are not in the read + write mode and the read + erase mode as the memory areas which are not used for executing the erase operation.
42. The memory device according to claim 39 or 41, wherein the memory area further includes a read + write + erase mode in which a read operation, a write operation, and an erase operation can be performed in the memory area;
the selection module is further configured to:
and when the storage areas which are not in the read + write mode and the read + erase mode do not exist, the modes of the storage areas are all converted into the read + write + erase mode.
43. The storage device according to any one of claims 37 to 42, wherein the obtaining module is further configured to receive a read request, the read request and the write request including an execution time, the execution time being used to instruct the storage device to process the read request or the write request before the execution time arrives;
the execution module is used for executing the read request or the write request according to the execution time of the read request or the write request.
CN201811571773.XA 2018-12-16 2018-12-21 Data processing method, controller, storage device and storage system Active CN111324296B (en)

Priority Applications (3)

Application Number Priority Date Filing Date Title
EP19899326.3A EP3879393A4 (en) 2018-12-16 2019-04-03 Data processing method, controller, storage device and storage system
PCT/CN2019/081221 WO2020124867A1 (en) 2018-12-16 2019-04-03 Data processing method, controller, storage device and storage system
US17/347,041 US11954332B2 (en) 2018-12-16 2021-06-14 Data processing method, controller, storage device, and storage system

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201811538076 2018-12-16
CN2018115380764 2018-12-16

Publications (2)

Publication Number Publication Date
CN111324296A true CN111324296A (en) 2020-06-23
CN111324296B CN111324296B (en) 2022-08-09

Family

ID=71164906

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811571773.XA Active CN111324296B (en) 2018-12-16 2018-12-21 Data processing method, controller, storage device and storage system

Country Status (3)

Country Link
US (1) US11954332B2 (en)
EP (1) EP3879393A4 (en)
CN (1) CN111324296B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114296656A (en) * 2021-12-31 2022-04-08 深圳大普微电子科技有限公司 Plane programming method and flash memory device thereof

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110727633A (en) * 2019-09-17 2020-01-24 广东高云半导体科技股份有限公司 Edge artificial intelligence computing system framework based on SoC FPGA
US11698752B2 (en) * 2020-12-03 2023-07-11 Micron Tehcnology, Inc. Retransmitting messages based on command queue depth in a memory subsystem
CN114546267B (en) * 2022-02-14 2022-11-18 深圳源创存储科技有限公司 Solid state disk based on big data calculation and solid state disk system

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101162608A (en) * 2006-10-10 2008-04-16 北京华旗资讯数码科技有限公司 Memory block of flash memory sign method
US20100011149A1 (en) * 2008-07-08 2010-01-14 Hitachi Global Storage Technologies Netherlands, B.V. Data Storage Devices Accepting Queued Commands Having Deadlines
CN102185874A (en) * 2011-01-19 2011-09-14 杭州华三通信技术有限公司 Method and device for processing commands based on iSCSI (internet small computer system interface)
CN102843366A (en) * 2012-08-13 2012-12-26 北京百度网讯科技有限公司 Network resource access permission control method and device
US20130013827A1 (en) * 2003-07-02 2013-01-10 Ling-Yi Liu Storage virtualization computer system and external controller therefor
CN103425587A (en) * 2012-05-18 2013-12-04 北京兆易创新科技股份有限公司 Erasing method and erasing device for nonvolatile memory
CN106598878A (en) * 2016-12-27 2017-04-26 湖南国科微电子股份有限公司 Method for separating cold data and hot data of solid state disk

Family Cites Families (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7165187B2 (en) * 2003-06-06 2007-01-16 Hewlett-Packard Development Company, L.P. Batch based distributed data redundancy
US8051232B2 (en) * 2007-06-25 2011-11-01 Intel Corporation Data storage device performance optimization methods and apparatuses
US10445229B1 (en) * 2013-01-28 2019-10-15 Radian Memory Systems, Inc. Memory controller with at least one address segment defined for which data is striped across flash memory dies, with a common address offset being used to obtain physical addresses for the data in each of the dies
JP5689919B2 (en) 2013-05-24 2015-03-25 キヤノンアネルバ株式会社 Information processing apparatus, information processing method, computer program, and computer-readable memory medium
US9727248B2 (en) * 2014-02-05 2017-08-08 Apple Inc. Dynamic IO operation timeout assignment for a solid state drive
US10534542B2 (en) * 2014-09-30 2020-01-14 Hewlett Packard Enterprise Development Lp Dynamic core allocation for consistent performance in a non-preemptive scheduling environment
US9933950B2 (en) * 2015-01-16 2018-04-03 Sandisk Technologies Llc Storage operation interrupt
CN106998317B (en) 2016-01-22 2019-08-20 高德信息技术有限公司 Abnormal access requests recognition methods and device
US10175891B1 (en) * 2016-03-15 2019-01-08 Pavilion Data Systems, Inc. Minimizing read latency for solid state drives
CN107305473B (en) 2016-04-21 2019-11-12 华为技术有限公司 A kind of dispatching method and device of I/O request
US10530888B2 (en) * 2016-06-01 2020-01-07 Home Box Office, Inc. Cached data expiration and refresh

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130013827A1 (en) * 2003-07-02 2013-01-10 Ling-Yi Liu Storage virtualization computer system and external controller therefor
CN101162608A (en) * 2006-10-10 2008-04-16 北京华旗资讯数码科技有限公司 Memory block of flash memory sign method
US20100011149A1 (en) * 2008-07-08 2010-01-14 Hitachi Global Storage Technologies Netherlands, B.V. Data Storage Devices Accepting Queued Commands Having Deadlines
CN102185874A (en) * 2011-01-19 2011-09-14 杭州华三通信技术有限公司 Method and device for processing commands based on iSCSI (internet small computer system interface)
CN103425587A (en) * 2012-05-18 2013-12-04 北京兆易创新科技股份有限公司 Erasing method and erasing device for nonvolatile memory
CN102843366A (en) * 2012-08-13 2012-12-26 北京百度网讯科技有限公司 Network resource access permission control method and device
CN106598878A (en) * 2016-12-27 2017-04-26 湖南国科微电子股份有限公司 Method for separating cold data and hot data of solid state disk

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114296656A (en) * 2021-12-31 2022-04-08 深圳大普微电子科技有限公司 Plane programming method and flash memory device thereof
WO2023125016A1 (en) * 2021-12-31 2023-07-06 深圳大普微电子科技有限公司 Plane programming method and flash memory device thereof

Also Published As

Publication number Publication date
CN111324296B (en) 2022-08-09
EP3879393A1 (en) 2021-09-15
US20210303173A1 (en) 2021-09-30
EP3879393A4 (en) 2022-01-05
US11954332B2 (en) 2024-04-09

Similar Documents

Publication Publication Date Title
CN111324296B (en) Data processing method, controller, storage device and storage system
US10776263B2 (en) Non-deterministic window scheduling for data storage systems
JP6713906B2 (en) Solid state drive and its operating method
KR20140084337A (en) Self-journaling and hierarchical consistency for non-volatile storage
KR20190004400A (en) Operation method of memory controller and operation method of user device
CN110968253B (en) Data storage method, device and system
KR20100011698A (en) Solid state storage system for data merging and method of controlling the same
EP3346387B1 (en) Storage system and system garbage collection method
JP2013544414A (en) Transaction log restore
CN107122130B (en) Data deduplication method and device
US8862819B2 (en) Log structure array
US20210081235A1 (en) Memory system
JP2016224708A (en) Memory system
WO2016101145A1 (en) Controller, method for identifying data block stability and storage system
JP2019169101A (en) Electronic apparatus, computer system, and control method
US10146783B2 (en) Using file element accesses to select file elements in a file system to defragment
CN112799595A (en) Data processing method, device and storage medium
CN109684271A (en) Snapshot data management method, device, electronic equipment and machine readable storage medium
WO2020124867A1 (en) Data processing method, controller, storage device and storage system
CN108572932B (en) Multi-plane NVM command fusion method and device
CN110688323A (en) System controller and system garbage recycling method
US11593262B1 (en) Garbage collection command scheduling
US10872015B2 (en) Data storage system with strategic contention avoidance
US10671307B2 (en) Storage system and operating method thereof
KR101979715B1 (en) Computing system and data management method thereof

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
GR01 Patent grant
GR01 Patent grant