WO2015010646A1 - 混合内存的数据访问方法、模块、处理器及终端设备 - Google Patents

混合内存的数据访问方法、模块、处理器及终端设备 Download PDF

Info

Publication number
WO2015010646A1
WO2015010646A1 PCT/CN2014/082974 CN2014082974W WO2015010646A1 WO 2015010646 A1 WO2015010646 A1 WO 2015010646A1 CN 2014082974 W CN2014082974 W CN 2014082974W WO 2015010646 A1 WO2015010646 A1 WO 2015010646A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
accessed
dram
error
processor
Prior art date
Application number
PCT/CN2014/082974
Other languages
English (en)
French (fr)
Inventor
陈荔城
陈明宇
崔泽汉
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2015010646A1 publication Critical patent/WO2015010646A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/08Error detection or correction by redundancy in data representation, e.g. by using checking codes
    • G06F11/10Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's
    • G06F11/1008Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's in individual solid state devices
    • G06F11/1048Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's in individual solid state devices using arrangements adapted for a specific error detection or correction feature

Definitions

  • the present invention relates to the field of computers, and in particular, to a data access method, a module, a processor, and a terminal device of a hybrid memory.
  • NVM Non-Volatile Memory, non- Volatile memory
  • PCM Phase Change Memory
  • MRAM Magnetic Random Access Memory
  • flash memory Flash
  • the memory access when using a mixed memory composed of DRAM and extended memory, the memory access still uses the DDRx memory synchronous access interface, wherein X refers to the generations of DDR protocols, such as DDR3, DDR4, and DDR (Double Data Rate). , double rate)
  • X refers to the generations of DDR protocols, such as DDR3, DDR4, and DDR (Double Data Rate). , double rate
  • the memory synchronous access interface requires the access command to have a fixed timing delay, so the non-uniform access latency due to the mixed memory cannot be directly handled, and the non-uniform access delay needs to be processed.
  • OS Operating System
  • software is required to maintain which pages are currently in use. (Page) is located in DRAM, which pages are only in extended memory, which is usually achieved by adding flag bits to the page table entry.
  • the OS When the OS receives the memory access request, that is, the data access request, first query the page table to obtain whether the data accessed in the data access request is in the DRAM, and if so, directly access the DRAM; if not, the page fault needs to be generated. Then, the page corresponding to the accessed data is migrated from the extended memory to the DRAM, and the flag bit in the corresponding page table entry is updated, and finally the memory access request is resent to the DRAM.
  • the page table that is, the data access request
  • the data access method of the above mixed memory needs to redesign the memory management part of the operating system of the existing processor, such as establishing and updating the flag bit in the page table item, generating a page fault interrupt, etc., and the code modification amount is compared. Large, the data access process is more complicated.
  • Embodiments of the present invention provide a data access method, a module, a processor, and a terminal device of a hybrid memory, which can simplify the data access process.
  • the first aspect provides a data access method for a hybrid memory, which is applied to a serial connection module, and includes:
  • the preset error data is sent to the memory controller, so that the memory controller triggers the processor to generate an error correction code ECC error interrupt according to the preset error data.
  • the access data is data accessed in the data access request;
  • the serial module migrates the to-be-accessed data located in the non-volatile memory NVM to the DRAM when the processor interrupts the ECC error.
  • the method before the sending the preset error data to the memory controller, the method further includes:
  • the address mapping table records data currently located in the DRAM in the storage module and data located in the NVM, and the storage module is a mixed memory composed of the DRAM and the NVM;
  • the migrating the to-be-accessed data located in the NVM to the DRAM includes:
  • the to-be-accessed data located in the NVM is migrated to the DRAM according to a preset migration granularity.
  • the data access request includes a physical address of the to-be-accessed data
  • the generating a data migration request according to the data access request includes:
  • the data migration request is generated according to the data access request, where the data migration request includes a physical address of the to-be-accessed data, and the data migration request further includes the preset migration granularity.
  • the preset migration granularity is the same as the granularity of the DRAM line buffer.
  • the address mapping table further records a cache flag, where the cache flag is used to identify whether the data is located in the cache.
  • the method further includes: querying a cache flag in the address mapping, and determining whether the to-be-accessed data is located in a cache;
  • the migration of the data to be accessed located in the NVM is stopped from being migrated into the DRAM.
  • the preset error data is data that has at least two errors.
  • the second aspect provides a data access method for a hybrid memory, which is applied to a processor, including:
  • the method before the generating an error correction code ECC error interrupt according to the preset error data, the method further includes:
  • the ECC check is performed on the preset error data to determine whether the error mode of the preset error data is an ECC error interrupt mode.
  • the method Also includes:
  • the preset error data is data that has at least two errors.
  • a serial connection module including:
  • a sending unit configured to send preset error data to the memory controller when the data to be accessed is not in the dynamic random access memory (DRAM), so that the memory controller triggers the processor to generate an error correction code according to the preset error data.
  • the ECC error is interrupted, and the to-be-accessed data is data accessed in the data access request;
  • a migration unit configured to migrate the to-be-accessed data located in the non-volatile memory NVM into the DRAM when the processor interrupts the ECC error processing.
  • the concatenation module further includes: an establishing unit, configured to establish an address mapping table, the address mapping, before sending the preset error data to the memory controller
  • the table records that the storage module is currently located in the Data in the DRAM and data located in the NVM, the storage module being a hybrid memory composed of the DRAM and the NVM;
  • a receiving unit configured to receive the data access request
  • a determining unit configured to query the address mapping table according to the data access request, and determine whether the to-be-accessed data is in the DRAM;
  • An execution unit configured to: when the determining unit determines that the to-be-accessed data is in the DRAM, acquire the to-be-accessed data in the DRAM, and determine, by the determining unit, that the to-be-accessed data is In the DRAM, the sending unit is triggered to send the preset error data.
  • the migration unit specifically includes:
  • a generating sub-unit configured to generate a data migration request according to the data access request, where the data requested to be migrated in the data migration request is the to-be-accessed data;
  • a migration subunit configured to migrate the to-be-accessed data located in the NVM to the DRAM according to the preset migration granularity according to the data migration request.
  • the data access request includes a physical address of the to-be-accessed data
  • the generating sub-unit is specifically configured to: generate the data migration request according to the data access request, where the data migration request includes a physical address of the to-be-accessed data, and the data migration request further includes the preset migration granularity .
  • the preset migration granularity is the same as the granularity of the DRAM line buffer.
  • the address mapping table further records a cache flag, where the cache flag is used to identify whether the data is located in the cache.
  • the determining unit is further configured to query a cache flag in the address mapping, and determine whether the to-be-accessed data is located in a cache.
  • the execution unit is further configured to stop migrating the to-be-accessed data located in the NVM to the DRAM when the to-be-accessed data is in a cache.
  • the receiving unit is further configured to receive the data access request that is resent by the processor;
  • the determining unit is further configured to query the address mapping table according to the data access request, and determine that the to-be-accessed data is in the DRAM, and obtain the to-be-accessed data in the DRAM.
  • the preset error data is data that has at least two errors.
  • a processor including:
  • a receiving unit configured to receive a trigger message sent by the memory controller, where the trigger message is sent by the memory controller after receiving preset error data sent by the serial module, where the preset error data is the serial connection
  • the module is configured to: when the data to be accessed is not in the DRAM, the processing unit is configured to generate an error correction code ECC error interrupt according to the preset error data, so that the serial module interrupts the ECC error in the processor At the time of processing, the to-be-accessed data located in the NVM is migrated into the DRAM.
  • the processor further includes: a determining unit, configured to: before the generating an error correction code ECC error according to the preset error data, by using the The error data is set to perform ECC check, and it is determined whether the error mode of the preset error data is an ECC error interrupt mode.
  • the processor further includes:
  • a sending unit configured to resend the data access request to the serial module after the serial module migrates the to-be-accessed data located in the NVM to the DRAM, to facilitate the string
  • the module acquires the to-be-accessed data in the DRAM.
  • the preset error data is data that has at least two errors.
  • a fifth aspect provides a terminal device, including:
  • the storage module is a hybrid memory composed of the DRAM and the NVM;
  • the serial connection module is any of the above-mentioned serial connection modules, and is configured to send preset error data to the memory controller when the data to be accessed is not in the dynamic random access memory (DRAM), So that the memory controller triggers the processor to generate an error correction code ECC error interrupt according to the preset error data, the data to be accessed is data accessed in the data access request; and the processor interrupts the ECC error. Processing, the serial module migrates the to-be-accessed data located in the non-volatile memory NVM into the DRAM;
  • DRAM dynamic random access memory
  • the processor is any processor that is configured to receive a trigger message sent by a memory controller, where the trigger message is sent by the memory controller after receiving preset error data sent by the serial module.
  • the preset error data is sent by the serial module when the data to be accessed is not in the DRAM; generating an error correction code ECC error interrupt according to the preset error data, so as to interrupt the ECC error in the processor
  • the concatenation module migrates the to-be-accessed data located in the NVM into the DRAM.
  • An embodiment of the present invention provides a data access method, a module, a processor, and a terminal device of a hybrid memory, including: when the data to be accessed is not in the dynamic random access memory (DRAM), sending preset error data to the memory controller, so that The memory controller triggers the processor to generate an error correction code ECC error interrupt according to the preset error data, the data to be accessed is data accessed in the data access request; and the processor interrupts the ECC error processing.
  • the serial module migrates the data to be accessed located in the non-volatile memory NVM into the DRAM.
  • the ECC error interrupt is triggered by transmitting the preset error data, so that the data to be accessed is migrated when the ECC error is interrupted, and the existing ECC processing mechanism is utilized.
  • FIG. 1 is a flowchart of a method for accessing data of a hybrid memory according to an embodiment of the present invention
  • FIG. 2 is a flowchart of another method for accessing data of a hybrid memory according to an embodiment of the present invention
  • FIG. 3 is a schematic structural diagram of a terminal device with a mixed memory in the prior art
  • FIG. 4 is a schematic structural diagram of a terminal device with a mixed memory according to an embodiment of the present invention
  • FIG. 5 is a flowchart of still another method for data access of a hybrid memory according to an embodiment of the present invention.
  • FIG. 6 is a schematic diagram of a method for generating preset error data according to an embodiment of the present invention
  • FIG. 7 is a schematic diagram of an address mapping table according to an embodiment of the present invention
  • FIG. 8 is a schematic structural diagram of a serial connection module according to an embodiment of the present disclosure.
  • FIG. 9 is a schematic structural diagram of another serial connection module according to an embodiment of the present disclosure.
  • FIG. 10 is a schematic structural diagram of a migration unit in a serial connection module according to an embodiment of the present disclosure.
  • FIG. 11 is a schematic structural diagram of a processor according to an embodiment of the present disclosure.
  • FIG. 12 is a schematic structural diagram of another processor according to an embodiment of the present invention.
  • the structure of the terminal device 10 having the mixed memory may be as shown in FIG. 1, including: a processor 101, a memory controller 102, and a storage module 103.
  • the storage module 103 includes: a DRAM 1031, an NVM 1032, that is, the The storage module 103 is a hybrid memory composed of the DRAM 1031 and the NVM 1032, wherein the memory controller 102 can exchange information with the storage module 103.
  • the memory controller is responsible for controlling the memory and making The memory exchanges data with the CPU, and in the terminal device 10, the operating system running by the processor 101 needs to modify and establish the flag bit in the page table entry by modifying the code amount, and generates a page fault when the DRAM 1031 does not have data to be accessed. Interrupt and so on.
  • the structure of the terminal device 20 can be as shown in FIG. 2, including: a processor 201, a memory controller 202, a serial connection module 203, and a storage module 204.
  • the storage module 204 includes: a DRAM 2041, an NVM 2042,
  • the memory controller 202 can perform information interaction with the serial module 203, and the memory access still uses the DDRx memory synchronous access interface.
  • the hardware structure of the memory controller 202 is the same as that of a normal memory controller.
  • the serial connection module 203 may be configured by an FPGA (Field-Programmable Gate Array) or an ASIC (Application Specific Integrated Circuit), and the terminal device 20 may be an operating system (Operating System).
  • a system device, such as a server, can also be a virtual machine or the like.
  • An embodiment of the present invention provides a data access method for a hybrid memory, as shown in FIG. 3, which is applied to a serial connection module, and includes:
  • Step 301 When the data to be accessed is not in the dynamic random access memory (DRAM), send preset error data to the memory controller, so that the memory controller triggers the processor to generate an ECC according to the preset error data (Error Correcting Code). , error correction code) Error interrupt.
  • DRAM dynamic random access memory
  • the to-be-accessed data is data accessed in a data access request.
  • the storage space in the serial module in which the preset error data is stored may have a mapping relationship with the kernel space.
  • Step 302 When the processor interrupts the ECC error processing, the serial module migrates the to-be-accessed data located in the non-volatile memory NVM into the DRAM.
  • the data migration request may be generated according to the data access request, where the data requested to be migrated in the data migration request is the to-be-accessed data.
  • the data access request includes a physical address of the to-be-accessed data.
  • the splicing module generates the data migration request according to the data access request, where the data migration request includes a physical address of the data to be accessed, and the data migration request further includes the preset migration granularity;
  • the request, according to the preset migration granularity can be the same as the granularity of the DRAM line buffer.
  • a request queue may be set in the serial connection module, and the serial connection module first adds the data migration request to the request queue, and then sequentially according to the sequence of data migration requests in the request queue. Perform the migration of the corresponding data.
  • the ECC error interrupt is triggered by transmitting the preset error data, so that the data to be accessed is migrated when the ECC error is interrupted, and the existing ECC processing mechanism is utilized.
  • an address mapping table is further needed, where the address mapping table records data currently located in the DRAM and data located in the NVM in the storage module; receiving the data access request; The data access request queries the address mapping table to determine whether the data to be accessed is in the DRAM. Specifically, the address mapping table further records a cache flag, where the cache flag is used to identify whether the data is located in a cache (Cache); since the capacity of the DRAM is smaller than the NVM capacity, the DRAM is used for the cache of the NVM, that is, only Can store part of the NVM data. When the processor needs to access the data of the NVM, it needs to put the data into the DRAM first.
  • the cache flag is used to optimize the selection replacement process: the data in the cache is not replaced from the DRAM into the NVM, that is, the address map can be queried before the preset error data is sent to the memory controller.
  • a cache flag determining whether the to-be-accessed data is located in a cache; when the to-be-accessed data is located in a cache, stopping migrating the to-be-accessed data located in the NVM to the DRAM, so that the data is located in the cache The data to be accessed is not replaced from DRAM.
  • the serial module further needs to receive the data access request resent by the processor; query the address mapping table according to the data access request, and determine that the to-be-accessed data is in the In the DRAM, the to-be-accessed data is acquired in the DRAM.
  • An embodiment of the present invention provides a data access method for a hybrid memory, which is applied to a processor.
  • the CPU is a CPU (Central Processing Unit), as shown in FIG. 2, and includes: Step 401: Receive a trigger message sent by the memory controller, where the trigger message is sent by the memory controller after receiving the preset error data sent by the serial module, where the preset error data is the serial connection module. Sent when the data to be accessed is not in DRAM.
  • the preset error data may be data having at least two errors.
  • Step 402 Generate an ECC error interrupt according to the preset error data, so that when the serial module interrupts the ECC error interrupt processing, the serial module will be located in the NVM to be accessed. Data is migrated into the DRAM.
  • the processor may resend the data access request to the serial connection module, so that the serial connection module acquires the to-be-accessed data in the DRAM.
  • the trigger message sent by the memory controller is triggered to trigger the ECC error interrupt, so that the serial module performs the migration of the data to be accessed when the ECC error is interrupted.
  • the existing ECC processing mechanism reduces the memory management part of the existing processor core, reduces the amount of code modification, and simplifies the data access process.
  • the processor may perform an ECC check on the preset error data to determine whether the error mode of the preset error data is an ECC error interrupt mode, and the ECC error interrupt mode and the existing The ECC error interrupt mode is the same, and the present invention will not go into details.
  • the data access method of the mixed memory in the terminal device 20, as shown in FIG. 5, includes:
  • Step 501 The memory controller sends a data access request to the serial module.
  • the data access request of the memory controller may be generated and sent by the processor, and directly forwarded to the serial module by the memory controller, or may be generated by the memory controller according to the related data request sent by the processor.
  • a request queue may be established in the memory controller, and one or more of the data access requests are stored in the data request queue, and sequentially sent to the serial connection module.
  • Step 502 The serial module determines whether the data to be accessed is in the DRAM. When the data to be accessed is in the DRAM, step 508 is performed. When the data to be accessed is not in the DRAM, step 503 is performed.
  • the concatenation module may establish an address mapping table prior to step 501, the address mapping table recording data currently in the DRAM and data located in the NVM in the storage module. After receiving the data access request sent by the memory controller, querying the address mapping table according to the data access request to determine whether the to-be-accessed data is in the DRAM.
  • the address mapping table may set an In-DRAM field for indicating whether the data to be accessed is in the DRAM. In the In-DRAM field, 1 may be used to represent the data to be accessed in the DRAM, and 0 is the data to be accessed is not in the DRAM. Medium, but only in NVM.
  • Step 503 The serial module sends preset error data to the memory controller. Go to step 504.
  • the serial connection module can set a storage space, and the storage space stores preset error data, and the preset error data can trigger the ECC to process the ECC error interrupt mode, that is, the ECC error interrupt.
  • the serial module redirects the data access request to the storage space, and the preset error data is sent from the storage space to the memory controller.
  • the storage space in which the preset error data is stored in the serial connection module has a mapping relationship with the kernel space.
  • the storage space can be mapped to the kernel space by using the ioremap (10 address space remapping) system call, so as to ensure that the storage space is in addition to the serial module access, other parts, such as an OS, an application, etc. Will not visit.
  • the storage space is set to a space in which the preset error data is stored, and the preset error data is data having at least two errors.
  • the kernel space is a part of the specific space in the Linux system. When the Linux system divides itself, some core software is independent of the normal application and runs at a higher privilege level. They reside in the protected area. In the memory space, you have all the permissions to access the hardware device. This space is called kernel space.
  • FIG. 6 shows an example of generating preset error data.
  • the preset error data has 4 errors.
  • the preset data A is obtained, and the preset data A is subjected to an ECC operation to obtain preset data.
  • the ECC value of A, the 16 bits of the binary value of the preset data A are all 1, and then the preset data A is modified to obtain the error data B, so that the data of the specified four positions of the binary value of the error data B is more preset data.
  • A is inverted (from 1 to 0).
  • the binary values of the preset data A are reversed from the right, left 9, 9, 15, and 16 bits to obtain the ECC of the preset data A.
  • the value is the ECC value of the error data B, that is, the error data B and the preset data A have the same ECC value, but the binary values are different, and finally the binary value of the error data B and the ECC value of the error data B are used as preset errors. data.
  • Step 504 The memory controller sends a trigger message to the processor.
  • the memory controller calculates a corresponding ECC value according to the received data, and then compares it with the read ECC value, and compares whether the calculated ECC value and the read ECC value are the same to determine whether an error occurs, when returning data.
  • the memory controller directly corrects the position of the error.
  • the memory controller receives the preset error data, so it will determine that there is an error, and The processor sends a trigger message, and the trigger message includes preset error data.
  • Step 505 The processor determines whether the error mode of the preset error data is an ECC error interrupt mode. When the error mode of the preset error data is the ECC error interrupt mode, step 506 is performed, and when the error mode of the preset error data is not the ECC error interrupt mode, step 510 is performed.
  • the processor performs ECC check on the preset error data in the trigger message. Specifically, the error mode is first determined. Because there are at least two errors in the data returned by the memory controller, the processor generates an ECC error interrupt.
  • the processor performs the ECC check on the preset error data, but there are at least two errors in the returned data.
  • the ECC error is the normal error mode
  • the other is the ECC error interrupt mode. Therefore, it is necessary to determine whether the error mode of the preset error data is the ECC error interrupt mode.
  • the ECC error interrupt mode is related to the preset error data. For example, as shown in FIG. 6, when the preset error data is composed of the error data B and the ECC value of the preset data A, when the error data B is ECC When the ECC value of the error data B as shown in Fig. 6 is obtained by the operation, it indicates that the ECC error interrupt mode has occurred.
  • Step 506 The processor generates an ECC error interrupt. Go to step 507. in. Go to step 508.
  • the contiguous module may generate a data migration request according to the data access request, where the data requested to be migrated in the data migration request is the to-be-accessed data. Specifically, the data access request includes a physical address of the to-be-accessed data.
  • the splicing module generates the data migration request according to the data access request, where the data migration request includes a physical address of the to-be-accessed data, and the data migration request further includes the preset migration granularity;
  • the migration request may be set in the serial connection module according to the preset application, and the serial connection module may first add the data migration request to the request queue, and then follow each data migration request in the request queue. The order of the data is migrated in sequence.
  • the size of the row buffer (Row Buffer) of the DRAM may be selected as the granularity of the NVM to DRAM migration, so that when the row address of the data to be accessed is migrated to the DRAM, if the serial module receives the memory
  • the address mapping table can be directly used to query the address mapping table to query whether the data to be accessed is in the DRAM. If not, the migration operation from step 503 to step 506 can be repeated immediately. Inquiries, which can reduce the time delay caused by part of the data migration operation and improve data access performance.
  • Step 508 The processor resends the data access request to the serial module. Steps
  • the first status register may be included in the serial connection module, and each time the ECC error interrupt mode occurs, the serial connection module sets the value of the corresponding indication register to 1; and these registers can be mapped into the kernel space, each time When the ECC error is interrupted, the memory controller first reads these status registers. If it is 1, it recognizes the ECC error interrupt mode. If it is 0, it recognizes the normal error mode.
  • the serial connection module includes a second status register
  • the second status register indicates whether the work of migrating the data to be accessed from the NVM to the DRAM is completed, the serial connection module is provided with a migration queue, and the serial connection module adds the data migration request to the
  • the status register is set to 0, after the data migration to be accessed is completed, the status register is set to 1; the memory controller queries the second register, Once the value of the second register is found to be 1, indicating that the migration has completed, the data access request can be resent.
  • Step 509 The serial module sends the to-be-accessed data in the DRAM to the memory controller.
  • Step 510 The processor executes a normal ECC processing procedure.
  • the address mapping table may further record other state information, such as data located in the cache.
  • the serial module may query the address mapping table. Data in the cache that exceeds a preset time limit migrates to the DRAM.
  • the address mapping table may be as shown in FIG. 7.
  • ADDR Address
  • In-DRAM is used to indicate whether data is in DRAM, and 1 may be used in the In-DRAM field.
  • the first data is in the DRAM, 0 means that the data is not in the DRAM, but only in the NVM;
  • the address mapping table also records a cache flag, and the cache flag is used to identify whether the data is in the cache, such as using In-Cache Indicates whether the data is in the cache.
  • the serial module can determine whether to replace the data in the DRAM according to the In-Cache; lru is the replacement indication of the data in the DRAM; NVM-ADDR indicates the address where the data is stored in the NVM.
  • the In-Cache When data is read from the DRAM into the cache, the In-Cache is set to 1. When the data is replaced from the cache into the DRAM, the In-Cache is reset to 0.
  • the replacement strategy of the DRAM in this embodiment. Medium, select one of the oldest data blocks in the cache that exceeds the preset time limit and is not accessed, and replace it with DRAM, that is, look forward from the lru position and find the first In-Cache 0 data block from the cache. Replaced with DRAM.
  • the data is data that needs to be queried or data to be accessed.
  • the cache flag in the address mapping may be queried to determine whether the to-be-accessed data is located in the cache; Stopping migrating the to-be-accessed data located in the NVM into the DRAM.
  • the ECC error interrupt is triggered by receiving the preset error data, so that the serial module performs the migration of the data to be accessed when the ECC error is interrupted.
  • Some ECC processing mechanisms eliminate the need to change the hardware structure of the memory controller, reduce the redesign of the memory management part of the operating system running on the existing processor, reduce the amount of code modification, and simplify the data access process.
  • the embodiment of the present invention provides a serial connection module 60.
  • the serial connection module 60 is composed of an FPGA or an ASIC. As shown in FIG. 8, the method includes:
  • the sending unit 601 is configured to send preset error data to the memory controller when the data to be accessed is not in the dynamic random access memory (DRAM), so that the memory controller triggers the processor to generate an ECC error according to the preset error data.
  • the data to be accessed is the data accessed in the data access request.
  • the migration unit 602 is configured to migrate the to-be-accessed data located in the non-volatile memory NVM into the DRAM when the processor interrupts the ECC error processing.
  • the transmitting unit triggers the ECC error interrupt by transmitting the preset error data, so that the migration unit performs the migration of the data to be accessed when the ECC error is interrupted, and the existing data is utilized.
  • the ECC processing mechanism eliminates the need to change the hardware structure of the memory controller, reduces the redesign of the memory management part of the operating system running on the existing processor, reduces the amount of code modification, and simplifies the data access process.
  • serial connection module 60 further includes:
  • the establishing unit 603 is configured to: before the sending the preset error data to the memory controller, establish an address mapping table, where the address mapping table records data currently located in the DRAM in the storage module And data located in the NVM, the storage module is a hybrid memory composed of the DRAM and the NVM.
  • the receiving unit 604 is configured to receive the data access request.
  • the determining unit 605 is configured to query the address mapping table according to the data access request, and determine whether the to-be-accessed data is in the DRAM.
  • the executing unit 606 is configured to: when the determining unit 604 determines that the to-be-accessed data is in the DRAM, acquire the to-be-accessed data in the DRAM, and determine, by the determining unit, that the to-be-accessed When the data is in the DRAM, the sending unit 601 is triggered to send the preset error data.
  • the receiving unit 604 is further configured to receive the data access request that is resent by the processor.
  • the determining unit 605 is further configured to query the address mapping table according to the data access request, and determine that the to-be-accessed data is obtained. In the DRAM, the to-be-accessed data is acquired in the DRAM.
  • the migration unit 602 specifically includes:
  • a generating sub-unit 6021 configured to generate a data migration request according to the data access request, where the data requested to be migrated in the data migration request is the to-be-accessed data;
  • the migration sub-unit 6022 is configured to: according to the data migration request, the data access request according to the preset migration granularity, including the physical address of the to-be-accessed data,
  • the generating sub-unit 6021 is specifically configured to: generate the data migration request according to the data access request, where the data migration request includes a physical address of the to-be-accessed data, and the data migration request further includes the preset migration granularity.
  • the preset migration granularity may be the same as the granularity of the DRAM row buffer.
  • the address mapping table may also record a cache flag, and the cache flag is used to identify whether the data is located in the cache.
  • the preset error data may be data having at least two errors. Since the capacity of the DRAM is smaller than the NVM capacity, the DRAM is used for the cache of the NVM, that is, only part of the NVM data can be stored. When the processor needs to access the data of the NVM, it needs to put the data into the DRAM first. If the capacity in the DRAM is full, that is, there is no free space, you need to first replace the data in the DRAM and put it back in the NVM.
  • this cache flag is used to optimize this selection replacement process: the data located in the cache is not replaced from the DRAM into the NVM, that is, the migration unit 602 can be used to replace the data in the selected DRAM and put it back into the NVM.
  • the flag for identifying whether the data is located in the cache (Cache) needs to be queried, and if the data is in the cache, it is not replaced from the DRAM.
  • the determining unit 605 is further configured to query a cache flag in the address mapping, and determine whether the to-be-accessed data is located in a cache.
  • the executing unit 606 is further configured to: when the to-be-accessed data is located in a cache, Stop migrating the to-be-accessed data located in the NVM into the DRAM.
  • the sending unit when the data to be accessed is not in the dynamic random access memory DRAM, the sending unit triggers the ECC error interrupt by sending the preset error data, so that the migration unit performs the data to be accessed when the ECC error is interrupted.
  • Migration using the existing ECC processing mechanism, without changing the hardware structure of the memory controller, reducing the redesign of the memory management part of the operating system running on the existing processor, reducing the amount of code modification, simplifying data access process.
  • the embodiment of the present invention provides a processor 70, as shown in FIG. 11, including:
  • the receiving unit 701 is configured to receive a trigger message sent by the memory controller, where the trigger message is sent by the memory controller after receiving preset error data sent by the serial module, where the preset error data is the string
  • the module is sent when the data to be accessed is not in the DRAM.
  • the processing unit 702 is configured to generate an ECC error interrupt according to the preset error data, so that the serial connection module migrates the to-be-accessed data located in the NVM when the processor interrupts the ECC error processing. To the DRAM.
  • the receiving unit triggers the processing unit to perform an ECC error interrupt by receiving a trigger message sent by the memory controller, so that the serial module performs the access when the ECC error is interrupted.
  • DRAM dynamic random access memory
  • the processing mechanism reduces the memory management part of the existing processor core, reduces the amount of code modification, and simplifies the data access process.
  • the processor 70 further includes:
  • the determining unit 703 is configured to determine whether the error mode of the preset error data is an ECC error interrupt by performing an ECC check on the preset error data before the generating an ECC error interrupt according to the preset error data. mode.
  • the sending unit 704 is configured to resend the data access request to the serial module after the serial module migrates the to-be-accessed data located in the NVM into the DRAM, to facilitate the The serial module acquires the data to be accessed in the DRAM.
  • the preset error data may be data having at least two errors.
  • the processor provided by the embodiment of the present invention, when the data to be accessed is not in the dynamic random access memory (DRAM), the receiving unit triggers the processing unit to perform an ECC error interrupt by receiving a trigger message sent by the memory controller, so that the serial module fails in the ECC.
  • the data to be accessed is migrated during the interruption, and the existing ECC processing mechanism is used to reduce the redesign of the memory management part of the existing processor core, which reduces the amount of code modification and simplifies the data access process.
  • the embodiment of the present invention provides a terminal device 20, as shown in FIG. 2, including: a processor 201, a memory controller 202, a serial connection module 203, and a storage module 204.
  • the storage module 204 includes: a DRAM 2041, an NVM 2042, where The memory controller 202 can exchange information with the serial module 203.
  • the memory access still uses the DDRx memory synchronous access interface.
  • the hardware structure of the memory controller 202 is the same as that of a normal memory controller.
  • the serial connection module 203 is composed of an FPGA or an ASIC, and the terminal device 20 may be a device running an OS (Operating System), a virtual machine, or the like.
  • the serial connection module 203 is a serial connection module according to any embodiment of the present invention, configured to send preset error data to the memory controller when the data to be accessed is not in the dynamic random access memory (DRAM), so as to facilitate the memory.
  • the controller triggers the processor to generate an error correction code ECC error interrupt according to the preset error data, and the to-be-accessed data is data accessed in the data access request;
  • ECC error interrupt processing is performed, migrates the to-be-accessed data located in the non-volatile memory NVM into the DRAM.
  • the processor 201 is configured to receive a trigger message sent by a memory controller, where the trigger message is after the memory controller receives the preset error data sent by the serial module. And sending, the preset error data is sent by the serial module when the data to be accessed is not in the DRAM; generating an error correction code ECC error interrupt according to the preset error data, so as to be in the processor pair
  • the serial module migrates the to-be-accessed data located in the NVM into the DRAM.
  • the disclosed systems, devices, and methods may be implemented in other ways.
  • the device embodiments described above are merely illustrative.
  • the division of the unit is only a logical function division.
  • there may be another division manner for example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored, or not executed.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be electrical, mechanical or otherwise.
  • the components displayed for the unit may or may not be physical units, ie may be located in one place, or may be distributed over multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solution of the embodiment.
  • each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may be physically included separately, or two or more units may be integrated into one unit.
  • the above integrated unit can be implemented in the form of hardware or in the form of hardware plus software functional units.
  • the foregoing program may be stored in a computer readable storage medium, and when executed, the program includes the steps of the foregoing method embodiment; and the foregoing storage medium includes: ROM, RAM
  • ROM read-only memory
  • RAM random access memory

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

