WO2013185636A1 - 控制数据传输过程中的中断的方法 - Google Patents

控制数据传输过程中的中断的方法 Download PDF

Info

Publication number
WO2013185636A1
WO2013185636A1 PCT/CN2013/077284 CN2013077284W WO2013185636A1 WO 2013185636 A1 WO2013185636 A1 WO 2013185636A1 CN 2013077284 W CN2013077284 W CN 2013077284W WO 2013185636 A1 WO2013185636 A1 WO 2013185636A1
Authority
WO
WIPO (PCT)
Prior art keywords
dma
data
storage device
interrupt
buffer memory
Prior art date
Application number
PCT/CN2013/077284
Other languages
English (en)
French (fr)
Inventor
路向峰
殷雪冰
Original Assignee
北京忆恒创源科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 北京忆恒创源科技有限公司 filed Critical 北京忆恒创源科技有限公司
Priority to EP13804884.8A priority Critical patent/EP2863316A4/en
Priority to US14/408,513 priority patent/US9448955B2/en
Publication of WO2013185636A1 publication Critical patent/WO2013185636A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/14Handling requests for interconnection or transfer
    • G06F13/20Handling requests for interconnection or transfer for access to input/output bus
    • G06F13/24Handling requests for interconnection or transfer for access to input/output bus using interrupt
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/14Handling requests for interconnection or transfer
    • G06F13/20Handling requests for interconnection or transfer for access to input/output bus
    • G06F13/28Handling requests for interconnection or transfer for access to input/output bus using burst mode transfer, e.g. direct memory access DMA, cycle steal
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/061Improving I/O performance
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/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
    • G06F3/0679Non-volatile semiconductor memory device, e.g. flash memory, one time programmable memory [OTP]

Definitions

  • the present invention relates to a Solid Storage Device (SSD) and, more particularly, to an interrupt issued by a storage device to a host.
  • SSD Solid Storage Device
  • Solid-state storage devices are also high-capacity, non-volatile storage devices for computer systems.
  • Solid-state storage devices generally use flash (Flash) as a storage medium.
  • flash flash
  • a solid state storage device as shown in Fig. 17 is disclosed in Chinese Patent Publication No. CN102043689A. As shown in Figure 17, it is a functional block diagram of the current solid-state storage device. It mainly includes a host system 1701 and a solid state storage device 1702.
  • the solid state storage device 1702 includes an interface module 1703, a solid state storage processor 1704, and a flash array 1706 composed of Flas h particles 1705.
  • the interface module 1703 is mainly used to implement an interface that is consistent with the host system, such as SATA (Serial Advanced Technology Attachment), USB (Universal Serial Bus), and PCIE (Periph eral). Component Interconnect Express, SCSI (Small Compute System Interface), IDE (Integrated Drive Electronics), etc.
  • SATA Serial Advanced Technology Attachment
  • USB Universal Serial Bus
  • PCIE Periph eral
  • Component Interconnect Express SCSI (Small Compute System Interface)
  • IDE Integrated Drive Electronics
  • the solid state storage processor 1704 is the control core of the entire storage device, and is mainly responsible for the control signal and data transmission between the interface module 1703 and the flash array 1706, the Flash management, the conversion or mapping of the host logical address to the Flash physical address, and the wear leveling ( Mapping logical addresses to different physical addresses to prevent a single Flash from being prematurely operated in an excessively centralized operation), bad block management, and the like.
  • the solid state storage processor 1704 can be implemented in a variety of ways, including software, hardware, firmware, or a combination thereof.
  • 1705 is a single Flash granule, and multiple Flash granules 1705 form a Flash Array 1706.
  • a random access memory such as DRAM or SRAM or other type of memory suitable for high speed read/write operations may be set in the solid state storage device as writing data to or reading from the flash memory.
  • the cache when writing data.
  • the computer issues a SCSI (Small Computer System Interface) command to the storage device, and the storage device receives and processes the SCSI command, and executes the corresponding storage medium read and write process according to the operation indicated by the SCSI command.
  • the SCSI command does not directly operate the cache. That is, the cache is "transparent" to the computer or user.
  • the allocation and management of the cache will be a burden on the controller on the solid state storage device.
  • the cache memory is fully occupied, if the solid state storage device receives a new access request from the host system, it is also necessary to perform a replacement operation on the cache memory. This increases the complexity of the controller and allows the host to experience bumps in read/write performance.
  • DMA Direct Memory Access
  • a method and apparatus for performing DMA transmission are disclosed in Chinese Patent Document CN101221544A.
  • DM A typical process for A transmission is the Scatter/Gather operation. In the scatter/gather operation, a plurality of data blocks to be transferred are stored in discrete address locations of the system (host) memory.
  • the processor does not need to program the DMA controller for each block of data that is to be moved from a source to a certain destination. Instead, the processor builds a descriptor table or descriptor link table in system memory. A set of descriptors is included in the descriptor table or descriptor link table.
  • Each descriptor describes the direction of movement of the block, the source address, the destination address, and the number of bytes that can be transferred.
  • the data of the agreed length can be transmitted by DMA.
  • a scheme for avoiding data loss in the buffer memory when the storage device is unexpectedly powered off is disclosed in Chinese Patent Publication No. CN 101710252B.
  • the backup power is provided in the storage device, and when an unexpected power failure occurs, the backup power supply provides temporary power to the storage device for transferring the data in the buffer memory (Cache) to the flash memory.
  • U.S. Patent No. 8,031,551 B2 discloses the use of a capacitor as a backup power source for a storage device, and detects the performance of the capacitor during operation, and charges the capacitor when it is detected that the capacitance is too low.
  • a method of controlling an interrupt in a data transmission process for transmitting data between an information processing device and a storage device, the storage device comprising a flash memory comprising: The storage device receives a write request sent by the information processing device; writes data to the flash memory in response to the write request; sends a message to the information processing device to indicate completion of the write request, and Calculating a number of times of transmitting a message to the information processing device within a predetermined time interval; wherein, if the number of times is greater than a predetermined threshold, stopping sending an interrupt to the information processing device.
  • the message is transmitted to the information processing device if the number of times is not greater than a predetermined threshold.
  • the information processing device may set the predetermined threshold and/or the predetermined time interval.
  • a storage device comprising a flash memory, a control circuit and an interface unit, the control circuit further comprising an interrupt controller, the storage device being communicably connected to the information processing device;
  • the interface unit receives a write request sent by the information processing device; the control circuit writes data to the flash memory based on the write request; the interrupt controller sends an interrupt to the information processing device to indicate the write Execution of the request is completed; the interrupt controller counts the number of interruptions sent to the information processing device within a predetermined time interval; the interrupt controller further compares the number of times with a predetermined threshold, if the number of times is greater than a predetermined threshold, Then, transmission of an interrupt to the information processing device is suppressed.
  • the interrupt controller allows an interrupt to be transmitted to the information processing device if the number of interruptions is not greater than a predetermined threshold.
  • a method of controlling an interrupt in a data transfer process for transferring data between an information processing device and a storage device, the storage device including a flash memory and a buffer memory the method includes: the storage device receiving a write request sent by the information processing device; writing data to the buffer memory based on the write request, and incrementing a counter; and the data in the buffer memory Extracting and writing to the flash memory, and decrementing the counter; if the counter is less than a first predetermined threshold, and the number of times the message is sent to the information processing device within a predetermined time interval is less than a second predetermined threshold, then The information processing device transmits a message indicating completion of execution of the write request.
  • the information is not processed.
  • the device sends a message indicating completion of execution of the write request.
  • a storage device including a flash memory, a buffer memory, a control circuit, and an interface unit, the control circuit further including an interrupt controller, the storage device being communicable with the information processing device
  • the interface unit receives a write request sent by the information processing device; the control circuit writes data to the buffer memory based on the write request, and increments a counter; the control circuit buffers the buffer The data in the memory is fetched and written to the flash memory, and the counter is decremented; the interrupt controller counts a message sent to the information processing device within a predetermined time interval indicating completion of execution of the write request The number of times; if the counter is less than the first predetermined threshold, and the number of times is less than the second predetermined threshold, the interrupt controller sends a message to the information processing device indicating that the write request is completed.
  • the counter is not less than a first predetermined threshold, or the number of times the message is sent to the information processing device within a predetermined time interval is not less than a second predetermined threshold, then the interrupt controller does not The information processing device transmits a message indicating completion of execution of the write request.
  • a method of writing data to a storage device the storage device including a buffer memory and a flash memory, the storage device being communicably coupled to the information processing device, The method includes: receiving a first write command from an information processing device, the first write command including data to be written, an address for the flash memory, and an address for the buffer memory; An address for the buffer memory, the data to be written is written to the buffer memory; based on an address for the flash memory and an address for the buffer memory, The data to be written in the buffer memory is written to the flash memory.
  • a method for performing D MA transmission between an information processing device and a storage device the storage device including a buffer memory and a flash memory chip
  • the method comprising: receiving the first 10 requesting; allocating a first storage unit and a second storage unit to the first 10 request; transmitting the first DMA descriptor to the storage device, the first DMA descriptor including a DMA host address, for An address of the flash memory chip of the storage device, and an address for the first buffer memory and a second address for the buffer memory, wherein the address for the first buffer memory is the same as the first memory unit
  • the second address for the buffer memory corresponds to the second storage unit
  • DMA transmission is performed between the storage device and the information processing device according to the first DMA descriptor; a message of the storage device, the message indicating that the storage device has performed completion on the first DMA descriptor; releasing the first storage unit and the second storage unit.
  • the storage device includes a buffer memory, the method comprising: receiving a first DMA descriptor command from the information processing device, the first DMA descriptor command including a first address for buffering memory and Length information; obtaining, in a buffer memory of the storage device, a first storage unit based on the first address for buffer memory, storing the length information in the first storage unit; processing from the information
  • the device receives first DMA descriptor data, the first DMA descriptor data including a second address for the buffer memory; based on the second address of the buffer memory in the buffer memory of the storage device Obtaining a second storage unit, recording an address of the first storage unit in the second storage unit; writing first data from the information processing device in a DMA transfer manner based on the first DMA descriptor data Accessing the second storage unit; accessing length information in the first storage unit based on an address of the first storage unit recorded in the second
  • FIG. 1 is a block diagram showing the structure of a storage device according to an embodiment of the present invention.
  • FIGS. 2A, 2B are schematic diagrams of write commands in accordance with an embodiment of the present invention.
  • FIG. 3 is a flowchart of a method for a storage device to execute a write command according to an embodiment of the present invention
  • FIG. 4 is a schematic diagram of a host according to an embodiment of the present invention
  • FIG. 5 is a flowchart of a host performing a write operation according to an embodiment of the present invention.
  • FIG. 6 is a schematic diagram of a second write command according to an embodiment of the present invention.
  • FIGS. 7A, 7B are flowcharts showing a second write command executed by a memory device in accordance with an embodiment of the present invention
  • FIG. 7C is a block diagram showing a structure of a memory device for executing the second write command in FIGS. 7A, 7B;
  • FIG. 8 is a software block diagram of a host in accordance with an embodiment of the present invention.
  • FIG. 9A is a flowchart of a host creating and executing a second write command according to an embodiment of the present invention
  • FIG. 9B is a flowchart of a host creating and executing a second write command according to another embodiment of the present invention
  • FIG. 10B is a flow chart of creating a linked list in a buffer memory of a storage device according to an embodiment of the present invention.
  • Figure 10C is a flow diagram of a memory device executing a DMA descriptor using a linked list created in a buffer memory, in accordance with an embodiment of the present invention
  • Figures 11A-11F show various states of the buffer memory associated with Figures 10B, 10C;
  • Figure 12 is a block diagram showing the structure of a memory device in accordance with yet another embodiment of the present invention.
  • FIG. 13 is a structural block diagram of a storage device according to still another embodiment of the present invention.
  • FIG. 14A is a flowchart of a memory device performing interrupt suppression according to still another embodiment of the present invention
  • FIG. 14B is a flowchart of a memory device performing interrupt suppression according to still another embodiment of the present invention
  • FIG. 15 is a flowchart according to the present invention.
  • FIG. 16A is a block diagram showing a structure of a memory device that performs interrupt suppression according to still another embodiment of the present invention
  • FIG. 16B is an execution interrupt according to still another embodiment of the present invention.
  • 16C is a structural block diagram of a storage device that performs interrupt suppression according to still another embodiment of the present invention
  • FIG. 16D is a structural block diagram of a storage device that performs interrupt suppression according to still another embodiment of the present invention.
  • 17 is a block diagram showing the structure of a solid state storage device according to the related art.
  • FIG. 1 is a block diagram showing the structure of a memory device in accordance with an embodiment of the present invention.
  • the embodiment shown in Figure 1 includes a host 101 and a storage device 102 coupled to the host 101.
  • the host 101 and the storage device 102 can be coupled in a plurality of manners, including but not limited to connecting the host 101 and the storage device through, for example, SATA, IDE, USB, PCIE, SCSI, Ethernet, Fibre Channel, wireless communication network, and the like.
  • the host 101 may be an information processing device capable of communicating with the storage device in the manner described above, for example, a personal computer, a tablet, a server, a portable computer, a network switch, a router, a cellular phone, a personal digital assistant, or the like.
  • the storage device 102 includes a host interface 103, a control circuit 104, one or more flash chips 105, and a buffer memory 106.
  • Host interface 103 can be adapted to exchange data with host 101 via, for example, SATA, IDE, USB, PCIE, SCSI, Ethernet, Fibre Channel, and the like.
  • Control circuitry 104 is used to control data transfers between host interface 103, flash chip 105, and buffer memory 106, as well as for flash management, host logical address to flash physical address mapping, erase equalization, bad block management, and the like.
  • Control circuit 104 can be implemented in a variety of ways, including software, hardware, firmware, or a combination thereof.
  • the control circuit 104 can be in the form of an FPGA (Field-programmable gate array), an ASIC (Application Specific Integrated Circuit), or a combination thereof.
  • Control circuitry 104 may also include a processor or controller.
  • host 101 issues a read command or a write command to storage device 102.
  • Control circuit 104 receives the read command or write command via host interface 103.
  • the first write command 200 as an example is described in detail in FIG.
  • FIG. 2A is a schematic diagram of a write command in accordance with an embodiment of the present invention.
  • the write command 200 includes fields 201, 202, 203, and 204.
  • Field 201 indicates that the command is a write command
  • field 202 is a flash address
  • field 203 is data
  • the write command 200 instructs storage device 102 to write data in data field 203 to the flash chip based on the flash address indicated by field 202.
  • the field 204 is a buffer memory address.
  • the storage device 102 When the storage device 102 receives the write command 200, the data in the data field 203 is first written to the buffer memory 106 based on the buffer memory address indicated by the field 204, and then the data is The data in field 203 is written to flash chip 105 based on the flash address indicated by field 202. In one example, storage device 102 reads the data in data field 203 from the buffer memory 106 based on the buffer memory address indicated by field 204, and then reads the data from buffer memory 106, which in turn The data is written to the flash chip 105.
  • field 204 may be the full address of buffer memory 106, while in another embodiment, field 204 is an offset value relative to a certain base address. In one embodiment, field 203 carries data to be written to flash memory 105.
  • field 203 may carry a pointer to the data to be written to storage device 102, and the data may be stored in the memory of host 101, in which case storage device 102 passes DMA transfer process from host 1 01 obtained the data.
  • field 203 can carry a pointer to data to be written to storage device 102, and the data can be stored in a buffer memory of storage device 102.
  • Field 202 may be the physical address or logical address of flash chip 105 to which data is to be written.
  • Field 202 can also be a pointer to buffer memory 106 in which is stored a physical or logical address for flash chip 105. The process of converting a logical address to a physical address can be implemented by looking up an address mapping table.
  • a write command can have a variety of specific encoding modes and field ordering.
  • the field 214 indicating that the write command 210 is of a write operation may be at the end of the write command 210 or elsewhere.
  • the field 211 carries the buffer memory address
  • the field 212 carries data or a pointer to the location where the data is stored.
  • the flash address is stored in field 213, or a pointer to a flash address, which may be a logical address or a physical address.
  • step 30 is a flow chart of a method of a write operation performed by a memory device in accordance with an embodiment of the present invention.
  • the storage device 102 receives the write command 200 from the host 101. After receiving the write command 200 through the host interface 103, the control circuit 104 of the storage device 102 extracts a field 201 included in the write command 200 for indicating that the operation type is a write operation for indicating the flash memory to be written. A field 202 of an address, a field 203 for indicating data to be written, and a field 204 for indicating the address of the buffer memory 106. At step 30
  • the control circuit 104 obtains an address for the buffer memory 106 based on the field 204, and obtains data to be written based on the field 203, and writes data to be written to the buffer memory 1 The position indicated by field 204 in 06.
  • the storage device 102 can send a message to the host to indicate that execution of the write command 200 is complete, although the data has not yet been actually written into the flash chip 105 at this time. In this manner, in the view of the host 101, after the execution of step 302 is completed, the write command 200 has been executed, thereby improving the performance of the storage device 102 executing the write command 200.
  • the message sent to the host may be included in the interrupt request sent by the storage device 102 to the host 101, or may be based on the coupling mode between the host 101 and the storage device 102 (SATA, IDE, USB, PCIE, SCSI, Ethernet, Fibre Channel, wireless communication networks, etc.) and choose the appropriate way to send other messages.
  • the data to be written is written to the buffer memory 106
  • the data to be written indicated by the field 203 is written to the flash memory chip based on the flash address indicated by the field 202 under the control of the control circuit 104. 105 (step 303).
  • the storage device 102 can also send a message to the host to indicate completion of execution of the write command 200, in particular, the host can now again specify to write data in the write command 200. This is used to indicate the address of the buffer memory 106 without causing data errors due to overwriting of data at the address.
  • the field 202 indicates a logical address for the flash chip 105
  • the logical address is converted to a physical address for the flash chip 105.
  • the manner in which logical addresses to physical addresses are translated is known to those skilled in the art.
  • the written data is retrieved from the buffer memory 106 and written to the flash memory chip 105.
  • the operation of writing data to the buffer memory 106 in step 302, and the operation of writing data to the flash memory 105 in step 303 may be performed in parallel.
  • a plurality of write commands can be simultaneously processed in the storage device 102, wherein, at one time, based on a write command, the control circuit 104 writes the first data into the buffer memory 106; In the command, the control circuit 104 writes the second data present in the buffer memory 106 into the flash memory chip 105.
  • the buffer memory 106 may be a dual port memory such that while the first data is written to the buffer memory 106 via the first port, The second port reads the second data from the buffer memory 106.
  • the operation of the maintenance buffer 106 is removed from the control circuit 104 by carrying a field 204 for indicating the address of the buffer memory 106 in the write command, and the host 101 has the ability to more flexibly control the storage device 102. .
  • FIG. 4 is a schematic diagram of a host in accordance with an embodiment of the present invention.
  • 4 is a block diagram showing the software composition of the host 400.
  • Host 400 can be a personal computer, a server computer, or other computing capable device.
  • Host 400 includes one or more user applications 401, 402, and 403, and an operating system 404.
  • the operating system 404 has a storage device driver 405.
  • the driver 405 includes a buffer control block 406 for controlling the buffer memory 106 of the storage device 102 in the host 400.
  • the buffer control block 406 is composed of a plurality of memory cells (411, 412 ... 41n), and each of the memory cells (411, 412 ...
  • the storage unit stores and records the operating status of the corresponding storage unit in the buffer memory 106.
  • a plurality of memory locations, e.g., two, in the buffer memory are involved in a read/write command sent to the memory device 102.
  • the two storage units (411, 412) in the buffer control block 406 are associated together, and the association relationship between the storage units 411 and 412 is also recorded in the storage units 411, 412, for example.
  • One or more pointers to the storage unit 412 are recorded in the storage unit 411.
  • one or more pointers to memory unit 411 are also recorded in storage unit 412.
  • FIG. 5 is a flow chart of a host performing a write operation in accordance with an embodiment of the present invention.
  • the application or other program sends a write request.
  • the storage device driver 405 in FIG. 4 receives the write request (step 501), and the write request includes an address provided by the application or other program to be written for the storage device, and an address for the storage device. It can be a file path and an offset value and is further converted to a logical address for the storage device.
  • the logical address is a logical address for a flash chip on a storage device that writes data to the flash chip based on the logical address.
  • storage device driver 405 allocates an idle buffer for the write request.
  • the buffer control block 406 is traversed to find a storage unit, which is an idle state, for example, the storage unit 411.
  • the storage unit 411 is in an idle state, indicating that the corresponding storage unit in the buffer memory 106 of the storage device 102 is in an idle state, and can receive the written data.
  • the storage device driver 405 sends a write command to the storage device 102, where the data to be written and the address for the storage device 102 are included in the write command, and the write command further includes the storage unit 411.
  • the address used to buffer memory 106 Those skilled in the art will appreciate that there are multiple ways to obtain a correspondence between the memory cells 411 and corresponding memory cells in the buffer memory 106.
  • the buffer control block 406 has n memory cells (411, 412 ... 41n), and the buffer memory 106 also includes n memory cells, and the memory cell 411 corresponds to the first one of the buffer memories 106.
  • the location in the flush control block 406 can calculate the address of the corresponding memory location in the buffer memory 106. Still as an example, still The address of the corresponding memory location in the buffer memory 106 can be stored in the memory locations (411, 412 ... 412). In still another example, the write command carries a sequence number that indicates both the location of the memory location 411 in the buffer control block 406 and the location of the corresponding memory location in the buffer memory 106.
  • a message from storage device 102 is received.
  • the message is an interrupt request indicating that the write command sent in step 503 has been executed.
  • control circuitry 104 in storage device 102 writes data in a write command to buffer memory 106 (in particular, writes to buffer memory 106 and buffer control).
  • the storage device transmits an interrupt indicating that the execution of the write command is completed.
  • control circuit 104 writes data to flash chip 105
  • storage device 102 sends an interrupt to host 101.
  • the interrupt request further includes information indicating the location of the buffer control block 406 associated with the write command sent in step 503. The information may be the address of one or more of the storage units (411, 412, ..., 41n), the number of one or more of the storage units (411, 412, ..., 41n).
  • step 505 in response to the interrupt request received in step 504, and based on the information of the memory location of the buffer control block 406 associated with the write command indicated in the interrupt request, release is associated with the write command
  • the buffer control block 406 has memory cells (411, 412 ... 41n).
  • the release of the memory cells (411, 412 ... 41n) may specifically be such that the corresponding memory cells in the buffer memory 106 are set to the idle state in the memory cells (411, 412, ..., 41n).
  • the write command in step 503 involves two memory locations 41 1 and 412 of the buffer control block 406, and the pointers pointing to each other are recorded in the storage units 411 and 412, respectively, to represent the two stores.
  • Units 411, 412 are associated with the same write command.
  • the interrupt request received in step 504 either the storage unit 411 or the storage unit 412 may be indicated.
  • step 505 based on the pointer indicating one of the storage units 4 11 and 412, two storage units 411 and 412 are obtained and released.
  • three or more memory cells (411, 412 ... 41n) can also be associated in a write command in this manner.
  • the second write command instructs the storage device 102 to obtain data from the host 101 in DMA mode and write it into the flash chip 105.
  • the second write command can be the DMA Descriptor 600.
  • the DMA Descriptor 600 includes a DMA command 610 and one or more DMA data (620, 630).
  • the DMA command 610 includes a field 611 for indicating the DMA mode, i.e., the operation indicated by the DMA descriptor 600, which may be a flash read, write, erase, or other operation.
  • Field 612 indicates the logical address of the storage device.
  • the field 613 indicates the length of the DMA descriptor 600, that is, the number of DMA data (620, 630) included in the DMA descriptor 60 0, which may be one or more.
  • Field 614 indicates the address of buffer 106.
  • the DMA data 620, 630 includes fields 621, 631, respectively, for indicating the host address in the DMA transfer.
  • the DMA data 620, 630 also includes fields 622, 632, respectively, for indicating the address of the buffer memory 106.
  • the logical address of the storage device of field 612 in DMA command 610 is available for DMA data 620, 63 0.
  • the storage device 102 initiates a DMA transfer between the host 101 and the storage device 102 according to the host address indicated by the field 621 and the buffer memory address indicated by the field 622.
  • the received data is ultimately stored in the flash chip 105 indicated by field 612.
  • DMA descriptor 600 includes DMA data 620 and 630
  • storage device 102 will The data resulting from the DMA transfer in accordance with the DMA data 620 is ultimately stored in the flash chip 105 indicated by field 612, and the memory device 102 also performs the DMA transfer based on the DMA data 630, ultimately stored in field 612.
  • a flash chip 105 is indicated by a predetermined offset value.
  • DMA Descriptor 600 can indicate multiple DMA transfers between host 101 and storage device 102, each DMA transfer corresponding to one of DMA data 620, 630, transmitting the same number each time DMA transfer Data (e.g., 4K bytes), and the logical addresses of the DMA-transferred storage devices corresponding to the DMA data 620 and the DMA data 630 are continuous (e.g., separated by a predetermined offset value, which can be compared with the data transmitted by the DMA) The amount corresponds to).
  • DMA transfer Data e.g., 4K bytes
  • the logical addresses of the DMA-transferred storage devices corresponding to the DMA data 620 and the DMA data 630 are continuous (e.g., separated by a predetermined offset value, which can be compared with the data transmitted by the DMA) The amount corresponds to).
  • only one storage device logical address (field 612) can be carried in DMA descriptor 600.
  • the data from the DMA host address indicated by the field 621 is written to the buffer memory 106 indicated by the field 622, and then written to the flash chip 105.
  • the data from the DMA host address indicated by the field 631 is written to the buffer memory 106 indicated by the field 632, and then written to the flash memory chip 105.
  • Field 614 is optional. At the buffer memory address corresponding to field 614, as an example, the length of the DMA descriptor 600 indicated by field 613 may be saved. Thus, it is possible to record how many DMA transfers corresponding to the DMA plurality of data 62 0, 630 have been executed, or how many have not yet been executed.
  • the storage device 102 sends an interrupt to the host 101. , to indicate completion of execution of the DMA descriptor 600.
  • the DMA Descriptor 600 although it corresponds to the 2 DMA transfer process, only an interrupt is sent to the host 101. Reducing the number of interrupt requests will help reduce the workload on the host 101.
  • FIG. 7A, 7B are flow diagrams of a memory device executing a second write command in accordance with an embodiment of the present invention.
  • the second write command may be the descriptor 600 as shown in FIG.
  • storage device 102 receives DMA descriptor 600. Addresses for the host (e.g., DMA host addresses 621, 631), addresses for flash chip 105 (e.g., storage device logical address 612), and addresses for buffer memory 106 are included in DMA descriptor 600 (e.g., , buffer memory addresses 622, 632).
  • the DMA descriptor 600 in Fig. 6 includes the DMA command 610, DMA data 620, 630, this is for the purpose of clarity only.
  • the DMA command 610, DMA data 620, 630 can also be combined.
  • the storage device 102 extracts an address for the host from the DMA descriptor 600, an address for the flash chip 105, and an address for the buffer memory 106.
  • the storage device 102 writes data from the host 101 to the buffer memory 106 in a D MA transfer manner based on the address for the host and the address for the buffer memory.
  • the data written in the buffer memory in step 702 is written to the flash chip 105 based on the address for the flash memory and the buffer memory.
  • an interrupt is sent to the host 101 to indicate completion of execution of the DMA transfer. If this is only included in the DMA Descriptor 600
  • the DMA transfer (e.g., DMA description 600 includes only DMA command 610 and DMA data 620), then the interrupt also indicates completion of execution of DMA descriptor 600.
  • an interrupt is sent to the host 101 to indicate completion of execution of the DMA transfer.
  • DMA Descriptor 600 containing a plurality of DMA data (620, 630) is shown.
  • storage device 102 receives DMA descriptor 600, which includes DMA command 610, DMA data 620, and DMA data 630.
  • DMA data 620 is converted to a first DMA ⁇ : instruction
  • DMA data 630 is converted to a second DMA microinstruction.
  • the first DMA microinstruction includes a DMA host address 621 and a buffer memory address 622. Based on the first DMA microinstruction, a logical address 612, a DMA operation type, and a DMA descriptor length 613 of the storage device corresponding thereto can also be obtained.
  • the logical address 612 and the DMA operation type of the storage device may be part of the first DMA instruction, or may be stored in the buffer memory 106 and accessed through an index in the first DMA microinstruction, and may also be passed through A DMA microinstruction is placed in a particular operational queue (read, write, erase, other) to identify the type of operation of the first DMA microinstruction.
  • a pointer stored in the buffer memory 106 is obtained based on the buffer memory address 622 and a predetermined offset value, based on which the logical address 612 and/or of the storage device are obtained. Or DMA descriptor length 613.
  • a pointer stored in the buffer memory 106 is obtained based on the buffer memory address 632 and a predetermined offset value, based on which the logical address 612 and/or DMA of the storage device is obtained. Descriptor length 613.
  • DMA descriptor length 613 is stored in buffer memory 106 based on buffer memory address 614, where the DMA descriptor length is equivalent to the number of DMA data in DMA descriptor 600 (or DMA description)
  • the total number of DMA commands and DMA data in the character 600, from which the number of DMA data can be obtained, and the DMA descriptor length 613 are accessed by the index in the first DMA microinstruction.
  • the order of execution of the first DMA ⁇ instruction and the second DMA ⁇ instruction becomes unimportant.
  • the length of the DMA descriptor in the buffer memory 106 is decremented (for example, by 1 or minus the unit length). When the length of the DMA descriptor in the buffer memory 106 becomes 0, it indicates that All DMA operations of the D MA descriptor 600 are all performed.
  • step 713 for the first DMA microinstruction, data is written to the corresponding buffer memory 106 in a DMA transfer manner based on the DMA host address 621 and the buffer memory address 622.
  • the corresponding data is written to the buffer memory 106 in a DMA transfer manner based on the DMA host address 631 and the buffer memory address 632.
  • an interrupt is sent to the host to indicate completion of the operation of the DMA Descriptor 600.
  • step 713 further comprising writing data written to the buffer memory 106 corresponding to the first DMA microinstruction to the flash memory chip 105 based on the storage device logical address 612.
  • step 714 also includes writing data written to buffer memory 106 corresponding to the second DMA microinstruction to the flash memory chip 105 based on the sum of the storage device logical address 612 plus a predetermined offset value.
  • the DMA stored in the buffer memory is also accessed based on the indices in the first and second microinstructions.
  • the descriptor length is 613 and the DMA descriptor length 613 is decremented (eg, minus 1 or minus the unit length). such, When the DMA descriptor length 613 becomes 0, it means that the operation on the DMA descriptor 600 is completed. In this manner, a plurality of DMA descriptors 600 can be simultaneously processed in the storage device 102, and the order of execution of the first DMA ⁇ instruction and the second DMA instruction is also unimportant.
  • DMA data in DMA descriptor 600 may also be performed. For example, a flag is provided for each DMA data of each D MA descriptor 600 in a buffer memory or register, and each time a DMA data (DMA microinstruction) is executed, the corresponding flag is set. It is also possible to sequentially execute each DMA data (DMA microinstruction) in the DMA descriptor 600, and when the last DMA data (DMA microinstruction) is executed, it means that the execution of the D MA descriptor 600 is completed.
  • DMA microinstruction DMA microinstruction
  • an interrupt is sent to the host 101, and the host driver analyzes whether the execution of the DMA Descriptor 600 has been completed.
  • the analysis method is similar to the process of identifying whether a plurality of DMA data in the DMA descriptor 600 are both executed in the storage device 102 described above.
  • FIG. 7C A block diagram of a structure for implementing the storage device for executing the second write command of Figs. 7A, 7B is shown in Fig. 7C.
  • host 101 includes a PCIE controller 721 and a host memory 722.
  • the host memory 722 can be a random access memory (RAM), and the PCIE controller 721 is used to communicate with the storage device via the PCIE bus.
  • RAM random access memory
  • the storage device 102 includes a PCIE interface 731, a DMA command analyzer 732, a microinstruction FIF 0 (first in first out buffer) 733, a DMA write operation controller 734, a DMA write interface 735, a logical address to physical address conversion circuit 736, The flash interface controller 737, the flash memory chip 105, and the buffer memory 106.
  • the PCIE interface 731 receives the DMA descriptor 600 transmitted by the host 101 through the PCIE controller 721.
  • the connection between the host 101 and the storage device 102 is not limited to the PCIE mode, and the host 101 and the storage device 102 can also be connected through SATA, IDE, US B, PCIE, SCSI, Ethernet, Fibre Channel, and the like.
  • the DMA command analyzer 732 converts the DMA descriptor 600 received by the PCIE interface 731 into a DMA microinstruction.
  • the DMA instruction analyzer converts it into a first DMA instruction corresponding to DMA data 620 and a second DM A data 630.
  • the second DMA microinstruction The structure of the first DM A microinstruction and the second DM A microinstruction has been described in detail above.
  • the DMA command parser 732 also extracts the DMA descriptor length from the DMA command 610 of the DMA Descriptor 600 and saves it, which can be stored in the buffer memory 106, a register or the like.
  • the DMA descriptor length indicates the number of DMA data included in the DMA descriptor 600, and also indicates the number of DMA microinstructions obtained from the DMA descriptor 600.
  • the DMA command analyzer 732 stores the first DMA instruction and the second DMA ⁇ : instruction in the ⁇ : instruction FIFO 733.
  • the microinstruction FIFO 733 is capable of buffering DMA microinstructions and providing DMA microinstructions to the DMA write operations controller 734 in a first in first out manner.
  • the write operation is taken as an example here, it is described that the DMA microinstruction corresponding to the DMA write operation is cached in the microinstruction FIF0733, and those skilled in the art will realize that the DMA microinstruction corresponding to the DMA read operation can be written with the DMA.
  • the corresponding DMA microinstruction is mixed in the ⁇ : instruction FIF0733.
  • the ⁇ : instruction FIF0733 can also be configured in two or more parts, one part dedicated to storing the DMA ⁇ : instruction corresponding to the DMA read operation and the other part dedicated to storing the DMA micro instruction corresponding to the DMA write operation.
  • DMA write operation controller 734 performs DMA based on these DMA microinstructions.
  • the first DMA ⁇ instruction includes a DMA host address 621 and a buffer memory address 622.
  • the DMA write operation controller 734 initiates a DMA write operation between the host 101 and the storage device 102 through the DMA write interface 735 using the DMA host address 621 and the buffer memory address 622, and transfers the data stored at the DMA host address 621 to the DMA host.
  • the transmitted data may have a predetermined length (e.g., 4 Kbytes).
  • the DMA write operation controller 734 performs a similar operation to transfer the data stored at the DMA host address 631 to the location indicated by the buffer memory address 632.
  • a logical address for the respective storage device is available from the first DMA microinstruction and the second DMA microinstruction.
  • the logical address of the storage device for each DMA microinstruction is translated to the physical address for flash memory chip 105.
  • the Flash interface controller 737 writes the data written to the buffer memory 106 to the flash memory chip 105 based on the physical address provided by the physical address to physical address translation circuit 736.
  • the Flash interface controller 737 also extracts the DMA descriptor length from the saved DMA command 610 from the D MA descriptor 600 based on the index in the first and second microinstructions, and decrements the DMA descriptor (eg, Decrease by 1 or subtract the unit length). Thus, when the length of the DMA descriptor becomes 0, it means that the operation on the DMA descriptor 600 is completed. In turn, an interrupt can be sent to the host to indicate completion of the operation of the DMA Descriptor 600.
  • the DMA write operation controller also accesses the saved DMA descriptor length and determines whether all data corresponding to the DMA descriptor 600 has been written to the buffer memory 106 and sends an indication to the host. All data has been written to the interrupt of buffer memory 106.
  • Figure 8 is a software block diagram of a host in accordance with an embodiment of the present invention.
  • Figure 8 is a block diagram showing the software of the host 800, which is similar to the software block diagram of the host shown in Figure 4. The difference is that the buffer control block 406 in Fig. 8 further includes a 10 request list 801.
  • the 10 request list 801 is a linked list composed of the storage units (411, 412, ... 41n) in the buffer control block 406.
  • the 10 request list 801 can be a singly linked list, a doubly linked list, or a circular linked list.
  • a corresponding 10 request linked list 801 is created, which includes the DMA command 610, the DMA data 620, and the DMA data 630, respectively.
  • step 901 the host device's storage device driver 405 receives 10 requests.
  • the 10 request indicates that a plurality of data blocks of different physical addresses dispersed in the host memory are written into the storage device 102, for which a scatter-collect DMA operation is performed between the host and the storage device.
  • the operation of the host to write data to the memory will be described below by way of example.
  • an empty state storage unit such as storage unit 411, is fetched from buffer control block 406.
  • a DMA command 610 of the DMA descriptor 600 is created, based on the content of the 10 request, populating the DMA mode field 611 in the DMA command 610 (in this example, a write operation), storage device logic Address field 612 (this information is available from 10 requests), DMA Descriptor Length field 613 (this information is available from 10 requests), and buffer memory address field 614 (in conjunction with storage unit 411 assigned in step 902) Corresponding).
  • the created DMA command 610 is then sent to the storage device 102.
  • the storage unit 411 is taken as the start node (for example, the storage unit 811) of the 10 request list 801 for the 10 request.
  • a 10 request chain table 801 is created for returning the occupied storage unit to the buffer control block 406 after the storage device 102 executes the DMA descriptor 600, and notifying the application software or other upper layer software about the execution completion of the 10 request. .
  • a pointer corresponding to the 10 request is also stored in the storage unit 411.
  • the remaining length of the DMA data portion can also be obtained. Before the first DMA data is generated, the remaining length of the DMA data portion is the number of DMA data (62 0, 630 ) in the DMA descriptor 600, which is an example of which the DMA descriptor length is decremented by one.
  • an empty state storage unit e.g., storage unit 412
  • DMA data 620 of DMA descriptor 600 is created, populated with DMA host address field 621 in D MA data 620 (this information is available from 10 requests) and buffer memory address 622 (with allocated memory) Unit 412 corresponds to, for example, the offset value or sequence number of storage unit 412 in buffer control block 406).
  • the created DMA data 620 is then sent to the storage device 102.
  • the storage unit 412 is taken as a node (e.g., storage unit 812) for the 10 request list 801 for the 10 request.
  • the remaining length of the DMA data portion is decremented to obtain the number of DMA data in the DMA descriptor 600 that has not been sent to the storage device.
  • step 909 if the remaining length of the DMA data portion is 0, it indicates that the generation of the DMA descriptor 600 has been completed, and in step 910, the storage device driver 405 will wait for the processing of the DMA descriptor 600 returned by the storage device 102 to be completed.
  • the interrupt is interrupted, and the corresponding 10 request list 801 is found according to the interrupt, and the storage units (811, 812) in the 10 request list 801 are released.
  • the state of the memory cells (811, 812) in the 10 request list 801 is set to idle, so that the state of the memory cells 411, 412 can be learned to be free by the buffer control block 406.
  • the CPU speed associated with the DMA host address (621, 631) of the DMA descriptor 600 is also notified.
  • the buffer memory performs a coherency process to reflect that the data at the DMA host address (621, 631) may have changed due to a read DMA read operation.
  • the interrupt returned by the storage device 102 includes content indicating one of the plurality of storage units (811, 812) (or one of the buffer memory addresses 622, 632) in the request list 801, according to the content, The memory cells (811, 812) are released by the 10 request list 801.
  • step 909 if the remaining length of the DMA data portion is greater than 0, it indicates that the generation of the DMA descriptor 600 has not been completed, and one or more DMA data needs to be generated for the 10 request, then the process returns to step 906 and the step 906 is repeated. , 908 and 909.
  • FIG. 9B is a flow diagram of a host creating and executing a second write command in accordance with another embodiment of the present invention.
  • the free memory cells in buffer control block 406 are further organized into a pool of free memory cells to facilitate the creation process of DMA descriptor 600.
  • the pool of free memory cells is formed by organizing the memory cells (411, 412, . . . , . . . , 41n) in the buffer control block 406 into a linked list.
  • the memory location can be fetched from the pool of free memory cells, thereby eliminating the overhead of looking up the free memory location in the buffer control block 406.
  • step 921 10 requests are received by the host's storage device driver 405. Similar to FIG. 9A, the 10 request indicates that a plurality of data blocks dispersed at different physical addresses of the host memory are written into the storage device 102, for which a scatter-gather DMA operation is performed between the host and the storage device.
  • the length of the DMA descriptor (e.g., the number of DMA commands and the number of DMA data) corresponding to the same 10 request is calculated. It is noted that in the embodiment disclosed in FIG. 9A, the DMA descriptor length is obtained during the process of creating the DMA command 610 in step 904, and those skilled in the art will appreciate that the various steps are not necessarily performed in the order disclosed in this embodiment.
  • step 923 it is determined whether the free storage unit pool is empty. If the pool of free memory cells is not empty, i.e., there is a memory location in the buffer control block 406 that is in an idle state, then proceed to step 924 and a free memory location (e.g., memory location 411) is fetched from the pool of free memory cells. If the free storage unit pool is empty, it means that there are no free storage units in the buffer control block 406. Then, in step 925, the idle storage unit pool is waited for to appear an empty storage unit. When the execution of the DMA descriptor is completed, the associated memory cells are released, causing free memory cells to appear in the free memory cell pool. This will be described in detail later.
  • a free memory location e.g., memory location 4111
  • DMA Descriptor 600 includes a DMA command and one or more DMA data.
  • processing proceeds to step 927, and based on the contents of the 10 request, a DMA command 610 of the DMA descriptor 600 is created, populating the fields (611, 612, 613, 614) in the DMA command 610.
  • a pointer corresponding to the 10 request is also stored in the storage unit 411 so that after the execution of the 10 request is completed, the 10 request can be identified and notified to the application software or other upper layer software.
  • the processing proceeds to step 928, and based on the contents of the 10 request, the DMA data 620 of the DMA descriptor 600 is created, and the fields (621, 622) of the DMA data 620 are filled.
  • step 929 the generated DMA command or DMA data is transmitted to the storage device 102.
  • the storage unit 411 obtained in step 924 is set in the 10 request list 801.
  • the first storage unit that enters the 10 request list 801 will serve as the head node of the 10 request list 801, but it will also be appreciated that when the 10 request list 801 is organized as a circular list, it does not exist. Head node".
  • the DMA descriptor length is also decremented.
  • the storage device driver 405 will wait for the interrupt returned by the storage device 102 indicating that the processing of the DMA descriptor 600 has been completed. And finding the corresponding 10 request list 801 according to the interrupt, and releasing the storage unit (811, 812) in the 10 request list 801. In other words, the state of the memory cells (811, 812) in the 10 request list 801 is set to idle, so that the state of the memory cells 411, 412 is known to be free by the buffer control block 068, and the memory cells are 411, 412 are placed in the pool of free storage units.
  • the interrupt returned by the storage device 102 includes content indicating one of the plurality of storage units (811, 812) in the request list 801, according to which the storage unit (811, 812) is passed through the 10 request list 801. ) freed.
  • step 931 if the DMA descriptor length is greater than 0, it indicates that the generation of the DMA descriptor 600 has not been completed, and one or more DMA data needs to be generated for the 10 request, then the process returns to step 923 and steps 923-931 are repeated. .
  • DMA descriptor 600 The generation process of the DMA descriptor 600 is described above in conjunction with FIGS. 9A, 9B.
  • DMA descriptor 600 A plurality of DMA operations to be performed are described in the Decentralized-Collected DMA, the data of which is derived from being stored in a continuous or unconnected storage space.
  • DMA descriptor 600 is generated includes, but is not limited to, the specific manners described above in Figures 9A, 9B.
  • FIG 10A is a flow diagram of creating a linked list in a buffer memory of a storage device, in accordance with an embodiment of the present invention.
  • the DMA Descriptor 600 is converted to one or more microinstructions.
  • storage device 102 is responsive to DMA descriptors transmitted by host 101. 600, a linked list is also established in the buffer memory 106, which associates a plurality of microinstructions corresponding to the same DMA descriptor 600.
  • DMA Descriptor 600 includes DMA commands 610 and DMA data 620, 630.
  • An example of the process by which host 101 transmits DMA descriptor 600 to storage device 102 has been previously described in connection with Figures 9A and 9B.
  • creating a linked list in the buffer memory of the storage device will facilitate storage device execution of 10 operations, particularly concurrent/out-of-order execution of multiple 10 operations, multiple access operations may be accessed by The linked list is linked together. Such 10 operations that do not have an associated relationship can be executed concurrently in the storage device.
  • step 1004 it is determined whether the DMA command 610 or the DMA data 620, 630 is received. If the DMA command 610 is received, in step 1006, the buffer memory address for the DMA command 610 is extracted from the buffer memory address field 61 0 therein, and based on the buffer memory address, the DMA command 610 is The storage space is allocated in the buffer memory 106. Next, in step 1008, the buffer memory address assigned to the DMA command 610 is saved for use in allocating buffer memory addresses for the DMA data 620, 630.
  • step 1010 the buffer memory address for the DMA data 620 is extracted from the buffer memory address field 622 of the D MA data 620, and based on the The memory address is allocated for the DMA data 620 in the buffer memory 106.
  • step 1012 the buffer memory address of the DMA command 610 held in step 1008 is stored in the memory space of the buffer memory allocated for the DMA data 620.
  • the storage space allocated for the DMA command 610 and the DMA data 620 forms a linked list, wherein the storage space allocated for the DMA command 610 is the head node of the linked list, and the storage allocated for the DMA data 620. The space is connected to the head node of the linked list.
  • the storage space is allocated in the buffer memory 106 for the DMA data 630 based on the buffer memory address 632 in the DMA data 630 through steps 1010 and 1012, and is in the DMA format.
  • the buffer memory address of the DMA command 610 is stored in the storage space of the buffer memory allocated by the data 630.
  • the buffer memory address for DMA data 620 may also be stored in the memory space of buffer memory 106 allocated for DM A data 630 to form a different type of linked list.
  • the storage space allocated in the buffer memory 106 for the DM A command 610, the DMA data 620, 630 is created as a circular linked list or a doubly linked list.
  • the storage device 102 has been described above based on DMA data (620, 63) in connection with Figures 7A, 7B, 7C. 0) A DMA instruction is generated and saved in instruction FIFO 733. DMA Data (620, 630) The operation of generating a DMA instruction may occur after step 1012 and carry the buffer memory address allocated for the DMA data (620, 630) in the DMA instruction.
  • Figure 10B is a flow diagram of creating a linked list in a buffer memory of a storage device, in accordance with an embodiment of the present invention.
  • information related to the processing or execution of the DMA descriptor is also stored in the created linked list.
  • Figure 10C is a flow diagram of a memory device executing a DM A descriptor using a linked list created in a buffer memory, in accordance with an embodiment of the present invention.
  • Figure 11 A-11 shows the various states of the buffer memory associated with Figures 10B and 10C.
  • 1100 indicates the storage space in the buffer memory 106.
  • step 1020 host 101 transmits DMA descriptor 600 to storage device 102.
  • step 1022 it is determined whether the DMA command 610 or the DMA data 620, 630 is received. If a DMA command 610 is received, at step 1024, the buffer memory address is extracted from the buffer memory address field 610, and based on the buffer memory address, the memory space is allocated in the buffer memory 106 for the DMA command 610. Referring to Figure 11A, memory space 1101 is allocated for DMA command 610.
  • the DMA Descriptor Length field 613 is also extracted from the DMA command 610, and the length of the DMA data portion of the DMA Descriptor 600 (e.g., the DMA Descriptor Length minus 1) is obtained from the DMA Descriptor Length 613.
  • the buffer memory address assigned to the DMA command 610 is saved for use in allocating buffer addresses for the D MA data 620, 630.
  • the length of the DMA data portion is recorded in the buffer memory allocated for the DMA command 610. Referring to Fig. 11A, the length of the D MA data portion is stored in the storage space 1101 (in this example, the length of the DMA data portion is 2).
  • step 1028 the buffer memory address for the DMA data 620 is extracted from the buffer memory address field 622 of the D MA data 620, and based on the The memory address is allocated for the DMA data 620 in the buffer memory 106. Referring to Figure 11B, memory space 1112 is allocated for DMA data 620. And in step 1030, the buffer memory address of the DMA command 610 saved in step 1026 is stored in the memory space 1112 of the buffer memory allocated for the DMA data 620.
  • the storage spaces (1101 and 1112) allocated for the DMA command 610 and the DMA data 620 form a linked list, wherein the storage space 1101 allocated for the DMA command 610 is the head node of the linked list, which is the DMA.
  • the storage space 1112 allocated by the data 620 is connected to the head node of the linked list.
  • the DMA host address corresponding to the DMA data 620 is also stored in the storage space 1112.
  • the storage space 1123 is allocated in the buffer memory 106 for the DMA data 630 based on the buffer memory address 632 in the DMA data 630 through steps 1028 and 1030 (see FIG. 11C). And in the storage space 1123, the buffer memory address of the DMA command 6 10 is saved. And the D MA host address corresponding to the DMA data 630 is also stored in the storage space 1123.
  • a linked list corresponding to the DMA descriptor 600 is formed in the buffer memory 106, wherein the storage space 1101 is the head node of the linked list, and the storage spaces 1112 and 1123 are nodes of the linked list and point to the head node of the linked list.
  • the buffer memory address for DMA data 620 may also be stored in the memory space 1123 of the buffer memory 106 allocated for the DMA data 630, thereby Form different types of linked lists.
  • the storage space allocated to the DMA command 610, the DMA data 620, 630 in the buffer memory 106 is created as a circular linked list or a doubly linked list.
  • FIG 10C is a flow diagram of a memory device executing a DMA Descriptor using a linked list created in a buffer memory, in accordance with an embodiment of the present invention. It has been described above in connection with Figures 7A, 7B, 7C that the memory device 102 generates DMA instructions based on the DMA data (620, 630) and is stored in the instruction FIFO 733.
  • the linked list in the buffer memory 106 is utilized.
  • the DMA microinstruction includes a buffer memory address by which a storage space in the buffer memory 106 allocated to the DMA data corresponding to the DMA microinstruction can be obtained, and the DMA can be obtained.
  • the DMA microinstruction corresponding to the DMA data 620 is indicated by the first DMA microinstruction, and the DMA instruction corresponding to the DMA data 630 is indicated by the second DMA instruction.
  • the first DMA microinstruction is obtained from the microinstruction FIF0733.
  • step 1042 the address of the memory space 1112 of the buffer memory 106 allocated for the DMA data 620 is included in the first DMA microinstruction, and the DMA host address is obtained from the storage space 1112.
  • the DM A host address is provided by the DMA Host Address field 621 in the DMA data 620.
  • DMA transfer is performed between the host 101 and the storage device 102, and data of a predetermined length (for example, 4 KB) at the DMA host address of the host 101 is transferred to the buffer memory of the storage device 102 in a DMA manner. in.
  • a similar operation is performed to transfer the data at the DMA host address provided by the DMA host address field 632 of the DMA data 630 of the host 101 to the buffer memory of the storage device 102 in DMA mode.
  • a storage space 1112 and a storage space 1123 in which data transmitted in the DM A mode is stored after the execution of the first DMA instruction and the second DMA instruction are shown.
  • the execution of the first DM A microinstruction continues.
  • a predetermined length of data is fetched from the storage space by the address of the storage space 1112 in the first DM A microinstruction, and the data is transferred from the host 101 to the storage space 1112 of the buffer memory 106 by the DMA operation in step 1042.
  • the data is written to the flash chip 105 based on the address for the flash memory included in the first DMA microinstruction through a flash interface controller (e.g., the Flash interface controller 737 in Fig. 7C).
  • the address for the flash memory is obtained by the storage device logical address field 612 in the DMA command 610.
  • the second DM A microinstruction is executed in a similar manner.
  • the address for the flash memory included in the second DM A microinstruction is added to the storage device logical address field 612 in the DMA command 610 by a predetermined value (eg, the length of the data corresponding to the DMA transfer, in this example, It is 4KB).
  • the storage device logical address in DMA command 610 is translated to the physical address of the storage device and data is written to flash memory chip 105 based on the physical address.
  • the mapping process from the logical address of the storage device to the physical address is well known to those skilled in the art.
  • step 1046 execution of the first DM A microinstruction continues. Obtaining the address of the storage space 1101 allocated for the DMA command 610 by the address of the storage space 1112 in the first DM A microinstruction, and The DMA data portion length is obtained in the storage space 1101, and the DMA data portion length stored in the storage 1101 is decremented (for example, minus 1 or minus the unit length). Referring to FIG. 11E, for the first DMA ⁇ instruction, after the length of the DMA data portion in the storage space 1101 is decremented, its value is changed from 2 to 1. Also, the address of the storage space 1101 is no longer stored in the storage space 1112 for indicating that the execution of the DMA data 620 has been completed. At step 1048, since the length of the DMA data portion is not 0, it means that the operation on the DMA descriptor 600 has not been completed because it also contains another DMA data 630, at which time no further processing is performed.
  • the address of the storage space 1101 allocated for the DMA command 610 is obtained by the address of the storage space 1123 in the second DM A microinstruction, and the DMA is obtained in the storage space 1101.
  • the data portion length, and the length of the DMA data portion stored in the storage 1101 is decremented (for example, minus 1 or minus the unit length).
  • the length of the DMA data portion in the memory space 1101 is decremented, and its value is changed from 1 to 0.
  • the address of the storage space 1101 is no longer stored in the storage space 1 123, indicating that the execution of the DMA data 630 has been completed.
  • step 1048 since the length of the DMA data portion is 0, it means that the execution of the DMA descriptor 600 has been completed.
  • step 1050 an interrupt is sent to the host 101 to indicate that execution of the DMA description 600 has been completed.
  • the storage spaces 1112 and 1123 no longer hold the address of the storage space 1101.
  • the value of the length of the DMA data portion in the storage space 1101 is 0. In this case, it means that the execution of the DMA descriptor 600 has been completed, and the storage spaces 1101, 1112, and 1123 are no longer used, and these storage spaces can be freed for execution of other DMA descriptors.
  • the release and reuse of the respective memory space is controlled by the host 101, and the release of the memory space in the linked list 801 has been described above in connection with Figures 9A and 9B.
  • the release of the storage space in the 10 request list 801 means Release of storage spaces 1101, 1112, and 1123 in the buffer memory.
  • the scheme of storing the DMA host addresses corresponding to the first and second instructions in the buffer memory 106 is described above with reference to FIGS. 10B, 10C, 11A-11F, so that the DMA ⁇ instruction does not have to carry the DMA host address.
  • the use of circuit resources is reduced and the first and second DMA microinstructions corresponding to the same DMA descriptor 600 are associated together by buffer memory 106.
  • storage device logical addresses and/or DMA host addresses corresponding to the first and second microinstructions may also be stored in the buffer memory, thereby further reducing the length of the DMA microinstructions and their The occupation of resources.
  • FIG. 12 is a hardware block diagram of a memory device in accordance with yet another embodiment of the present invention.
  • the host 101 includes a PCIE controller 721 and a host memory 722.
  • the storage device 102 includes a PC IE interface 731, a DMA command analyzer 732, an instruction first in first out buffer (FIFO) 733, a DMA write operation controller 734, a DMA write interface 735, a logical address to physical address conversion circuit 736, and a buffer.
  • the memory 106 is flushed.
  • the storage device 102 further includes a DMA read/write micro-instruction determining circuit 1210, a DMA read interface 1212, flash controllers 1221, 1222, 1223, flash interfaces 1231, 1232, 1233, a completion control circuit 1242, a multiplexer 1241, and a multi-channel. Sharer 1243.
  • the flash interfaces 1231, 1232, 1233 are coupled to the flash chip 105.
  • the PCIE interface 731 receives the DMA descriptor 600 transmitted by the host 101 through the PCIE controller 721.
  • the connection between the host 101 and the storage device 102 is not limited to the PCIE mode.
  • DMA command analyzer 732 will PC
  • the DMA descriptor 600 received by the IE interface 731 is converted into a DMA microinstruction.
  • the DMA instruction analyzer converts it into a first DMA microinstruction corresponding to the DMA data 620 and a second DMA ⁇ instruction corresponding to the DMA data 630.
  • the first and second DM A microinstructions respectively include a field indicating the microinstruction type (read/write/erase/other), indicating an address of a storage unit in the buffer memory 106 corresponding thereto.
  • Field a field that indicates the logical address of the storage device.
  • DMA command analyzer 732 also allocates memory locations in buffer memory 106 for DMA commands 610 and stores therein the length of the DMA data portion.
  • the DMA instruction analyzer also allocates memory locations in buffer memory 106 for DMA data 620, stores therein the address of the memory location allocated by DM A command 610, and stores the DMA host address in DMA data 620.
  • the DMA instruction parser also allocates memory locations in buffer memory 106 for DMA data 630, stores therein the address of the memory location allocated for DMA command 610, and stores the D MA host address in DMA data 630.
  • the DMA command analyzer 732 stores the first DMA instruction and the second DMA ⁇ : instruction in the ⁇ : instruction FIFO 733.
  • the instruction FIFO 733 is capable of buffering DMA instructions and providing DMA microinstructions to the DMA read and write microinstruction decision circuit 1210 in a first in first out manner.
  • the DMA read/write ⁇ instruction judging circuit 1210, the type of the obtained DMA instruction is judged.
  • the DMA write operation controller 734 performs DMA write operations based on these DMA microinstructions.
  • the DMA write operation controller 734 obtains the DMA host address from the buffer memory 106 using the field in the first DMA microinstruction indicating the address of the memory cell in its corresponding buffer memory 106, and is written through the DM A write interface 735.
  • a DMA write operation is initiated between the host 101 and the storage device 102, and the data stored in the DMA host address is transferred to the storage unit of the buffer memory 106 corresponding to the first DMA microinstruction, and the transmitted data may have a predetermined schedule.
  • the length (for example 4K bytes).
  • the DMA write operation controller 734 obtains the DMA host address from the buffer memory 106 using the field of the address of the memory cell in its corresponding buffer memory 106, and is at the host 101 and the storage device 102.
  • a DMA write operation is initiated to transfer the data stored in the DMA host address to the memory location of the buffer memory 106 corresponding to the second DMA microinstruction.
  • a logical address for the respective storage device is obtained from fields of the first DMA microinstruction and the second DMA microinstruction indicating the logical address of the storage device.
  • the logical address of the storage device of each D MA microinstruction is converted to the physical address for the flash memory chip 105.
  • the Flash controllers 1221, 1222, 1223 will write the data written to the buffer memory 106 via the flash interfaces 1231, 1232, 1233 based on the physical address provided by the physical address to physical address translation circuit 73 6 .
  • the flash controller 1221 is coupled to the flash memory interface 1231
  • the Flash controller 1222 is coupled to the flash memory interface 1232
  • the flash controller 1223 is coupled to the flash memory interface 1233.
  • the flash interfaces 1231, 1232, 1233 are respectively coupled to the respective flash chips.
  • the physical address of the flash chip 105 obtained from the logical address translation of the storage device in the DMA microinstruction
  • the physical address indicates a particular flash chip
  • the flash chip is associated with a particular one of the flash interfaces 1231, 1232, 1233 Coupling.
  • the flash interfaces 1231, 1232, 1233 are also coupled to the buffer memory by a multiplexer 1241. Based on the physical address, the multiplexer 1241 transfers data from the buffer memory 106 to a particular one of the flash interfaces 1231, 1232, 1233.
  • the completion control circuit 1242 After the flash interfaces 1231, 1232, 1233 write data into the flash chip 105, the completion control circuit 1242 also determines a field based on the address of the memory cell in the buffer memory 106 corresponding thereto in the first and second microinstructions. Accessing the buffer memory 106, and in turn accessing the memory locations allocated to the DMA command 610 in the buffer memory, obtaining the length of the DMA data portion therefrom, and decrementing the length of the DMA data portion (eg, subtracting 1 or subtracting the unit length) ). Thus, when the length of the DMA data portion in the memory location allocated for the DMA command 610 becomes 0, it means that the operation on the DMA descriptor 600 is completed. In turn, an interrupt can be sent to the host to indicate completion of the operation of the DMA Descriptor 600.
  • Flash controllers 1221, 1222, 1223 and three flash interfaces 1231, 1232, 1233 are shown by way of example in FIG. 12, those skilled in the art will recognize that a variety of different amounts of Flash can be used.
  • the controller interfaces with the flash memory to match the number of flash memory chips.
  • the DMA read/write microinstruction decision circuit 1210 transfers it directly to the logical address to the physical address conversion circuit 736, and obtains the physical address for the flash chip 105.
  • Flash controllers 1221, 1222, 1223 read data from flash memory chip 105 via flash interfaces 1231, 1232, 1 233 based on the physical address.
  • a DMA transfer is initiated between the host 101 and the storage device 102, and the read data is transferred to the host RAM 722 of the host 101 at the location indicated by the DMA host address.
  • the flash interfaces 1231, 1232, 1233 are coupled to the DMA read interface 1212 via the multiplexer 1243 such that data obtained from the flash interfaces 1231, 1232, 1233 can be transferred to the host RAM 722 via the DMA read interface 1212.
  • the completion control circuit 1242 After the flash interfaces 1231, 1232, 1233 read data from the flash chip 105, the completion control circuit 1242 also accesses the buffer memory based on the field of the address of the memory cell in the buffer memory 106 corresponding thereto in the DMA microinstruction. 106, and in turn obtains the length of the DMA data portion, and decrements the length of the DMA data portion (eg, minus 1 or minus the unit length). Thus, when the length of the DMA data portion becomes 0, it means that the operation of the DMA descriptor is completed. In turn, an interrupt can be sent to the host to indicate that the operation of the DMA descriptor is complete.
  • DMA data corresponding to one DMA descriptor 600 is associated by a linked list created in the buffer memory 106, so that the operation sequence for the plurality of DMA instructions becomes not important.
  • the storage device can also perform read operations from the present disclosure.
  • the flash chip address and the buffer memory address can be specified in the read command, and the buffer memory can be used as a buffer for reading data.
  • the buffer memory address can also be described in the DMA descriptor associated with the read operation, and after the data is read from the flash chip, the buffer memory can be utilized as a buffer for reading the data.
  • FIG. 13 is a block diagram showing the structure of a memory device according to still another embodiment of the present invention.
  • the storage device in Figure 13 Similar to the storage device in Figure 1. The difference is that the control circuit 104 further includes an interrupt control circuit 1301. In a further embodiment, the storage device also includes a backup power source 1305.
  • a backup power source 1305 can be provided in a variety of ways, such as a supercapacitor, a UPS, a rechargeable battery, and the like. It has been previously described that the control circuit 104 writes data from the host 101 to the buffer memory 106 based on the write command 200 in FIG. 2A, and then writes it to the flash memory chip 105.
  • a message or interrupt request can be sent to the host 101 to indicate that the write operation to the command 200 has been completed.
  • the storage device 102 can ensure that the data will be reliably written to the flash chip 105. Even if an unexpected power outage occurs at this time, the backup power source 1305 can provide power to write the data in the buffer memory 106 to the flash memory chip 105.
  • the interrupt control circuit 1301 Since the capacity of the backup power source 1305 may not be sufficient to support writing of all data in the buffer memory 106 to the flash memory chip 105, the interrupt control circuit 1301 also monitors the amount of data in the buffer memory 106 that has not been written into the flash memory chip 105. . When the amount of data exceeds a predetermined threshold such that the energy of the backup power source 1305 cannot support writing the amount of data to the flash memory chip 105, the interrupt control circuit 1301 will temporarily suppress the activity of transmitting a message or interruption to the host 101. Since no message or interrupt is received from the storage device 102, the host 101 will recognize that the execution of the write command 200 by the storage device 102 has not been completed, which means that if a power down occurs at this time, the storage device 102 does not guarantee writes. Execution of command 200 will be completed and data carried in write command 200 may be lost.
  • the host 101 can assume that the storage device 102 is in the "busy" state, and accordingly does not temporarily issue further writes to the storage device 102. Enter the command.
  • the host 101 may also issue other write commands to the storage device 102 concurrently or asynchronously without waiting for a message or interrupt indicating completion of the write command 200.
  • host 101 should be aware that execution may not be completed for write commands that do not receive a message or interrupt indicating completion of execution.
  • the message or interrupt indicating completion of the execution of the write command 200 does not imply a release of the corresponding memory location of the buffer memory 106. Because the corresponding memory cells of the buffer memory 102 have data that has not yet been written to the flash memory chip 105, these memory cells are still in an occupied state.
  • the interrupt control circuit 1301 detects the amount of data to be written to the flash memory chip 105 in the buffer memory 106, temporarily not transmitting a message or interrupt indicating completion of execution of the write command 200 to the host 101, ensuring the buffer memory 106.
  • the amount of data to be written to the flash chip 105 does not exceed the capability of the backup power source 1305.
  • the interrupt control circuit 1301 maintains a counter.
  • the control circuit 104 writes data to the buffer memory 106
  • the counter is incremented; and when the control circuit 104 takes out the data in the buffer memory 106 and writes it to the flash chip 105, the counter is decremented.
  • the interrupt control circuit 1301 performs interrupt suppression.
  • the interrupt control circuit 1 301 resumes transmitting the instruction to the host 101 indicating that the write command 200 is completed. Message or interruption.
  • the control circuit 104 records the amount of data written to the buffer memory 106 and the amount of data written to the flash chip 105, and the interrupt control circuit 1301 calculates the difference between the two to be buffered in the buffer memory 106 to be written.
  • the size of the predetermined threshold can be set in advance. It is related to factors such as the amount of power of the backup power source 1305, the power consumption of the storage device 102, and the like. For a particular backup power source 1305 and storage device 102, an appropriate predetermined threshold can be determined experimentally.
  • the capacitance and the amount of power of the battery may change over time, it is also possible to measure the amount of power of the backup power source 1305 or parameters indicative of the amount of power during operation, as mentioned in U.S. Patent No. 8,031,551 B2. And establishing a correspondence between the parameter and the threshold is stored in the storage device 102, for detecting the parameter of the backup power source 1305 at runtime, and adjusting the threshold.
  • This threshold can also be set by the host 101 to the storage device 102.
  • a dedicated threshold setting command can be provided, issued by host 101, and received by storage device 102.
  • the threshold value to be set may be carried in the threshold setting command, or the parameter that causes the storage device 102 to detect the indicated power amount of the backup power source 1305 based on the threshold setting command, and thereby change the threshold setting.
  • the interrupt control circuit 1301 inhibits the activity of sending a message or interrupt to the host 101 by caching a message or interrupt to be sent to the host 101.
  • the interrupt control circuit 1301 may buffer an identifier for identifying the write command 200 to the host 101.
  • the write command 200 itself can be cached.
  • the buffer memory address 204 indicated by the write command 200 can also be buffered because the buffer memory address 204 can indicate to the host 101 which memory unit or cells should be released.
  • the suppression of the message or interrupt by the interrupt control circuit 1301 does not depend on the buffer memory address 204 carried in the write command 200. Message or interrupt suppression may also be implemented for situations where the buffer memory address is not included in the write command and the allocation of buffer memory 106 is handled by storage device 102. In this case, the identifier of the write command itself or the write command can be cached.
  • control circuit 104 writes the data in the buffer memory 106 into the flash memory chip 105 even if the interrupt control circuit 1301 suppresses the activity of transmitting a message or interrupt to the host 101.
  • the message or interrupt buffered by the interrupt control circuit 1301 is discarded, and the corresponding data that has not been written to the flash chip 105 is also discarded, and the buffer memory 106 has been transferred.
  • the host 101 transmits data corresponding to the write command indicating completion of execution or the interrupted write command to the flash chip 105.
  • buffer memory 106 when buffer memory 106 is empty, host 101 can issue multiple write commands to storage device 102 and quickly receive a message or interrupt indicating completion of the write command. At this point, host 101 will experience that storage device 102 has good write performance. When the free space of the buffer memory 106 is exhausted, or because the interrupt control circuit 1301 implements interrupt suppression, the host 101 experiences a rapid deterioration in the write performance of the storage device 102. This performance bump is disadvantageous because the time consumed by the writing process becomes unpredictable.
  • the interrupt control circuit 1301 also monitors the number of times a message or interrupt is issued to the host 101 during a certain period of time. If the number of messages or interruptions issued during a certain period of time is excessive, such as exceeding a certain threshold, the interrupt control circuit 1301 will suppress the activity of transmitting a message or interruption to the host 101. Thus, when the free space of the buffer memory 106 in the storage device 102 is large, although the storage device 102 can accept more concurrent write commands, the interrupt control by the interrupt control circuit 1301 is not suppressed to the host. More messages or interruptions.
  • the time period for implementation monitoring here can be set by the user and can be dynamically adjusted at runtime, while the corresponding threshold can also be set by the user and can be dynamically adjusted at runtime.
  • messages or interrupt suppression implemented to reduce bumps and messages or interrupt suppression implemented to accommodate the power of the backup power source may be implemented separately or in combination.
  • the message or interrupt suppression implemented separately to reduce bumps has been described above and is adapted to the power of the backup power source.
  • the interrupt control circuit 1301 detects the amount of data in the buffer memory 106 that has not been written in the flash chip 105. When the amount of data exceeds the first predetermined threshold, the interrupt control circuit 1301 generates a first interrupt suppression signal.
  • the interrupt control circuit 1301 also monitors the number of times a message or interrupt is actually issued to the host 101 during a certain period of time.
  • the interrupt control circuit 1301 generates a second interrupt suppression signal if the number of messages or interrupts issued during a certain period of time exceeds a certain second threshold. If any of the first interrupt suppression signal or the second interrupt suppression signal is valid, the interrupt control circuit 1301 implements a message or interrupt suppression. For example, the interrupt control circuit 1301 temporarily does not send a message or interrupt to the host 101, but instead It's cached.
  • the interrupt control circuit 1301 will be able to send a cached or newly generated message or interrupt to the host 101.
  • FIGS. 14A and 14B are flowcharts showing a memory device performing interrupt suppression according to still another embodiment of the present invention. Implement message or interrupt suppression to accommodate the power of the backup power source.
  • storage device 102 receives data from host 101 to be written to the storage device. In one example, the data is included in the write command 200. In other examples, the data can be transferred from host 101 to storage device 102 by DMA.
  • control circuit 104 writes the data to buffer memory 106 and increments the counter. The value of the counter indicates the amount of data in the buffer memory 106 that has not been written to the flash chip 105. For write commands with a fixed amount of data, the increment of the counter can be increased by the number of units, such as 1.
  • the increment of the counter can be an increase in the value corresponding to the amount of data.
  • the interrupt control circuit 1301 can send a message or interrupt to the host 101 to indicate completion of execution of the write command.
  • the interrupt control circuit 1301 determines if the counter is less than a predetermined threshold. If the value of the counter is less than the predetermined threshold, then step 1408 is executed, and the interrupt control circuit 1301 sends a message or interrupt to the host indicating that the write command has been processed.
  • step 1406 if the interrupt control circuit 1301 finds that the counter is greater than the predetermined threshold, no message or interrupt indicating that the write command has been completed is sent to the host 101.
  • the interrupt control circuit 1301 can implement message or interrupt suppression by buffering messages or interrupts.
  • control circuit 104 When the buffer memory 106 has data that has not been written to the flash chip 105, the control circuit 104 reads the data from the buffer memory 106, step 1410. Also, at step 1412, control circuit 104 also writes the read data to flash memory chip 105 and decrements the counter. The decrement of the counter can be a unit number or a value corresponding to the amount of data.
  • the execution of steps 1410 and 1412 is in parallel with the execution of steps 1402, 1404, 1406, 1408.
  • step 1406 if the interrupt control circuit 1301 finds that the counter is greater than the predetermined threshold, the interrupt controller 1301 performs interrupt suppression, and as the steps 1410, 1412 are executed, the buffered data is continuously written to the flash chip 105, thereby counter The value of the counter is decremented and the value of the counter will become less than a predetermined threshold.
  • step 1502 the storage device 102 receives the slave host 101.
  • the data is included in the write command 200.
  • the data may be transferred from host 101 to storage device 102 by DMA.
  • control circuit 104 writes the data to buffer memory 106 and increments the counter. The value of the counter indicates the amount of data in the buffer memory 106 that has not been written into the flash chip 105.
  • the interrupt control circuit 1301 can send a message or interrupt to the host 101 to indicate completion of execution of the write command and count the number of times the message or interrupt is sent. .
  • the interrupt control circuit 1301 determines whether the number of interrupts issued within the predetermined time interval is greater than a predetermined threshold. In one example, a timer that generates a time-of-day signal at regular intervals can be used. It also monitors the number of messages or interrupts that occur between the two incoming signals.
  • step 1510 is performed, and the interrupt control circuit 1301 sends a message or interrupt to the host indicating that the write command has been processed.
  • step 156 if the interrupt control circuit 1301 finds that the counter is greater than the predetermined threshold, no message or interrupt indicating that the write command has been completed is sent to the host 101.
  • the interrupt control circuit 1301 can implement message or interrupt suppression by buffering messages or interrupts. In another example, whenever the timer's arrival signal is asserted, a predetermined value is set for the counter indicating the number of messages or interrupts that can be sent to the host 101 before the next timer expires signal is valid, and The counter is decremented each time a message or interrupt is issued.
  • the interrupt controller 1301 begins to implement interrupt suppression.
  • the timing interval and/or predetermined threshold of the timer may be updated by host 101 or control circuitry 104. It should also be noted that the message or interrupt suppression implemented by the interrupt controller 1301 does not affect the control circuit 104 writing data in the buffer memory 106 to the flash memory chip 105. In the case where there is data to be written in the buffer memory 106, the control circuit 104 can write the data in the buffer memory 106 to the flash memory chip 105 in parallel with other operations.
  • Control circuit 104 receives the data to be written to storage device 102 and writes the data to buffer memory 106.
  • the interrupt control circuit 1301 detects the amount of data in the buffer memory 106 that has not been written in the flash chip 105. When the amount of data exceeds the first predetermined threshold, the interrupt control circuit 1301 generates a first interrupt suppression signal.
  • the interrupt control circuit 1301 also monitors the number of times a message or interrupt is actually issued to the host 101 during a certain period of time.
  • the interrupt control circuit generates a second interrupt suppression signal if the number of messages or interrupts issued during a certain period of time exceeds a certain second threshold. If any of the first interrupt suppression signal or the second interrupt suppression signal is valid, the interrupt control circuit 1301 implements a message or interrupt suppression. For example, the interrupt control circuit 1301 temporarily does not send a message or interrupt to the host 101, but instead It's cached.
  • the interrupt control circuit 1301 will be able to send the cached or newly generated message or interrupt to the host 101.
  • FIG. 16A is a block diagram showing the structure of a memory device that performs interrupt suppression according to still another embodiment of the present invention.
  • the storage device in FIG. 16A is similar to the storage device in FIG. 7C for performing the DMA shown in FIG. Descriptor 600. The difference is that it also includes an interrupt controller 1601. Interrupt controller 1601 is coupled to DMA write interface 735 and Flash interface controller 737.
  • DMA write operation controller 734 initiates a DMA write operation between host 101 and storage device 102 via DMA write interface 735 using DMA host address 621 and buffer memory address 622,
  • the data stored at the DMA host address 621 is transferred to the location indicated by the buffer memory address 622, and the transmitted data may have a predetermined length (e.g., 4 Kbytes).
  • the interrupt controller 1601 records the amount of data written to the buffer memory 106 but not yet written into the flash chip 105.
  • each DMA microinstruction corresponds to the same amount of data (eg, 4K bytes)
  • the counter can be maintained by the interrupt controller 1601, and when data is written to the buffer memory 106 based on the first D MA microinstruction (or after) , increments the counter by a unit value (for example, 1 , corresponding to 4K bytes).
  • the DMA write operation controller 734 performs a similar operation to transfer the data stored at the DMA host address 631 to the location indicated by the buffer memory address 632.
  • the counter is still incremented by the unit value.
  • the Flash interface controller 737 writes the data written to the buffer memory 106 to the flash memory chip 105 based on the physical address provided by the physical address to the physical address translation circuit 736. .
  • the interrupt controller 1601 decrements the counter by a unit value.
  • the interrupt controller 1601 After the data is written to the buffer memory 106 in a DMA manner based on the first DMA microinstruction or the second DMA microinstruction, the interrupt controller 1601 checks if the counter is greater than a predetermined threshold. If the counter is greater than the predetermined threshold, it means that too much data to be written has been stored in the buffer memory 106. In the event of an accidental power loss, the amount of backup power on the storage device 102 is insufficient to support saving the data to be written to the flash chip 105. Thus, the interrupt controller 1601 suppresses a message or interrupt sent to the host 101 indicating completion of execution of the first DMA micro or second DMA instruction.
  • the flash controller decides whether to send a message or interrupt to the host 101 indicating that the DMA descriptor 600 is complete based on whether the counter is greater than a predetermined threshold.
  • the message or interrupt suppressed by the interrupt controller 1601, and the DMA ⁇ : instruction corresponding to these messages or interrupts or its DMA descriptor are discarded.
  • the data transferred by the DMA command or the DMA descriptor corresponding to the message or interrupt that the interrupt controller 1601 has sent to the host 101 will be written to the flash chip 105 using the backup power.
  • the interrupt controller 1601 also utilizes another counter to record the number of messages or interrupts actually sent to the host 101 over a predetermined time interval.
  • a predetermined time interval can be obtained by setting a timer. If the number of messages or interrupts actually sent to the host 101 exceeds another threshold within a predetermined time interval, the interrupt controller 1601 suppresses the message or interrupt sent to the host 101.
  • the message or interrupt suppression implemented to accommodate the power of the backup power source is combined with message or interrupt rejection implemented to reduce jolt.
  • a first interrupt suppression signal is generated.
  • a second interrupt suppression signal is generated.
  • the interrupt controller 1601 implements a message or interrupt suppression. along with The flash interface controller 737 writes the data in the buffer memory 106 to the flash memory chip 105, and the first interrupt suppression signal can be made invalid.
  • the second interrupt suppression signal is variable as time passes and the timer is again sent to the time signal. Invalid.
  • the interrupt controller 1 601 stops performing interrupt suppression and transmits the buffered message or interrupt to the host 101.
  • the time period of the timer here can be set by the user and can be dynamically adjusted at runtime, and the corresponding threshold (including the threshold associated with the amount of data to be written to the flash chip 105 in the buffer memory 106, and The threshold associated with the number of messages or interrupts actually sent to the host 101 during the predetermined time interval is also configurable by the user and can be dynamically adjusted at runtime.
  • Figure 16B is a block diagram showing the structure of a memory device that performs interrupt suppression in accordance with still another embodiment of the present invention.
  • the storage device in Fig. 16B is similar to the storage device in Fig. 16A for performing the DMA descriptor 600 shown in Fig. 6. The difference is that it also includes an interrupt buffer memory 1613.
  • Interrupt buffer memory 161 3 is coupled to interrupt controller 1601. When the interrupt controller 1601 determines that a message or interrupt suppression is to be performed, it buffers the message or interrupt in the interrupt buffer memory 1613. In one example, the interrupt controller caches all messages or interrupts to be sent to host 101 in interrupt buffer memory 1613.
  • a message or an interrupt is fetched from the interrupt buffer memory 1613 without being subjected to the interrupt control, and is transmitted to the host 101.
  • buffered in the interrupt buffer memory 1613 is an identifier for identifying the DMA descriptor 600 to the host 101.
  • the first DMA microinstruction and the second DMA microinstruction may be buffered.
  • the buffer memory address 622 and the buffer memory address 632 can also be cached because the buffer memory addresses 622, 632 can indicate the DMA descriptor 600 to the host 101.
  • one of buffer memory address 622 and cache buffer address 632 is buffered in the interrupt buffer.
  • the host 101 can obtain 10 requests corresponding thereto.
  • the linked list and thus know which 10 requests are completed.
  • interrupt buffer memory 1613 may not be provided, and instead, a message or interrupt to be sent to the host 101 is buffered in the buffer memory 106.
  • FIG. 16C is a block diagram showing the structure of a memory device that performs interrupt suppression according to still another embodiment of the present invention.
  • the storage device in FIG. 16C is similar to the storage device in FIG. 16A for performing the DMA descriptor 600 shown in FIG. The difference is that the interrupt controller 1602 is not coupled to the DMA write interface 735 but to the DMA write operation controller 734 and the Flash interface controller 737.
  • the DMA write operation controller 734 initiates a DMA write operation between the host 101 and the memory device 102 via the DMA write interface 735 using the DMA host address 621 and the buffer memory address 622.
  • the data stored at the DMA host address 621 is transferred to the location indicated by the buffer memory address 622, and the transmitted data may have a predetermined length (e.g., 4 Kbytes).
  • the interrupt controller 1602 records the amount of data written to the buffer memory 106 but not yet written into the flash chip 105. Since each DM A microinstruction corresponds to the same amount of data (eg, 4K bytes), the counter can be maintained by the interrupt controller 1602, and when data is written to the buffer memory 106 based on the first DMA microinstruction (or after) , increments the counter by a unit value (for example, 1 , corresponding to 4K bytes).
  • the DMA write operation controller 734 performs a similar operation to transfer the data stored at the DMA host address 631 to the location indicated by the buffer memory address 632. Writing data to the buffer memory 106 based on the second DMA microinstruction (or After that), the counter is still incremented by the unit value. It has been previously disclosed that for each DMA microinstruction, the F1 ash interface controller 737 writes the data written to the buffer memory 106 to the flash memory chip 105 based on the physical address provided by the physical address to the physical address translation circuit 736. in. Next, the interrupt controller 1602 decrements the counter by a unit value.
  • the interrupt controller 1602 determines that a message or interrupt suppression is to be performed, the interrupt controller 1602 instructs the D MA write operation controller 734 to suspend the operation of fetching the DMA microinstruction from the microinstruction FIF0733. In this way, DMA microinstructions that have not yet been executed are cached in FIF0733. While corresponding to the DMA microinstructions that have been executed by the DMA write controller 734 and the DMA write interface 735, the interrupt controller 1602 sends a message or interrupt to the host 101 indicating that the DMA microinstructions have been executed.
  • the interrupt controller 1602 when all of the DMA instructions corresponding to a DMA descriptor have been executed by the DMA write operation controller 734 and the DMA write interface 735, the interrupt controller 1602 sends an indication to the host 101 of the DMAs. The instruction or the DMA descriptor is executed to complete the message or interrupt. When the data in the buffer memory 106 is written to the flash chip 105, the interrupt controller 1602 determines that the interrupt suppression is not required, which instructs the DMA write controller to acquire the DMA microinstruction from the microinstruction FIF0733 and execute.
  • the microinstruction in the microinstruction FIF0733 is discarded, and the data transmitted by the DMA ⁇ instruction or the DMA descriptor corresponding to the message or interrupt that the interrupt controller 160 has sent to the host 101, It will be written to the flash chip 105 using the backup power source.
  • the interrupt controller 1602 also maintains a timer to monitor the number of messages or interrupts sent to the host 101 over a certain time interval. When the number of messages or interrupts sent to the host 101 exceeds a threshold within a certain time interval, the interrupt controller 1602 suppresses the activity of sending a message or interrupt to the host 101, that is, instructing the DMA write operation controller 734 to suspend the acquisition of the DMA micro from the microinstruction FIF0733. instruction.
  • interrupt controller 1602 messages or interrupt suppression implemented to accommodate the power of the backup power source are combined with messages or interrupt suppression implemented to reduce jolts.
  • Figure 16D is a block diagram showing the structure of a memory device that performs interrupt suppression in accordance with still another embodiment of the present invention.
  • the storage device in Fig. 16D is similar to the storage device in Fig. 12 for performing the DMA descriptor 600 shown in Fig. 6. The difference is that an interrupt controller 1603 is also included.
  • Interrupt controller 1603 is coupled to D MA write operation controller 734 and Flash interface 1231, Flash interface 1232 (not shown), and Flash interface 1233 (not shown).
  • the interrupt controller 1603 sets a first counter for the flash chip coupled to the Flash interface 1231, a second counter for the flash chip coupled to the Flash interface 1232, and a third counter for the flash chip coupled to the Flash interface 1 233.
  • each of the Flash interfaces 1231, 1232, 1233 respectively incorporates a plurality of flash chips or flash dies
  • a plurality of flash chips or flash tubes coupled to each of the Flash interfaces 1231, 1232, 1233 may be The cores are respectively provided with counters corresponding thereto.
  • a message or interrupt suppression is implemented to accommodate the power of the backup power source, it is preferred to monitor the amount of data to be written, respectively, for a plurality of flash chips or dies coupled to the Flash interfaces 1231, 1232, 1233.
  • each of the Flash interfaces 1231, 1232, 1233 is coupled to a flash chip, and each flash chip includes a flash die, a first counter, a second counter, and a third counter.
  • each flash chip or die coupled to the Flash interface 1231 corresponds to a flash chip or die coupled to the Flash interface 1231, a flash chip or die coupled to the Flash interface 1232, and a flash chip or die coupled to the Flash interface 1233, respectively.
  • Implemented in a similar manner.
  • the DMA microinstruction When the DMA microinstruction is executed under the control of the DMA write controller 734, and a DMA operation is initiated between the host 101 and the storage device 102 through the DMA write interface 735, the data is written to the buffer memory 106 in the DM A manner, and then interrupted.
  • the controller 1603 obtains the logical address for the flash chip 105 corresponding to the DMA instruction through the DMA write operation controller 734, and further obtains the physical address applied to the flash memory chip 105 relative to the logical address, thereby determining the DMA microinstruction.
  • a counter eg, a second counter
  • the interrupt controller 1603 can also obtain the physical address for the flash chip 105 corresponding to the DMA microinstruction in other manners.
  • one of the Flash interfaces 1231, 1232, 1233 eg, the Flash interface 1232
  • the interrupt controller 1603 is instructed to correspond to a counter of the flash chip or die that writes the data (at In this example, the second counter) is decremented.
  • the interrupt controller 1603 performs interrupt suppression when any of the first counter, the second counter, and the third counter exceeds a predetermined threshold. When neither the first counter, the second counter, and the third counter exceeds a predetermined threshold, the interrupt controller 1603 releases the interrupt suppression. It will also be appreciated that the predetermined thresholds corresponding to the first counter, the second counter and the third counter may be different from one another to accommodate the respective flash chip or die corresponding thereto.
  • the interrupt controller 1603 also maintains a timer to monitor the number of messages or interrupts sent to the host 101 over a certain time interval. When the number of messages or interrupts sent to the host 101 exceeds a threshold within a certain time interval, the interrupt controller 1603 suppresses the activity of transmitting a message or interrupt to the host 101, that is, instructs the DMA write operation controller 734 to suspend the acquisition of the DMA micro from the microinstruction FIF0733. instruction.
  • interrupt controller 1603 messages or interrupt suppression implemented to accommodate the power of the backup power source are combined with messages or interrupt suppression implemented to reduce jolts.
  • storage device 102 can support concurrent operations on multiple DMA descriptors 600.
  • DMA data corresponding to one DMA descriptor 600 is associated by a linked list created in the buffer memory 106, so that the operation sequence for the plurality of DMA instructions becomes not important.
  • the message or interrupt sent by the interrupt controller 1603 to the host 101 may indicate completion of execution of the DMA microinstruction, and may also indicate completion of execution of the DMA descriptor associated with the DM A microinstruction.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Memory System (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

公开了一种控制数据传输过程中的中断的方法,用于在信息处理设备和存储设备之间传输数据,存储设备包括闪存存储器。控制数据传输过程中的中断的方法包括:存储设备接收信息处理设备发送的写请求(1502);响应于写请求,向闪存存储器中写入数据(1504);向信息处理设备发送消息,以指示写请求的完成,并计算预定时间间隔内向信息处理设备发送消息的次数;其中,若次数大于预定阈值(1506),则停止向信息处理设备发送中断。还公开了一种存储设备。

Description

说 明 书
控制数据传输过程中的中断的方法
技术领域
本发明涉及固态存储设备 ( Solid Storage Device, SSD ) , 更具体地, 本发明 涉及存储设备向主机发出的中断。
背景技术
同机械式硬盘相类似, 固态存储设备 (SSD ) 也是用于计算机系统的大容量、 非易失性存储设备。 固态存储设备一般以闪存 ( Flash ) 作为存储介质。 在中国专利 文献 CN102043689A中公开了如图 17所示的固态存储设备。如图 17所示, 为目前一 般的固态存储设备的功能框图。其中主要包括主机系统 1701 和固态存储设备 1702。 其中, 固态存储设备 1702 包括接口模块 1703 , 固态存储处理器 1704 , 以及以 Flas h 颗粒 1705为单位组成的 Flash 阵列 1706。 其中, 接口模块 1703 主要用于实现 与主机系统一致的接口十办议, 例如 SATA ( Serial Advanced Technology Attachment , 串行高级技术附件) 、 USB ( Universal Serial Bus , 通用串行总线) 、 PCIE ( Periph eral Component Interconnect Express , †央速夕卜围组件互连) 、 SCSI ( Small Compute r System Interface , 小型计算机系统接口) 、 IDE ( Integrated Drive Electronics , 集 成驱动器电子) 等。 通过接口模块 1703 , 固态存储设备呈现给主机系统的是一个拥 有一定逻辑空间的标准存储设备。固态存储处理器 1704是整个存储设备的控制核心, 主要负责接口模块 1703 以及闪存阵列 1706之间的控制信号及数据的传输、 Flash管 理、 主机逻辑地址到 Flash 物理地址的转换或映射、 损耗均衡(将逻辑地址映射到 不同的物理地址从而防止单个 Flash被过于集中地操作而提前失效) 、 坏块管理等。 可由软件、 硬件、 固件或者其组合的多种方式实现固态存储处理器 1704。 1705为单 个 Flash 颗粒, 多个 Flash 颗粒 1705组成 Flash 阵列 1706。
为提高固态存储设备的读、 写速度, 可以在固态存储设备中设置诸如 DRAM或 SRAM的随机访问存储器或其他类型的适于高速读 /写操作的存储器, 作为向闪存写 入数据或从闪存读写数据时的高速緩冲存储器。在存储设备访问过程中,作为一个例 子, 计算机向存储设备发出 SCSI (小型计算机系统接口) 命令, 存储设备接收并处 理 SCSI命令, 依据 SCSI命令所指示的操作执行相应的存储介质读写过程。 在这一 过程中, SCSI命令并不直接操作高速緩冲存储器。 即, 高速緩冲存储器对计算机或 者用户是 "透明" 的。 也有一些存储设备提供了高速緩冲存储器的 "清洗" 机制, 计 算机或用户可使用预定的命令强制存储设备将高速緩冲存储器中的数据写入到非易 失性存储介质 (例如, 磁盘或者闪存) 中。
然而, 对高速緩冲存储器的分配和管理将成为固态存储设备上的控制器的工作 负担。 而且当高速緩冲存储器被完全占用后, 如果固态存储设备接收到来自主机系统 的新的访问请求, 则还需要执行对高速緩冲存储器的替换操作。这样既增加了控制器 的复杂度, 又会让主机经历在读 /写性能上的颠簸。
在主机与设备之间还可以进行 DMA ( Direct Memory Access ,直接存储器访问) 传输。 在中国专利文献 CN101221544A中公开了执行 DMA传输的方法和设备。 DM A传输的一个典型过程是分散 /收集 (Scatter/Gather ) 操作。 分散 /收集操作中, 待传 输的多个数据块存储在系统(主机)存储器的不连续的多个地址位置。 处理器不需要 为要从某一源移动到某一目的地的每个数据块对 DMA控制器进行编程的操作。而是, 处理器在系统存储器中建立描述符表或描述符链接表。描述符表或描述符链接表中包 括一组描述符。 每个描述符都描述了数据块移动方向、 源地址、 目的地地址以及可选 的传输的字节数。 在一个描述符中不包括传输字节数的情况下, 可通过 DMA方式传 输约定长度的数据。
中国专利文献 CN 101710252B中公开了避免存储设备意外断电时緩冲存储器中 的数据丢失的方案。 其中, 在存储设备中提供备用电源, 当发生意外断电时, 由备用 电源向存储设备提供临时的电能, 用于将緩冲存储器 (Cache ) 中的数据转存到闪存 中。 在美国专利文献 US8031551B2公开了用电容作为存储设备的备用电源的方案, 并在运行时检测电容的性能, 在检测到电容容量过低时, 对电容进行充电。
发明内容
因而, 分担存储设备上的控制器的工作负担是有益的。 通过将与存储设备的緩 冲存储器有关的维护工作转移给主机, 既减轻了存储设备的控制器的负载, 也向主机 提供了更灵活控制存储设备的能力。
然而, 半导体技术发展的速度远超过作为备用电源的电容。 作为备用电源的电 容所提供的能量限制了可在存储设备中使用的緩冲存储器的大小。
根据本发明的第一实施例, 提供了一种控制数据传输过程中的中断的方法, 用 于在信息处理设备和存储设备之间传输数据, 所述存储设备包括闪存存储器, 该方法 包括: 所述存储设备接收所述信息处理设备发送的写请求; 响应于所述写请求, 向所 述闪存存储器中写入数据;向所述信息处理设备发送消息,以指示所述写请求的完成, 并计算预定时间间隔内向所述信息处理设备发送消息的次数; 其中, 若所述次数大于 预定阈值, 则停止向所述信息处理设备发送中断。
在根据本发明的第一实施例中, 其中若所述次数不大于预定阈值, 则允许向所 述信息处理设备发送消息。
在根据本发明的第一实施例中, 其中所述信息处理设备可设置所述预定阈值和 / 或所述预定时间间隔。
根据本发明的第二实施例, 提供了一种存储设备, 包括闪存存储器、 控制电路 以及接口单元, 所述控制电路还包括中断控制器, 所述存储设备与信息处理设备可通 信地连接; 所述接口单元接收信息处理设备发送的写请求; 所述控制电路基于所述写 请求向所述闪存存储器中写入数据; 所述中断控制器向所述信息处理设备发送中断, 以指示所述写请求的执行完成;所述中断控制器统计预定时间间隔内向所述信息处理 设备发送的中断的次数; 所述中断控制器还将所述次数同预定阈值相比较, 若所述次 数大于预定阈值, 则抑制向所述信息处理设备发送中断。
在根据本发明的第二实施例中, 其中若所述中断次数不大于预定阈值, 则所述 中断控制器允许向所述信息处理设备发送中断。
在根据本发明的第二实施例中, 其中响应于所述接口单元接收信息处理设备发 送的写请求, 所述控制电路緩存所述写请求。 根据本发明的第三实施例, 提供了一种控制数据传输过程中的中断的方法, 用 于在信息处理设备和存储设备之间传输数据,所述存储设备包括闪存存储器和緩冲存 储器, 该方法包括: 所述存储设备接收所述信息处理设备发送的写请求; 基于所述写 入请求, 将数据写入所述緩冲存储器, 并使计数器递增; 将所述緩冲存储器中的所述 数据取出并写入所述闪存存储器, 并使所述计数器递减; 若所述计数器小于第一预定 阈值, 且预定时间间隔内向所述信息处理设备发送消息的次数小于第二预定阈值, 则 向所述信息处理设备发送指示所述写入请求的执行完成的消息。
在根据本发明的第三实施例中, 其中所述计数器不小于第一预定阈值, 或者预 定时间间隔内向所述信息处理设备发送消息的次数不小于第二预定阈值,则不向所述 信息处理设备发送指示所述写入请求的执行完成的消息。
根据本发明的第四实施例, 提供了一种存储设备, 包括闪存存储器、 緩冲存储 器、 控制电路以及接口单元, 所述控制电路还包括中断控制器, 所述存储设备与信息 处理设备可通信地连接; 所述接口单元接收信息处理设备发送的写请求; 所述控制电 路基于所述写请求, 将数据写入所述緩冲存储器, 并使计数器递增; 所述控制电路将 所述緩冲存储器中的所述数据取出并写入所述闪存存储器, 并使所述计数器递减; 所 述中断控制器统计预定时间间隔内向所述信息处理设备发送的指示所述写请求的执 行完成的消息的次数; 若所述计数器小于第一预定阈值, 且所述次数小于第二预定阈 值, 所述中断控制器向所述信息处理设备发送指示所述写请求执行完成的消息。
在根据本发明的第四实施例中, 所述计数器不小于第一预定阈值, 或者预定时 间间隔内向所述信息处理设备发送消息的次数不小于第二预定阈值,则所述中断控制 器不向所述信息处理设备发送指示所述写请求的执行完成的消息。
在本发明的第五实施例中, 提供了一种将数据写入存储设备的方法, 所述存储 设备包括緩冲存储器和闪存存储器, 所述存储设备与信息处理设备可通信地连接, 所 述方法包括: 从信息处理设备接收第一写入命令, 所述第一写入命令包括要写入的数 据、用于所述闪存存储器的地址以及用于所述緩冲存储器的地址; 基于所述用于所述 緩冲存储器的地址, 将所述要写入的数据写入到所述緩冲存储器; 基于用于所述闪存 存储器的地址和用于所述緩冲存储器的地址,将所述緩冲存储器中的所述要写入的数 据, 写入到所述闪存存储器。
在本发明的第六实施例中, 提供了一种在信息处理设备和存储设备之间进行 D MA传输的方法, 所述存储设备包括緩冲存储器和闪存芯片, 所述方法包括: 接收第 一 10请求; 为所述第一 10请求分配第一存储单元与第二存储单元; 向所述存储设备 发送所述第一 DMA描述符, 所述第一 DMA描述符包括 DMA主机地址、 用于所述 存储设备的闪存芯片的地址以及第一用于緩冲存储器的地址与第二用于緩冲存储器 的地址, 其中, 所述第一用于緩冲存储器的地址同所述第一存储单元相对应, 所述第 二用于緩冲存储器的地址同所述第二存储单元相对应;在所述存储设备和所述信息处 理设备之间依据所述第一 DMA描述符进行 DMA传输; 接收来自所述存储设备的消 息, 所述消息指示所述存储设备对第一 DM A描述符已执行完成; 释放所述第一存储 单元与所述第二存储单元。
在本发明的第七实施例中, 提供了一种由与信息处理设备通信的存储设备执行 的方法, 所述存储设备包括緩冲存储器, 所述方法包括: 从所述信息处理设备接收第 一 DMA描述符命令, 所述第一 DMA描述符命令包括第一用于緩冲存储器的地址以 及长度信息;在所述存储设备的緩冲存储器中基于所述第一用于緩冲存储器的地址获 得第一存储单元,在所述第一存储单元中存储所述长度信息; 从所述信息处理设备接 收第一 DMA描述符数据, 所述第一 DMA描述符数据包括第二用于緩冲存储器的地 址;在所述存储设备的緩冲存储器中基于所述第二用于緩冲存储器的地址获得第二存 储单元, 在所述第二存储单元中记录所述第一存储单元的地址; 基于所述第一 DMA 描述符数据, 以 DMA传输方式从所述信息处理设备将第一数据写入到所述第二存储 单元; 基于第二存储单元中记录的所述第一存储单元的地址,访问所述第一存储单元 中的长度信息, 以确定 DMA操作是否完成。
附图说明
当连同附图阅读时, 通过参考后面对示出性的实施例的详细描述, 将最佳地理 解本发明以及优选的使用模式和其进一步的目的和优点, 其中附图包括:
图 1是根据本发明实施例的存储设备的结构框图;
图 2A、 2B是根据本发明实施例的写入命令的示意图;
图 3是根据本发明实施例的存储设备执行写入命令的方法的流程图; 图 4是根据本发明实施例的主机的示意图;
图 5是根据本发明实施例的主机执行写入操作的流程图;
图 6是根据本发明实施例的第二写入命令的示意图;
图 7A、 7B是根据本发明实施例的存储设备执行第二写入命令的流程图; 图 7C中展示了用于实施图 7A、7B中的执行第二写入命令的存储设备的结构框 图;
图 8是根据本发明实施例的主机的软件方框图;
图 9 A是根据本发明实施例的主机创建并执行第二写入命令的流程图; 图 9B是根据本发明另一实施例的主机创建并执行第二写入命令的流程图; 图 10A是根据本发明的一实施例的在存储设备的緩冲存储器中创建链表的流程 图;
图 10B是根据本发明的一实施例的在存储设备的緩冲存储器中创建链表的流程 图;
图 10C是根据本发明的一实施例的存储设备利用在緩冲存储器中创建的链表执 行 DMA描述符的流程图;
图 11A-11F展示出了与图 10B、 图 10C相关联的緩冲存储器的多种状态; 图 12是根据本发明的又一实施例的存储设备的结构框图;
图 13是根据本发明又一实施例的存储设备的结构框图;
图 14A是根据本发明的又一实施例的存储设备执行中断抑制的流程图; 图 14B是根据本发明的又一实施例的存储设备执行中断抑制的流程图; 图 15是根据本发明的又一实施例的存储设备执行中断抑制的流程图; 图 16 A是根据本发明的又一实施例的执行中断抑制的存储设备的结构框图; 图 16B是根据本发明的又一实施例的执行中断抑制的存储设备的结构框图; 图 16C是根据本发明的又一实施例的执行中断抑制的存储设备的结构框图; 图 16D是根据本发明的又一实施例的执行中断抑制的存储设备的结构框图; 以 及
图 17是根据现有技术的固态存储设备的结构框图。
具体实施方式
图 1是根据本发明实施例的存储设备的结构框图。 如图 1所示的实施例包括主 机 101以及同主机 101相耦合的存储设备 102。 主机 101同存储设备 102之间可通过 多种方式相耦合, 耦合方式包括但不限于通过例如 SATA、 IDE, USB、 PCIE、 SCSI, 以太网、 光纤通道、 无线通信网络等连接主机 101与存储设备 102。 主机 101可以是 能够通过上述方式同存储设备相通信的信息处理设备,例如,个人计算机、平板电脑、 服务器、 便携式计算机、 网络交换机、 路由器、 蜂窝电话、 个人数字助理等。 存储设 备 102包括主机接口 103、 控制电路 104、 一个或多个闪存芯片 105以及緩冲存储器 106。 主机接口 103可适配于通过例如 SATA、 IDE, USB、 PCIE、 SCSI, 以太网、 光纤通道等方式与主机 101交换数据。 控制电路 104用于控制在主机接口 103、 闪存 芯片 105以及緩冲存储器 106之间的数据传输, 还用于闪存管理、主机逻辑地址到闪 存物理地址映射、 擦除均衡、 坏块管理等。 可通过软件、 硬件、 固件或其组合的多种 方式实现控制电路 104。控制电路 104可以是 FPGA ( Field-programmable gate array, 现场可编程门阵列 ) 、 ASIC ( Application Specific Integrated Circuit, 应用专用集成 电路) 或者其组合的形式。 控制电路 104也可以包括处理器或者控制器。
根据本发明的一个实施例, 主机 101向存储设备 102发出读出命令或者写入命 令。控制电路 104经由主机接口 103接收到该读出命令或写入命令。在附图 2中详细 描述了作为例子的第一写入命令 200。
参看图 2A、 2B , 图 2A是根据本发明实施例的写入命令的示意图。 写入命令 2 00包括字段 201、 202、 203和 204。 字段 201指示该命令为写入命令, 字段 202为闪 存地址, 字段 203为数据, 该写入命令 200指示存储设备 102将数据字段 203中的数 据基于由字段 202所指示的闪存地址写入闪存芯片 105。字段 204为緩冲存储器地址, 存储设备 102接收到该写入命令 200时,先将数据字段 203中的数据基于写入由字段 204所指示緩冲存储器地址写入緩冲存储器 106, 再将数据字段 203中的数据基于由 字段 202所指示的闪存地址写入闪存芯片 105。 在一个例子中, 存储设备 102将数据 字段 203中的数据基于写入由字段 204所指示緩冲存储器地址写入緩冲存储器 106 后, 再从緩冲存储器 106中读出该数据, 继而将该数据写入到闪存芯片 105。 将数据 写入到緩冲存储器 106的操作,同将存储器 106中的另一数据读出并写入到闪存芯片 105的操作可以并发执行, 从而使得主机 101向存储设备 102的写入操作的并发性能 得到提升, 并且不会显著增加控制电路 104的复杂度, 因为控制电路 104无需处理緩 冲存储器 106的空间分配任务。 在一个实施例中, 字段 204中可以是緩冲存储器 106 的完整地址, 而在另一个实施例中, 字段 204是相对某一基地址的偏移值。 在一个实 施例中, 字段 203中携带要写入闪存 105的数据。 而在另一个实施例中, 字段 203 中可携带一个指针, 该指针指向要写入存储设备 102的数据, 而该数据可以存储在主 机 101的存储器中, 在此情况下, 存储设备 102通过随后的 DMA传输过程从主机 1 01获得该数据。 在依然另一个实施例中, 字段 203可携带一个指针, 该指针指向要 写入存储设备 102的数据, 而该数据可以存储在存储设备 102的緩冲存储器中。 字段 202可以是要将数据写入的闪存芯片 105的物理地址或逻辑地址。 字段 202也可以是 一个指针, 指向緩冲存储器 106 , 在其中存储有用于闪存芯片 105的物理地址或逻辑 地址。 逻辑地址到物理地址的转换过程, 可以通过查找地址映射表的方式实现。
所属领域技术人员将容易意识到, 写入命令可以具有多种具体编码方式和字段 顺序。 例如, 参看图 2B , 指示写入命令 210的类型是写操作的字段 214可以在写入 命令 210的末尾或者其他位置。 而在字段 211中携带緩冲存储器地址, 在字段 212 中携带数据或指向数据的存放位置的指针。在字段 213中存放闪存地址, 或者指向存 放闪存地址的指针, 闪存地址可以是逻辑地址或物理地址。
图 3是根据本发明实施例的存储设备执行写入命令的方法的流程图。 在步骤 30
1 , 存储设备 102从主机 101接收到写入命令 200。 存储设备 102的控制电路 104通 过主机接口 103接收到写入命令 200后,提取出包含于写入命令 200中的用于指示操 作类型为写操作的字段 201 , 用于指示要写入的闪存的地址的字段 202, 用于指示要 写入的数据的字段 203 , 以及用于指示緩冲存储器 106的地址的字段 204。 在步骤 30
2, 响应于该写入命令 200, 控制电路 104基于字段 204得到用于緩冲存储器 106的 地址, 并基于字段 203得到要写入的数据, 以及将要写入的数据写入到緩冲存储器 1 06中由字段 204所指示的位置。 当将数据写入到緩冲存储器 106中后, 存储设备 10 2可向主机发送消息以指示写入命令 200的执行完成, 虽然数据此时尚未被实际写入 到闪存芯片 105之中。 以此方式, 在主机 101看来, 在步骤 302执行完成后, 写入命 令 200已经执行完成, 从而提升了存储设备 102的执行写入命令 200的性能。 向主机 发送的消息可以包含于存储设备 102向主机 101所发送的中断请求之中,也可以基于 主机 101与存储设备 102之间的耦合方式 (SATA、 IDE, USB、 PCIE、 SCSI, 以太 网、 光纤通道、 无线通信网络等)而选择适当的其他消息发送方式。 在将要写入的数 据写入到緩冲存储器 106之后,在控制电路 104的控制下, 将由字段 203所指示的要 写入的数据,基于由字段 202所指示的闪存地址,写入到闪存芯片 105中(步骤 303 )。 当将数据写入到闪存芯片 105中后,存储设备 102也可向主机发送消息以指示写入命 令 200的执行完成, 特别地, 此时主机可以在写入命令 200中再次指定将数据写入该 用于指示緩冲存储器 106的地址, 而不会因对该地址处的数据的重写而导致数据错 误。 在一个例子中, 如果字段 202所指示的是用于闪存芯片 105的逻辑地址, 则将该 逻辑地址转换为用于闪存芯片 105的物理地址。逻辑地址到物理地址的转换方式是所 属领域技术人员所了解的。 在一个例子中, 在步骤 303 , 从緩冲存储器 106中重新取 得所写入的数据, 并将该数据写入到闪存芯片 105。 所属领域技术人员将意识到, 在 控制电路 104的控制下, 步骤 302中将数据写入到緩冲存储器 106的操作, 与步骤 3 03中将数据写入到闪存存储器 105的操作, 可以并行执行。 这样, 在存储设备 102 中可以同时处理多个写入命令, 其中, 在一个时刻, 基于一个写入命令, 控制电路 1 04将第一数据写入到緩冲存储器 106中; 而基于另一个写入命令, 控制电路 104将 存在于緩冲存储器 106中的第二数据写入到闪存芯片 105中。緩冲存储器 106可以是 双端口存储器,使得在经由第一端口向緩冲存储器 106写入第一数据的同时, 可以从 第二端口从緩冲存储器 106读出第二数据。 所属领域技术人员可意识到緩冲存储器 1
06的其他实施方式, 以支持对多份数据的同时读出和 /或写入操作。
通过在写入命令中携带用于指示緩冲存储器 106的地址的字段 204, 将维护緩 冲存储器 106的工作从控制电路 104移除了,并且使主机 101拥有了更灵活控制存储 设备 102的能力。
图 4是根据本发明实施例的主机的示意图。 图 4是示出了主机 400的软件组成 的方框图。主机 400可以是个人计算机、服务器计算机或者其他具有计算能力的设备。 主机 400包括一个或多个用户应用程序 401、 402和 403 , 以及操作系统 404。 操作系 统 404中具有存储设备驱动程序 405。 在根据本发明的实施例中, 驱动程序 405中包 括緩冲区控制块 406 , 用以在主机 400中控制存储设备 102的緩冲存储器 106。 緩冲 区控制块 406由多个存储单元 (411、 412…… 41η ) 组成, 緩冲区控制块 406中的每 个存储单元 (411、 412…… 41η ) 对应于緩冲存储器 106中的一个存储单元, 并记录 緩冲存储器 106中的对应存储单元的工作状态。 在一个实施例中, 緩冲区控制块 406 中的存储单元 (411、 412…… 41η ) 的每一个, 记录緩冲存储器 106中的对应存储单 元是空闲的还是已经被占用。在进一步的一个实施例中, 在发送给存储设备 102的一 个读 /写命令中涉及緩冲存储器中的多个存储单元, 例如 2个。 在此情况下, 将緩冲 区控制块 406中的 2个存储单元 (411、 412 ) 关联在一起, 在存储单元 411、 412中 还记录存储单元 411与 412之间的这种关联关系, 例如, 在存储单元 411中记录指向 存储单元 412的一个或多个指针。在依然进一步的实施例中, 在存储单元 412中还记 录指向存储单元 411的一个或多个指针。
图 5是根据本发明实施例的主机执行写入操作的流程图。 当用户应用程序或者 其他程序请求执行将数据写入到存储设备的操作时,应用程序或其他程序会发送写请 求。 图 4中的存储设备驱动程序 405接收该写请求 (步骤 501 ) , 该写请求中包括应 用程序或其他程序所提供的要写入的数据已经用于存储设备的地址,用于存储设备的 地址可以是文件路径及偏移值, 并进一步被转换为用于存储设备的逻辑地址。在一个 例子中, 该逻辑地址是用于存储设备上的闪存芯片的逻辑地址, 该写请求要将数据基 于该逻辑地址写入到闪存芯片中。 在步骤 502, 存储设备驱动程序 405为该写请求分 配空闲的緩冲存储器。 具体地, 遍历緩冲区控制块 406 , 找到其中为空闲状态的存储 单元, 例如, 存储单元 411。 存储单元 411为空闲状态, 表示在存储设备 102的緩冲 存储器 106中的对应存储单元为空闲状态, 可以接收写入的数据。
在步骤 503中, 存储设备驱动程序 405向存储设备 102发送写命令, 在写命令 中包括要写入的数据以及用于存储设备 102的地址,在该写命令中还包括同存储单元 411相对应的用于緩冲存储器 106的地址。 所属领域技术人员将意识到, 有多种方式 获得存储单元 411与緩冲存储器 106中的对应存储单元的对应关系。 例如,緩冲区控 制块 406中有 η个存储单元 ( 411、 412…… 41η ) , 而緩冲存储器 106中也包括 η个 存储单元, 存储单元 411对应于緩冲存储器 106中的第一个存储单元, 而存储单元 4 12对应于緩冲存储器 106中的第二个存储单元, 以及类似地, 存储单元 41η对应于 緩冲存储器 106中的第 η个存储单元, 使得基于存储单元 411在緩冲区控制块 406 中的位置可计算出緩冲存储器 106中的对应存储单元的地址。依然作为一个例子,还 可以在存储单元 (411、 412…… 412 ) 中存储緩冲存储器 106中的对应存储单元的地 址。 在依然另一个例子中, 在写命令中携带一个序号, 该序号既指示存储单元 411 在緩冲区控制块 406中的位置, 又指示在緩冲存储器 106中的对应存储单元的位置。
在步骤 504, 接收到来自存储设备 102的消息。 在一个例子中, 该消息是中断 请求, 该中断请求指示在步骤 503中发送的写命令已经执行完毕。 如前面所述的, 在 一个例子中,存储设备 102中的控制电路 104在将写命令中的数据写入到緩冲存储器 106 (特别地, 写入到緩冲存储器 106中与緩冲区控制块 406的存储单元 411相对应 的存储单元) 之后, 存储设备即发送中断, 指示该写命令执行完成。 在一个例子中, 控制电路 104将数据写入到闪存芯片 105之后, 存储设备 102向主机 101发送中断。 在一个例子中,该中断请求中还包括指示步骤 503中发送的写命令相关的緩冲区控制 块 406的存储单元的信息。 该信息可以是一个或多个存储单元 (411、 412 ··· ··· 41η ) 的地址, 一个或多个存储单元 (411、 412 ··· ··· 41η ) 的序号。
在步骤 505 , 响应于在步骤 504中接收到的该中断请求, 并基于该中断请求中 所指示的与该写命令相关的緩冲区控制块 406的存储单元的信息,释放与该写命令相 关的緩冲区控制块 406的存储单元( 411、 412…… 41η )。释放存储单元( 411、 412…… 41η )具体可以是在存储单元(411、 412 ··· ··· 41η ) 中设置緩冲存储器 106中的对应存 储单元是空闲状态。
在一个例子中, 步骤 503中的写命令涉及緩冲区控制块 406的两个存储单元 41 1与 412, 并且, 存储单元 411与 412中分别记录了指向彼此的指针, 以表示这两个 存储单元 411、 412关联于同一个写命令。 在步骤 504中接收到的中断请求中, 既可 以指示存储单元 411也可以指示存储单元 412。 在步骤 505中, 基于指示存储单元 4 11与 412之一的指针, 可获得两个存储单元 411与 412, 并将其释放。 类似地, 所属 领域技术人员可意识到以此方式还可以在写命令中关联三个或更多的存储单元(411、 412…… 41η ) 。
图 6是根据本发明实施例的第二写入命令的示意图。 第二写入命令指示存储设 备 102以 DMA方式从主机 101获得数据并写入到闪存芯片 105中。 第二写入命令可 以是 DMA描述符 600。 DMA描述符 600包括 DMA命令 610以及一个或多个 DMA 数据 ( 620、 630 ) 。 DMA命令 610包括字段 611 , 用于指示 DMA方式, 即该 DMA 描述符 600指示的操作, 其可以为闪存读、 写、 擦除或者其他操作。 字段 612指示存 储设备的逻辑地址。 字段 613指示该 DMA描述符 600的长度, 即该 DMA描述符 60 0所包括的 DMA数据 ( 620、 630 ) 的个数, 其可以为 1个或多个。 字段 614指示緩 冲存储器 106的地址。 DMA数据 620、 630分别包括字段 621、 631 , 用于指示 DMA 传输中的主机地址。 DMA数据 620、 630还分别包括字段 622、 632, 用于指示緩冲 存储器 106的地址。
DMA命令 610中的字段 612的存储设备的逻辑地址可用于 DMA数据 620、 63 0。在 DMA描述符 600中仅包括一个 DMA数据 620的情况下,存储设备 102根据字 段 621指示的主机地址和字段 622指示的緩冲存储器地址, 在主机 101和存储设备 1 02之间发起 DMA传输,并最终将接收到的数据存储到由字段 612所指示的闪存芯片 105中。 在 DMA描述符 600包括 DMA数据 620与 630的情况下, 存储设备 102将 根据 DMA数据 620而执行 DMA传输所得的数据, 最终存储在由字段 612所指示的 闪存芯片 105中, 而存储设备 102还将根据 DMA数据 630而执行 DMA传输所得的 数据,最终存储在由字段 612加上一预定偏移值所指示的闪存芯片 105中。换句话说, DMA描述符 600可以指示在主机 101和存储设备 102之间的多次 DMA传输, 每次 DMA传输同 DMA数据 620、 630中的一个相对应, 每次 DMA传输中传输相同数量 的数据(例如 4K字节), 并且 DMA数据 620与 DMA数据 630所对应的 DMA传输 的存储设备的逻辑地址是连续的 (例如, 相距预定的偏移值, 该偏移值可以与 DMA 传输的数据量相对应) 。 这样, 可以在 DMA描述符 600中仅携带一个存储设备逻辑 地址(字段 612 )。 而 DMA数据 620与 DMA数据 630所对应的 DMA传输的两个 D MA主机地址 (字段 621、 631 ) 可以是不连续的, 这样可以支持分散 -收集 ( Scatter- Gather ) 方式的 DMA传输。
在对应于 DMA数据 620的 DMA传输中, 将来自字段 621所指示的 DMA主机 地址的数据, 写入到字段 622所指示的緩冲存储器 106中, 继而再写入到闪存芯片 1 05中。 在对应于 DMA数据 630的 DMA传输中, 将来自字段 631所指示的 DMA主 机地址的数据, 写入到字段 632所指示的緩冲存储器 106中, 继而再写入到闪存芯片 105中。
字段 614是可选的。 在字段 614所对应的緩冲存储器地址处, 作为一个例子, 可保存字段 613所指示的 DMA描述符 600的长度。从而可以记录 DMA多个数据 62 0、 630所对应的 DMA传输有多少已经得到执行, 或者有多少尚未被执行。 对于 DM A描述符 600, 当其全部 DMA数据 620、 630所对应的 DMA传输均已执行完毕后, 例如,所对应的数据均写入到闪存芯片 105中后,存储设备 102向主机 101发送中断, 以指示对 DMA描述符 600的执行完成。 这样, 对于 DMA描述符 600 , 虽然其对应 于 2次 DMA传输过程, 但仅向主机 101发送一次中断。 减少中断请求次数, 将有助 于降低主机 101的工作负荷。
图 7A、 7B是根据本发明实施例的存储设备执行第二写入命令的流程图。 第二 写入命令可以是如图 6所示的描述符 600。 参看图 7A, 在步骤 701 , 存储设备 102 接收 DMA描述符 600。 在 DMA描述符 600中包括用于主机的地址(例如, DMA主 机地址 621、 631 ) , 用于闪存芯片 105的地址(例如, 存储设备逻辑地址 612 ) 以及 用于緩冲存储器 106的地址 (例如, 緩冲存储器地址 622、 632 ) 。 虽然在图 6中的 DMA描述符 600包括 DMA命令 610、 DMA数据 620、 630 , 但这仅是为了清楚表达 的目的。 DMA命令 610、 DMA数据 620、 630也可以组合在一起。 存储设备 102从 DMA描述符 600中提取出用于主机的地址, 用于闪存芯片 105的地址以及用于緩冲 存储器 106的地址。
在步骤 702,存储设备 102基于用于主机的地址和用于緩冲存储器的地址, 以 D MA传输方式从主机 101将数据写入到緩冲存储器 106。 在步骤 703 , 基于用于闪存 存储器的地址和用于緩冲存储器, 将在步骤 702中写入到緩冲存储器中的数据, 写入 到闪存芯片 105。
在一个例子中, 在步骤 702, 将数据写入到緩冲存储器 106之后, 向主机 101 发送中断, 以指示对 DMA传输的执行完成。 如果 DMA描述符 600中仅包括这一次 DMA传输 (例如, DMA描述 600仅包括 DMA命令 610与 DMA数据 620 ) , 则该 中断也表示对 DMA描述符 600的执行完成。 在一个例子中, 在步骤 703 , 将数据写 入到闪存芯片 105之后, 向主机 101发送中断, 以指示对 DMA传输的执行完成。
参看图 7B , 其示出了对包含多个 DMA数据 ( 620、 630 ) 的 DMA描述符 600 的更详细的处理过程。 在步骤 711 , 存储设备 102接收 DMA描述符 600, DMA描述 符 600包括 DMA命令 610、 DMA数据 620以及 DMA数据 630。
在步骤 712, 基于 DMA描述符 600, 将 DMA数据 620变换为第一 DMA ^:指 令, 将 DMA数据 630变换为第二 DMA微指令。 第一 DMA微指令中包括 DMA主 机地址 621和緩冲存储器地址 622。 基于第一 DMA微指令, 还可以获得与其对应的 存储设备的逻辑地址 612、 DMA操作类型以及 DMA描述符长度 613。 该存储设备的 逻辑地址 612和 DMA操作类型可以是第一 DMA 指令的一部分, 也可以是存储在 緩冲存储器 106中, 并通过在第一 DMA微指令中的索引来访问, 还可以通过将第一 DMA微指令放置在特定的操作队列 (读、 写、 擦除、 其他) 中, 以标识第一 DMA 微指令的操作类型。
作为依然另一个例子, 对于第一 DMA微指令, 根据緩冲存储器地址 622与一 预定的偏移值得到存储在緩冲存储器 106中的指针,基于该指针, 获得存储设备的逻 辑地址 612和 /或 DMA描述符长度 613。 通过类似的方式, 对于第二 DMA微指令, 根据緩冲存储器地址 632与一预定偏移值得到存储在緩冲存储器 106中的指针,基于 该指针, 获得存储设备的逻辑地址 612和 /或 DMA描述符长度 613。
在优选的实施例中, 基于緩冲存储器地址 614, 将 DMA描述符长度 613存储在 緩冲存储器 106中, 其中 DMA描述符长度等同于 DMA描述符 600中的 DMA数据 的个数 (或者 DMA描述符 600中的 DMA命令与 DMA数据的总计个数, 从中可以 得到 DMA数据的个数) , 并通过在第一 DMA微指令中的索引来访问 DMA描述符 长度 613。 这样, 第一 DMA ^敫指令与第二 DMA ^敫指令的执行顺序变得不重要。 每 执行一个 DMA微指令, 将緩冲存储器 106中的 DMA描述符长度递减 (例如, 减 1 或减去单位长度) , 当緩冲存储器 106中的 DMA描述符长度变为 0时, 表示对该 D MA描述符 600的所有 DMA操作全都执行完成。
在步骤 713 , 对于第一 DMA微指令, 基于 DMA主机地址 621和緩冲存储器地 址 622, 以 DMA传输方式将数据写入到相应緩冲存储器 106中。
在步骤 714, 对于第二 DMA微指令, 基于 DMA主机地址 631和緩冲存储器地 址 632, 以 DMA传输方式将相应数据写入到緩冲存储器 106中。
在步骤 715 , 向主机发送中断, 以指示对 DMA描述符 600的操作完成。
在一个例子中, 步骤 713 , 还包括将同第一 DMA微指令相对应的写入到緩冲存 储器 106中的数据, 基于存储设备逻辑地址 612, 写入到闪存芯片 105中。 步骤 714 还包括将同第二 DMA微指令相对应的写入到緩冲存储器 106中的数据,基于存储设 备逻辑地址 612加上预定偏移值的和, 写入到闪存芯片 105中。
在优选的实施例中, 在步骤 713、 714中, 将相应数据写入到緩冲存储器 106中 之后, 还基于在第一、 第二微指令中的索引, 访问存储在緩冲存储器中的 DMA描述 符长度 613 , 并将 DMA描述符长度 613递减(例如, 减 1或减去单位长度) 。 这样, 当该 DMA描述符长度 613变为 0时, 意味着对 DMA描述符 600的操作完成。 以此 方式, 可以在存储设备 102中同时处理多个 DMA描述符 600, 并且第一 DMA ^敫指 令与第二 DMA 指令的执行顺序也是不重要的。 还可以釆用其他方式来识别 DMA 描述符 600中的多个 DMA数据均被执行。 例如, 在緩冲存储器或寄存器中为每个 D MA描述符 600的每个 DMA数据提供标志, 每当一个 DMA数据( DMA微指令)被 执行后, 将相应的标志置位。 还可以顺序执行 DMA描述符 600中的每个 DMA数据 ( DMA微指令) , 当最后一个 DMA数据 ( DMA微指令)被执行后, 意味着对该 D MA描述符 600的执行完成。
在依然另一个实施例中,当 DMA描述符 600中的每一个 DMA ^敫指令被执行后, 向主机 101发送中断, 并由主机驱动程序来分析对 DMA描述符 600的执行是否已完 成。 分析方法同上面所描述的存储设备 102中识别 DMA描述符 600中的多个 DMA 数据是否均被执行的过程相类似。
图 7C中展示了用于实施图 7A、 7B中的执行第二写入命令的存储设备的结构框 图。 图 7C中, 主机 101包括 PCIE控制器 721和主机存储器 722。 主机存储器 722 可以是随机访问存储器 ( RAM ) , PCIE控制器 721用于同存储设备经由 PCIE总线 进行通信。 存储设备 102中包括 PCIE接口 731、 DMA指令分析器 732、 微指令 FIF 0 (先进先出緩冲器) 733、 DMA写操作控制器 734、 DMA写接口 735、 逻辑地址到 物理地址转换电路 736、 Flash接口控制器 737、 闪存芯片 105以及緩冲存储器 106。
PCIE接口 731接收主机 101通过 PCIE控制器 721发送的 DMA描述符 600。主 机 101与存储设备 102之间的连接不限于 PCIE方式, 还可以通过 SATA、 IDE, US B、 PCIE, SCSI, 以太网、 光纤通道等连接主机 101与存储设备 102。 DMA指令分 析器 732将 PCIE接口 731接收到的 DMA描述符 600变换为 DMA微指令。 对于如 图 6所示的 DMA描述符 600, 其中包括 DMA数据 620和 DMA数据 630, 则 DMA 指令分析器将其变换为对应于 DMA数据 620的第一 DMA 指令和对应于第二 DM A数据 630的第二 DMA微指令。 第一 DM A微指令与第二 DM A微指令的结构已在 上文中详细介绍。 DMA指令分析器 732还从 DMA描述符 600的 DMA命令 610中提 取出 DMA描述符长度, 并对其加以保存, 可以保存在緩冲存储器 106、 一个寄存器 或者类似物中。 DMA描述符长度指示了 DMA描述符 600所包括的 DMA数据的数 量, 也指示了从该 DMA描述符 600所得到的 DMA微指令的个数。 DMA指令分析 器 732将第一 DMA 指令与第二 DMA ^:指令存储在^:指令 FIFO 733中。
微指令 FIFO 733能够緩存 DMA微指令, 并按照先进先出的方式向 DMA写操 作控制器 734提供 DMA微指令。 虽然这里仅以写操作为例, 描述了将与 DMA写操 作对应的 DMA微指令緩存在微指令 FIF0733中,所属领域技术人员将意识到可以将 与 DMA读操作对应的 DMA微指令同与 DMA写操作对应的 DMA微指令混合緩存 在^:指令 FIF0733。还可以将^:指令 FIF0733配置为两部分或多个部分, 其中一部分 专用于存储与 DMA读操作对应的 DMA ^:指令, 而将另一部分专用于存储与 DMA 写操作对应的 DMA微指令。
对于与 DMA写操作对应的 DMA微指令, 例如, 前面所提到的第一 DM A微指 令与第二 DMA微指令, DMA写操作控制器 734基于这些 DMA微指令来执行 DMA 写操作。 如同前面所提到的, 第一 DMA ^敫指令中包括, DMA主机地址 621和緩冲 存储器地址 622。DMA写操作控制器 734利用 DMA主机地址 621和緩冲存储器地址 622,通过 DMA写接口 735在主机 101和存储设备 102之间发起 DMA写操作,将存 储在 DMA主机地址 621处的数据, 传输到緩冲存储器地址 622所指示的位置, 所传 输的数据可以具有预定的长度(例如 4K字节)。 对于第二 DMA微指令, DMA写操 作控制器 734执行类似的操作, 将存储在 DMA主机地址 631处的数据, 传输到緩冲 存储器地址 632所指示的位置。
从第一 DMA微指令和第二 DMA微指令可获得用于各自的存储设备的逻辑地 址。 在逻辑地址到物理地址转换电路 736 , 为每条 DMA微指令的存储设备的逻辑地 址转换为用于闪存芯片 105的物理地址。 对于每一条 DMA微指令, Flash接口控制 器 737将写入到緩冲存储器 106的数据,基于逻辑地址到物理地址转换电路 736所提 供的物理地址, 写入到闪存芯片 105中。
Flash接口控制器 737还基于在第一、 第二微指令中的索引, 访问所保存的从 D MA描述符 600的 DMA命令 610中提取出 DMA描述符长度, 并将 DMA描述符递 减 (例如, 减 1或减去单位长度) 。 这样, 当该 DMA描述符长度变为 0时, 意味着 对 DMA描述符 600的操作完成。 继而, 可向主机发送中断, 以指示对 DMA描述符 600的操作完成。在一个例子中, DMA写操作控制器也访问所保存的 DMA描述符长 度, 并确定是否已将与 DMA描述符 600相对应的所有数据均写入到緩冲存储器 106 中, 并向主机发送指示所有数据已写入到緩冲存储器 106的中断。
图 8是根据本发明实施例的主机的软件方框图。 图 8是示出了主机 800的软件 的方框图, 其同图 4中展示的主机的软件方框图相类似。 不同之处在于, 图 8中的緩 冲区控制块 406中还包括 10请求链表 801。 10请求链表 801是利用緩冲区控制块 40 6中的存储单元(411、 412…… 41η )组成的链表。 10请求链表 801可以是单向链表、 双向链表或循环链表。 在生成如图 6所示的 DMA描述符 600时, 对于一个 DMA描 述符 600 ,创建一个与之相对应的 10请求链表 801 , 其中包括分别与 DMA命令 610、 DMA数据 620、 DMA数据 630分别相对应的存储单元 (811、 812、 813 ) 。 需要指 出的是, 存储单元(811、 812、 813 )是緩冲区控制块 406的存储单元(411、 412…… 41η )中的三个存储单元, 并通过设置相应的指针, 形成 10请求链表 801。 在图 8中, 将存储单元(811、 812、 813 ) 与存储单元(411、 412…… 41η )分开展示, 仅仅是为 了清楚地描述的需要。
图 9 Α是根据本发明实施例的主机创建并执行第二写入命令的流程图。 在一个 实施例中, 步骤 901 , 由主机的存储设备驱动程序 405接收 10请求。 该 10请求指示 将分散在主机存储器的不同物理地址的多个数据块写入到存储设备 102中,为此将在 主机与存储设备之间执行分散 -收集 DMA操作。 下面将以举例的方式描述主机向存 储器写入数据的操作过程。
在步骤 902, 结合图 8 , 从緩冲区控制块 406中取出一个空闲状态的存储单元, 例如存储单元 411。
在步骤 904, 根据 10请求的内容, 创建 DMA描述符 600的 DMA命令 610, 填 充 DMA命令 610中的 DMA方式字段 611 (在该例子中, 是写操作) 、 存储设备逻 辑地址字段 612 (从 10请求中可获得该信息) 、 DMA描述符长度字段 613 (从 10 请求中可获得该信息) 以及緩冲存储器地址字段 614 (与步骤 902中所分配的存储单 元 411相对应) 。 继而将所创建的 DMA命令 610发送给存储设备 102。 并将存储单 元 411作为用于该 10请求的 10请求链表 801的起始节点 (例如存储单元 811 ) 。 创 建 10请求链表 801 , 用于在存储设备 102执行完 DMA描述符 600之后,将所占用的 存储单元归还给緩冲区控制块 406 , 并就该 10请求的执行完成通知应用软件或其他 上层软件。 为此目的, 在一个例子中, 还在存储单元 411中存储对应于该 10请求的 指针。 基于 DMA描述符长度, 还可获得 DMA数据部分的剩余长度。 在生成第一个 DMA数据之前, DMA数据部分的剩余长度是 DMA描述符 600中的 DMA数据 ( 62 0、 630 ) 的个数, 作为一个例子, 其为 DMA描述符长度减 1。
在步骤 906 , 从緩冲区控制块 406中取出一个空闲状态的存储单元, 例如, 存 储单元 412。 根据 10请求的内容, 创建 DMA描述符 600的 DMA数据 620, 填充 D MA数据 620中的 DMA主机地址字段 621 (从 10请求中可获得该信息)以及緩冲存 储器地址 622 (与所分配的存储单元 412相对应, 例如, 存储单元 412在緩冲区控制 块 406中的偏移值或序号) 。 继而将所创建的 DMA数据 620发送给存储设备 102。 并将存储单元 412作为用于该 10请求的 10请求链表 801的节点(例如存储单元 812 )。
在步骤 908 , 将 DMA数据部分剩余长度递减, 得到 DMA描述符 600中尚未发 送给存储设备的 DMA数据的个数。
在步骤 909 , 如果 DMA数据部分的剩余长度为 0, 则表示 DMA描述符 600的 生成已经完成,进而在步骤 910存储设备驱动程序 405将等待存储设备 102返回的表 示 DMA描述符 600的处理已经完成的中断, 并依据该中断找到与之对应的 10请求 链表 801 , 以及将 10请求链表 801中的存储单元 ( 811、 812 ) 释放。 换句话说, 将 由 10请求链表 801中的存储单元 (811、 812 ) 的状态设置为空闲, 从而使得通过緩 冲区控制块 406可以获知存储单元 411、 412的状态为空闲。 在一个例子中, 在 DM A描述符 600指示读操作, 且主机 101的 CPU包括高速緩冲存储器的情况下, 还通 知同 DMA描述符 600的 DMA主机地址( 621、 631 )相关联的 CPU高速緩冲存储器 执行一致性处理, 以反映出 DMA主机地址 ( 621、 631 ) 处的数据可能因读 DMA读 操作而发生变化。 在一个例子中, 存储设备 102返回的中断中包括指示 10请求链表 801中的多个存储单元 (811、 812 ) 之一 (或者緩冲存储器地址 622、 632之一) 的 内容, 依据该内容, 通过 10请求链表 801将存储单元 ( 811、 812 ) 释放。
在步骤 909 , 如果 DMA数据部分的剩余长度大于 0, 则表示 DMA描述符 600 的生成尚未完成, 还需要为 10请求生成一个或多个 DMA数据, 那么处理将返回到 步骤 906并重复执行步骤 906、 908和 909。
图 9B是根据本发明另一实施例的主机创建并执行第二写入命令的流程图。在该 实施例中, 将緩冲区控制块 406中的空闲存储单元进一步组织为空闲存储单元池, 以 有助于 DMA描述符 600的创建过程。 通过将緩冲区控制块 406中状态为空闲的存储 单元 (411、 412 ··· ··· 41η ) 组织成链表来形成空闲存储单元池。 当需要从緩冲区控制 块 406中获得空闲存储单元时, 可以从空闲存储单元池中取出存储单元,从而省去了 在緩冲区控制块 406中查找空闲存储单元的开销。 在一个实施例中, 步骤 921 , 由主机的存储设备驱动程序 405接收 10请求。 同 图 9A相类似, 该 10请求指示将分散在主机存储器的不同物理地址的多个数据块写 入到存储设备 102中, 为此将在主机与存储设备之间执行分散 -收集 DMA操作。
在步骤 922, 根据 10请求的内容, 计算出用于与相同该 10请求相对应的 DMA 描述符的长度(例如, DMA命令以及 DMA数据的个数)。 注意到在图 9A公开的实 施例中, 是在步骤 904创建 DMA命令 610的过程中获得 DMA描述符长度, 所属领 域技术人员将意识到各个步骤并非必然以本实施例中所公开的顺序执行。
在步骤 923 , 判断空闲存储单元池中是否为空。 如果空闲存储单元池非空, 即 緩冲区控制块 406中存在处于空闲状态的存储单元, 则进行到步骤 924, 并从空闲存 储单元池中取出一个空闲存储单元(例如存储单元 411 )。如果空闲存储单元池为空, 意味着緩冲区控制块 406中没有空闲的存储单元。 则在步骤 925 , 等待空闲存储单元 池被更新, 以出现空闲的存储单元。 当 DMA描述符的执行完成后, 与之相关的存储 单元会被释放,从而在空闲存储单元池中出现空闲的存储单元。后面对此会详细介绍。
在步骤 926 , 确定当前要生成用于 DMA描述符 600的 DMA命令字段还是 DM A数据字段。 一般而言, DMA描述符 600包括一个 DMA命令和一个或多个 DMA数 据。 当要生成 DMA命令时, 处理转向步骤 927 , 并根据 10请求的内容, 创建 DMA 描述符 600的 DMA命令 610, 填充 DMA命令 610中的各个字段 ( 611、 612、 613、 614 )。 在一个例子中, 还在存储单元 411中存储对应于该 10请求的指针, 以便在该 10请求的执行完成后, 可识别该 10请求并通知应用软件或其他上层软件。 当要生成 DMA数据时, 处理转向步骤 928 , 并根据 10请求的内容, 创建 DMA描述符 600的 DMA数据 620 , 填充 DMA数据 620的各个字段 (621、 622 ) 。
接下来, 在步骤 929, 将所生成的 DMA命令或 DMA数据发送给存储设备 102。 并在步骤 930 , 将在步骤 924中获得的存储单元 411设置在 10请求链表 801中。 作 为一个例子, 第一个进入到 10请求链表 801的存储单元, 将作为 10请求链表 801 的头节点, 但是, 也将意识到当 10请求链表 801被组织为环形链表时, 其中并不存 在 "头节点" 。 在步骤 930 , 还将 DMA描述符长度递减。
在步骤 931 , 如果 DMA描述符长度为 0, 意味着 DMA描述符 600的生成已经 完成, 进而在步骤 932存储设备驱动程序 405将等待存储设备 102返回的表示 DMA 描述符 600的处理已经完成的中断, 并依据该中断找到与之对应的 10请求链表 801 , 以及将 10请求链表 801中的存储单元( 811、 812 )释放。 换句话说, 将由 10请求链 表 801中的存储单元 (811、 812 ) 的状态设置为空闲, 从而使得通过緩冲区控制块 4 06可以获知存储单元 411、 412的状态为空闲, 并将存储单元 411、 412放入空闲存 储单元池中。 在一个例子中, 存储设备 102返回的中断中包括指示 10请求链表 801 中的多个存储单元 ( 811、 812 ) 之一的内容, 依据该内容, 通过 10请求链表 801将 存储单元 ( 811、 812 ) 释放。
在步骤 931 , 如果 DMA描述符长度大于 0, 则表示 DMA描述符 600的生成尚 未完成, 还需要为 10请求生成一个或多个 DMA数据, 那么处理将返回到步骤 923 并重复执行步骤 923-931。
上面结合图 9A、 9B描述了 DMA描述符 600的生成过程。 DMA描述符 600用 于在分散-收集 DMA中描述要执行的多个 DMA操作, 该多个 DMA操作的数据来源 于存储在连续或不联系的存储空间中。 所属领域技术人员将容易意识到, DMA描述 符 600的生成方式包括但不限于上面图 9A、 9B中描述的具体方式。
图 10A是根据本发明的实施例的在存储设备的緩冲存储器中创建链表的流程 图。 在如图 7A-7C所公开的存储设备处理 DMA描述符 600的过程中, 将 DMA描述 符 600转换为一个或多个微指令。在进一步的实施例中, 为了有效处理一个或多个微 指令之间的关联关系 (例如, 这些微指令均同 DMA描述符 600相关联) , 存储设备 102响应于主机 101所传输的 DMA描述符 600 , 还在緩冲存储器 106中建立链表, 该链表将对应于同一 DMA描述符 600的多个微指令关联起来。
如图 10A所示, 在步骤 1002, 主机 101向存储设备 102发送 DMA描述符 60 0。 DMA描述符 600包括 DMA命令 610与 DMA数据 620、 630。 前面已经结合图 9 A与图 9B而描述了主机 101向存储设备 102发送 DMA描述符 600的过程的例子。 还应当意识到, 在存储设备的緩冲存储器中创建链表, 将有助于存储设备对 10操作 的执行, 特别是对多个 10操作的并发 /乱序执行, 多个 10操作可通过访问各自的链 表而关联在一起。这样不具备关联关系的 10操作可以在存储设备中并发执行。 因而, 还可以响应除 DMA命令之外的其他类型的 10命令或其他命令, 以在存储设备中创 建链表。
在步骤 1004, 判断所接收到的是 DMA命令 610还是 DMA数据 620、 630。 如果接收到 DMA命令 610 , 在步骤 1006 , 从其中的緩冲存储器地址字段 61 0中提取出用于该 DMA命令 610的緩冲存储器地址, 并基于该緩冲存储器地址, 为 该 DMA命令 610在緩冲存储器 106中分配存储空间。 接下来, 在步骤 1008 , 保存为 该 DMA命令 610所分配的緩冲存储器地址, 用来在为 DMA数据 620、 630分配緩冲 存储器地址时使用。
如果在步骤 1004判断出所接收到的是 DMA数据 620 , 则在步骤 1010 , 从 D MA数据 620的緩冲存储器地址字段 622从提取出用于该 DMA数据 620的緩冲存储 器地址, 并基于该緩冲存储器地址, 为该 DMA数据 620在緩冲存储器 106中分配存 储空间。 并在步骤 1012中, 在为该 DMA数据 620所分配的緩冲存储器的存储空间 中, 存储在步骤 1008中保存的 DMA命令 610的緩冲存储器地址。 这样, 在緩冲存 储器 106中, 为 DMA命令 610和 DMA数据 620所分配的存储空间形成了链表, 其 中为 DMA命令 610所分配的存储空间是链表的头节点, 为 DMA数据 620所分配的 存储空间连接到链表的头节点。
在 DMA描述符 600还包括 DMA数据 630的情况下, 通过步骤 1010和步骤 1012, 基于 DMA数据 630中的緩冲存储器地址 632为 DMA数据 630在緩冲存储器 106中分配存储空间, 并在为 DMA数据 630所分配的緩冲存储器的存储空间中, 保 存 DMA命令 610的緩冲存储器地址。 所属领域技术人员将意识到, 也可以在为 DM A数据 630所分配的緩冲存储器 106的存储空间中, 保存用于 DMA数据 620的緩冲 存储器地址, 从而形成不同类型的链表。 在其他例子中, 将緩冲存储器 106中为 DM A命令 610、 DMA数据 620、 630所分配的存储空间创建为循环链表或双向链表。
上面结合图 7A、 7B、 7C已经描述了存储设备 102基于 DMA数据 ( 620、 63 0 ) 生成 DMA 指令, 并保存在 指令 FIFO 733中。 DMA数据 ( 620、 630 ) 生成 DMA 指令的操作可以发生于步骤 1012之后, 并在 DMA 指令中携带为 DMA数 据 ( 620、 630 ) 所分配的緩冲存储器地址。
图 10B是根据本发明的一实施例的在存储设备的緩冲存储器中创建链表的流 程图。 同图 10A所提供的实施例相比, 图 10B的实施例中, 还将与 DMA描述符的 处理或执行相关的信息存储在所创建的链表中。 图 10C是根据本发明的一实施例的 存储设备利用在緩冲存储器中创建的链表执行 DM A描述符的流程图。 图 11 A- 11 F展 示出了与图 10B与图 10C相关联的緩冲存储器的多种状态。 在图 11A-11F中, 1100 指示緩冲存储器 106中的存储空间。
具体地, 在步骤 1020, 主机 101向存储设备 102发送 DMA描述符 600。 在步骤 1022, 判断所接收到的是 DMA命令 610还是 DMA数据 620、 630。 如果接收到 DMA命令 610 , 在步骤 1024, 从緩冲存储器地址字段 610中提 取出緩冲存储器地址, 并基于该緩冲存储器地址, 为该 DMA命令 610在緩冲存储器 106中分配存储空间。 参看图 11A, 为 DMA命令 610分配存储空间 1101。 以及还从 DMA命令 610中提取出 DMA描述符长度字段 613 ,从 DMA描述符长度 613可以得 到该 DMA描述符 600的 DMA数据部分的长度 (例如, DMA描述符长度减 1 ) 。 接 下来, 在步骤 1026 , 保存为该 DMA命令 610所分配的緩冲存储器地址, 用来在为 D MA数据 620、 630分配緩冲地址时使用。 并且, 将 DMA数据部分的长度记录在为 该 DMA命令 610所分配的緩冲存储器中。参看图 11A,在存储空间 1101中保存了 D MA数据部分的长度 (在这个例子中, DMA数据部分的长度为 2 ) 。
如果在步骤 1022判断出所接收到的是 DMA数据 620 , 则在步骤 1028 , 从 D MA数据 620的緩冲存储器地址字段 622从提取出用于该 DMA数据 620的緩冲存储 器地址, 并基于该緩冲存储器地址, 为该 DMA数据 620在緩冲存储器 106中分配存 储空间。 参看图 11B , 为 DMA数据 620分配存储空间 1112。 并在步骤 1030中, 在 为该 DMA数据 620所分配的緩冲存储器的存储空间 1112中, 存储在步骤 1026中保 存的 DMA命令 610的緩冲存储器地址。 这样, 在緩冲存储器 106中, 为 DMA命令 610和 DMA数据 620所分配的存储空间 ( 1101与 1112 ) 形成了链表, 其中为 DMA 命令 610所分配的存储空间 1101是链表的头节点, 为 DMA数据 620所分配的存储 空间 1112连接到链表的头节点。 还在存储空间 1112中存储同 DMA数据 620相对应 的 DMA主机地址。
在 DMA描述符 600还包括 DMA数据 630的情况下, 通过步骤 1028和步骤 1030, 基于 DMA数据 630中的緩冲存储器地址 632为 DMA数据 630在緩冲存储器 106中分配存储空间 1123 (参看图 11C ) , 并在存储空间 1123中, 保存 DMA命令 6 10的緩冲存储器地址。 以及还在存储空间 1123中存储同 DMA数据 630相对应的 D MA主机地址。
因而, 在緩冲存储器 106中形成了同 DMA描述符 600相对应的链表, 其中 存储空间 1101是链表的头节点, 存储空间 1112和 1123是链表的节点, 并指向该链 表的头节点。 所属领域技术人员将意识到, 也可以在为 DMA数据 630所分配的緩冲 存储器 106的存储空间 1123中, 保存用于 DMA数据 620的緩冲存储器地址, 从而 形成不同类型的链表。 在其他例子中, 将緩冲存储器 106中为 DMA命令 610、 DMA 数据 620、 630所分配的存储空间创建为循环链表或双向链表。
图 10C是根据本发明的一实施例的存储设备利用在緩冲存储器中创建的链表 执行 DMA描述符的流程图。 上面结合图 7A、 7B、 7C已经描述了存储设备 102基于 DMA数据( 620、 630 )生成 DMA 指令, 并保存在 指令 FIFO 733中。 在存储设 备 102对 DMA微指令的执行中, 在一个例子中, 利用在緩冲存储器 106中的链表。 在 DMA微指令中, 包括緩冲存储器地址, 通过该緩冲存储器地址, 可以获得为同该 DMA微指令相对应的 DMA数据所分配的緩冲存储器 106中的存储空间, 进而可以 获得与该 DMA数据所对应的 DMA主机地址以及与该 DMA数据所对应的 DMA描 述符中的 DMA数据部分长度或 DMA数据的个数。
在下面的描述中, 将对应于 DMA数据 620的 DMA微指令用第一 DMA微指 令指示, 将对应于 DMA数据 630的 DMA 指令用第二 DMA 指令指示。
在步骤 1040, 从微指令 FIF0733中获得将第一 DMA微指令。
在步骤 1042, 第一 DMA微指令中包括为 DMA数据 620所分配的緩冲存储 器 106的存储空间 1112的地址, 并从存储空间 1112中获得 DMA主机地址。 该 DM A主机地址是由 DMA数据 620中的 DMA主机地址字段 621所提供的。 基于 DMA 主机地址, 在主机 101和存储设备 102之间进行 DMA传输, 将主机 101的该 DMA 主机地址处的预定长度(例如, 4KB ) 的数据, 以 DMA方式传输到存储设备 102的 緩冲存储器中。 对于第二 DMA微指令, 执行类似的操作, 将主机 101的由 DMA数 据 630的 DMA主机地址字段 632所提供的 DMA主机地址处的数据, 以 DMA方式 传输到存储设备 102的緩冲存储器的为 DMA数据 632所分配的存储空间 1123处。 在图 11D中, 示出了执行完第一 DMA 指令与第二 DMA 指令后, 存储了以 DM A方式传输的数据的存储空间 1112和存储空间 1123。
在步骤 1044 , 继续对第一 DM A微指令加以执行。 通过第一 DM A微指令中 的存储空间 1112的地址, 从存储空间中取出预定长度的数据, 该数据是在步骤 1042 中, 通过 DMA操作从主机 101传输到緩冲存储器 106的存储空间 1112的。 并通过 闪存接口控制器 (例如, 图 7C中的 Flash接口控制器 737 ) 将该数据基于第一 DMA 微指令中所包括的用于闪存存储器的地址, 写入到闪存芯片 105。 该用于闪存存储器 的地址是通过 DMA命令 610中的存储设备逻辑地址字段 612所得到的。 对第二 DM A微指令以类似的方式加以执行。 通过第二 DMA微指令中包括的存储空间 1123的 地址, 从存储空间中取出预定长度的数据, 并将该数据通过闪存接口控制器, 基于第 二 DMA 指令中所包括的用于闪存存储器的地址, 写入到闪存芯片 105。 第二 DM A微指令中所包括的用于闪存存储器的地址, 是通过 DMA命令 610中的存储设备逻 辑地址字段 612加上预定值(例如对应于 DMA传输的数据的长度, 在该例子中, 是 4KB ) 所得到的。 在一个例子中, 将 DMA命令 610中的存储设备逻辑地址转换为存 储设备的物理地址, 并基于该物理地址将数据写入到闪存芯片 105中。从存储设备的 逻辑地址到物理地址的映射过程, 是所属领域技术人员所熟知的。
在步骤 1046 , 继续对第一 DM A微指令加以执行。 通过第一 DM A微指令中 的存储空间 1112的地址, 获得为 DMA命令 610所分配的存储空间 1101的地址, 并 在存储空间 1101中获得 DMA数据部分长度, 以及将存储 1101中存储的 DMA数据 部分长度递减 (例如, 减 1或者减去单位长度) 。 参看图 11E, 对于第一 DMA ^敫指 令, 将存储空间 1101中的 DMA数据部分长度递减后, 其值由 2变为 1。 并且, 存储 空间 1112中不再保存存储空间 1101的地址, 用于表明对 DMA数据 620的执行已经 完成。 在步骤 1048 , 由于 DMA数据部分的长度不为 0 , 意味着对 DMA描述符 600 的操作尚未完成, 因为其还包含另一个 DMA数据 630, 此时, 不进行进一步的处理。
当第二 DMA微指令在步骤 1046被执行时, 通过第二 DM A微指令中的存储 空间 1123的地址, 获得为 DMA命令 610所分配的存储空间 1101的地址, 并在存储 空间 1101中获得 DMA数据部分长度, 以及将存储 1101中存储的 DMA数据部分长 度递减 (例如, 减 1或者减去单位长度) 。 参看图 11F, 对于第二 DMA ^敫指令, 将 存储空间 1101中的 DMA数据部分长度递减后, 其值由 1变为 0。 并且, 存储空间 1 123中不再保存存储空间 1101的地址, 用于表明对 DMA数据 630的执行已经完成。
此时, 当第二 DMA描述符在步骤 1048被执行时, 由于 DMA数据部分的长 度为 0 , 意味着对 DMA描述符 600的执行已经完成。 接下来, 在步骤 1050 , 向主机 101发送中断, 以指示对 DMA描述 600的执行已经完成。
再次参看图 11F, 存储空间 1112与 1123均不再保存存储空间 1101的地址。 存储空间 1101中的 DMA数据部分长度的值为 0。 在此情况下, 意味着对 DMA描述 符 600的执行已经完成, 对存储空间 1101、 1112与 1123均不会再加以使用, 这些存 储空间可以被释放以用于对其他 DMA描述符的执行。 在一个例子中, 由主机 101控 制对相应存储空间的释放和再利用, 在上面已结合图 9A与图 9B对 10请求链表 801 中的存储空间的释放。 由于緩冲区控制块 406中的存储单元 (411、 412 ··· ··· 41η ) 与 緩冲存储器 106中的存储空间相对应,因而对 10请求链表 801中的存储空间的释放, 意味着对緩冲存储器中的存储空间 1101、 1112与 1123的释放。
上面结合图 10B、 10C、 11A-11F而描述了在緩冲存储器 106中存储对应于第 一与第二^:指令的 DMA主机地址的方案, 从而使得 DMA ^敫指令中不必携带 DMA 主机地址而减少了对电路资源的占用, 并通过緩冲存储器 106将对应于同一 DMA描 述符 600的第一、第二 DMA微指令关联在一起的方案。所属领域技术人员将意识到, 还可以将对应于第一与第二微指令的存储设备逻辑地址和 /或 DMA主机地址存储在 緩冲存储器中, 从而进一步减少 DMA微指令的长度及其对电路资源的占用。
图 12是根据本发明的又一实施例的存储设备的硬件方框图。 与图 7C中公开 的相似, 主机 101包括 PCIE控制器 721和主机存储器 722。 存储设备 102中包括 PC IE接口 731、 DMA指令分析器 732、 指令先进先出緩冲器 (FIFO ) 733、 DMA写 操作控制器 734、 DMA写接口 735、逻辑地址到物理地址转换电路 736以及緩冲存储 器 106。存储设备 102中还包括 DMA读写微指令判断电路 1210, DMA读接口 1212, 闪存控制器 1221、 1222、 1223 , 闪存接口 1231、 1232、 1233 , 完成控制电路 1242、 多路选择器 1241以及多路共享器 1243。 闪存接口 1231、 1232、 1233 禹合于闪存芯 片 105。
PCIE接口 731接收主机 101通过 PCIE控制器 721发送的 DMA描述符 600。 主机 101与存储设备 102之间的连接不限于 PCIE方式。 DMA指令分析器 732将 PC IE接口 731接收到的 DMA描述符 600变换为 DMA微指令。 对于如图 6所示的 DM A描述符 600,则 DMA指令分析器将其变换为对应于 DMA数据 620的第一 DMA微 指令和对应于 DMA数据 630的第二 DMA ^敫指令。 在一个例子中, 第一与第二 DM A微指令中分别包括指示该微指令类型 (读 /写 /擦除 /其他)的字段、 指示与其对应的 緩冲存储器 106中的存储单元的地址的字段、 指示存储设备的逻辑地址的字段。
参看图 10B与图 11C, DMA指令分析器 732还针对 DMA命令 610 , 在緩冲 存储器 106中分配存储单元, 并在其中存储 DMA数据部分的长度。 DMA指令分析 器还针对 DMA数据 620 , 在緩冲存储器 106中分配存储单元, 并在其中存储为 DM A命令 610所分配的存储单元的地址,以及存储 DMA数据 620中的 DMA主机地址。 DMA指令分析器还针对 DMA数据 630 ,在緩冲存储器 106中分配存储单元, 并在其 中存储为 DMA命令 610所分配的存储单元的地址, 以及存储 DMA数据 630中的 D MA主机地址。
DMA指令分析器 732将第一 DMA 指令与第二 DMA ^:指令存储在^:指令 FIFO 733中。
指令 FIFO 733能够緩存 DMA 指令, 并按照先进先出的方式向 DMA读 写微指令判断电路 1210提供 DMA微指令。
在 DMA读写^:指令判断电路 1210, 判断所获得的 DMA 指令的类型。 对 于与 DMA写操作对应的 DM A微指令, 例如, 前面所提到的第一 DM A微指令与第 二 DMA微指令, DMA写操作控制器 734基于这些 DMA微指令来执行 DMA写操作。 DMA写操作控制器 734利用第一 DMA微指令中的指示与其对应的緩冲存储器 106 中的存储单元的地址的字段, 从緩冲存储器 106中获得 DMA主机地址, 并通过 DM A写接口 735在主机 101和存储设备 102之间发起 DMA写操作, 将存储在 DMA主 机地址中的数据,传输到与第一 DMA微指令相对应的緩冲存储器 106的存储单元中, 所传输的数据可以具有预定的长度(例如 4K字节) 。 对于第二 DMA微指令, DMA 写操作控制器 734利用与其对应的緩冲存储器 106中的存储单元的地址的字段,从緩 冲存储器 106中获得 DMA主机地址, 并在主机 101和存储设备 102之间发起 DMA 写操作, 将存储在 DMA主机地址中的数据, 传输到与第二 DMA微指令相对应的緩 冲存储器 106的存储单元中。
从第一 DMA微指令和第二 DMA微指令的指示存储设备的逻辑地址的字段获 得用于各自的存储设备的逻辑地址。 在逻辑地址到物理地址转换电路 736 , 将每条 D MA微指令的存储设备的逻辑地址转换为用于闪存芯片 105的物理地址。对于每一条 DMA微指令, Flash控制器 1221、 1222、 1223基于逻辑地址到物理地址转换电路 73 6所提供的物理地址, 通过闪存接口 1231、 1232、 1233将写入到緩冲存储器 106的 数据, 写入到闪存芯片 105中, 其中, Flash控制器 1221同闪存接口 1231相耦合, F lash控制器 1222同闪存接口 1232相耦合, Flash控制器 1223同闪存接口 1233相耦 合。 而闪存接口 1231、 1232、 1233分别耜合到各自的闪存芯片。 因而对于从 DMA 微指令中的存储设备的逻辑地址转换得到的用于闪存芯片 105的物理地址,该物理地 址指示了特定的闪存芯片, 并且该闪存芯片与闪存接口 1231、 1232、 1233的特定一 个相耦合。 因而, 基于该物理地址, 可以确定使用闪存接口 1231、 1232、 1233中的 哪一个将数据写入闪存芯片, 也可以确定使用 Flash控制器 1221、 1222、 1223中的 哪一个。 闪存接口 1231、 1232、 1233还通过多路选择器 1241与緩冲存储器相耦合。 基于该物理地址, 多路选择器 1241将数据从緩冲存储器 106传送给闪存接口 1231、 1232、 1233中的特定一个。
闪存接口 1231、 1232、 1233将数据写入到闪存芯片 105中之后, 完成控制电 路 1242还基于在第一、 第二微指令中的指示与其对应的緩冲存储器 106中的存储单 元的地址的字段, 访问緩冲存储器 106 , 并进而访问緩冲存储器中为 DMA命令 610 所分配的存储单元, 从中获得 DMA数据部分的长度, 并将 DMA数据部分的长度递 减 (例如, 减 1或减去单位长度) 。 这样, 当为 DMA命令 610所分配的存储单元中 的该 DMA数据部分的长度变为 0时, 意味着对 DMA描述符 600的操作完成。 继而, 可向主机发送中断, 以指示对 DMA描述符 600的操作完成。
虽然图 12中以举例的方式展示了包括三个 Flash控制器 1221、 1222、 1223 以及三个闪存接口 1231、 1232、 1233的实施例, 所属领域技术人员将意识到可以使 用多种不同数量的 Flash控制器与闪存接口, 以同闪存芯片的数量相适应。
对于与 DMA读操作对应的 DMA微指令, DMA读写微指令判断电路 1210将 其直接传送给逻辑地址到物理地址转换电路 736 , 并得到用于闪存芯片 105的物理地 址。 Flash控制器 1221、 1222、 1223基于该物理地址, 通过闪存接口 1231、 1232、 1 233将从闪存芯片 105中读出数据。 并基于 DMA微指令中的指示与其对应的緩冲存 储器 106中的存储单元的地址的字段, 从緩冲存储器 106中获得与该 DMA微指令相 对应的 DMA主机地址,以及经由 DMA读接口 1212在主机 101与存储设备 102之间 发起 DMA传输, 将读出数据传输到主机 101的主机 RAM 722中由该 DMA主机地 址所指示的位置处。 闪存接口 1231、 1232、 1233经由多路共享器 1243与 DMA读接 口 1212相耜合, 使得从闪存接口 1231、 1232、 1233获得的数据均可以通过 DMA读 接口 1212传输到主机 RAM 722。 当闪存接口 1231、 1232、 1233从闪存芯片 105读 出数据后, 完成控制电路 1242也基于在 DMA微指令中的指示与其对应的緩冲存储 器 106中的存储单元的地址的字段, 访问緩冲存储器 106, 并进而获得 DMA数据部 分的长度, 并将 DMA数据部分的长度递减 (例如, 减 1或减去单位长度) 。 这样, 当该 DMA数据部分的长度变为 0时, 意味着对该 DMA描述符的操作完成。 继而, 可向主机发送中断, 以指示对该 DMA描述符的操作完成。
在图 12所公开的存储设备中,可以支持对多个 DMA描述符 600的并发操作。 对于多个 DMA描述符 600的每一个, 通过在緩冲存储器 106中创建的链表, 将与一 个 DMA描述符 600相对应的 DMA数据关联在一起, 使得对多个 DMA 指令的操 作顺序变得不重要。
上面已经详细描述了存储设备执行数据写入操作或与写操作相关的 DM A描 述符的执行。 显然, 存储设备执行读操作也可以从本发明公开中获益。 例如, 可以在 读取命令中同时指定闪存芯片地址和緩冲存储器地址,并利用緩冲存储器作为读出数 据的緩冲。 也可以在与读操作相关的 DMA描述符中描述緩冲存储器地址, 在将数据 从闪存芯片中读出后, 可利用緩冲存储器作为读出数据的緩存。
图 13是根据本发明又一实施例的存储设备的结构框图。 图 13中的存储设备 同图 1中的存储设备相似。 其不同之处在于, 其控制电路 104中还包括中断控制电路 1301。 在进一步的实施例中, 存储设备还包括备用电源 1305。 可以有多种方式提供 备用电源 1305 , 例如, 超级电容、 UPS、 可充电电池等。 前面已经描述了控制电路 1 04基于图 2A中的写入命令 200将来自主机 101的数据先写入緩冲存储器 106 , 再写 入闪存芯片 105。 并且, 当基于命令 200将数据写入緩冲存储器 106之后, 可向主机 101发送消息或中断请求, 以指示对命令 200的写入操作已完成。 虽然此时数据尚未 被写入到闪存芯片 105 , 但存储设备 102可确保该数据将被可靠地写入到闪存芯片 1 05。 即使此时发生意外断电, 备用电源 1305也可提供电能将緩冲存储器 106中的该 数据写入到闪存芯片 105。
由于备用电源 1305的容量可能不足以支持緩冲存储器 106中的全部数据写入 到闪存芯片 105 , 因而, 中断控制电路 1301还监控在緩冲存储器 106中且尚未写入 闪存芯片 105中的数据量。 当该数据量超过一预定阈值, 而使得备用电源 1305的能 量无法支持将该数据量写入到闪存芯片 105时, 中断控制电路 1301将暂时地抑制向 主机 101发送消息或中断的活动。 由于没有接收到来自存储设备 102的消息或中断, 主机 101会意识到存储设备 102对写入命令 200的执行尚未完成, 这意味着, 如果此 时发生掉电,存储设备 102不保证对写入命令 200的执行将完成, 写入命令 200中所 携带的数据可能丢失。
当没有接到来自存储设备 102的指示写入命令 200的执行完成的消息或中断 时, 主机 101可以认为存储设备 102处于 "忙" 状态, 而相应地暂时不向存储设备 1 02发出进一步的写入命令。 主机 101也可以不等待指示写入命令 200的执行完成的 消息或中断, 而并发或异步地向存储设备 102发出其他写入命令。但主机 101应当意 识到,对于没有接收到指示执行完成的消息或中断的写入命令, 其执行可能是没有完 成的。还应当注意到的是,当主机 101分配存储设备 102的緩冲存储器 106的情况下, 指示写入命令 200的执行完成的消息或中断并非意味着对緩冲存储器 106的相应的存 储单元的释放, 因为緩冲存储器 102的相应存储单元还有尚未被写入到闪存芯片 105 中的数据, 这些存储单元依然处于被占用状态。
因而,通过中断控制电路 1301检测緩冲存储器 106中待写入闪存芯片 105的 数据量, 暂时地不向主机 101发送指示写入命令 200的执行完成的消息或中断,确保 了緩冲存储器 106中的待写入闪存芯片 105的数据量不会超过备用电源 1305的能力。
在一个例子中, 中断控制电路 1301维护一个计数器。 当控制电路 104将数据 写入緩冲存储器 106时, 计数器递增; 而当控制电路 104将緩冲存储器 106中的数据 取出并写入闪存芯片 105时, 计数器递减。 从而, 当该计数器的值超过预定阈值时, 中断控制电路 1301实施中断抑制。 而随着控制电路 104不断地取出緩冲存储器 106 中的数据并写入闪存芯片 105 , 使得计数器递减到预定阈值之下时, 中断控制电路 1 301恢复向主机 101发送指示写入命令 200操作完成的消息或中断。 有多种类似方式 可获得緩冲存储器 106中待写入闪存芯片 105的数据量, 如提供緩冲队列, 并监视队 列深度。在一个例子中, 控制电路 104记录写入緩冲存储器 106的数据量和写入闪存 芯片 105的数据量, 而中断控制电路 1301计算二者的差值得到在緩冲存储器 106中 緩存的待写入闪存芯片 105的数据量。 预定阈值的大小可以预先设定。 其与备用电源 1305的电量、 存储设备 102的 功耗等因素相关。 对于特定的备用电源 1305和存储设备 102, 可通过实验测定合适 的预定阈值。 以及出于可靠性的考虑, 优选地在设定阈值时, 提供一定的裕度。 由于 电容、 电池的电量会随着时间而发生变化, 还可以在运行时测量备用电源 1305的电 量或指示该电量的参数, 如在美国专利文献 US8031551B2中所提到的。 并建立该参 数与阈值的对应关系存储在存储设备 102中, 用于在运行时检测备用电源 1305的参 数, 并调整阈值。 还可以通过主机 101向存储设备 102设置该阈值。 可提供专用的阈 值设置命令, 由主机 101发出, 由存储设备 102接收。 在阈值设置命令中可携带要设 定的阈值, 也可基于该阈值设置命令引起存储设备 102检测备用电源 1305的指示电 量的参数, 并进而改变阈值设定。
在一个例子中, 中断控制电路 1301抑制向主机 101发送消息或中断的活动通 过緩存要向主机 101发送的消息或中断而实现。 具体地, 中断控制电路 1301可緩存 用于向主机 101标识写入命令 200的标识符。 可选地, 可以緩存写入命令 200本身。 还可以緩存写入命令 200所指示的緩冲存储器地址 204, 因为该緩冲存储器地址 204 可向主机 101指示哪个或哪些存储单元应当被释放。 并且, 中断控制电路 1301对消 息或中断的抑制, 并不依赖于写入命令 200中携带的緩冲存储器地址 204。 对于写入 命令中不包括緩冲存储器地址,而由存储设备 102处理緩冲存储器 106的分配的情况, 也可实施消息或中断抑制。这种情况下,可以緩存写入命令本身或写入命令的标识符。
需要指出的是, 即使中断控制电路 1301抑制了向主机 101发送消息或中断的 活动, 控制电路 104依然将緩冲存储器 106中的数据写入到闪存芯片 105中。
在发生掉电的情况下, 由中断控制电路 1301所緩存的消息或中断被丢弃, 与 之相对应的尚未被写入到闪存芯片 105的数据也被丢弃,而将緩冲存储器 106中已经 向主机 101发送了指示执行完成的消息或中断的写入命令相对应的数据写入到闪存 芯片 105中。
还将注意到的是, 当緩冲存储器 106为空时, 主机 101可向存储设备 102发 出多个写入命令, 并很快接收到指示写入命令完成的消息或中断。 此时, 主机 101 会体验到存储设备 102具有很好的写入性能。 当緩冲存储器 106的空闲空间被耗尽, 或由于中断控制电路 1301实施了中断抑制, 主机 101会体验到存储设备 102的写入 性能迅速变差。这种性能上的颠簸是不利的,因为写入过程消耗的时间变得不可预测。
为减少颠簸, 中断控制电路 1301还监视一定时间期间内向主机 101发出消息 或中断的次数。如果在一定时间期间内发出的消息或中断次数过多,诸如超过了一定 的阈值, 则中断控制电路 1301将抑制向主机 101发送消息或中断的活动。 这样, 当 存储设备 102中的緩冲存储器 106的空闲空间较多时,虽然存储设备 102可以接受较 多的并发的写入命令, 但通过中断控制电路 1301的中断抑制, 而不会向主机发出过 多的消息或中断。这里的实施监视的时间周期是可以由用户设置的, 并且可以在运行 时动态调整, 而相应的阈值也是可以由用户设置的, 并且可以在运行时动态调整。
还将指出的是, 为减少颠簸而实施的消息或中断抑制与为同备用电源的电量 相适应而实施的消息或中断抑制, 可以单独实施, 也可以组合实施。 前面已经描述了 单独实施为减少颠簸而实施的消息或中断抑制以及为同备用电源的电量相适应而实 施的消息或中断抑制的例子。 在组合实施的例子中, 中断控制电路 1301检测在緩冲 存储器 106中且尚未写入闪存芯片 105中的数据量。当该数据量超过第一预定阈值时, 中断控制电路 1301产生第一中断抑制信号。而中断控制电路 1301还监视一定时间期 间内向主机 101实际发出消息或中断的次数。如果在一定时间期间内发出的消息或中 断次数超过了一定的第二阈值, 中断控制电路 1301产生第二中断抑制信号。 若第一 中断抑制信号或第二中断抑制信号中的任何一者有效, 则中断控制电路 1301实施消 息或中断抑制, 例如, 中断控制电路 1301暂时地不向主机 101发送消息或中断, 而 是将其緩存起来。进一步地, 随着中断抑制的实施以及随着緩冲存储器 106中的数据 被写入闪存芯片 105 , 在緩冲存储器 106中尚未写入闪存芯片 105中的数据量将小于 第一阈值,从而第一中断抑制信号将变为无效; 而随着中断抑制的实施以及随着时间 的流逝,在一定时间期间内发出的消息或中断次数将小于第二阈值,从而第二中断抑 制信号将变为无效。 当第一中断抑制信号与第二中断抑制二者均变为无效后, 中断控 制电路 1301将可以将緩存的或新产生的消息或中断发送给主机 101。
图 14A与 14B根据本发明的又一实施例的存储设备执行中断抑制的流程图。 为同备用电源的电量相适应而实施消息或中断抑制。 在步骤 1402, 存储设备 102接 收到来自主机 101的要写入存储设备的数据。在一个例子中, 该数据包含于写入命令 200中。 在其他例子中, 该数据可通过 DMA方式从主机 101传输到存储设备 102。 在步骤 1404, 控制电路 104将该数据写入到緩冲存储器 106, 并将计数器递增。 计数 器的值指示在緩冲存储器 106中尚未被写入到闪存芯片 105中的数据量。对于具有固 定数据量的写入命令, 对计数器的递增可以是增加单位数量, 例如 1。 对于具有可变 数据量的写入命令,对计数器的递增可以是增加与数据量相对应的数值。 前面已经公 开了, 当将数据写入到緩冲存储器 106之后, 中断控制电路 1301可向主机 101发送 消息或中断, 以指示对写入命令的执行完成。 而为实施中断抑制, 在步骤 1406, 中 断控制电路 1301判断计数器是否小于预定阈值。 如果计数器的值小于预定阈值, 则 执行步骤 1408 , 中断控制电路 1301向主机发送指示写入命令已经处理完成的消息或 中断。 在步骤 1406, 若中断控制电路 1301发现计数器大于预定阈值, 则不向主机 1 01发送指示写入命令已执行完成的消息或中断。 中断控制电路 1301可通过对消息或 中断的緩存来实施消息或中断抑制。
继续参看图 14B , 其展示了与图 14A所展示的方法流程图并发的另一部分方 法的流程图。 当緩冲存储器 106中具有尚未写入闪存芯片 105的数据时, 控制电路 1 04从緩冲存储器 106中读出数据, 步骤 1410。 并且, 在步骤 1412, 控制电路 104还 将读出的数据写入到闪存芯片 105 , 并且将计数器递减。 计数器的递减可以是单位数 量或与数据量相对应的数值。 步骤 1410与 1412的执行是与步骤 1402、 1404、 1406、 1408的执行并行的。 因而, 在步骤 1406 , 若中断控制电路 1301发现计数器大于预定 阈值, 中断控制器 1301实施中断抑制时, 随着步骤 1410、 1412的执行, 緩冲的数据 被不断的写入闪存芯片 105 , 从而计数器的值递减, 并使得计数器的值将可以变得小 于预定阈值。
图 15为根据本发明的又一实施例的存储设备 102执行中断抑制的流程图。为 减少颠簸而实施消息或中断抑制。 在步骤 1502, 存储设备 102接收到来自主机 101 的要写入存储设备的数据。 在一个例子中, 该数据包含于写入命令 200中。 在其他例 子中, 该数据可通过 DMA方式从主机 101传输到存储设备 102。 在步骤 1504, 控制 电路 104将该数据写入到緩冲存储器 106, 并将计数器递增。 计数器的值指示在緩冲 存储器 106中尚未被写入到闪存芯片 105中的数据量。 前面已经公开了, 当将数据写 入到緩冲存储器 106之后, 中断控制电路 1301可向主机 101发送消息或中断, 以指 示对写入命令的执行完成,并对发送消息或中断的次数进行计数。而为实施中断抑制, 在步骤 1506, 中断控制电路 1301判断预定时间间隔内发出的中断次数是否大于预定 阈值。 在一个例子中, 可使用每隔一定时间产生到时信号的定时器。 并监视两次到时 信号之间发生的消息或中断次数。 如果中断次数不大于预定阈值, 则执行步骤 1510 , 中断控制电路 1301向主机发送指示写入命令已经处理完成的消息或中断。 在步骤 15 06, 若中断控制电路 1301发现计数器大于预定阈值, 则不向主机 101发送指示写入 命令已执行完成的消息或中断。 中断控制电路 1301可通过对消息或中断的緩存来实 施消息或中断抑制。 在另一个例子中, 每当定时器的到时信号有效时, 为计数器设定 预定数值, 该数值表示在下一次定时器到时信号有效前, 可向主机 101发出的消息或 中断的数量, 并且每发出一消息或中断, 将该计数器递减。 若在下一定时器到时信号 有效前, 计数器递减为 0 , 则中断控制器 1301开始实施中断抑制。 在一个例子中, 定时器的定时间隔和 /或预定阈值可以由主机 101或者控制电路 104更新。 还需要指 出的是, 中断控制器 1301实施的消息或中断抑制, 并不影响控制电路 104将緩冲存 储器 106中的数据写入到闪存芯片 105中。在緩冲存储器 106中存在待写入的数据的 情况下,控制电路 104就可以与其他操作并行地将緩冲存储器 106中的数据写入到闪 存芯片 105中。
在进一步的实施例中, 可将图 14A、 14B所展示的为同备用电源的电量相适 应而实施的消息或中断抑制, 与图 15所展示的为减少颠簸而实施的消息或中断抑制 相结合。 控制电路 104接收要写入存储设备 102的数据, 并将数据写入緩冲存储器 1 06。 中断控制电路 1301检测在緩冲存储器 106中且尚未写入闪存芯片 105中的数据 量。 当该数据量超过第一预定阈值时, 中断控制电路 1301产生第一中断抑制信号。 而中断控制电路 1301还监视一定时间期间内向主机 101实际发出消息或中断的次数。 如果在一定时间期间内发出的消息或中断次数超过了一定的第二阈值,中断控制电路 产生第二中断抑制信号。 若第一中断抑制信号或第二中断抑制信号中的任何一者有 效, 则中断控制电路 1301实施消息或中断抑制, 例如, 中断控制电路 1301暂时地不 向主机 101发送消息或中断, 而是将其緩存起来。 进一步地, 随着中断抑制的实施以 及随着緩冲存储器 106中的数据被写入闪存芯片 105 , 在緩冲存储器 106中且尚未写 入闪存芯片 105中的数据量将小于第一阈值,从而第一中断抑制信号将变为无效; 而 随着中断抑制的实施以及随着时间的流逝,在一定时间期间内发出的消息或中断次数 将小于第二阈值,从而第二中断抑制信号将变为无效。 当第一中断抑制信号与第二中 断抑制二者均变为无效后, 中断控制电路 1301将可以将緩存的或新产生的消息或中 断发送给主机 101。
图 16 A是根据本发明的又一实施例的执行中断抑制的存储设备的结构框图。 图 16A中的存储设备同图 7C中的存储设备相似, 用于执行根据图 6所展示的 DMA 描述符 600。 其不同之处在于, 其还包括中断控制器 1601。 中断控制器 1601耦合到 DMA写接口 735和 Flash接口控制器 737。 如同前面所提到的, 对于第一 DMA微指 令, DMA写操作控制器 734利用 DMA主机地址 621和緩冲存储器地址 622, 通过 DMA写接口 735在主机 101和存储设备 102之间发起 DMA写操作,将存储在 DMA 主机地址 621处的数据, 传输到緩冲存储器地址 622所指示的位置, 所传输的数据可 以具有预定的长度 (例如 4K字节) 。 接下来, 中断控制器 1601记录被写入到緩冲 存储器 106但尚未被写入到闪存芯片 105中的数据量。 由于每条 DMA微指令对应相 同数量的数据(例如 4K字节), 可由中断控制器 1601维护计数器, 并在基于第一 D MA微指令而将数据写入到緩冲存储器 106时 (或之后) , 使计数器递增单位值(例 如 1 , 对应于 4K字节) 。 对于第二 DMA 指令, DMA写操作控制器 734执行类似 的操作, 将存储在 DMA主机地址 631处的数据, 传输到緩冲存储器地址 632所指示 的位置。 基于第二 DMA微指令而将数据写入到緩冲存储器 106时 (或之后) , 依然 使计数器递增单位值。 前面已经公开了, 对于每一条 DMA微指令, Flash接口控制 器 737将写入到緩冲存储器 106的数据,基于逻辑地址到物理地址转换电路 736所提 供的物理地址, 写入到闪存芯片 105中。 接着, 中断控制器 1601将计数器递减单位 值。
在基于第一 DMA微指令或第二 DMA微指令以 DMA方式将数据写入到緩冲 存储器 106之后, 中断控制器 1601检查计数器是否大于预定阈值。 若计数器大于预 定阈值, 意味着緩冲存储器 106中已经存储了过多的待写入数据。在意外掉电的情况 下,存储设备 102上的备用电源的电量不足以支持将这些待写入数据保存到闪存芯片 105中。 因而, 中断控制器 1601抑制向主机 101发送的指示对第一 DMA微指令或第 二 DMA 指令的执行完成的消息或中断。 在一个例子中, 当 DMA描述符 600所包 括的第一 DMA微指令与第二 DMA微指令均执行完成, 即基于第一 DMA微指令和 第二 DMA微指令所传输的数据均写入緩冲存储器 106后, 闪存控制器基于计数器是 否大于预定阈值而决定是否向主机 101发送指示 DMA描述符 600执行完成的消息或 中断。 在意外掉电实际发生时, 为中断控制器 1601所抑制的消息或中断, 以及与这 些消息或中断所对应的 DMA ^:指令或其 DMA描述符被丢弃。 而与中断控制器 1601 已经向主机 101发送的消息或中断相对应的 DMA ^敫指令或 DMA描述符所指示传输 的数据, 将利用备用电源而写入到闪存芯片 105中。
在另一个实施例中, 中断控制器 1601还利用另一计数器记录在一预定时间间 隔内向主机 101实际发送的消息或中断的数量。可通过设置一定时器来获得预定时间 间隔。若在预定时间间隔内, 向主机 101实际发送的消息或中断的数量超出了另一阈 值, 则中断控制器 1601抑制向主机 101发送的消息或中断。
在依然另一个实施例中, 为同备用电源的电量相适应而实施的消息或中断抑 制, 与为减少颠簸而实施的消息或中断抑制相结合。 当中断控制器 1601检测到緩冲 存储器 106中的尚未写入到闪存芯片 105的数据超过预定阈值,则产生第一中断抑制 信号。 当中断控制器 1601检测到在预定时间间隔内向主机 101实际发送的消息或中 断的数量超出了另一预定阈值, 则产生第二中断抑制信号。 当第一中断抑制信号与第 二中断抑制信号中的任意一者有效时, 中断控制器 1601实施消息或中断抑制。 随着 Flash接口控制器 737将緩冲存储器 106中的数据写入闪存芯片 105 , 第一中断抑制 信号可变为无效, 随着时间的流逝以及定时器再次发出到时信号, 第二中断抑制信号 可变为无效。 当第一中断抑制信号与第二中断抑制信号均变为无效时, 中断控制器 1 601停止实施中断抑制, 而向主机 101发送所緩存的消息或中断。
这里的定时器的时间周期是可以由用户设置的,并且可以在运行时动态调整, 而相应的阈值(包括与緩冲存储器 106中的待写入闪存芯片 105的数据量相关的阈值, 以及与预定时间间隔内向主机 101实际发送的消息或中断的数量相关的阈值)也是可 以由用户设置的, 并且可以在运行时动态调整。
图 16B是根据本发明的又一实施例的执行中断抑制的存储设备的结构框图。 图 16B中的存储设备同图 16A中的存储设备相似,用于执行根据图 6所展示的 DMA 描述符 600。 其不同之处在于, 其还包括中断緩冲存储器 1613。 中断緩冲存储器 161 3耦合到中断控制器 1601。 当中断控制器 1601判定要执行消息或中断抑制时, 其将 消息或中断緩存在中断緩冲存储器 1613中。 在一个例子中, 中断控制器将所有要发 送给主机 101的消息或中断均緩存在中断緩冲存储器 1613中。 并且, 在无需实施中 断控制的情况下, 从中断緩冲存储器 1613中取出消息或中断, 并发送给主机 101。 在一个例子中, 在中断緩冲存储器 1613中緩存的是用于向主机 101标识 DMA描述 符 600的标识符。 可选地, 可以緩存第一 DMA微指令和第二 DMA微指令。 还可以 緩存緩冲存储器地址 622与緩冲存储器地址 632, 因为该緩冲存储器地址 622、 632 可向主机 101指示 DMA描述符 600。 在优选的实施例中, 在中断緩冲緩冲器中緩存 緩冲存储器地址 622与緩存緩冲存储器地址 632中的一个。通过在消息或中断中向主 机 101指示緩存緩冲存储器地址 622与緩存緩冲存储器地址 632中的一个, 参照图 9 A、 图 9B中公开的实施例, 主机 101可得到与之对应的 10请求链表, 并因而获知哪 个 10请求被完成。
在另一个实施例中, 可不设置中断緩冲存储器 1613 , 而作为替代, 在緩冲存 储器 106中緩存要发送给主机 101的消息或中断。
图 16C是根据本发明的又一实施例的执行中断抑制的存储设备的结构框图。 图 16C中的存储设备同图 16A中的存储设备相似,用于执行根据图 6所展示的 DMA 描述符 600。 其不同之处在于, 中断控制器 1602不是耦合到 DMA写接口 735而是耦 合到 DMA写操作控制器 734和 Flash接口控制器 737。 如同前面所提到的, 对于第 一 DMA 指令, DMA写操作控制器 734利用 DMA主机地址 621和緩冲存储器地 址 622, 通过 DMA写接口 735在主机 101和存储设备 102之间发起 DMA写操作, 将存储在 DMA主机地址 621处的数据, 传输到緩冲存储器地址 622所指示的位置, 所传输的数据可以具有预定的长度 (例如 4K字节) 。 接下来, 中断控制器 1602记 录被写入到緩冲存储器 106但尚未被写入到闪存芯片 105中的数据量。 由于每条 DM A微指令对应相同数量的数据 (例如 4K字节) , 可由中断控制器 1602维护计数器, 并在基于第一 DMA微指令而将数据写入到緩冲存储器 106时(或之后) , 使计数器 递增单位值(例如 1 , 对应于 4K字节) 。 对于第二 DMA微指令, DMA写操作控制 器 734执行类似的操作, 将存储在 DMA主机地址 631处的数据, 传输到緩冲存储器 地址 632所指示的位置。基于第二 DMA微指令而将数据写入到緩冲存储器 106时(或 之后) , 依然使计数器递增单位值。 前面已经公开了, 对于每一条 DMA微指令, F1 ash接口控制器 737将写入到緩冲存储器 106的数据, 基于逻辑地址到物理地址转换 电路 736所提供的物理地址, 写入到闪存芯片 105中。 接着, 中断控制器 1602将计 数器递减单位值。
当中断控制器 1602判定要执行消息或中断抑制时, 中断控制器 1602指示 D MA写操作控制器 734暂停从微指令 FIF0733中获取 DMA微指令的操作。以此方式, 将尚未被执行的 DMA微指令緩存在 FIF0733中。 而对应已经通过 DMA写操作控制 器 734和 DMA写接口 735而被执行的 DMA微指令, 中断控制器 1602向主机 101 发送指示这些 DMA微指令被执行完成的消息或中断。 或者, 在一个例子中, 当一个 DMA描述符所对应的全部 DMA 指令均已经通过 DMA写操作控制器 734和 DMA 写接口 735而被执行后, 中断控制器 1602向主机 101发送指示这些 DMA ^敫指令或 该 DMA描述符被执行完成的消息或中断。 当随着緩冲存储器 106中的数据被写入到 闪存芯片 105 , 中断控制器 1602判定无需再实施中断抑制时, 其指示 DMA写操作控 制器从微指令 FIF0733中获取 DMA微指令并执行。
当掉电实际发生时, 微指令 FIF0733中的微指令被丢弃, 而与中断控制器 16 02已经向主机 101发送的消息或中断相对应的 DMA ^敫指令或 DMA描述符所指示传 输的数据, 将利用备用电源而写入到闪存芯片 105中。
在另一个实施例中, 中断控制器 1602也维护定时器来监视一定时间间隔内向 主机 101发送的消息或中断的数量。当一定时间间隔内向主机 101发送的消息或中断 的数量超过阈值时, 中断控制器 1602抑制向主机 101发送消息或中断的活动, 即指 示 DMA写操作控制器 734暂停从微指令 FIF0733中获取 DMA微指令。
在依然另一个实施例中, 在中断控制器 1602中, 为同备用电源的电量相适应 而实施的消息或中断抑制, 与为减少颠簸而实施的消息或中断抑制相结合。
图 16D是根据本发明的又一实施例的执行中断抑制的存储设备的结构框图。 图 16D中的存储设备同图 12中的存储设备相似, 用于执行根据图 6所展示的 DMA 描述符 600。 其不同之处在于, 还包括中断控制器 1603。 中断控制器 1603耦合到 D MA写操作控制器 734以及 Flash接口 1231、 Flash接口 1232 (未示出 ) 、 Flash接口 1233 (未示出) 。 中断控制器 1603为同 Flash接口 1231相耦合的闪存芯片设置第一 计数器, 为同 Flash接口 1232相耦合的闪存芯片设置第二计数器, 为同 Flash接口 1 233相耦合的闪存芯片设置第三计数器。 在 Flash接口 1231、 1232、 1233的每一个分 别 禹合了多个闪存芯片或闪存管芯的情况下, 可为同 Flash接口 1231、 1232、 1233 的每一个所耦合的多个闪存芯片或闪存管芯分别设置与之对应的计数器。在为同备用 电源的电量相适应而实施消息或中断抑制时, 优选地针对同 Flash接口 1231、 1232、 1233相耦合的多个闪存芯片或管芯分别监控其待写入的数据量。
作为举例, 在一个实施例中, Flash接口 1231、 1232、 1233的每一个均同一 个闪存芯片相耦合, 而每个闪存芯片上包括一个闪存管芯, 第一计数器、 第二计数器 与第三计数器分别对应于与 Flash接口 1231相耦合的闪存芯片或管芯、与 Flash接口 1232相耦合的闪存芯片或管芯以及与 Flash接口 1233相 禹合的闪存芯片或管芯。 对 于 Flash接口 1231、 1232、 1233的每一个均耦合到多个闪存芯片或管芯的情况, 可 釆用类似的方式实施。 当在 DMA写控制器 734的控制下, 执行 DMA微指令, 并通 过 DMA写接口 735在主机 101和存储设备 102之间发起 DMA操作, 将数据以 DM A方式写入緩冲存储器 106后, 中断控制器 1603通过 DMA写操作控制器 734获得 该 DMA 指令所对应的用于闪存芯片 105的逻辑地址, 并进而获得与该逻辑地址相 对应用于闪存芯片 105的物理地址, 从而确定该 DMA微指令的数据将写入的闪存芯 片或管芯, 并将与为该闪存芯片或管芯而设置的计数器 (例如, 第二计数器) 递增。 中断控制器 1603也可釆用其他方式获得与 DMA微指令相对应的用于闪存芯片 105 的物理地址。 当 Flash接口 1231、 1232、 1233之一 (例如 Flash接口 1232 ) 将数据 写入到与其耦合的闪存芯片 105时, 指示中断控制器 1603将对应于写入数据的闪存 芯片或管芯的计数器 (在该例子中, 第二计数器) 递减。
当第一计数器、 第二计数器和第三计数器中的任何一个超过预定阈值时, 中 断控制器 1603实施中断抑制。 当第一计数器、 第二计数器和第三计数器均未超过预 定阈值时, 中断控制器 1603解除中断抑制。 还将意识到, 对应于第一计数器、 第二 计数器与第三计数器的预定阈值可以彼此不同,以同与其相对应的各个闪存芯片或管 芯相适应。
在另一个实施例中, 中断控制器 1603也维护定时器来监视一定时间间隔内向 主机 101发送的消息或中断的数量。当一定时间间隔内向主机 101发送的消息或中断 的数量超过阈值时, 中断控制器 1603抑制向主机 101发送消息或中断的活动, 即指 示 DMA写操作控制器 734暂停从微指令 FIF0733中获取 DMA微指令。
在依然另一个实施例中, 在中断控制器 1603中, 为同备用电源的电量相适应 而实施的消息或中断抑制, 与为减少颠簸而实施的消息或中断抑制相结合。
前面已经提到, 存储设备 102可以支持对多个 DMA描述符 600的并发操作。 对于多个 DMA描述符 600的每一个, 通过在緩冲存储器 106中创建的链表, 将与一 个 DMA描述符 600相对应的 DMA数据关联在一起, 使得对多个 DMA 指令的操 作顺序变得不重要。 在中断控制器 1603向主机 101发送的消息或中断, 可以指示对 DMA微指令的执行完成, 也可指示对与 DM A微指令相关联的 DMA描述符的执行 完成。
已经为了示出和描述的目的而展现了对本发明的描述, 并且不旨在以所公开 的形式穷尽或限制本发明。 对所属领域技术人员, 许多调整和变化是显而易见的。

Claims

权 利 要 求 书
1. 一种控制数据传输过程中的中断的方法, 用于在信息处理设备和存储设备之间传输数 据, 所述存储设备包括闪存存储器, 该方法包括:
所述存储设备接收所述信息处理设备发送的写请求;
响应于所述写请求, 向所述闪存存储器中写入数据;
向所述信息处理设备发送消息, 以指示所述写请求的完成, 并计算预定时间间隔内向 所述信息处理设备发送消息的次数;
其中, 若所述次数大于预定阈值, 则停止向所述信息处理设备发送消息。
2. 根据权利要求 1所述的方法, 其中若所述次数不大于预定阈值, 则允许向所述信息处 理设备发送消息。
3. 根据权利要求 1或 2所述的方法, 其中所述信息处理设备可设置所述预定阈值和 /或所 述预定时间间隔。
4. 一种存储设备, 包括闪存存储器、 控制电路以及接口单元, 所述控制电路还包括中断 控制器, 所述存储设备与信息处理设备可通信地连接;
所述接口单元接收信息处理设备发送的写请求;
所述控制电路基于所述写请求向所述闪存存储器中写入数据;
所述中断控制器向所述信息处理设备发送中断, 以指示所述写请求的执行完成; 所述中断控制器统计预定时间间隔内向所述信息处理设备发送的中断的次数; 所述中断控制器还将所述次数同预定阈值相比较, 若所述次数大于预定阈值, 则抑制 向所述信息处理设备发送中断。
5. 根据权利要求 4所述的存储设备, 其中若所述中断次数不大于预定阈值, 则所述中断 控制器允许向所述信息处理设备发送中断。
6. 根据权利要求 4所述的存储设备, 其中响应于所述接口单元接收信息处理设备发送的 写请求, 所述控制电路緩存所述写请求。
7. 一种控制数据传输过程中的中断的方法, 用于在信息处理设备和存储设备之间传输数 据, 所述存储设备包括闪存存储器和緩冲存储器, 该方法包括:
所述存储设备接收所述信息处理设备发送的写请求;
基于所述写请求, 将数据写入所述緩冲存储器, 并使计数器递增;
将所述緩冲存储器中的所述数据取出并写入所述闪存存储器, 并使所述计数器递减; 若所述计数器小于第一预定阈值,且预定时间间隔内向所述信息处理设备发送消息的 次数小于第二预定阈值, 则向所述信息处理设备发送指示所述写请求的执行完成的消息。
8. 根据权利要求 7所述的方法, 其中所述计数器不小于第一预定阈值, 或者预定时间间 隔内向所述信息处理设备发送消息的次数不小于第二预定阈值,则不向所述信息处理设备 发送指示所述写请求的执行完成的消息。
9. 一种存储设备, 包括闪存存储器、 緩冲存储器、 控制电路以及接口单元, 所述控制电 路还包括中断控制器, 所述存储设备与信息处理设备可通信地连接;
所述接口单元接收信息处理设备发送的写请求; 所述控制电路基于所述写请求, 将数据写入所述緩冲存储器, 并使计数器递增; 所述控制电路将所述緩冲存储器中的所述数据取出并写入所述闪存存储器,并使所述 计数器递减;
所述中断控制器统计预定时间间隔内向所述信息处理设备发送的指示所述写请求的 执行完成的消息的次数;
若所述计数器小于第一预定阈值, 且所述次数小于第二预定阈值, 所述中断控制器向 所述信息处理设备发送指示所述写请求执行完成的消息。
10. 根据权利要求 9所述的存储设备, 所述计数器不小于第一预定阈值, 或者预定时 间间隔内向所述信息处理设备发送消息的次数不小于第二预定阈值,则所述中断控制 器不向所述信息处理设备发送指示所述写请求的执行完成的消息。
PCT/CN2013/077284 2012-06-16 2013-06-15 控制数据传输过程中的中断的方法 WO2013185636A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP13804884.8A EP2863316A4 (en) 2012-06-16 2013-06-15 METHOD FOR CONTROLLING INTERRUPTION IN A DATA TRANSMISSION METHOD
US14/408,513 US9448955B2 (en) 2012-06-16 2013-06-15 Method for controlling interruption in data transmission process

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201210204774.7A CN102789439B (zh) 2012-06-16 2012-06-16 控制数据传输过程中的中断的方法与存储设备
CN201210204774.7 2012-06-16

Publications (1)

Publication Number Publication Date
WO2013185636A1 true WO2013185636A1 (zh) 2013-12-19

Family

ID=47154843

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2013/077284 WO2013185636A1 (zh) 2012-06-16 2013-06-15 控制数据传输过程中的中断的方法

Country Status (4)

Country Link
US (1) US9448955B2 (zh)
EP (1) EP2863316A4 (zh)
CN (1) CN102789439B (zh)
WO (1) WO2013185636A1 (zh)

Families Citing this family (27)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102789439B (zh) * 2012-06-16 2016-02-10 北京忆恒创源科技有限公司 控制数据传输过程中的中断的方法与存储设备
JP2014093655A (ja) * 2012-11-02 2014-05-19 Sony Corp 情報処理装置、情報処理方法及びプログラム
US20150033045A1 (en) * 2013-07-23 2015-01-29 Apple Inc. Power Supply Droop Reduction Using Feed Forward Current Control
WO2015101211A1 (zh) * 2013-12-30 2015-07-09 国民技术股份有限公司 存储系统及其非易失性存储器的控制方法
CN104216643A (zh) * 2014-08-26 2014-12-17 深圳创维数字技术股份有限公司 一种用户与设备的交互方法、装置以及系统
US9940379B2 (en) * 2014-09-30 2018-04-10 International Business Machines Corporation Hybrid data replication
US10120580B2 (en) 2015-03-31 2018-11-06 Toshiba Memory Corporation Method and design for dynamic management of descriptors for SGL operation
US9779043B2 (en) * 2015-11-16 2017-10-03 International Business Machines Corporation Techniques for handling queued interrupts in a data processing system
US10423568B2 (en) * 2015-12-21 2019-09-24 Microsemi Solutions (U.S.), Inc. Apparatus and method for transferring data and commands in a memory management environment
KR102649324B1 (ko) 2016-05-19 2024-03-20 삼성전자주식회사 적응 인터럽트 제어를 수행하는 컴퓨터 시스템 및 그것의 인터럽트 제어 방법
US10534540B2 (en) 2016-06-06 2020-01-14 Micron Technology, Inc. Memory protocol
CN106168932B (zh) * 2016-06-29 2020-12-18 联想(北京)有限公司 一种Flash控制方法及装置
US10963393B1 (en) 2017-01-13 2021-03-30 Lightbits Labs Ltd. Storage system and a method for application aware processing
CN107766268A (zh) * 2017-10-27 2018-03-06 郑州云海信息技术有限公司 存储设备的中断发送方法、装置、系统、设备及存储介质
CN110072199B (zh) * 2018-01-23 2023-01-20 优信拍(北京)信息科技有限公司 一种监控短消息发送异常的方法及系统
KR102536637B1 (ko) * 2018-03-29 2023-05-26 에스케이하이닉스 주식회사 메모리 컨트롤러 및 그 동작 방법
KR102560251B1 (ko) * 2018-06-20 2023-07-26 삼성전자주식회사 반도체 장치 및 반도체 시스템
US10896003B2 (en) * 2019-04-09 2021-01-19 Shannon Systems Ltd. Data storage device and system with interruption optimization
KR20210015086A (ko) * 2019-07-31 2021-02-10 에스케이하이닉스 주식회사 저장 장치 및 그 동작 방법
CN110928827B (zh) * 2019-11-29 2021-06-22 苏州浪潮智能科技有限公司 一种访问PCIe设备的优化的方法和设备
CN111736115B (zh) * 2020-05-13 2023-04-07 复旦大学 基于改进型sgdma+pcie的mimo毫米波雷达高速传输方法
US11579801B2 (en) 2020-06-09 2023-02-14 Samsung Electronics Co., Ltd. Write ordering in SSDs
CN111835659A (zh) * 2020-07-10 2020-10-27 北京思特奇信息技术股份有限公司 一种推送对外指令的流量控制方法、系统和电子设备
CN112131152B (zh) * 2020-09-15 2023-10-03 北京神州飞航科技有限责任公司 一种串行交互式传输扩展接口设计方法
CN112182344B (zh) * 2020-09-28 2023-09-15 腾讯科技(深圳)有限公司 一种数据请求方法、装置、服务器及存储介质
CN113378194B (zh) * 2021-06-09 2023-02-28 罗克佳华(重庆)科技有限公司 一种加解密运算加速方法、系统及存储介质
CN115617722B (zh) * 2022-12-05 2023-03-07 成都博宇利华科技有限公司 实现多pcie设备共享dma链表的系统及方法

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101221544A (zh) 2007-01-10 2008-07-16 国际商业机器公司 用于执行dma块移动的方法及dma设备
CN101620551A (zh) * 2009-05-07 2010-01-06 曙光信息产业(北京)有限公司 一种面向多虚拟机应用的网卡中断控制方法
CN101699413A (zh) * 2009-10-30 2010-04-28 成都市华为赛门铁克科技有限公司 硬盘数据读写控制方法、装置及数据存储系统
CN102043689A (zh) 2010-12-28 2011-05-04 武汉固捷联讯科技有限公司 一种用于固态存储设备的容错设计方法
US8031551B2 (en) 2009-06-26 2011-10-04 Seagate Technology Llc Systems, methods and devices for monitoring capacitive elements in devices storing sensitive data
CN101710252B (zh) 2009-12-08 2012-01-04 成都市华为赛门铁克科技有限公司 一种存储系统的供电方法和供电装置
CN102789439A (zh) * 2012-06-16 2012-11-21 北京忆恒创源科技有限公司 控制数据传输过程中的中断的方法

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5542076A (en) * 1991-06-14 1996-07-30 Digital Equipment Corporation Method and apparatus for adaptive interrupt servicing in data processing system
JP3525070B2 (ja) * 1999-01-27 2004-05-10 松下電器産業株式会社 アクセス制御装置及びアクセス方法
US7457897B1 (en) * 2004-03-17 2008-11-25 Suoer Talent Electronics, Inc. PCI express-compatible controller and interface for flash memory
US6978360B2 (en) * 2001-05-11 2005-12-20 International Business Machines Corporation Scalable processor
JP4681374B2 (ja) * 2005-07-07 2011-05-11 株式会社日立製作所 ストレージ管理システム
CN101339802B (zh) * 2007-07-06 2010-09-01 研祥智能科技股份有限公司 一种电子硬盘及电子设备
US8161234B2 (en) * 2008-12-30 2012-04-17 Intel Corporation Dynamically switching command types to a mass storage drive
US8055816B2 (en) * 2009-04-09 2011-11-08 Micron Technology, Inc. Memory controllers, memory systems, solid state drives and methods for processing a number of commands
US20130003751A1 (en) * 2011-06-30 2013-01-03 Oracle International Corporation Method and system for exponential back-off on retransmission

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101221544A (zh) 2007-01-10 2008-07-16 国际商业机器公司 用于执行dma块移动的方法及dma设备
CN101620551A (zh) * 2009-05-07 2010-01-06 曙光信息产业(北京)有限公司 一种面向多虚拟机应用的网卡中断控制方法
US8031551B2 (en) 2009-06-26 2011-10-04 Seagate Technology Llc Systems, methods and devices for monitoring capacitive elements in devices storing sensitive data
CN101699413A (zh) * 2009-10-30 2010-04-28 成都市华为赛门铁克科技有限公司 硬盘数据读写控制方法、装置及数据存储系统
CN101710252B (zh) 2009-12-08 2012-01-04 成都市华为赛门铁克科技有限公司 一种存储系统的供电方法和供电装置
CN102043689A (zh) 2010-12-28 2011-05-04 武汉固捷联讯科技有限公司 一种用于固态存储设备的容错设计方法
CN102789439A (zh) * 2012-06-16 2012-11-21 北京忆恒创源科技有限公司 控制数据传输过程中的中断的方法

Non-Patent Citations (1)

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

Also Published As

Publication number Publication date
CN102789439B (zh) 2016-02-10
CN102789439A (zh) 2012-11-21
EP2863316A1 (en) 2015-04-22
US20150193360A1 (en) 2015-07-09
EP2863316A4 (en) 2016-05-11
US9448955B2 (en) 2016-09-20

Similar Documents

Publication Publication Date Title
WO2013185636A1 (zh) 控制数据传输过程中的中断的方法
WO2013185637A1 (zh) 存储设备及其中断控制方法
WO2013170731A1 (zh) 将数据写入存储设备的方法与存储设备
WO2013170730A1 (zh) Dma传输方法及系统
US10838665B2 (en) Method, device, and system for buffering data for read/write commands in NVME over fabric architecture
CN105138287B (zh) 存储设备、中断控制方法以及供电时间测量方法
WO2023185035A1 (zh) 内存直接访问架构、系统、方法、电子设备和介质
US11579803B2 (en) NVMe-based data writing method, apparatus, and system
WO2018232736A1 (zh) 内存访问技术及计算机系统
KR20130009926A (ko) 유연한 플래시 명령어
KR20190033122A (ko) 멀티캐스트 통신 프로토콜에 따라 호스트와 통신하는 저장 장치 및 호스트의 통신 방법
KR20180049340A (ko) 스토리지 장치 및 그것의 링크 상태 제어 방법
US10318362B2 (en) Information processing apparatus, information processing method, and non-transitory computer-readable storage medium
WO2020087931A1 (zh) 一种数据备份方法、装置及系统
US10733118B2 (en) Computer system, communication device, and storage control method with DMA transfer of data
US10581748B2 (en) Information processing apparatus, information processing method, and non-transitory computer-readable storage medium
JP4692501B2 (ja) データ記憶システム、及びデータ記憶方法
KR101706088B1 (ko) Ssd 제어기에서의 프로세서 스위칭 방법 및 장치
TW202407533A (zh) 用於儲存設備的主機控制器完成隊列處理
TW202407547A (zh) 儲存裝置以及處理自主機計算裝置至儲存裝置的命令的方法
JP2014059661A (ja) 情報処理装置及びその制御方法、プログラム

Legal Events

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

Ref document number: 13804884

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

WWE Wipo information: entry into national phase

Ref document number: 14408513

Country of ref document: US

REEP Request for entry into the european phase

Ref document number: 2013804884

Country of ref document: EP

WWE Wipo information: entry into national phase

Ref document number: 2013804884

Country of ref document: EP