一种混合内存的数据访问方法、模块、处理器及终端设备,涉及计算机领域,能够简化数据访问过程。包括:当待访问数据不在动态随机存取存储器DRAM中时,向内存控制器发送预设出错数据,以便于所述内存控制器根据所述预设出错数据触发处理器产生错误纠正码ECC出错中断,所述待访问数据为数据访问请求中访问的数据;在所述处理器对所述ECC出错中断处理时,所述串接模块将位于非易失性存储器NVM中的所述待访问数据迀移至所述DRAM中。该一种混合内存的数据访问方法、模块、处理器及终端设备,用于混合内存的数据访问。

Description

混合内存的数据访问方法、 模块、 处理器及终端设备 本申请要求于 2013 年 7 月 25 日提交中国专利局、 申请号为 201310317746.0、 发明名称为"混合内存的数据访问方法、 模块、 处理器及终 端设备 "的中国专利申请的优先权, 其全部内容通过引用结合在本申请中。
技术领域
本发明涉及计算机领域, 尤其涉及一种混合内存的数据访问方法、 模块、 处理器及终端设备。
背景技术
随着技术的逐渐进步, 处理器内集成的核的个数不断增长, 服务 器、 云计算平台对内存容量的需求也不断增长, 而内存容量的增长速度 较慢, 通常的, 内存主要都是使用 DRAM ( Dynamic Random Access Memory, 动态随机存取存储器) , 而为了提高内存容量的增长速度, 研发新型的内存材料成为了必然趋势,目前新型的内存材料研究主要集 中在 NVM(Non- Volatile Memory, 非易失性存储器)材料上, 如 PCM (Phase Change Memory, 相变存储器), MRAM (Magnetic Random Access Memory, 磁性随机存储器)和快闪存储器(Flash)等等。这些 NVM 材料具有位密度高、 静态功耗低和非易失等优点, 但是 NVM等新型的 内存材料还存在写寿命有限等缺点,使得这些新型的内存材料还无法完 全替代 DRAM作为内存, 而是作为 DRAM的扩展内存。
现有技术中, 在使用由 DRAM和扩展内存组成的混合内存时, 内 存访问仍然使用 DDRx 内存同步访问接口, 其中, X是指第几代 DDR 协议, 如 DDR3 , DDR4 , 而 DDR ( Double Data Rate, 双倍速率) 内存 同步访问接口要求访问命令具有固定的时序延迟,因此无法直接处理这 种由于混合内存带来的非一致访存延迟,需要对所述非一致访问延迟进 行处理。 示例的, 当在 OS (Operating System , 操作***) 中使用由 DRAM 和扩展内存组成的混合内存时, 需要软件来维护当前哪些页面 (Page)位于 DRAM 中, 哪些页面只在扩展内存中, 这一般通过在页表 项中增加标志位来实现。 当 OS收到访存请求, 即数据访问请求, 先查 询页表获取数据访问请求中访问的数据是否在 DRAM中, 如果是, 则 直接访问 DRAM; 如果不是, 需要产生缺页中断 (Page Fault), 然后将 访问的数据对应的页面从扩展内存迁移到 DRAM中, 并更新对应页表 项中的标志位, 最后才能向 DRAM重新发送访存请求。
但是上述混合内存的数据访问方法需要对现有的处理器运行的操作 ***中的内存管理部分进行重新设计,如建立和更新页表项中的标志位、 产生缺页中断等, 代码修改量较大, 数据访问过程较为复杂。
发明内容
本发明的实施例提供一种混合内存的数据访问方法、 模块、 处理 器及终端设备, 能够简化数据访问过程。
为达到上述目的, 本发明的实施例釆用如下技术方案:
第一方面, 提供一种混合内存的数据访问方法, 应用于串接模块, 包括:
当待访问数据不在动态随机存取存储器 DRAM中时, 向内存控制 器发送预设出错数据,以便于所述内存控制器根据所述预设出错数据触 发处理器产生错误纠正码 ECC 出错中断, 所述待访问数据为数据访问 请求中访问的数据;
在所述处理器对所述 ECC出错中断处理时, 所述串接模块将位于 非易失性存储器 NVM中的所述待访问数据迁移至所述 DRAM中。
结合第一方面, 在第一种可实施方式中, 在所述向内存控制器发 送预设出错数据之前, 所述方法还包括:
建立地址映射表, 所述地址映射表记录了存储模块中当前位于所 述 DRAM中的数据和位于所述 NVM中的数据, 所述存储模块为由所 述 DRAM和所述 NVM组成的混合内存;
接收所述数据访问请求;
根据所述数据访问请求查询所述地址映射表, 判断所述待访问数 据是否在所述 DRAM中; 当所述待访问数据在所述 DRAM中,则在所述 DRAM中获取所述 待访问数据。
结合第一种可实施方式,在第二种可实施方式中,所述将位于 NVM 中的所述待访问数据迁移至所述 DRAM中包括:
按照所述数据访问请求生成数据迁移请求, 所述数据迁移请求中 请求迁移的数据为所述待访问数据;
根据所述数据迁移请求,按照预设迁移粒度将位于 NVM中的所述 待访问数据迁移至所述 DRAM中。
结合第二种可实施方式, 在第三种可实施方式中, 所述数据访问 请求包括所述待访问数据的物理地址,
所述按照所述数据访问请求生成数据迁移请求包括:
根据所述数据访问请求生成所述数据迁移请求, 所述数据迁移请 求包括所述待访问数据的物理地址,所述数据迁移请求还包括所述预设 迁移粒度。
结合第二、 三种可实施方式, 在第四种可实施方式中,
所述预设迁移粒度与 DRAM行緩冲器的粒度相同。
结合第一至四种可实施方式, 在第五种可实施方式中, 所述地址 映射表还记录了緩存标志, 所述緩存标志用于标识数据是否位于緩存 中,
在所述向内存控制器发送预设出错数据之前, 所述方法还包括: 查询所述地址映射中的緩存标志, 判断所述待访问数据是否位于 緩存中;
当所述待访问数据位于緩存中,停止将位于所述 NVM中的所述待 访问数据迁移至所述 DRAM中。
结合第一至五种可实施方式, 在第六种可实施方式中,
接收所述处理器重新发送的所述数据访问请求;
根据所述数据访问请求查询所述地址映射表, 判断得到所述待访 问数据在所述 DRAM中, 则在所述 DRAM中获取所述待访问数据。
结合第一方面, 第一至六种可实施方式, 在第七种可实施方式中, 所述预设出错数据为至少存在两位出错的数据。 第二方面, 提供一种混合内存的数据访问方法, 应用于处理器, 包括:
接收内存控制器发送的触发消息, 所述触发消息是所述内存控制 器在接收串接模块发送的预设出错数据后发送的,所述预设出错数据为 所述串接模块在待访问数据不在 DRAM中时发送的;
根据所述预设出错数据产生错误糾正码 ECC出错中断, 以便于所 述串接模块在所述处理器对所述 ECC出错中断处理时, 所述串接模块 将位于 NVM中的所述待访问数据迁移至所述 DRAM中。
结合第二方面, 在第一种可实现方式中, 在所述根据所述预设出 错数据产生错误糾正码 ECC出错中断之前, 所述方法还包括:
通过对所述预设出错数据进行 ECC校验, 判断所述预设出错数据 的错误模式是否为 ECC出错中断模式。
结合第二方面、 第一种可实现方式, 在第二种可实现方式中, 在 所述串接模块将位于所述 NVM 中的所述待访问数据迁移至所述 DRAM中之后, 所述方法还包括:
重新向所述串接模块发送所述数据访问请求, 以便于所述串接模 块在所述 DRAM中获取所述待访问数据。
结合第二方面、 第一、 二种可实现方式, 在第三种可实现方式中, 所述预设出错数据为至少存在两位出错的数据。
第三方面, 提供一种串接模块, 包括:
发送单元, 用于在待访问数据不在动态随机存取存储器 DRAM中 时, 向内存控制器发送预设出错数据, 以便于所述内存控制器根据所述 预设出错数据触发处理器产生错误纠正码 ECC出错中断, 所述待访问 数据为数据访问请求中访问的数据;
迁移单元, 用于在所述处理器对所述 ECC出错中断处理时, 所述 迁移单元将位于非易失性存储器 NVM 中的所述待访问数据迁移至所 述 DRAM中。
结合第二方面, 在第一种可实施方式中, 所述串接模块还包括: 建立单元, 用于在所述向内存控制器发送预设出错数据之前, 建 立地址映射表, 所述地址映射表记录了存储模块中当前位于所述 DRAM 中的数据和位于所述 NVM 中的数据, 所述存储模块为由所述 DRAM和所述 NVM组成的混合内存;
接收单元, 用于接收所述数据访问请求;
判断单元, 用于根据所述数据访问请求查询所述地址映射表, 判 断所述待访问数据是否在所述 DRAM中;
执行单元, 用于在所述判断单元判断得到所述待访问数据在所述 DRAM中时, 则在所述 DRAM中获取所述待访问数据, 在所述判断单 元判断得到所述待访问数据在所述 DRAM中时, 触发所述发送单元发 送所述预设出错数据。
结合第一种可实施方式, 在第二种可实施方式中, 所述迁移单元 具体包括:
生成子单元, 用于按照所述数据访问请求生成数据迁移请求, 所 述数据迁移请求中请求迁移的数据为所述待访问数据;
迁移子单元, 用于根据所述数据迁移请求, 按照预设迁移粒度将 位于 NVM中的所述待访问数据迁移至所述 DRAM中。
结合第二种可实施方式, 在第三种可实施方式中, 所述数据访问 请求包括所述待访问数据的物理地址,
所述生成子单元具体用于: 根据所述数据访问请求生成所述数据 迁移请求, 所述数据迁移请求包括所述待访问数据的物理地址, 所述数 据迁移请求还包括所述预设迁移粒度。
结合第二、 三种可实施方式, 在第四种可实施方式中,
所述预设迁移粒度与 DRAM行緩冲器的粒度相同。
结合第一至四种可实施方式, 在第五种可实施方式中, 所述地址 映射表还记录了緩存标志, 所述緩存标志用于标识数据是否位于緩存 中,
所述判断单元还用于查询所述地址映射中的緩存标志, 判断所述 待访问数据是否位于緩存中;
所述执行单元还用于在所述待访问数据位于緩存中时, 停止将位 于所述 NVM中的所述待访问数据迁移至所述 DRAM中。
结合第一至五种可实施方式, 在第六种可实施方式中, 所述接收单元还用于接收所述处理器重新发送的所述数据访问请 求;
所述判断单元还用于根据所述数据访问请求查询所述地址映射 表, 判断得到所述待访问数据在所述 DRAM中, 则在所述 DRAM中获 取所述待访问数据。
结合第三方面, 第一至六种可实施方式, 在第七种可实施方式中, 所述预设出错数据为至少存在两位出错的数据。
第四方面, 提供一种处理器, 包括:
接收单元, 用于接收内存控制器发送的触发消息, 所述触发消息 是所述内存控制器在接收串接模块发送的预设出错数据后发送的,所述 预设出错数据为所述串接模块在待访问数据不在 DRAM中时发送的; 处理单元, 用于根据所述预设出错数据产生错误糾正码 ECC出错 中断,以便于所述串接模块在所述处理器对所述 ECC出错中断处理时, 将位于 NVM中的所述待访问数据迁移至所述 DRAM中。
结合第四方面, 在第一种可实现方式中, 所述处理器还包括: 判断单元, 用于在所述根据所述预设出错数据产生错误糾正码 ECC出错中断之前, 通过对所述预设出错数据进行 ECC校验, 判断所 述预设出错数据的错误模式是否为 ECC出错中断模式。
结合第四方面、 第一种可实现方式, 在第二种可实现方式中, 所 述处理器还包括:
发送单元,用于在所述串接模块将位于所述 NVM中的所述待访问 数据迁移至所述 DRAM中之后, 重新向所述串接模块发送所述数据访 问请求, 以便于所述串接模块在所述 DRAM中获取所述待访问数据。
结合第四方面、 第一、 二种可实现方式, 在第三种可实现方式中, 所述预设出错数据为至少存在两位出错的数据。
第五方面, 提供一种终端设备, 包括:
处理器, 内存控制器, 串接模块, 存储模块, 所述存储模块为由 所述 DRAM和所述 NVM组成的混合内存;
所述串接模块为以上任意所述的串接模块, 用于在待访问数据不 在动态随机存取存储器 DRAM中时,向内存控制器发送预设出错数据 , 以便于所述内存控制器根据所述预设出错数据触发处理器产生错误纠 正码 ECC出错中断, 所述待访问数据为数据访问请求中访问的数据; 在所述处理器对所述 ECC 出错中断处理时, 所述串接模块将位于非易 失性存储器 NVM中的所述待访问数据迁移至所述 DRAM中;
所述处理器为以上任意所述的处理器, 用于接收内存控制器发送 的触发消息,所述触发消息是所述内存控制器在接收串接模块发送的预 设出错数据后发送的,所述预设出错数据为所述串接模块在待访问数据 不在 DRAM中时发送的; 根据所述预设出错数据产生错误纠正码 ECC 出错中断, 以便于在所述处理器对所述 ECC 出错中断处理时, 所述串 接模块将位于 NVM中的所述待访问数据迁移至所述 DRAM中。
本发明的实施例提供一种混合内存的数据访问方法、 模块、 处理器 及终端设备,包括: 当待访问数据不在动态随机存取存储器 DRAM中时, 向内存控制器发送预设出错数据, 以便于所述内存控制器根据所述预设 出错数据触发处理器产生错误纠正码 ECC出错中断, 所述待访问数据为 数据访问请求中访问的数据;在所述处理器对所述 E C C出错中断处理时, 所述串接模块将位于非易失性存储器 NVM 中的所述待访问数据迁移至 所述 DRAM 中。 这样一来, 在待访问数据不在动态随机存取存储器 DRAM中时,通过发送预设出错数据来触发 ECC出错中断,使得在 ECC 出错中断时进行待访问数据的迁移, 利用已有的 ECC处理机制, 无需改 变内存控制器的硬件结构, 减少对对现有的处理器运行的操作***中内 存管理部分的重新设计, 降低了代码修改量, 简化了数据访问过程。
附图说明
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实 施例或现有技术描述中所需要使用的附图作简单地介绍, 显而易见地, 下面 描述中的附图仅仅是本发明的一些实施例, 对于本领域普通技术人员来讲, 在不付出创造性劳动的前提下, 还可以根据这些附图获得其他的附图。
图 1为本发明实施例提供的一种混合内存的数据访问方法流程图; 图 2 为本发明实施例提供的另一种混合内存的数据访问方法流程 图;
图 3为现有技术中存在混合内存的终端设备的结构示意图; 图 4 为本发明实施例提供的存在混合内存的终端设备的结构示意 图;
图 5 为本发明实施例提供的又一种混合内存的数据访问方法流程 图;
图 6为本发明实施例提供的生成预设出错数据的方法示意图; 图 7为本发明实施例提供的地址映射表的示意图;
图 8为本发明实施例提供的一种串接模块结构示意图;
图 9为本发明实施例提供的另一种串接模块结构示意图;
图 10 为本发明实施例提供的一种串接模块中迁移单元结构示意 图;
图 11为本发明实施例提供的一种处理器结构示意图;
图 12为本发明实施例提供的另一种处理器结构示意图。
具体实施方式
下面将结合本发明实施例中的附图, 对本发明实施例中的技术方案进行 清楚、 完整地描述, 显然, 所描述的实施例仅仅是本发明一部分实施例, 而 不是全部的实施例。 基于本发明中的实施例, 本领域普通技术人员在没有做 出创造性劳动前提下所获得的所有其他实施例 , 都属于本发明保护的范围。
现有技术中,存在混合内存的终端设备 10的结构可以如图 1所示, 包括: 处理器 101 , 内存控制器 102 , 存储模块 103 , 所述存储模块 103 包括: DRAM1031 , NVM1032, 即所述存储模块 103为由所述 DRAM1031和所述 NVM1032组成的混合内存, 其中, 内存控制器 102可以与存储模块 103进行 信息交互, 通常的, 单一内存的终端设备中, 内存控制器负责控制内存并且 使内存与 CPU之间交换数据, 而在终端设备 10中, 处理器 101运行的操作 ***需要通过修改代码量来建立和更新页表项中的标志位, 在 DRAM1031不 存在待访问数据时产生缺页中断等等。 在本发明实施例中, 终端设备 20的结构可以如图 2所示, 包括: 处理器 201 , 内存控制器 202, 串接模块 203 ,存储模块 204, 所述存储模块 204包括: DRAM2041 , NVM2042, 其中, 内存控制器 202可以与串接模块 203进行信 息交互, 内存访问仍然使用 DDRx内存同步访问接口, 内存控制器 202的硬 件结构与通常的内存控制器相同。 所述串接模块 203 可以由 FPGA ( Field - Programmable Gate Array, 现场可编程门阵列)或 ASIC ( Application Specific Integrated Circuit , 专用集成电路) 构成, 所述终端设备 20 可以为运行 OS(Operating System, 操作***)的装置, 如服务器, 也可以为虚拟机等等。
本发明实施例提供一种混合内存的数据访问方法, 如图 3 所示, 应用于 串接模块, 包括:
步骤 301、 当待访问数据不在动态随机存取存储器 DRAM中时, 向内存 控制器发送预设出错数据, 以便于所述内存控制器根据所述预设出错数据触 发处理器产生 ECC ( Error Correcting Code, 错误纠正码) 出错中断。
特别的, 所述待访问数据为数据访问请求中访问的数据。 所述串接模块 中的存储有所述预设出错数据的存储空间可以与内核空间存在映射关系。
步骤 302、 在所述处理器对所述 ECC出错中断处理时, 所述串接模块将 位于非易失性存储器 NVM中的所述待访问数据迁移至所述 DRAM中。
示例的, 可以按照所述数据访问请求生成数据迁移请求, 所述数据迁移 请求中请求迁移的数据为所述待访问数据, 具体的, 所述数据访问请求包括 所述待访问数据的物理地址, 串接模块根据所述数据访问请求生成所述数据 迁移请求, 所述数据迁移请求包括所述待访问数据的物理地址, 所述数据迁 移请求还包括所述预设迁移粒度; 根据所述数据迁移请求, 按照预设迁移粒 度可以与 DRAM行緩冲器的粒度相同。 特别的, 在实际应用中, 所述串接模 块中可以设置请求队列, 串接模块首先将所述数据迁移请求添加至所述请求 队列中, 然后按照该请求队列中各个数据迁移请求的顺序依次进行相应数据 的迁移。 这样一来, 在待访问数据不在动态随机存取存储器 DRAM中时, 通过发 送预设出错数据来触发 ECC出错中断,使得在 ECC出错中断时进行待访问数 据的迁移, 利用已有的 ECC处理机制, 无需改变内存控制器的硬件结构, 减 少对对现有的处理器运行的操作***中内存管理部分的重新设计, 降低了代 码修改量, 简化了数据访问过程。
进一步的, 在步骤 301 之前, 还需要建立地址映射表, 所述地址映射表 记录了存储模块中当前位于所述 DRAM中的数据和位于所述 NVM中的数据; 接收所述数据访问请求; 根据所述数据访问请求查询所述地址映射表, 判断 所述待访问数据是否在所述 DRAM中。 特别的, 所述地址映射表还记录了緩 存标志, 所述緩存标志用于标识数据是否位于緩存( Cache )中; 由于 DRAM 的容量比 NVM容量要小, 所以 DRAM用于 NVM的緩存, 即只能存放部分 的 NVM数据。当处理器需要访问 NVM的数据时,需要先将数据放入到 DRAM 中, 而如果 DRAM 中容量已满, 即没有可用空间, 就需要先选择将 DRAM 中的数据替换出来放回 NVM。 所以这时对 DRAM中数据需要一个选择替换 的过程。 而这个緩存标志是用于优化这个选择替换过程的: 位于緩存中的数 据不从 DRAM中替换至 NVM中, 即在所述向内存控制器发送预设出错数据 之前, 还可以查询所述地址映射中的緩存标志, 判断所述待访问数据是否位 于緩存中; 当所述待访问数据位于緩存中,停止将位于所述 NVM中的所述待 访问数据迁移至所述 DRAM中,这样位于緩存中的待访问数据则不从 DRAM 中替换出去。
特别的, 在步骤 302之后, 串接模块还需要接收所述处理器重新发送的 所述数据访问请求; 根据所述数据访问请求查询所述地址映射表, 判断得到 所述待访问数据在所述 DRAM中, 则在所述 DRAM中获取所述待访问数据。 这样整个混合内存的数据访问过程才完成。 本发明实施例提供一种混合内存的数据访问方法, 应用于处理器, 所述 处理器通常为 CPU ( Central Processing Unit, 中央处理器 )如图 2所示, 包括: 步骤 401、接收内存控制器发送的触发消息, 所述触发消息是所述内存控 制器在接收串接模块发送的预设出错数据后发送的, 所述预设出错数据为所 述串接模块在待访问数据不在 DRAM中时发送的。
所述预设出错数据可以为至少存在两位出错的数据。
步骤 402、 根据所述预设出错数据产生 ECC出错中断, 以便于所述串接 模块在所述处理器对所述 ECC 出错中断处理时, 所述串接模块将位于 NVM 中的所述待访问数据迁移至所述 DRAM中。
在所述待访问数据迁移完成之后, 处理器可以重新向所述串接模块发送 所述数据访问请求, 以便于所述串接模块在所述 DRAM中获取所述待访问数 据。
这样一来, 在待访问数据不在动态随机存取存储器 DRAM中时, 通过接 收内存控制器发送的触发消息来触发 ECC 出错中断, 使得串接模块在 ECC 出错中断时进行待访问数据的迁移, 利用已有的 ECC处理机制, 减少对现有 处理器内核中的内存管理部分进行重新设计, 降低了代码修改量, 简化了数 据访问过程。
进一步的, 在步骤 402之前, 处理器可以通过对所述预设出错数据进行 ECC校验, 判断所述预设出错数据的错误模式是否为 ECC出错中断模式, 所 述 ECC出错中断模式与现有的 ECC出错中断模式相同,本发明对此不再赘述。
在本发明实施例中, 终端设备 20中的混合内存的数据访问方法, 如图 5 所示, 包括:
步骤 501、 内存控制器向串接模块发送数据访问请求。 执行步骤 502。 内存控制器的数据访问请求可以是由处理器生成并发送过来, 由内存控 制器直接转发给串接模块的, 也可以是内存控制器根据处理器发送过来的相 关数据请求生成的。 在内存控制器中可以建立请求队列, 将一条或多条所述 数据访问请求存入该数据请求队列, 依次发送给串接模块。
步骤 502、 串接模块判断待访问数据是否在 DRAM中, 当待访问数据在 DRAM中, 执行步骤 508, 当待访问数据不在 DRAM中, 执行步骤 503。 串接模块可以在步骤 501 之前建立地址映射表, 所述地址映射表记录了 存储模块中当前位于所述 DRAM中的数据和位于所述 NVM中的数据。 在接 收到内存控制器发送的数据访问请求后, 根据所述数据访问请求查询所述地 址映射表, 判断所述待访问数据是否在所述 DRAM中。 所述地址映射表可以 设置 In— DRAM字段,用于指示待访问数据是否在 DRAM中,在所述 In— DRAM 字段中可以釆用 1代表待访问数据在 DRAM中, 0代表待访问数据不在 DRAM 中, 而只在 NVM中。
步骤 503、 串接模块向内存控制器发送预设出错数据。 执行步骤 504。 串接模块可以设置存储空间, 所述存储空间存储有预设出错数据, 所述 预设出错数据能够触发 ECC对 ECC出错中断模式的处理,即 ECC出错中断。 当待访问数据不在 DRAM中时,串接模块将数据访问请求重定向到存储空间, 由存储空间向内存控制器发送预设出错数据。 所述串接模块中的存储有所述 预设出错数据的存储空间与内核空间存在映射关系。 示例的, 所述存储空间 可通过使用 ioremap ( 10地址空间重映射)***调用映射到内核空间, 这样可 以保证这段存储空间除了串接模块访问外, 其它部分, 如 OS, 应用等软件等 都不会访问到。 可以在终端设备 40***初始化的时候, 将这段存储空间设置 为存储有预设出错数据的空间, 预设出错数据为至少存在两位出错的数据。 需要说明的是, 内核空间为 Linux***中的一部分特定空间,在 Linux***对 自身进行了划分时, 一部分核心软件独立于普通应用程序, 运行在较高的特 权级别上, 它们驻留在被保护的内存空间上, 拥有访问硬件设备的所有权限, 这样的空间称为内核空间。
可选的, 图 6给出了一个生成预设出错数据的例子, 该预设出错数据存 在 4位出错, 首先, 获取预设数据 A, 对所述预设数据 A进行 ECC运算得到 预设数据 A的 ECC值, 所述预设数据 A的二进制数值的 16位均为 1 , 然后 修改预设数据 A得到错误数据 B, 使得错误数据 B的二进制数值的指定 4个 位置的数据较预设数据 A取反 (由 1变成 0),图 6中将预设数据 A的二进制数 值从右向左数的 9、 13、 15和 16位进行了数据取反, 获取预设数据 A的 ECC 值作为错误数据 B的 ECC值, 即错误数据 B和预设数据 A存在相同的 ECC 值, 但两者二进制数值不同, 最终将错误数据 B的二进制数值和错误数据 B 的 ECC值作为预设出错数据。
步骤 504、 内存控制器向处理器发送触发消息。
通常的, 内存控制器根据接收到的数据计算相应的 ECC值, 然后与读取 的 ECC值进行比较, 通过比较计算得到的 ECC值和读取的 ECC值是否相同 来判断是否出错, 当返回数据中存在 1 位出错时, 内存控制器直接对出错的 位置进行修正, 当返回数据中存在至少两位出错时, 由于内存控制器接收到 预设出错数据, 因此会判断出存在错误, 并向所述处理器发送触发消息, 所 述触发消息包括预设出错数据。
步骤 505、 处理器判断所述预设出错数据的错误模式是否为 ECC出错中 断模式。当所述预设出错数据的错误模式是 ECC出错中断模式,执行步骤 506, 当所述预设出错数据的错误模式不是 ECC出错中断模式, 执行步骤 510。
处理器会对所述触发消息中的预设出错数据进行 ECC校验, 具体的, 先 进行错误模式的判断, 由于内存控制器返回数据中存在至少两位出错, 处理 器产生 ECC出错中断。
本发明实施例中, 为了减少对对现有的处理器运行的操作***的代码修 改量, 处理器对所述预设出错数据同样进行 ECC校验, 但在对返回数据中存 在至少两位出错的 ECC时,可能存在两种结果,一种是 ECC出错为普通出错 模式, 一种是 ECC出错中断模式, 因此需要判断所述预设出错数据的错误模 式是否为 ECC出错中断模式。所述 ECC出错中断模式与所述预设出错数据相 关,示例的,如图 6所示,当预设出错数据由错误数据 B和预设数据 A的 ECC 值组成,当对错误数据 B进行 ECC运算得到如图 6所示的错误数据 B的 ECC 值时, 说明出现了 ECC出错中断模式。
步骤 506、 处理器产生 ECC出错中断。 执行步骤 507。 中。 执行步骤 508。 串接模块可以按照所述数据访问请求生成数据迁移请求, 所述数据迁移 请求中请求迁移的数据为所述待访问数据, 具体的, 所述数据访问请求包括 所述待访问数据的物理地址, 串接模块根据所述数据访问请求生成所述数据 迁移请求, 所述数据迁移请求包括所述待访问数据的物理地址, 所述数据迁 移请求还包括所述预设迁移粒度; 然后根据所述数据迁移请求, 按照预设迁 实际应用中, 所述串接模块中可以设置请求队列, 串接模块首先将所述数据 迁移请求添加至所述请求队列中, 然后按照该请求队列中各个数据迁移请求 的顺序依次进行相应数据的迁移。
需要说明的是, 目前的 DRAM的访问协议中, 发送数据时, 总是先送行 地址,再送列地址。在本发明实施例中,可以选择以 DRAM的行緩冲器(Row Buffer ) 大小作为 NVM到 DRAM迁移的粒度, 这样当待访问数据的行地址 迁移到 DRAM中时, 若串接模块接收到内存控制器发送新的数据访问请求的 行地址时, 便可以直接使用行地址就可以查询地址映射表来查询待访问数据 是否在 DRAM中,如果不在,就可以立即重复步骤 503至步骤 506迁移操作, 询, 从而能够减少部分数据迁移操作带来的时间延迟, 提高数据访问性能。
步骤 508、处理器重新向所述串接模块发送所述数据访问请求。执行步骤
502。
可选的, 串接模块内可以包括第一状态寄存器, 每次发生 ECC出错中断 模式时, 串接模块都将对应指示寄存器的值设置为 1 ; 而这些寄存器可以映射 到内核空间中, 每次 ECC出错中断时, 内存控制器都先去读取这些状态寄存 器, 如果为 1 , 就识别为 ECC出错中断模式; 如果为 0, 就识别为普通出错 模式。 同时串接模块内包括第二状态寄存器, 所述第二状态寄存器指示待访 问数据从 NVM迁移到 DRAM的工作是否完成, 串接模块设置有迁移队列, 串接模块将所述数据迁移请求加入所述迁移队列时, 将状态寄存器设置为 0, 完成待访问数据迁移后,将状态寄存器设置为 1 ;内存控制器查询第二寄存器, 一旦发现第二寄存器的值变为 1 , 表示迁移已经完成, 可以重新发送数据访问 请求。
步骤 509、 串接模块将 DRAM中待访问数据发送给内存控制器。
步骤 510、 处理器执行正常 ECC处理流程。
特别的, 在本发明实施例中, 所述地址映射表还可以记录其他的状态信 息, 如位于緩存中的数据; 在所述步骤 507之后, 串接模块可以查询所述地 址映射表, 将所述位于緩存中的数据中超过预设时限的数据迁移至所述 DRAM中。
示例的, 所述地址映射表可以如图 7所示, ADDR(Address, 地址)代表 物理地址; In— DRAM用于指示数据是否在 DRAM中 , 在所述 In— DRAM字 段中可以釆用 1代表第一数据在 DRAM中, 0代表数据不在 DRAM中, 而只 在 NVM中; 所述地址映射表还记录了緩存标志, 所述緩存标志用于标识数据 是否位于緩存中, 如釆用 In— Cache指示数据是否在緩存中, 串接模块可根据 In— Cache判断是否进行 DRAM中数据的替换; lru为 DRAM中数据的替换指 示; NVM— ADDR则指示数据在 NVM中存放的地址。 当数据从 DRAM被读 入到緩存中的时候, 设置 In— Cache为 1 , 当数据从緩存中被替换至 DRAM中 后, 重置 In— Cache为 0; 对于 DRAM的替换策略, 在本实施例中, 选择在緩 存中且超过预设时限的没被访问的时间最久的一个数据块替换至 DRAM, 即 从 lru位置开始往前找, 找到第一个 In— Cache为 0的数据块从緩存中替换至 DRAM。 所述数据为需要查询的数据或待访问数据。 特别的, 当将位于非易 失性存储器 NVM中的所述待访问数据迁移至所述 DRAM中时, 当 In— Cache 指示所述待访问数据中的部分数据位于緩存中, 则无需将所述部分数据从非 易失性存储器 NVM中迁移至所述 DRAM中, 这样可以减少迁移数据, 简化 数据访问过程。 因此在步骤 503 中串接模块向内存控制器发送预设出错数据 之前, 还可以查询所述地址映射中的緩存标志, 判断所述待访问数据是否位 于緩存中; 当所述待访问数据位于緩存中,停止将位于所述 NVM中的所述待 访问数据迁移至所述 DRAM中。 需要说明的是, 本发明实施例提供的混合内存的数据访问方法步骤的先 后顺序可以进行适当调整, 步骤也可以根据情况进行相应增减, 任何熟悉本 技术领域的技术人员在本发明揭露的技术范围内, 可轻易想到变化的方法, 都应涵盖在本发明的保护范围之内, 因此不再赘述。
本发明实施例中, 在待访问数据不在动态随机存取存储器 DRAM中时, 通过接收预设出错数据来触发 ECC出错中断,使得串接模块在 ECC出错中断 时进行待访问数据的迁移, 利用已有的 ECC处理机制, 无需改变内存控制器 的硬件结构, 减少对对现有的处理器运行的操作***中内存管理部分的重新 设计, 降低了代码修改量, 简化了数据访问过程。 本发明实施例提供一种串接模块 60 , 所述串接模块 60由 FPGA或 ASIC 构成, 如图 8所示, 包括:
发送单元 601 ,用于在待访问数据不在动态随机存取存储器 DRAM中时, 向内存控制器发送预设出错数据, 以便于所述内存控制器根据所述预设出错 数据触发处理器产生 ECC出错中断, 所述待访问数据为数据访问请求中访问 的数据。
迁移单元 602, 用于在所述处理器对所述 ECC出错中断处理时, 所述串 接模块将位于非易失性存储器 NVM中的所述待访问数据迁移至所述 DRAM 中。
这样一来, 在待访问数据不在动态随机存取存储器 DRAM中时, 发送单 元通过发送预设出错数据来触发 ECC出错中断,使得迁移单元在 ECC出错中 断时进行待访问数据的迁移, 利用已有的 ECC处理机制, 无需改变内存控制 器的硬件结构, 减少对对现有的处理器运行的操作***中内存管理部分的重 新设计, 降低了代码修改量, 简化了数据访问过程。
进一步的, 如图 9所示, 所述串接模块 60还包括:
建立单元 603 , 用于在所述向内存控制器发送预设出错数据之前, 建立地 址映射表, 所述地址映射表记录了存储模块中当前位于所述 DRAM中的数据 和位于所述 NVM中的数据, 所述存储模块为由所述 DRAM和所述 NVM组 成的混合内存。
接收单元 604 , 用于接收所述数据访问请求。
判断单元 605 , 用于根据所述数据访问请求查询所述地址映射表, 判断所 述待访问数据是否在所述 DRAM中。
执行单元 606,用于在所述判断单元 604判断得到所述待访问数据在所述 DRAM中时, 则在所述 DRAM中获取所述待访问数据, 在所述判断单元判断 得到所述待访问数据在所述 DRAM中时, 触发所述发送单元 601发送所述预 设出错数据。
所述接收单元 604还用于接收所述处理器重新发送的所述数据访问请求; 所述判断单元 605还用于根据所述数据访问请求查询所述地址映射表, 判断 得到所述待访问数据在所述 DRAM中, 则在所述 DRAM中获取所述待访问 数据。
如图 10所示, 所述迁移单元 602具体包括:
生成子单元 6021 , 用于按照所述数据访问请求生成数据迁移请求, 所述 数据迁移请求中请求迁移的数据为所述待访问数据;
迁移子单元 6022, 用于根据所述数据迁移请求, 按照预设迁移粒度将位 所述数据访问请求包括所述待访问数据的物理地址,
所述生成子单元 6021具体用于: 根据所述数据访问请求生成所述数据迁 移请求, 所述数据迁移请求包括所述待访问数据的物理地址, 所述数据迁移 请求还包括所述预设迁移粒度。
需要说明的是, 所述预设迁移粒度可以与 DRAM行緩冲器的粒度相同。 所述地址映射表还可以记录緩存标志, 所述緩存标志用于标识数据是否位于 緩存中。 所述预设出错数据可以为至少存在两位出错的数据。 由于 DRAM的 容量比 NVM容量要小, 所以 DRAM用于 NVM的緩存, 即只能存放部分的 NVM数据。 当处理器需要访问 NVM的数据时, 需要先将数据放入到 DRAM 中, 而如果 DRAM 中容量已满, 即没有可用空间, 就需要先选择将 DRAM 中的数据替换出来放回 NVM。 所以这时对 DRAM中数据需要一个选择替换 的过程。 而这个緩存标志这是用于优化这个选择替换过程的: 位于緩存中的 数据不从 DRAM 中替换至 NVM中, 即所述迁移单元 602可以用于在选择 DRAM中的数据替换出来放回 NVM时, 需要查询所述用于标识数据是否位 于緩存(Cache ) 中的标志, 如果数据位于緩存中, 则不从 DRAM 中替换出 去。
因此, 所述判断单元 605还用于查询所述地址映射中的緩存标志, 判断 所述待访问数据是否位于緩存中; 所述执行单元 606还用于在所述待访问数 据位于緩存中时, 停止将位于所述 NVM 中的所述待访问数据迁移至所述 DRAM中。
本发明实施例提供的串接模块, 在待访问数据不在动态随机存取存储器 DRAM中时, 发送单元通过发送预设出错数据来触发 ECC出错中断, 使得迁 移单元在 ECC出错中断时进行待访问数据的迁移,利用已有的 ECC处理机制, 无需改变内存控制器的硬件结构, 减少对对现有的处理器运行的操作***中 内存管理部分的重新设计, 降低了代码修改量, 简化了数据访问过程。 本发明实施例提供一种处理器 70, 如图 11所示, 包括:
接收单元 701 , 用于接收内存控制器发送的触发消息, 所述触发消息是所 述内存控制器在接收串接模块发送的预设出错数据后发送的, 所述预设出错 数据为所述串接模块在待访问数据不在 DRAM中时发送的。
处理单元 702, 用于根据所述预设出错数据产生 ECC出错中断, 以便于 所述串接模块在所述处理器对所述 ECC出错中断处理时, 将位于 NVM中的 所述待访问数据迁移至所述 DRAM中。
这样一来, 在待访问数据不在动态随机存取存储器 DRAM中时, 接收单 元通过接收内存控制器发送的触发消息来触发处理单元进行 ECC出错中断, 使得串接模块在 ECC 出错中断时进行待访问数据的迁移, 利用已有的 ECC 处理机制, 减少对现有处理器内核中的内存管理部分进行重新设计, 降低了 代码修改量, 简化了数据访问过程。 进一步的, 如图 12所示, 所述处理器 70还包括:
判断单元 703 , 用于在所述根据所述预设出错数据产生 ECC出错中断之 前, 通过对所述预设出错数据进行 ECC校验, 判断所述预设出错数据的错误 模式是否为 ECC出错中断模式。
发送单元 704, 用于在所述串接模块将位于所述 NVM中的所述待访问数 据迁移至所述 DRAM中之后, 重新向所述串接模块发送所述数据访问请求, 以便于所述串接模块在所述 DRAM中获取所述待访问数据。
特别的, 所述预设出错数据可以为至少存在两位出错的数据。
本发明实施例提供的处理器, 在待访问数据不在动态随机存取存储器 DRAM中时, 接收单元通过接收内存控制器发送的触发消息来触发处理单元 进行 ECC出错中断,使得串接模块在 ECC出错中断时进行待访问数据的迁移, 利用已有的 ECC处理机制, 减少对现有处理器内核中的内存管理部分进行重 新设计, 降低了代码修改量, 简化了数据访问过程。
本发明实施例提供一种终端设备 20, 如图 2所示, 包括: 处理器 201 , 内存控制器 202, 串接模块 203 , 存储模块 204, 所述存储模块 204 包括: DRAM2041 , NVM2042, 其中, 内存控制器 202可以与串接模块 203进行信 息交互, 内存访问仍然使用 DDRx内存同步访问接口, 内存控制器 202的硬 件结构与通常的内存控制器相同。 所述串接模块 203由 FPGA或 ASIC构成, 所述终端设备 20可以为运行 OS(Operating System,操作***)的装置,也可以 为虚拟机等等。
所述串接模块 203 为本发明实施例任意所述的串接模块, 用于在待访问 数据不在动态随机存取存储器 DRAM中时,向内存控制器发送预设出错数据, 以便于所述内存控制器根据所述预设出错数据触发处理器产生错误糾正码 ECC 出错中断, 所述待访问数据为数据访问请求中访问的数据; 在所述处理 器对所述 ECC 出错中断处理时, 所述串接模块将位于非易失性存储器 NVM 中的所述待访问数据迁移至所述 DRAM中。
所述处理器 201 为本发明实施例任意所述的处理器, 用于接收内存控制 器发送的触发消息, 所述触发消息是所述内存控制器在接收串接模块发送的 预设出错数据后发送的, 所述预设出错数据为所述串接模块在待访问数据不 在 DRAM中时发送的; 根据所述预设出错数据产生错误纠正码 ECC出错中 断, 以便于在所述处理器对所述 ECC出错中断处理时, 所述串接模块将位于 NVM中的所述待访问数据迁移至所述 DRAM中。
所属领域的技术人员可以清楚地了解到, 为描述的方便和简洁, 上述描 述的***, 装置和单元的具体工作过程, 可以参考前述方法实施例中的对应 过程, 在此不再赘述。
在本申请所提供的几个实施例中, 应该理解到, 所揭露的***, 装置和 方法, 可以通过其它的方式实现。 例如, 以上所描述的装置实施例仅仅是示 意性的, 例如, 所述单元的划分, 仅仅为一种逻辑功能划分, 实际实现时可 以有另外的划分方式, 例如多个单元或组件可以结合或者可以集成到另一个 ***, 或一些特征可以忽略, 或不执行。 另一点, 所显示或讨论的相互之间 的耦合或直接耦合或通信连接可以是通过一些接口, 装置或单元的间接耦合 或通信连接, 可以是电性, 机械或其它的形式。 为单元显示的部件可以是或者也可以不是物理单元, 即可以位于一个地方, 或者也可以分布到多个网络单元上。 可以根据实际的需要选择其中的部分或 者全部单元来实现本实施例方案的目的。
另外, 在本发明各个实施例中的各功能单元可以集成在一个处理单元中, 也可以是各个单元单独物理包括, 也可以两个或两个以上单元集成在一个单 元中。 上述集成的单元既可以釆用硬件的形式实现, 也可以釆用硬件加软件 功能单元的形式实现。
本领域普通技术人员可以理解: 实现上述方法实施例的全部或部分步骤 可以通过程序指令相关的硬件来完成, 前述的程序可以存储于一计算机可读 取存储介质中, 该程序在执行时, 执行包括上述方法实施例的步骤; 而前述 的存储介质包括: ROM、 RAM, 磁碟或者光盘等各种可以存储程序代码的介 以上所述, 仅为本发明的具体实施方式, 但本发明的保护范围并不局限 于此, 任何熟悉本技术领域的技术人员在本发明揭露的技术范围内, 可轻易 想到变化或替换, 都应涵盖在本发明的保护范围之内。 因此, 本发明的保护 范围应以所述权利要求的保护范围为准。

Claims

权 利 要求 书
1、 一种混合内存的数据访问方法, 应用于串接模块, 其特征在于, 包括:
当待访问数据不在动态随机存取存储器 DRAM中时, 向内存控制器 发送预设出错数据, 以便于所述内存控制器根据所述预设出错数据触发 处理器产生错误纠正码 ECC出错中断, 所述待访问数据为数据访问请求 中访问的数据;
在所述处理器对所述 ECC出错中断处理时, 所述串接模块将位于非 易失性存储器 NVM中的所述待访问数据迁移至所述 DRAM中。
2、 根据权利要求 1所述的方法, 其特征在于, 在所述向内存控制器 发送预设出错数据之前, 所述方法还包括:
建立地址映射表, 所述地址映射表记录了存储模块中当前位于所述 DRAM 中的数据和位于所述 NVM 中的数据, 所述存储模块为由所述 DRAM和所述 NVM组成的混合内存;
接收所述数据访问请求;
根据所述数据访问请求查询所述地址映射表, 判断所述待访问数据 是否在所述 DRAM中;
当所述待访问数据在所述 DRAM中,则在所述 DRAM中获取所述待 访问数据。
3、 根据权利要求 2所述的方法, 其特征在于,
所述将位于 NVM中的所述待访问数据迁移至所述 DRAM中包括: 按照所述数据访问请求生成数据迁移请求, 所述数据迁移请求中请 求迁移的数据为所述待访问数据;
根据所述数据迁移请求,按照预设迁移粒度将位于 NVM中的所述待 访问数据迁移至所述 DRAM中。
4、 根据权利要求 3所述的方法, 其特征在于, 所述数据访问请求包 括所述待访问数据的物理地址,
所述按照所述数据访问请求生成数据迁移请求包括:
根据所述数据访问请求生成所述数据迁移请求, 所述数据迁移请求 包括所述待访问数据的物理地址, 所述数据迁移请求还包括所述预设迁 移粒度。
5、 根据权利要求 3或 4所述的方法, 其特征在于, 所述预设迁移粒度与 DRAM行緩冲器的粒度相同。
6、根据权利要求 2至 5任意一项权利要求所述的方法,其特征在于, 所述地址映射表还记录了緩存标志, 所述緩存标志用于标识数据是否位 于緩存中,
在所述向内存控制器发送预设出错数据之前, 所述方法还包括: 查询所述地址映射中的緩存标志, 判断所述待访问数据是否位于緩 存中;
当所述待访问数据位于緩存中,停止将位于所述 NVM中的所述待访 问数据迁移至所述 DRAM中。
7、根据权利要求 2至 6任意一项权利要求所述的方法,其特征在于, 接收所述处理器重新发送的所述数据访问请求;
根据所述数据访问请求查询所述地址映射表, 判断得到所述待访问 数据在所述 DRAM中, 则在所述 DRAM中获取所述待访问数据。
8、根据权利要求 1至 7任意一项权利要求所述的方法,其特征在于, 所述预设出错数据为至少存在两位出错的数据。
9、 一种混合内存的数据访问方法, 应用于处理器, 其特征在于, 包 括:
接收内存控制器发送的触发消息, 所述触发消息是所述内存控制器 在接收串接模块发送的预设出错数据后发送的, 所述预设出错数据为所 述串接模块在待访问数据不在 DRAM中时发送的;
根据所述预设出错数据产生错误纠正码 ECC出错中断, 以便于在所 述处理器对所述 ECC 出错中断处理时, 所述串接模块将位于 NVM中的 所述待访问数据迁移至所述 DRAM中。
10、 根据权利要求 9 所述的方法, 其特征在于, 在所述根据所述预 设出错数据产生错误糾正码 ECC出错中断之前, 所述方法还包括:
通过对所述预设出错数据进行 ECC校验, 判断所述预设出错数据的 错误模式是否为 ECC出错中断模式。
11、 根据权利要求 9或 10所述的方法, 其特征在于, 在所述串接模 块将位于所述 NVM中的所述待访问数据迁移至所述 DRAM中之后, 所 述方法还包括:
重新向所述串接模块发送所述数据访问请求, 以便于所述串接模块 在所述 DRAM中获取所述待访问数据。
12、 根据权利要求 9至 11任意一项权利要求所述的方法, 其特征在 于, 所述预设出错数据为至少存在两位出错的数据。
13、 一种串接模块, 其特征在于, 包括:
发送单元,用于在待访问数据不在动态随机存取存储器 DRAM中时, 向内存控制器发送预设出错数据, 以便于所述内存控制器根据所述预设 出错数据触发处理器产生错误纠正码 ECC出错中断, 所述待访问数据为 数据访问请求中访问的数据;
迁移单元, 用于在所述处理器对所述 ECC出错中断处理时, 所述迁 移单元将位于非易失性存储器 NVM 中的所述待访问数据迁移至所述 DRAM中。
14、 根据权利要求 13所述的串接模块, 其特征在于, 所述串接模块 还包括:
建立单元, 用于在所述向内存控制器发送预设出错数据之前, 建立 地址映射表, 所述地址映射表记录了存储模块中当前位于所述 DRAM中 的数据和位于所述 NVM中的数据, 所述存储模块为由所述 DRAM和所 述 NVM组成的混合内存;
接收单元, 用于接收所述数据访问请求;
判断单元, 用于根据所述数据访问请求查询所述地址映射表, 判断 所述待访问数据是否在所述 DRAM中;
执行单元, 用于在所述判断单元判断得到所述待访问数据在所述 DRAM中时, 则在所述 DRAM中获取所述待访问数据, 在所述判断单元 判断得到所述待访问数据在所述 DRAM中时, 触发所述发送单元发送所 述预设出错数据。
15、 根据权利要求 14所述的串接模块, 其特征在于, 所述迁移单元 具体包括:
生成子单元, 用于按照所述数据访问请求生成数据迁移请求, 所述 数据迁移请求中请求迁移的数据为所述待访问数据;
迁移子单元, 用于根据所述数据迁移请求, 按照预设迁移粒度将位 于 NVM中的所述待访问数据迁移至所述 DRAM中。
16、 根据权利要求 15所述的串接模块, 其特征在于, 所述数据访问 请求包括所述待访问数据的物理地址,
所述生成子单元具体用于: 根据所述数据访问请求生成所述数据迁移请求, 所述数据迁移请求 包括所述待访问数据的物理地址, 所述数据迁移请求还包括所述预设迁 移粒度。
17、 根据权利要求 15或 16所述的串接模块, 其特征在于, 所述预设迁移粒度与 DRAM行緩冲器的粒度相同。
18、 根据权利要求 14至 17 所述的串接模块, 其特征在于, 所述地 址映射表还记录了緩存标志, 所述緩存标志用于标识数据是否位于緩存 中,
所述判断单元还用于查询所述地址映射中的緩存标志, 判断所述待 访问数据是否位于緩存中;
所述执行单元还用于在所述待访问数据位于緩存中时, 停止将位于 所述 NVM中的所述待访问数据迁移至所述 DRAM中。
19、 根据权利要求 14至 18任意一项权利要求所述的串接模块, 其 特征在于, 包括:
所述接收单元还用于接收所述处理器重新发送的所述数据访问请 求;
所述判断单元还用于根据所述数据访问请求查询所述地址映射表, 判断得到所述待访问数据在所述 DRAM中,则在所述 DRAM中获取所述 待访问数据。
20、 根据权利要求 13 至 19任意一项权利要求所述的串接模块, 其 特征在于, 所述预设出错数据为至少存在两位出错的数据。
21、 一种处理器, 其特征在于, 包括:
接收单元, 用于接收内存控制器发送的触发消息, 所述触发消息是 所述内存控制器在接收串接模块发送的预设出错数据后发送的, 所述预 设出错数据为所述串接模块在待访问数据不在 DRAM中时发送的;
处理单元, 用于根据所述预设出错数据产生错误糾正码 ECC出错中 断, 以便于所述串接模块在所述处理器对所述 ECC出错中断处理时, 将 位于 NVM中的所述待访问数据迁移至所述 DRAM中。
22、 根据权利要求 21所述的处理器, 其特征在于, 所述处理器还包 括:
判断单元, 用于在所述根据所述预设出错数据产生错误糾正码 ECC 出错中断之前, 通过对所述预设出错数据进行 ECC校验, 判断所述预设 出错数据的错误模式是否为 ECC出错中断模式。
23、 根据权利要求 21 或 22所述的处理器, 其特征在于, 所述处理 器还包括:
发送单元,用于在所述串接模块将位于所述 NVM中的所述待访问数 据迁移至所述 DRAM中之后, 重新向所述串接模块发送所述数据访问请 求, 以便于所述串接模块在所述 DRAM中获取所述待访问数据。
24、 根据权利要求 21 至 23任意一项权利要求所述的处理器, 其特 征在于, 所述预设出错数据为至少存在两位出错的数据。
25、 一种终端设备, 其特征在于, 包括:
处理器, 内存控制器, 串接模块, 存储模块, 所述存储模块为由所 述 DRAM和所述 NVM组成的混合内存;
所述串接模块为权利要求 13 至 20任意一项权利要求所述的串接模 块, 用于在待访问数据不在动态随机存取存储器 DRAM中时, 向内存控 制器发送预设出错数据, 以便于所述内存控制器根据所述预设出错数据 触发处理器产生错误纠正码 ECC出错中断, 所述待访问数据为数据访问 请求中访问的数据; 在所述处理器对所述 ECC出错中断处理时, 所述串 接模块将位于非易失性存储器 NVM 中的所述待访问数据迁移至所述 DRAM中;
所述处理器为权利要求 21至 24 任意一项权利要求所述的处理器, 用 于接收内存控制器发送的触发消息, 所述触发消息是所述内存控制器在接 收串接模块发送的预设出错数据后发送的, 所述预设出错数据为所述串接 模块在待访问数据不在 DRAM中时发送的;根据所述预设出错数据产生错 误纠正码 ECC 出错中断, 以便于在所述处理器对所述 ECC 出错中断处理 时,所述串接模块将位于 NVM中的所述待访问数据迁移至所述 DRAM中。
PCT/CN2014/082974 2013-07-25 2014-07-25 混合内存的数据访问方法、模块、处理器及终端设备 WO2015010646A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201310317746.0A CN104346293B (zh) 2013-07-25 2013-07-25 混合内存的数据访问方法、模块、处理器及终端设备
CN201310317746.0 2013-07-25

Publications (1)

Publication Number Publication Date
WO2015010646A1 true WO2015010646A1 (zh) 2015-01-29

Family

ID=52392751

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/082974 WO2015010646A1 (zh) 2013-07-25 2014-07-25 混合内存的数据访问方法、模块、处理器及终端设备

Country Status (2)

Country Link
CN (1) CN104346293B (zh)
WO (1) WO2015010646A1 (zh)

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110059020B (zh) 2015-04-23 2024-01-30 华为技术有限公司 扩展内存的访问方法、设备以及***
CN106326135B (zh) * 2015-06-30 2020-06-02 华为技术有限公司 一种平移非易失性存储器nvm的数据的方法及装置
US20170060434A1 (en) * 2015-08-27 2017-03-02 Samsung Electronics Co., Ltd. Transaction-based hybrid memory module
CN105760220B (zh) * 2016-01-29 2019-05-17 湖南大学 一种基于混合内存的任务与数据调度方法和装置
CN105786717B (zh) * 2016-03-22 2018-11-16 华中科技大学 软硬件协同管理的dram-nvm层次化异构内存访问方法及***
CN107818052B (zh) * 2016-09-13 2020-07-21 华为技术有限公司 内存访问方法及装置
CN106569960B (zh) * 2016-11-08 2019-05-28 郑州云海信息技术有限公司 一种混合主存的末级缓存管理方法
WO2018090255A1 (zh) * 2016-11-16 2018-05-24 华为技术有限公司 内存访问技术
CN110807125B (zh) * 2019-08-03 2020-12-22 北京达佳互联信息技术有限公司 推荐***、数据访问方法及装置、服务器、存储介质
CN110781019B (zh) * 2019-09-03 2023-06-23 惠州市德赛西威汽车电子股份有限公司 一种基于功能安全的汽车仪表设计方法
CN112181712B (zh) * 2020-09-28 2022-02-22 中国人民解放军国防科技大学 一种提高处理器核可靠性的方法及装置

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060004982A1 (en) * 2004-06-30 2006-01-05 Matheny David L System and method for simulating real-mode memory access with access to extended memory
US20100223422A1 (en) * 2005-06-13 2010-09-02 Bonella Randy M Advanced Dynamic Disk Memory Module
CN102439577A (zh) * 2011-10-31 2012-05-02 华为技术有限公司 一种构建内存访问模型的方法及装置
CN102508787A (zh) * 2011-11-29 2012-06-20 清华大学 混合结构内存的内存分配***及方法
CN103092534A (zh) * 2013-02-04 2013-05-08 中国科学院微电子研究所 一种内存结构的调度方法和装置

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060004982A1 (en) * 2004-06-30 2006-01-05 Matheny David L System and method for simulating real-mode memory access with access to extended memory
US20100223422A1 (en) * 2005-06-13 2010-09-02 Bonella Randy M Advanced Dynamic Disk Memory Module
CN102439577A (zh) * 2011-10-31 2012-05-02 华为技术有限公司 一种构建内存访问模型的方法及装置
CN102508787A (zh) * 2011-11-29 2012-06-20 清华大学 混合结构内存的内存分配***及方法
CN103092534A (zh) * 2013-02-04 2013-05-08 中国科学院微电子研究所 一种内存结构的调度方法和装置

Also Published As

Publication number Publication date
CN104346293A (zh) 2015-02-11
CN104346293B (zh) 2017-10-24

Similar Documents

Publication Publication Date Title
WO2015010646A1 (zh) 混合内存的数据访问方法、模块、处理器及终端设备
US20200349100A1 (en) Presentation of direct accessed storage under a logical drive model
US11138143B2 (en) Techniques for command validation for access to a storage device by a remote client
US20160085585A1 (en) Memory System, Method for Processing Memory Access Request and Computer System
US9740439B2 (en) Solid-state storage management
US10223326B2 (en) Direct access persistent memory shared storage
WO2018076793A1 (zh) 一种NVMe数据读写方法及NVMe设备
US10593380B1 (en) Performance monitoring for storage-class memory
US8347050B2 (en) Append-based shared persistent storage
US8645811B2 (en) System and method for selective error checking
US11210020B2 (en) Methods and systems for accessing a memory
US10572402B2 (en) Storage device communicating with host according to multicast communication protocol and communication method of host
TW201237624A (en) Two-level system main memory
US11314635B1 (en) Tracking persistent memory usage
US20190026225A1 (en) Multiple chip multiprocessor cache coherence operation method and multiple chip multiprocessor
KR102107723B1 (ko) 메모리 컨트롤러 및 메모리 컨트롤러의 동작 방법
WO2019090493A1 (zh) 内存块回收方法和装置
AU2015402888B2 (en) Computer device and method for reading/writing data by computer device
WO2016019566A1 (zh) 内存管理方法、装置和***、以及片上网络
US20230244417A1 (en) Storage node, storage device, and network chip
KR20220050177A (ko) 3단의 계층적 메모리 시스템
TW202248862A (zh) 管理記憶體系統的方法以及用於頁面遷移的裝置及系統
US20220187992A1 (en) Systems and methods for data copy offload for storage devices
WO2014206234A1 (zh) 缓存方法及装置
CN116665727B (zh) 写i/o汇聚方法、装置、存储设备和存储介质

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: 14829986

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 14829986

Country of ref document: EP

Kind code of ref document: A1