CN109196473A - Buffer memory management method, cache manager, shared buffer memory and terminal - Google Patents

Buffer memory management method, cache manager, shared buffer memory and terminal Download PDF

Info

Publication number
CN109196473A
CN109196473A CN201780022195.1A CN201780022195A CN109196473A CN 109196473 A CN109196473 A CN 109196473A CN 201780022195 A CN201780022195 A CN 201780022195A CN 109196473 A CN109196473 A CN 109196473A
Authority
CN
China
Prior art keywords
cache
volatibility
data
thread
partitions
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201780022195.1A
Other languages
Chinese (zh)
Other versions
CN109196473B (en
Inventor
宋昆鹏
李艳华
李扬
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Publication of CN109196473A publication Critical patent/CN109196473A/en
Application granted granted Critical
Publication of CN109196473B publication Critical patent/CN109196473B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/0802Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
    • G06F12/0844Multiple simultaneous or quasi-simultaneous cache accessing
    • G06F12/0855Overlapped cache accessing, e.g. pipeline
    • G06F12/0857Overlapped cache accessing, e.g. pipeline by multiple requestors
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/0802Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
    • G06F12/0806Multiuser, multiprocessor or multiprocessing cache systems
    • G06F12/0842Multiuser, multiprocessor or multiprocessing cache systems for multiprocessing or multitasking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/0802Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
    • G06F12/0844Multiple simultaneous or quasi-simultaneous cache accessing
    • G06F12/0846Cache with multiple tag or data arrays being simultaneously accessible
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]

Abstract

A kind of buffer memory management method, cache manager, shared buffer memory and terminal, it is related to technical field of memory, this method is used for cache manager (121), this method comprises: during first thread accesses the first volatibility cache partitions (1211) in volatile memory (122), if first thread needs to be implemented long time-consuming operation, then by the first data backup in the first volatibility cache partitions (1211) to nonvolatile memory (123), the thread of any two volatibility cache partitions (1221) locking is different, each volatibility cache partitions (1221) forbid the different thread accesses of the thread locked from volatibility cache partitions (1221);During first thread executive chairman's time-consuming operation, setting the first volatibility cache partitions (1211) to can be by the state of the thread accesses different from first thread.This method solve the lower problems of the Buffer Utilization of terminal, improve the Buffer Utilization of terminal, can be used for terminal.

Description

Buffer memory management method, cache manager, shared buffer memory and terminal Technical field
This application involves technical field of memory, in particular to a kind of buffer memory management method, cache manager, shared buffer memory and terminal.
Background technique
Processor and volatile memory are provided in terminal.Processor includes multiple processor cores, and each processor core includes multiple threads, and per thread is used to access the data in volatile memory, and data are such as written in volatile memory.Multiple threads in same processor core can share volatile memory, and multiple thread is enabled to access the data in volatile memory simultaneously.
Currently, when a certain data are not visited for a long time, which will be replaced by other data in shared volatile memory.When a certain thread is when executing operation (such as loss of data operation) for needing to take a long time, the data that the thread originally accessed in volatile memory can be since long-time be without accessed, and replaced by the data of other threads, the data contamination of cross-thread occurs.In the related technology, shared volatile memory is divided into several volatibility cache partitions, and different threads is arranged and corresponds to different volatibility cache partitions by the data contamination of cross-thread in order to prevent, that is, a thread can only access the corresponding volatibility cache partitions of the thread.When a certain thread executes the operation taken a long time, the corresponding volatibility cache partitions of the thread are forbidden by other thread accesses, and the data which accesses in corresponding volatibility cache partitions can't be replaced by the data of other threads.
But, when a certain thread executes the operation taken a long time, forbid by other thread accesses the corresponding volatibility cache partitions of a certain thread, and a certain thread does not access the volatibility cache partitions yet at this time, so that the volatibility cache partitions can not be used effectively, therefore, the Buffer Utilization of terminal is lower.
Summary of the invention
Buffer Utilization in order to solve the problems, such as terminal is lower, and this application provides a kind of buffer memory management method, cache manager, shared buffer memory and terminals.The technical solution is as follows:
First aspect, provide a kind of buffer memory management method, shared buffer memory includes volatile memory and nonvolatile storage, the volatile memory includes at least two volatibility cache partitions, the described method includes: first thread is distributed in the first volatibility cache partitions, relevant first data of the first thread are stored on first volatibility cache partitions, the first volatibility cache partitions described in other thread accesses are not allowed during the first thread occupies first volatibility cache partitions, first volatibility cache partitions are the either partition at least two volatibility cache partitions;Judge whether first thread needs to be implemented long delay operation, the long delay operation refers to that operation duration is greater than the operation of preset time threshold, and the first thread does not access first volatibility cache partitions during executing the long delay operation;If the first thread needs to be implemented long delay operation, the nonvolatile memory is written into first data in first volatibility cache partitions, and discharge the first thread to the occupancy of first volatibility cache partitions.
It is exemplary, the buffer memory management method can be used for cache manager, due to during first thread occupies the first volatibility cache partitions, other the first volatibility of thread accesses cache partitions are not allowed, so that other threads can not be when first thread accesses the first volatibility cache partitions, other threads can not access the first volatibility cache partitions, it is therefore prevented that different threads Data between pollute mutually.And in first thread executive chairman's time-consuming operation, write first data into nonvolatile memory, first data are backed up, and first thread is discharged to the occupancy of the first volatibility cache partitions, namely in first thread executive chairman's time-consuming operation, first volatibility cache partitions can be improved the Buffer Utilization of terminal by other thread accesses, therefore.
Optionally, the method also includes: after long delay operation is finished by the first thread, the first thread is distributed to for the second volatibility cache partitions, and second volatibility cache partitions are written into first data in the non-volatile cache device, second volatibility cache partitions are other volatibility cache partitions except the differentiation of first volatibility caching or first volatibility cache partitions.That is, cache manager can restore first data from nonvolatile memory to the first volatibility cache partitions, or the second volatibility cache partitions different from the first volatibility cache partitions after first thread is finished long delay operation.Further, the first data are being restored to the second volatibility cache partitions, cache manager also can indicate that the first thread accesses the second volatibility cache partitions, and continue to access the first data on the second volatibility cache partitions.
Optionally, the nonvolatile storage contains at least two non-volatile cache subregion, it includes: the first non-volatile cache subregion first data in first volatibility cache partitions being written in the nonvolatile memory that the nonvolatile memory, which is written, in first data by first volatibility cache partitions, and the first non-volatile cache subregion is the either partition in at least two non-volatile caches subregion;The method also includes: record the incidence relation of the first thread Yu the first non-volatile cache subregion;Second volatibility cache partitions are written in first data by the non-volatile cache device, it include: that first data in the first non-volatile cache subregion are written by second volatibility cache partitions according to the incidence relation of the first thread and the first non-volatile cache subregion.It that is to say, the either partition in nonvolatile memory can be written in first data by the cache manager from the first volatile cache partitions, and when a certain subregion is written, record the incidence relation of first thread and the first non-volatile cache subregion, in order to when restoring the first data from nonvolatile memory to volatile memory, can determine first data and need the first thread using first data.
Optionally, each volatibility cache partitions lock a thread, and the thread of the locking of volatibility cache partitions described in any two is different, each volatibility cache partitions do not allow by unlocked thread accesses, it is described that first thread is distributed into first volatibility cache partitions, comprising: setting first volatibility cache partitions lock the first thread;Occupancy of the release first thread to first volatibility cache partitions, comprising: release the locking relation of first volatibility cache partitions and the first thread;And/or setting first volatibility cache partitions lock the second thread of the volatile memory to be visited.
That is, when discharging occupancy of the first thread to first volatibility cache partitions, in a first aspect, the locking relation of the first volatibility cache partitions and first thread can be released directly;Second aspect, can be after releasing the locking relation of the first volatibility cache partitions and first thread, and the first volatibility cache partitions of setting lock the second thread, and indicate second the first volatibility of thread accesses cache partitions;The third aspect can directly be arranged the first volatibility cache partitions and lock the second thread, the locking relation of the first volatibility cache partitions and first thread is override, and indicate second the first volatibility of thread accesses cache partitions.Wherein, by the way that the first volatibility cache partitions are locked the second thread, so that the first volatibility cache partitions have by the ability of second thread accesses different from first thread, and, after the first volatibility cache partitions are locked the second thread, second thread is able to access that the first volatibility cache partitions, to realize the effect for improving the Buffer Utilization of terminal.
Optionally, the nonvolatile memory includes at least two non-volatile cache subregions, and at least two volatibility cache partitions couple one by one at least two non-volatile caches subregion, it is described will be in first volatibility cache partitions First data nonvolatile memory is written, comprising: first data are written to the first non-volatile cache subregion being coupled with first volatibility cache partitions.In order to further prevent the data contamination of cross-thread, setting nonvolatile memory also includes multiple non-volatile cache subregions, and so, the data of the multiple threads backed up on nonvolatile memory would not pollute.
Optionally, the method also includes: during being written first data to the first non-volatile cache subregion, record the relevant information of first data, the relevant information of first data includes: the mark of the mark of first volatibility cache partitions, non-volatile memory mark and the first thread, and the non-volatile memory mark is used to indicate storage location of first data in the nonvolatile memory;After the first thread is finished the long time-consuming operation, according to the relevant information of first data, the first thread is distributed into first volatibility cache partitions, and first volatibility cache partitions are written into first data in the first non-volatile cache subregion.Namely, during by the first data backup to nonvolatile memory, the ins and outs for the first data that cache manager is backed up for the ease of understanding, cache manager needs the relevant information by the first data to record, and is restored in subsequent steps according to the relevant information of first data to the first data.
Optionally, the relevant information according to first data, the first thread is distributed into first volatibility cache partitions, and first volatibility cache partitions are written into first data in the first non-volatile cache subregion, it include: to be arranged in the relevant information of first data, first volatibility cache partitions indicated by the mark of first volatibility cache partitions, lock the first thread indicated by the mark of the first thread;By in the relevant information of first data, first non-volatile memory identifies the first data in the first indicated non-volatile cache subregion, and first volatibility cache partitions indicated by the mark to first volatibility cache partitions are written;In the relevant information for indicating first data, the first thread indicated by the mark of the first thread continues to access first volatibility cache partitions indicated by the mark of first volatibility cache partitions.
Optionally, in the relevant information according to first data, the first thread is distributed into first volatibility cache partitions, and by the first non-volatile cache subregion first data be written first volatibility cache partitions before, the method also includes: judge whether first volatibility cache partitions are accessed;The relevant information according to first data, the first thread is distributed into first volatibility cache partitions, and first volatibility cache partitions are written into first data in the first non-volatile cache subregion, it include: when first volatibility cache partitions are not visited, according to the relevant information of first data, the first thread is distributed into first volatibility cache partitions, and first volatibility cache partitions are written into first data in the first non-volatile cache subregion.
Namely, when first thread is finished long time-consuming operation, it may just be accessed by other threads (such as the second thread) on the first volatibility cache partitions, at this time, the loss of data of other threads in order to prevent, when needing that the first volatibility cache partitions is waited to be in idle condition (namely the first volatibility cache partitions are not visited), the access that just can be carried out first thread restores.
Optionally, the method is used for cache manager, the first non-volatile cache subregion includes multiple nonvolatile cache sub-districts, the capacity of each nonvolatile cache sub-district be all larger than or equal to first volatibility cache partitions capacity, it is described that first data are written to the first non-volatile cache subregion being coupled with first volatibility cache partitions, it include: that first data are written into the multiple nonvolatile cache sub-district to the first idle nonvolatile cache sub-district, first data are being written to before the first non-volatile cache subregion being coupled with first volatibility cache partitions, the relevant information of the data of the cache manager record does not include: to be used to indicate idle the non-volatile of nonvolatile cache sub-district to deposit Storage identifies, and the non-volatile memory mark in the relevant information of first data is used to indicate the first nonvolatile cache sub-district;
The relevant information for recording first data, it include: the relevant information that first data are recorded in preset cache list, the relevant information of first data further include: first identifier, the first identifier is used to indicate the long time-consuming operation and has not been executed, and the preset cache list is used to record the relevant information being written to the data of nonvolatile storage;
The method also includes: after the long time-consuming operation is finished by the first thread, by the first identifier in the relevant information of first data of the mark in the preset cache list comprising the first thread, it is changed to second identifier, the second identifier is used to indicate the long time-consuming operation and has been finished;
The relevant information according to first data, the first thread is distributed into first volatibility cache partitions, and first volatibility cache partitions are written into first data in the first non-volatile cache subregion, it include: successively according to the relevant information for including second identifier in the preset cache list, by volatibility cache partitions indicated by the mark of volatibility cache partitions in the relevant information comprising second identifier, distribute to thread indicated by the mark of thread in the relevant information comprising second identifier, and non-volatile memory in the relevant information comprising second identifier is identified to the data in indicated storage location, volatibility cache partitions indicated by the mark of volatibility cache partitions in the write-in relevant information comprising second identifier.
Since the capacity of the first non-volatile cache subregion is greater than the first volatibility cache partitions, therefore, it can allow for the thread of executive chairman's time-consuming operation more during accessing the first volatibility cache partitions, the data of write-in to nonvolatile storage are also more, the thread of access to be restored to the first volatibility cache partitions is also more, access of the thread of long time-consuming operation to the first volatibility cache partitions so cache manager needs successively to restore to be finished.
Optionally, the capacity of first volatibility cache partitions is greater than or equal to the capacity of the first non-volatile cache subregion.
Optionally, in the relevant information according to first data, the first thread is distributed into first volatibility cache partitions, and by the first non-volatile cache subregion first data be written first volatibility cache partitions before, the method also includes: judge second thread writes whether strategy is to write back strategy;If the strategy of writing to write back strategy, will have the data for having modified label to be written in first volatibility cache partitions: memory caches the other memory of cache level that rank is lower than the volatile memory.
It should be noted that the second thread is when data are written into the first volatibility cache partitions, the second thread can be written as the label in each data block in data to have modified label, and the caching in terminal includes the memory of multiple ranks.Before restoring first thread to the access of the first volatibility cache partitions, cache manager is in order to prevent when restoring access of the first thread to the first volatibility cache partitions, lose the data of the second thread, what cache manager can also judge the second thread writes whether strategy is to write back strategy.If the second thread writes strategy to write back strategy, there will be the data for having modified label to be written to: memory or lower than the other memory of the cache level of volatile memory in the first volatibility cache partitions.
Optionally, the relevant information of first data further include: third mark, first data that the third mark is used to indicate on the nonvolatile storage have not been written to first volatibility cache partitions, in the relevant information of instruction first data, the first thread indicated by the mark of the first thread, before continuing to access first volatibility cache partitions indicated by the mark of first volatibility cache partitions, the method also includes: the third mark in the relevant information of first data is changed to the 4th mark, first data that 4th mark is used to indicate on the nonvolatile storage have been written into first volatibility cache partitions.
It should be noted that restoring the first data to the first volatibility cache partitions, cache manager can also will be pre- If cache list in, third in the relevant information of the first data mark is changed to the 4th mark, and the first data that the 4th mark is used to indicate on nonvolatile storage have been written into the first volatibility cache partitions.So, cache manager is after restoring first thread to the access of the first volatibility cache partitions, cache manager can be identified according to the 4th in the relevant information of the first data in the preset cache list, determine that the first data have been restored to the first volatibility cache partitions.And then it executes in the relevant information for restoring next data comprising second identifier, the access of volatibility cache partitions indicated by mark of the thread indicated by the mark of thread to volatibility cache partitions.To prevent cache manager after the first data are restored write-in to the first volatibility cache partitions, write first data into again to the first volatibility cache partitions.
Optionally, the long time-consuming operation is loss of data operation, in the relevant information of instruction first data, the first thread indicated by the mark of the first thread, before continuing to access first volatibility cache partitions indicated by the mark of first volatibility cache partitions, the method also includes: receive the loss data of the first thread transmission;First volatibility cache partitions are written into the loss data.Namely, when the long time-consuming operation that first thread executes is that loss of data operates, before instruction first thread continues to access the first volatibility cache partitions, the cache manager can receive the loss data that the first thread of first thread transmission is found in executive chairman's time-consuming operation, and data will be lost, the first volatibility cache partitions are written, to guarantee after first thread is restored to the access of the first volatibility cache partitions, first thread can normally access the first volatibility cache partitions.
Optionally, first data include: the first data block and the second data block, wherein, data portion in first data block is unrelated with the first thread, data portion in second data block is related to the first thread, the nonvolatile memory is written in first data by first volatibility cache partitions, comprising: the content of the valid data position in first data block and second data block are written to the nonvolatile memory;After the nonvolatile memory is written in first data by first volatibility cache partitions, the method also includes: remove the content of whole valid data positions in first volatibility cache partitions.
It should be noted that the data stored on the first volatibility cache partitions include multiple data blocks, each data block includes: valid data position, label and data portion.When backing up the first data, the only content of backup valid data block (the second data block) and the valid data position in invalid data block (namely first data block), and in order to guarantee that next thread can normally access the first volatibility cache partitions, need to remove the content of whole valid data positions in the first volatibility cache partitions.
Optionally, the long time-consuming operation is the predetermined registration operation for operating duration and being greater than preset duration threshold value, and the predetermined registration operation includes: the operation of at least one of loss of data operation, the operation of access input-output equipment and sleep operation.That is, only in first thread executive chairman's time-consuming operation, and when the long time-consuming operation is predetermined registration operation, just execution is by the step in the first data backup to the first nonvolatile cache sub-district.When the long time-consuming operation is not predetermined registration operation, do not execute the step in the first data backup to the first nonvolatile cache sub-district.
Second aspect provides a kind of cache manager, which includes at least one module, at least one module is for realizing buffer memory management method provided by any optional way of above-mentioned first aspect or first aspect.
The third aspect, provide a kind of cache manager, the cache manager includes: that at least one transmitting module, at least one receiving module, at least one processing module, at least one memory module and at least one bus, storage module by bus are connected with processing module;Processing module is configured as executing the instruction stored in memory module;Processing module is realized by executing instruction: buffer memory management method provided by the possible implementation of any one in above-mentioned first aspect or first aspect.
Fourth aspect provides a kind of shared buffer memory, and the shared buffer memory includes: cache manager, volatile memory and nonvolatile memory, and the cache manager is cache manager described in second aspect or the third aspect;The volatile memory includes at least two volatibility cache partitions.
Optionally, the nonvolatile memory includes at least two non-volatile cache subregions, and at least two volatibility cache partitions couple one by one at least two non-volatile caches subregion.
5th aspect provides a kind of terminal, and the terminal includes: processor and shared buffer memory, and the processor includes at least two threads;The shared buffer memory is shared buffer memory described in fourth aspect.
Technical solution provided by the present application has the benefit that
During first thread occupies the first volatibility cache partitions, other the first volatibility of thread accesses cache partitions are not allowed, so that other threads can not be when first thread accesses the first volatibility cache partitions, other threads can not access the first volatibility cache partitions, it is therefore prevented that pollute mutually between the data of different threads.And in first thread executive chairman's time-consuming operation, write first data into nonvolatile memory, first data are backed up, and first thread is discharged to the occupancy of the first volatibility cache partitions, namely in first thread executive chairman's time-consuming operation, first volatibility cache partitions can be improved the Buffer Utilization of terminal by other thread accesses, therefore.
Detailed description of the invention
Fig. 1 is a kind of structural schematic diagram of terminal provided in an embodiment of the present invention;
Fig. 2 is a kind of partial structural diagram of terminal provided in an embodiment of the present invention;
Fig. 3 is a kind of structural schematic diagram for shared buffer memory that the relevant technologies provide;
Fig. 4 is the structural schematic diagram for another shared buffer memory that the relevant technologies provide;
Fig. 5 is a kind of structural schematic diagram of cache manager provided in an embodiment of the present invention;
Fig. 6 is a kind of method flow diagram of buffer memory management method provided in an embodiment of the present invention;
Fig. 7 is that a kind of cache manager provided in an embodiment of the present invention is restoring first thread to the method flow diagram of the access of the first volatibility cache partitions;
Fig. 8 is that another cache manager provided in an embodiment of the present invention is restoring first thread to the method flow diagram of the access of the first volatibility cache partitions;
Fig. 9 is a kind of structural schematic diagram for ferroelectric nonvolatile trigger that the relevant technologies provide;
Figure 10 is a kind of structural schematic diagram of cache manager provided in an embodiment of the present invention;
Figure 11 is the structural schematic diagram of another cache manager provided in an embodiment of the present invention;
Figure 12 is the structural schematic diagram of another cache manager provided in an embodiment of the present invention;
Figure 13 is the structural schematic diagram of another cache manager provided in an embodiment of the present invention;
Figure 14 be another embodiment of the present invention provides a kind of cache manager structural schematic diagram.
Specific embodiment
To keep the purposes, technical schemes and advantages of the application clearer, the application embodiment is described in further detail below in conjunction with attached drawing.
Fig. 1 is a kind of structural schematic diagram of terminal provided in an embodiment of the present invention, and Fig. 2 is a kind of partial structural diagram of terminal provided in an embodiment of the present invention.Incorporated by reference to Fig. 1 and Fig. 2, terminal 1 includes processor 10, caching (English: Cache) 11, local memory (English: Main Memory) 12.Processor 10 is able to access that the memory (English: storage) of caching 11 and local memory 12 and terminal, it should be noted that the memory of terminal is not showed that in Fig. 1 and Fig. 2.Optionally, terminal is computer, and the memory of terminal is hard disk.
Processor 10 includes at least one processor core 101 (in Fig. 1 by taking processor includes two processor cores 101 as an example), Each processor core 101 includes at least one thread 1011 (for each processor core is including two threads 1011 in Fig. 1).It should be noted that further including register in each processor core 101.It should be noted that processor 10 includes at least two threads 1011, and thread described in the embodiment of the present invention is hardware thread.
Caching 11 is multi-level buffer, when multiple processor cores 101 share certain level cache, or when multiple threads 1011 in a certain processor core 101 share certain level cache (while accessing certain level cache), grade caching is shared buffer memory A, and there are at least one shared buffer memory A in multi-level buffer.For example, multi-level buffer includes: level cache, L2 cache and three-level caching, level cache (English: 1 Cache of level;It referred to as: L1 Cache) is monopolized by some processor core, L2 cache (English: 2 Cache of level;It is shared referred to as: L2 Cache) between multiple processor cores, three-level caching (English: level3 Cache;Referred to as: L3 Cache) shared by all processor cores.In multiline procedure processor, L1 Cache can also be shared by multiple threads in same processor core.
It should be noted that the caching 11 in the practical scene of the embodiment of the present invention includes shared buffer memory A, the number for accessing the thread of shared buffer memory A is greater than or equal to two.Therefore, when processor 10 includes a processor core 101, which includes multiple threads 1011;When each processor core 101 includes a thread 1011, which includes at least two processor cores 101.
Referring to FIG. 2, shared buffer memory A includes: cache manager 121, volatile memory 122 and nonvolatile memory (English: Non-Volatile Memory;Referred to as: NVM) 123.It cache manager 121 and volatile memory 122, nonvolatile memory 123 and shares multiple threads of the shared buffer memory where the cache manager and is connected, cache manager 121 is for managing multiple thread accesses shared buffer memories.
Exemplary, volatile memory 122 is static random access memory (English: Static RandomAccess Memory;Referred to as: SRAM), NVM 123 is flash memory (English: Flash EEPROM;Referred to as: Flash), phase transition storage (English: Phase Change Memory;Referred to as: PCM), spin-torque switched-reluctance storage memory (English: Spin Transfer Torque Magnetoresistive Random Access Memory;Referred to as: STT-MRAM) or ferro-electric random access memory body is (English: Ferroelectric RandomAccess Memory;Referred to as: FeRAM) etc..Wherein, PCM is to realize the non-volatile of storage in crystalline state and amorphous different conductive characteristics using phase-change material, STT-MRAM is to realize magnetic memory using the tunnel-effect being exaggerated, have the characteristics that density is high, access time is short, power consumption is low and non-volatile, FRAM is the non-volatile memory characteristic realized using the bistable state polarization characteristic of ferroelectric thin film.
In the related technology, when a certain data in shared buffer memory are not visited for a long time, which will be replaced by other data.When a certain thread is when executing operation (such as loss of data operation) for needing to take a long time, the data that the thread originally accessed in shared buffer memory can be since long-time be without accessed, and replaced by the data of other threads, the data contamination of cross-thread occurs.Shared buffer memory is divided into several volatibility cache partitions by the data contamination of cross-thread in order to prevent, and different threads is arranged and corresponds to different volatibility cache partitions, that is, a thread can only access the corresponding volatibility cache partitions of the thread.When a certain thread executes the operation taken a long time, the corresponding volatibility cache partitions of the thread are forbidden by other thread accesses, and the data which accesses in corresponding volatibility cache partitions can't be replaced by the data of other threads.
Fig. 3 is a kind of structural schematic diagram for shared buffer memory that the relevant technologies provide, Fig. 4 is the structural schematic diagram for another shared buffer memory that the relevant technologies provide, wherein, shared buffer memory 11 is divided into two volatibility cache partitions B1 according to the road (English: way) in shared buffer memory B in Fig. 3, one of volatibility cache partitions B1 includes the corresponding storage region of a road (road 1), another volatibility cache partitions B1 includes the corresponding storage region of three roads (road 2, road 3 and road 4). Shared buffer memory B is divided into two volatibility cache partitions B2 according to the row (English: row) in shared buffer memory B in Fig. 4, one of volatibility cache partitions B2 includes row 1 to the corresponding storage region of row m, another volatibility cache partitions B2 includes row m+1 to the corresponding storage region of row x, m is the integer greater than 1 and less than x, and row x is the last one row in shared buffer memory B.When thread 1 and thread 2 share shared buffer memory B, which is able to access that in the volatibility cache partitions B1 or Fig. 4 in Fig. 3 including the corresponding storage region in a road to include volatibility cache partitions B2 of the row 1 to the corresponding storage region of row m;Thread 2 is able to access that in the volatibility cache partitions B1 or Fig. 4 in Fig. 3 including the corresponding storage region in three roads to include volatibility cache partitions B2 of the row m+1 to the corresponding storage region of row x.But, when a certain thread executes the operation taken a long time, forbid by other thread accesses the corresponding volatibility cache partitions of a certain thread, and a certain thread does not access the volatibility cache partitions yet at this time, so that the volatibility cache partitions can not be used effectively, therefore, the Buffer Utilization of processor is lower, and the performance of processor is poor.
Please continue to refer to Fig. 2, the pollution of inter-thread data in order to prevent, volatile memory 122 in the embodiment of the present invention is also divided into multiple volatibility cache partitions 1221 (in Fig. 2 by taking volatile memory includes two volatibility cache partitions 1221 as an example), such as obtains multiple volatibility cache partitions 1221 according to the road in volatile memory or division of going.Each volatibility cache partitions 1221 in multiple volatibility cache partitions 1221 lock a thread, and the thread that any two volatibility cache partitions 1221 lock is different, and the capacity of any two volatibility cache partitions 1221 may be the same or different.Optionally, nonvolatile memory 123 in the embodiment of the present invention is also divided into the multiple non-volatile cache subregions 1231 coupled with volatibility cache partitions (in Fig. 2 by taking nonvolatile memory includes two non-volatile cache subregions as an example), and each non-volatile cache subregion and a non-volatile cache subarea management, the non-volatile cache subregion of any two volatibility cache partitions coupling are different.
Fig. 5 is a kind of structural schematic diagram of cache manager 121 provided in an embodiment of the present invention, the cache manager 121 includes: at least one transmitting module 1211, at least one receiving module 1212, at least one processing module 1213, at least one memory module 1214, and at least one bus 1215, transmitting module, receiving module, processing module, storage module by bus are connected.Processing module 1213 is for executing the executable module stored in memory module 1214, such as computer program.In some embodiments, memory module 1214 stores program 12141, and program 12141 being capable of the execution of module 1213 processed.
Fig. 6 is a kind of method flow diagram of buffer memory management method provided in an embodiment of the present invention, which can execute program 12141 by the processing module 1213 in Fig. 5 to realize for the cache manager 121 in Fig. 2, the buffer memory management method.
It should be noted that, first volatibility cache partitions are the either partition at least two volatibility cache partitions in volatile memory, first non-volatile cache subregion is coupled with the first volatibility cache partitions in nonvolatile memory, and in the embodiment shown in fig. 6, first non-volatile cache subregion includes multiple nonvolatile cache sub-districts, the capacity of each nonvolatile cache sub-district be all larger than or equal to the first volatibility cache partitions capacity, the capacity of the first non-volatile cache subregion is greater than the capacity of the first volatibility cache partitions.
As shown in fig. 6, the buffer memory management method includes:
First thread is distributed in first volatibility cache partitions by step 601.
Cache manager is for managing access of multiple threads to shared buffer memory, and shared buffer memory includes volatile memory and nonvolatile memory, and volatile memory includes multiple volatibility cache partitions.Access volatile storage is being required to compared with multithreading When device, cache manager can this compared with filtering out multiple threads in multithreading, and multiple volatibility cache partitions are locked to one thread of the multiple threads screened namely the locking of each volatibility cache partitions one by one, and the thread of any two volatibility cache partitions locking is different.In step 601, the first volatibility cache partitions can be distributed to first thread by cache manager, and the first volatibility cache partitions are also locked first thread.
Then, cache manager would indicate that the volatibility cache partitions of the access locking of the per thread in multiple threads.Such as: cache manager can send access instruction to per thread, and access instruction includes the mark of the volatibility cache partitions of the thread locked, and thread just accesses to the volatibility cache partitions of locking according to access instruction after receiving access instruction.At this time, per thread in multiple thread is merely capable of the volatibility cache partitions of access locking, and other volatibility cache partitions can not be accessed, namely during first thread occupies the first volatibility cache partitions, cache manager does not allow other the first volatibility of thread accesses cache partitions, thus it is guaranteed that the pollution of the data of cross-thread will not occur in multiple thread accesses volatile memory.
Further, cache manager is after the thread for determining each volatibility cache partitions locking, locking list as shown in Table 1 can be established, which is used to record the mark of the mark of each volatibility cache partitions and the thread of each volatibility cache partitions locking.If volatibility cache partitions C1 and thread F1 is locked, volatibility cache partitions C2 and thread F2 are locked, and volatibility cache partitions C3 and thread F3 are locked, and volatibility cache partitions C4 and thread F4 are locked, and volatibility cache partitions C5 and thread F5 are locked.Locking list is carried out it should be noted that being only exemplary in table 1 for example, locking list can be different from table 1, and the embodiment of the present invention is not construed as limiting this in practical application.
Table 1
Volatibility cache partitions Thread
C1 F1
C2 F2
C3 F3
C4 F4
C5 F5
Step 602 judges whether the first thread needs to be implemented long time-consuming operation.If first thread needs to be implemented long time-consuming operation, 603 are thened follow the steps;If first thread does not need executive chairman's time-consuming operation, 602 are thened follow the steps.
During first thread accesses the first volatibility cache partitions, first thread can read the data stored on the first volatibility cache partitions, alternatively, the data stored on the first volatibility cache partitions of modification.When first thread needs to be implemented long time-consuming operation, which can receive the long time-consuming operation instruction of first thread transmission, and cache manager can indicate to determine that the first thread needs to be implemented long time-consuming operation according to the long time-consuming operation.Exemplary, long time-consuming operation is the operation for operating duration and being greater than preset duration threshold value, and first thread does not access the first volatibility cache partitions during executive chairman's delay operation;Optionally, which is 100 times of the clock cycle of terminal, and long time-consuming operation is loss of data processing (English: Cache Missing) or access input and output (English: In/Out;Referred to as: the I/O) operation of equipment.
Nonvolatile memory is written in the first data relevant to first thread in first volatibility cache partitions by step 603.
Cache manager is when determining that first thread needs to be implemented long time-consuming operation, cache manager just can determine that first thread can not access the first volatibility cache partitions in longer period at this time, and cache manager can also be by the first data backup relevant to first thread stored on the first volatibility cache partitions to nonvolatile memory.It should be noted that non-volatile Property memory also include multiple non-volatile cache subregions, and multiple non-volatile cache subregions are coupled with multiple volatibility cache partitions, and the non-volatile cache subregion of any two volatibility cache partitions coupling is different.When cache manager is needed the first data backup to nonvolatile memory, the cache manager can directly determine the first non-volatile cache subregion being coupled with the first volatibility cache partitions, and by first data backup to the first non-volatile cache subregion.
It should be noted that the ins and outs for the first data that cache manager is backed up for the ease of understanding, cache manager can record the relevant information of the first data during by the first data backup to nonvolatile memory.Exemplary, the relevant information of the first data includes: the mark of the mark of the first volatibility cache partitions, non-volatile memory mark and first thread, and non-volatile memory mark is used to indicate storage location of first data in nonvolatile memory.Optionally, the relevant information of first data further include: long time-consuming operation executes status indicator and data restore mark, and the long time-consuming operation executes status indicator are as follows: is used to indicate the first identifier that long time-consuming operation has not been executed, which restores mark are as follows: is used to indicate data and is written not from nonvolatile memory to the third mark of the first volatibility cache partitions.
Further, it is preset with cache list on cache manager, which is used to record the relevant information being written to the data of nonvolatile storage.For cache manager when recording the relevant information of the first data, the cache list is written in the relevant information of first data by cache manager.Optionally, the cache list is as shown in table 2, and the relevant information of first data includes: the mark (C1) of the first volatibility cache partitions, non-volatile memory mark (F1M1), the mark (W1) of first thread, first identifier (0) and the second identifier (0) for being used to indicate the first nonvolatile cache sub-district in the first non-volatile cache subregion.The relevant information of third data is also recorded in the cache list, the third data are to be stored in data relevant to third thread on third volatibility cache partitions, and in third thread executive chairman's time-consuming operation, nonvolatile cache sub-district of the cache manager by third data backup into third non-volatile cache subregion.The relevant information of the third data includes: the mark (C3) of third volatibility cache partitions, non-volatile memory mark (F3M1), the mark (W3) of third thread, first identifier (0) and the second identifier (0) for being used to indicate nonvolatile cache sub-district in third non-volatile cache subregion.
Table 2
It is exemplary, cache manager can be according to the relevant information of the data of record, an idle nonvolatile cache sub-district is chosen in multiple nonvolatile cache sub-districts of the first non-volatile cache subregion (before writing first data into duty nonvolatile memory, in the relevant information of the data of cache manager record and not comprising the non-volatile memory for the nonvolatile cache sub-district for being used to indicate free time mark) as the first nonvolatile cache sub-district, and write first data into the first nonvolatile cache sub-district idle into multiple nonvolatile cache sub-districts of the first non-volatile cache subregion, and increase the non-volatile memory mark for being used to indicate the first nonvolatile cache sub-district in the relevant information of the first data.
It should be noted that the data stored on the first volatibility cache partitions include multiple data blocks, each data block includes: valid data position, label and data portion.It is exemplary, the first data stored on first volatibility cache partitions include: the first data block and the second data block, wherein, data block is also referred to as Cache Line, data portion in first data block is unrelated with first thread, and the data portion that the valid data position in the first data block is used to indicate first data block is unrelated with first thread;Data portion in second data block is related to first thread, and the data portion that the valid data position in the second data block is used to indicate in second data block is related to first thread.Such as: the content of the valid data position in the first data block be " 0 ", second The content of valid data position in data block is " 1 ".Optionally, for cache manager when by the first data backup to nonvolatile memory, the content of the valid data position in the first data block and the second data block can be backed up to the first non-volatile cache subregion by cache manager.After by the first data backup to the first non-volatile cache subregion, cache manager also needs to remove the content of whole valid data positions in the first volatibility cache partitions.Namely, when backing up the first data, cache manager only backs up the content of valid data block (the second data block) and the valid data position in invalid data block (namely first data block), and in order to guarantee that next thread can normally access the first volatibility cache partitions, cache manager needs to remove the content of whole valid data positions in the first volatibility cache partitions.
Optionally, first thread is sent in the long time-consuming operation instruction of cache manager: the mark of long time-consuming operation, cache manager is after receiving long time-consuming operation instruction, it can determine whether the long time-consuming operation is predetermined registration operation according to the mark of the long time-consuming operation in the long time-consuming operation instruction, optionally, predetermined registration operation includes the operation of at least one of loss of data operation, the operation of access input-output equipment and sleep operation.When the long time-consuming operation is predetermined registration operation, cache manager just executes release first thread to the occupancy of the first volatibility cache partitions, and writes first data into the step in the first nonvolatile cache sub-district.When the long time-consuming operation is not predetermined registration operation, cache manager does not execute release first thread to the occupancy of the first volatibility cache partitions, and the step of writing first data into step in the first nonvolatile cache sub-district.
In addition, in the embodiment of the present invention, cache manager is by the first data backup to nonvolatile memory, when shared buffer memory powers off suddenly, the first data being stored on nonvolatile memory will not lose, and therefore, can further prevent the loss of the first data.
It should be noted that, in the embodiment of the present invention, in order to which the first data guaranteed on the first volatibility cache partitions can successfully back up to the first nonvolatile cache sub-district, then need to guarantee that the capacity of the first nonvolatile cache sub-district is greater than or equal to the capacity of the first volatibility cache partitions.Optionally, in order to effectively be utilized to the memory space in shared buffer memory, the capacity that the first nonvolatile cache sub-district can be set is equal to the capacity of the first volatibility cache partitions.
Step 604, the second thread that the first volatibility cache partitions are distributed to volatile memory to be visited.
Before step 604, first volatibility cache partitions lock always first thread, namely the first volatibility cache partitions only allow to be accessed by first thread before step 604, during first thread executive chairman's time-consuming operation, which does not access the first volatibility cache partitions.Therefore, cache manager can discharge first thread to the occupancy of the first volatibility cache partitions in step 604, first volatibility cache partitions are set as to be had by the state of the thread accesses different from first thread, namely the first volatibility cache partitions of setting by the ability of the thread accesses different from first thread.It should be noted that, cache manager be arranged the first volatibility cache partitions be can be by the state of other thread accesses when, cache manager can directly be arranged the first volatibility cache partitions and lock the second thread, and the locking relation of the first volatibility cache partitions and first thread is override (namely mode of step 604).Optionally, cache manager can also directly release the locking relation of the first volatibility cache partitions and first thread;Or, cache manager can also directly release the locking relation of the first volatibility cache partitions and first thread, and after releasing the locking relation of the first volatibility cache partitions and first thread, first volatibility cache partitions are set and lock the second thread, and indicate second the first volatibility of thread accesses cache partitions.
Exemplary, cache manager has screened multiple threads before step 604 in the more thread for needing to access volatile memory, and multiple thread includes first thread.In step 604, cache manager this compared with a thread is screened in the thread not being screened in multithreading again as the second thread.Cache manager can be arranged the first volatibility cache partitions and lock the second thread, so that the second thread is able to access that the first volatibility cache partitions.
As shown in table 1, when the first volatibility cache partitions are volatibility cache partitions C1, and first thread is thread F1, as shown in table 3, cache manager locks the first volatibility cache partitions (volatibility cache partitions F1) in step 604 Second thread (C6).
Table 3
Volatibility cache partitions Thread
C6 F1
C2 F2
C3 F3
C4 F4
C5 F5
Further, after the second thread is distributed in the first volatibility cache partitions, cache manager can also indicate second the first volatibility of thread accesses cache partitions of volatile memory to be visited.
It should be noted that cache manager can also be executed such as the similar method of method in step 602 to step 604 during second thread accesses the first volatibility cache partitions.Namely, if the second thread is also required to executive chairman's time-consuming operation, then the second data relevant to the second thread that cache manager can will also store on the first volatibility cache partitions, the second nonvolatile cache sub-district idle into the first non-volatile cache subregion is written, and during being written the second data to the second nonvolatile cache sub-district, the relevant information of the second data is recorded.Then, the first volatibility cache partitions can also be locked to another thread (not being first thread, nor the second thread) by cache manager, and indicate another the first volatibility of thread accesses cache partitions, be looped back and forth like this.Cache manager can record the relevant information of the second data in preset cache list, as shown in table 4, the relevant information of second data may include: the mark (C1) of the first volatibility cache partitions, the non-volatile memory mark (F1M2) for being used to indicate the second nonvolatile cache sub-district in the first non-volatile cache subregion, the mark (W2) of the second thread, first identifier (0) and third mark (0).
Table 4
Step 605, after first thread is finished long time-consuming operation, first thread is distributed into the first volatibility cache partitions, and the first volatibility cache partitions are written into the first data in nonvolatile memory.
After first thread is finished long time-consuming operation, cache manager needs to restore access of the first thread to the first volatibility cache partitions.But, since the first non-volatile cache subregion includes multiple nonvolatile cache sub-districts in the embodiment of the present invention, and the capacity of each nonvolatile cache sub-district is all larger than or is equal to the first volatibility cache partitions, therefore, the thread of executive chairman's time-consuming operation is more during accessing the first volatibility cache partitions, the data of write-in to nonvolatile storage are more, the thread of access to be restored to the first volatibility cache partitions is also more, access of the thread of long time-consuming operation to the first volatibility cache partitions so cache manager needs successively to restore to be finished.
It should be noted that, after first thread is finished long time-consuming operation, the first thread sends long time-consuming operation to cache manager and is finished instruction, in order to which cache manager is finished instruction according to the long time-consuming operation, by include in preset cache list first thread mark relevant information in first identifier be changed to second identifier.Wherein, second mark Knowledge is used to indicate long time-consuming operation and has been finished, at this point, it is second identifier that the long time-consuming operation being somebody's turn to do in the relevant information of the mark comprising first thread, which executes status indicator,.Exemplary, as shown in table 5, the long time-consuming operation in the relevant information of the mark (W1) comprising first thread can be executed status indicator by cache manager, be changed to second identifier (1) by first identifier (0).Further, if the second thread is also by chance finished long time-consuming operation at this time, then the long time-consuming operation in the relevant information of the mark (W2) comprising the second thread can also be executed status indicator by cache manager, be changed to second identifier (1) by first identifier (0).
Table 5
It is exemplary, cache manager is according to preset cache list, successively according to relevant information (such as relevant information of the first data in preset cache list including second identifier, the relevant information of second data), by volatibility cache partitions indicated by the mark of volatibility cache partitions in the relevant information comprising second identifier, distribute to thread indicated by the mark of thread in the relevant information comprising second identifier, and non-volatile memory in the relevant information comprising second identifier is identified to the data in indicated storage location, volatibility cache partitions indicated by mark of the write-in comprising volatibility cache partitions in the relevant information of second identifier.Namely successively restore comprising second identifier it is data cached in, the access of volatibility cache partitions indicated by mark of the thread indicated by the mark of thread to volatibility cache partitions.
Exemplary, Fig. 7 shows a kind of cache manager and is restoring the first access modules to the method flow diagram of the access of the first volatile memory cells, as shown in fig. 7, this method comprises:
Step 6051a, judge whether the first volatibility cache partitions are accessed.If the first volatibility cache partitions are accessed, 6051a is thened follow the steps;If the first volatibility cache partitions are not visited, 6052a is thened follow the steps.
After first thread is finished long time-consuming operation, cache manager needs to first determine whether the first volatibility cache partitions are being accessed, if the first volatibility cache partitions are being accessed, then cache manager continues to execute step 6051a, continues to judge whether the first volatibility cache partitions are being accessed.If the first volatibility cache partitions be not it is accessed, cache manager needs to be implemented step 6052a.
Namely, when first thread is finished long time-consuming operation, it may just be accessed by other threads (such as the second thread) on the first volatibility cache partitions, at this time, the loss of data of other threads in order to prevent, when needing that the first volatibility cache partitions is waited to be in idle condition (namely the first volatibility cache partitions are not visited), the access that just can be carried out first thread restores.It should be noted that the first volatibility cache partitions are in idle condition after the access to the first volatibility cache partitions is completed in other threads, alternatively, the first volatibility cache partitions are also at idle state during other threads executive chairman's time-consuming operation.
Step 6052a, according to the relevant information of the first data, first thread is distributed into the first volatibility cache partitions.Execute step 6053a.
Cache manager can be from the relevant information of the first data, read the mark of the first volatibility cache partitions and the mark of first thread, and then determine the first volatibility cache partitions and first thread, and the first volatibility cache partitions are set and lock first thread (as shown in table 1), first thread is also distributed into the first volatibility cache partitions.
Step 6053a, according to the relevant information of the first data, the first data on nonvolatile memory are written to the first volatibility cache partitions.
Cache manager can be from the relevant information of the first data, read non-volatile memory mark, and then determine the first indicated nonvolatile cache sub-district of non-volatile memory mark, and the first data stored in the first nonvolatile cache sub-district are obtained, and first data are written to the first volatibility cache partitions.Further, when writing first data into the first volatibility cache partitions, also only the first volatibility cache partitions can be written in the content of the valid data position in invalid data block and valid data block by cache manager.
It is writing first data into the first volatibility cache partitions, which also can indicate that in the relevant information of the first data, and first thread indicated by the mark of thread continues to access the first volatibility cache partitions.
It should be noted that, first data are being restored to the first volatibility cache partitions, cache manager will also be in preset cache list, third mark in the relevant information of first data is changed to the 4th mark, and the first data that the 4th mark is used to indicate on nonvolatile storage have been written into the first volatibility cache partitions.So, cache manager is in the step 6053a that is finished, namely after restoring first thread to the access of the first volatibility cache partitions, cache manager can be identified according to the 4th in the relevant information of the first data in the preset cache list, determine that the first data have been restored to the first volatibility cache partitions.And then it executes in the relevant information for restoring next data comprising second identifier, the access of volatibility cache partitions indicated by mark of the thread indicated by the mark of thread to volatibility cache partitions.To prevent cache manager writing first data into the first volatibility cache partitions, write first data into again to the first volatibility cache partitions.
Further, when the long time-consuming operation that first thread executes is loss of data operation (English: Cache missing), before step 6053a, the cache manager can receive the loss data that the first thread of first thread transmission is found in executive chairman's time-consuming operation, and after step 6053a, data will be lost, the first volatibility cache partitions are written, to guarantee after first thread is restored to the access of the first volatibility cache partitions, first thread can normally access the first volatibility cache partitions.
It should be noted that, when in embodiment shown in fig. 6, first non-volatile cache subregion does not include multiple nonvolatile cache sub-districts, and when the capacity of the first non-volatile cache subregion is greater than or equal to the capacity of the first volatibility cache partitions, embodiment shown in fig. 6 can occur to change as follows:
First, cache manager writes first data into the first non-volatile cache subregion into nonvolatile memory in step 603, and non-volatile memory mark is used to indicate the mark of the first non-volatile cache subregion in the relevant information of the first data of cache manager record.Further, since the first non-volatile cache subregion does not include multiple nonvolatile cache sub-districts, the first non-volatile cache subregion is merely capable of the data relevant to a thread stored on the first volatibility cache partitions of write-in, therefore, it is not multiple for needing to write data into the number of the thread of nonvolatile memory when accessing the first volatibility cache partitions, so the relevant information of the first data does not include that long time-consuming operation executes status indicator.
Secondly, during second thread accesses the first volatibility cache partitions, cache manager is not necessarily to execute the similar method of method in step 602 to step 604, namely when the second thread is also required to executive chairman's time-consuming operation, cache manager is without executing any movement.
Finally, when executing step 605, after first thread is finished long time-consuming operation, cache manager is without judging whether the first volatibility cache partitions are being accessed, but directly stop access of second thread to the first volatibility cache partitions, and first thread is distributed into the first volatibility cache partitions, and the first volatibility cache partitions are written into the first data in nonvolatile memory, restore access of the first thread to the first volatibility cache partitions.
Optionally, the capacity that the first non-volatile cache subregion is arranged in order to effectively be utilized to the memory space in shared buffer memory, in the embodiment of the present invention is equal to the capacity of the first volatibility cache partitions.
Exemplary, Fig. 8 shows another cache manager and is restoring first thread to the method flow diagram of the access of the first volatibility cache partitions, as shown in figure 8, this method comprises:
Step 6051b, according to the relevant information of the first data, first thread is distributed into the first volatibility cache partitions.
Cache manager is after determining that first thread is finished long time-consuming operation, cache manager can be directly according to the mark of first thread, determine the relevant information of the first data comprising the first thread, and from the relevant information of the first data, read the mark of the first volatibility cache partitions and the mark of first thread, and then determine the first volatibility cache partitions and first thread, and the first volatibility cache partitions are set and lock first thread, first thread is distributed into the first volatibility cache partitions.At this point, the second thread is not locked with the first volatibility cache partitions, the second thread can not access the first volatibility cache partitions.
Further, when data are written into the first volatibility cache partitions, the second thread is written as the label in each data block in data to have modified label the second thread, and the caching in terminal includes the memory of multiple ranks.Before restoring first thread to the access of the first volatibility cache partitions, namely before executing step 6051b, cache manager is in order to prevent when restoring access of the first thread to the first volatibility cache partitions, the data of the second thread are lost, cache manager also judges whether writing tactful for the second thread is to write back (English: Write Back) strategy.If the second thread writes strategy to write back strategy, will have in the first volatibility cache partitions and modify the data backup of label extremely: memory (English: Main Memory) or lower than the other memory of the cache level of volatile memory.
Step 6052b, according to the relevant information of the first data, the first data on nonvolatile memory are written to the first volatibility cache partitions.
Cache manager restores the specific steps of the first data in step 6052b, and with reference to the specific steps in the step 6053a in embodiment illustrated in fig. 7, the embodiment of the present invention does not repeat them here this.
Optionally, in step 605, second volatibility cache partitions can also be distributed to first thread by cache manager, and the second volatibility cache partitions are written into the first data in non-volatile cache device, the second volatibility cache partitions are other volatibility cache partitions except the differentiation of the first volatibility caching or the first volatibility cache partitions.That is, cache manager first data can be written from nonvolatile memory to the first volatibility cache partitions or the second volatibility cache partitions different from the first volatibility cache partitions after first thread is finished long delay operation.Further, it is writing first data into the second volatibility cache partitions, cache manager also can indicate that the first thread accesses the second volatibility cache partitions, and continue to access the first data on the second volatibility cache partitions.
Optionally, nonvolatile storage contains at least two non-volatile cache subregion, when at least two non-volatile cache subregions are not coupled at least two volatibility cache partitions one by one, the first non-volatile cache subregion in nonvolatile memory can be written in the first data in the first volatibility cache partitions by cache manager in step 602, the incidence relation of first thread and the first non-volatile cache subregion is recorded, the first non-volatile cache subregion is the either partition at least two non-volatile cache subregions.The second volatibility cache partitions can be distributed to first thread by cache manager in step 605, and according to the incidence relation of first thread and the first non-volatile cache subregion, the second volatibility cache partitions are written into the first data in the first non-volatile cache subregion.It that is to say, the either partition in nonvolatile memory can be written in first data by the cache manager from the first volatile cache partitions, and when a certain subregion is written, record the incidence relation of first thread and the first non-volatile cache subregion, in order to when restoring the first data from nonvolatile memory to volatile memory, can determine first data and need the first thread using first data.
In order to prevent in a sudden situation, loss of data in volatile memory, ferroelectric nonvolatile trigger as shown in Figure 9 is devised in the related technology, which includes: ferroelectric nonvolatile part and complementary metal oxide semiconductor (English: Complementary Metal Oxide Semiconductor;Referred to as: CMOS) volatile part.Signal input part Din, signal output end Dout, inversion signal output end are provided on ferroelectric nonvolatile partClock signal input terminal Clk and inverting clock signal output endWhen ferroelectric nonvolatile trigger works normally, COMS volatile part work in ferroelectric nonvolatile trigger, when there are emergency situations, ferroelectric nonvolatile trigger can generate the first signal RW, second signal PL and third signal PCH according to certain timing, and the data on COMS volatile part is made to backup to ferroelectric nonvolatile part.But in the related technology not when thread needs to be implemented long time-consuming operation, backed up using data of the non-volatile portions to thread.
In summary, due in buffer memory management method provided in an embodiment of the present invention, during first thread occupies the first volatibility cache partitions, other the first volatibility of thread accesses cache partitions are not allowed, so that other threads can not be when first thread accesses the first volatibility cache partitions, other threads can not access the first volatibility cache partitions, it is therefore prevented that pollute mutually between the data of different threads.And in first thread executive chairman's time-consuming operation, write first data into nonvolatile memory, first data are backed up, and first thread is discharged to the occupancy of the first volatibility cache partitions, namely in first thread executive chairman's time-consuming operation, first volatibility cache partitions can be improved the Buffer Utilization of terminal by other thread accesses, therefore.
Figure 10 is a kind of structural schematic diagram of cache manager provided in an embodiment of the present invention, which can be the cache manager in Fig. 2, and as shown in Figure 10, which includes:
Distribution module 1001, for first thread to be distributed in the first volatibility cache partitions, the first data relevant to first thread are stored on first volatibility cache partitions, other the first volatibility of thread accesses cache partitions are not allowed during first thread occupies the first volatibility cache partitions, the first volatibility cache partitions are the either partition at least two volatibility cache partitions;
First judgment module 1002, for judging whether first thread needs to be implemented long delay operation, long delay operation refers to that operation duration is greater than the operation of preset time threshold, and first thread does not access the first volatibility cache partitions during executive chairman's delay operation;
First writing module 1003, for nonvolatile memory being written in the first data in the first volatibility cache partitions, and discharge first thread to the occupancy of the first volatibility cache partitions when first thread needs to be implemented long delay operation.
In summary, a kind of cache manager provided in an embodiment of the present invention, due to during first thread occupies the first volatibility cache partitions, other the first volatibility of thread accesses cache partitions are not allowed, so that other threads can not be when first thread accesses the first volatibility cache partitions, other threads can not access the first volatibility cache partitions, it is therefore prevented that pollute mutually between the data of different threads.And in first thread executive chairman's time-consuming operation, first writing module 1003 writes first data into nonvolatile memory, first data are backed up, and first thread is discharged to the occupancy of the first volatibility cache partitions, namely in first thread executive chairman's time-consuming operation, first volatibility cache partitions can be improved the Buffer Utilization of terminal by other thread accesses, therefore.
Optionally, each volatibility cache partitions lock a thread, and the thread of any two volatibility cache partitions locking is different, and each volatibility cache partitions do not allow by unlocked thread accesses,
Distribution module 1001 is also used to: the first volatibility cache partitions of setting lock first thread;
First writing module 1003 is also used to:
Release the locking relation of the first volatibility cache partitions and first thread;
And/or
The second thread that first volatibility cache partitions lock volatile memory to be visited is set.
Optionally, nonvolatile memory includes at least two non-volatile cache subregions, and at least two volatibility cache partitions couple one by one at least two non-volatile cache subregions, and the first writing module 1003 is also used to:
It writes first data into the first non-volatile cache subregion being coupled with the first volatibility cache partitions.
Figure 11 is the structural schematic diagram of another cache manager provided in an embodiment of the present invention, as shown in figure 11, on the basis of Figure 10, the cache manager 100 further include:
Logging modle 1004, for during writing first data into the first non-volatile cache subregion, record the relevant information of the first data, the relevant information of first data includes: the mark of the mark of the first volatibility cache partitions, non-volatile memory mark and first thread, and non-volatile memory mark is used to indicate storage location of first data in nonvolatile memory;
Second writing module 1005, for after first thread is finished long time-consuming operation, according to the relevant information of the first data, first thread is distributed into the first volatibility cache partitions, and the first volatibility cache partitions are written into the first data in the first non-volatile cache subregion.
Optionally, the second writing module 1005 is also used to: in the relevant information of the first data of setting, the first volatibility cache partitions, lock first thread indicated by the mark of first thread indicated by the mark of the first volatibility cache partitions;By in the relevant information of the first data, the first non-volatile memory identifies the first data in the first indicated non-volatile cache subregion, and the first volatibility cache partitions indicated by the mark to the first volatibility cache partitions are written;In the relevant information for indicating the first data, first thread indicated by the mark of first thread continues to access the first volatibility cache partitions indicated by the mark of the first volatibility cache partitions.
Figure 12 is the structural schematic diagram of another cache manager provided in an embodiment of the present invention, as shown in figure 12, on the basis of Figure 11, the cache manager 100 further include:
Second judgment module 1006, for judging whether the first volatibility cache partitions are accessed;
Second writing module 1005 is also used to: when the first volatibility cache partitions are not visited, according to the relevant information of the first data, first thread is distributed into first volatibility cache partitions, and the first volatibility cache partitions are written into the first data in the first non-volatile cache subregion.
Optionally, the first non-volatile cache subregion includes multiple nonvolatile cache sub-districts, the capacity of each nonvolatile cache sub-district be all larger than or equal to the first volatibility cache partitions capacity,
First writing module 1003 is also used to: writing first data into multiple nonvolatile cache sub-districts the first idle nonvolatile cache sub-district, it is writing first data into before the first non-volatile cache subregion being coupled with the first volatibility cache partitions, the relevant information of the data of cache manager record does not include: to be used to indicate the non-volatile memory mark of idle nonvolatile cache sub-district, and the non-volatile memory mark in the relevant information of the first data is used to indicate the first nonvolatile cache sub-district;
Logging modle 1004 is also used to: the relevant information of the first data is recorded in preset cache list, the relevant information of first data further include: first identifier, first identifier is used to indicate long time-consuming operation and has not been executed, and preset cache list is used to record the relevant information being written to the data of nonvolatile storage;
Figure 13 is the structural schematic diagram of another cache manager provided in an embodiment of the present invention, as shown in figure 13, on the basis of Figure 12, the cache manager 100 further include: the first change module 1007, for after long time-consuming operation is finished by first thread, by the first identifier in the relevant information of the first data of the mark in preset cache list comprising first thread, it is changed to second identifier, second identifier is used to indicate long time-consuming operation and has been finished;
Second writing module 1005 is also used to: successively according to the relevant information in preset cache list including second identifier, by volatibility cache partitions indicated by the mark of volatibility cache partitions in the relevant information comprising second identifier, distribute to thread indicated by the mark of thread in the relevant information comprising second identifier, and by the data in the indicated storage location of non-volatile memory mark in the relevant information comprising second identifier, write-in includes volatibility cache partitions indicated by the mark of volatibility cache partitions in the relevant information of second identifier.
Optionally, Figure 14 be another embodiment of the present invention provides a kind of cache manager structural schematic diagram, as shown in figure 14, on the basis of Figure 11, the cache manager 100 further include:
Third judgment module 1008 writes whether strategy is to write back strategy for judge the second thread;
Third writing module 1009, for that will have the data for having modified label to be written in the first volatibility cache partitions when writing strategy to write back strategy: memory caches the other memory of cache level that rank is lower than volatile memory.
Optionally, the capacity of the first volatibility cache partitions is greater than or equal to the capacity of the first non-volatile cache subregion.
Optionally, the relevant information of first data further include: third mark, the first data that third mark is used to indicate on nonvolatile storage have not been written to the first volatibility cache partitions, cache manager shown in Figure 11 further include: the second change module 10010, for the third mark in the relevant information of the first data to be changed to the 4th mark, the first data that the 4th mark is used to indicate on nonvolatile storage are had been written into the first volatibility cache partitions.
Optionally, long time-consuming operation is loss of data operation, cache manager shown in Figure 11 further include: receiving module 10011, for receiving the loss data of first thread transmission;
The first volatibility cache partitions are written for that will lose data in 4th writing module 10012.
Optionally, first data include: the first data block and the second data block, wherein, data portion in first data block is unrelated with first thread, data portion in second data block is related to first thread, and the first writing module 1003 is also used to: the content of the valid data position in the first data block and the second data block are written to nonvolatile memory;
Cache manager shown in Figure 11 to Figure 14 is any further includes removing module (Figure 11 to Figure 14 is not shown), for removing the content of whole valid data positions in the first volatibility cache partitions.
Optionally, long time-consuming operation is the predetermined registration operation for operating duration and being greater than preset duration threshold value, and predetermined registration operation includes: the operation of at least one of loss of data operation, the operation of access input-output equipment and sleep operation.
In summary, a kind of cache manager provided in an embodiment of the present invention, due to during first thread occupies the first volatibility cache partitions, other the first volatibility of thread accesses cache partitions are not allowed, so that other threads can not be when first thread accesses the first volatibility cache partitions, other threads can not access the first volatibility cache partitions, it is therefore prevented that pollute mutually between the data of different threads.And in first thread executive chairman's time-consuming operation, first writing module writes first data into nonvolatile memory, first data are backed up, and first thread is discharged to the occupancy of the first volatibility cache partitions, namely in first thread executive chairman's time-consuming operation, first volatibility cache partitions can be improved the Buffer Utilization of terminal by other thread accesses, therefore.
It should be noted that embodiment of the method provided by the present application can mutually be referred to corresponding apparatus embodiments, the application is not limited this.The sequencing of embodiment of the method step provided by the present application is able to carry out appropriate adjustment; step also according to circumstances can accordingly be increased and decreased; anyone skilled in the art is within the technical scope of the present application; the method that variation can be readily occurred in; it should all cover within the scope of protection of this application, therefore repeat no more.
The sequencing of buffer memory management method step provided by the present application can carry out appropriate adjustment, and step according to circumstances can also accordingly be increased and decreased, and anyone skilled in the art within the technical scope of the present application, can readily occur in The method of variation should all cover within the scope of protection of this application, therefore repeat no more.
Those of ordinary skill in the art will appreciate that realizing that all or part of the steps of above-described embodiment may be implemented by hardware, relevant hardware can also be instructed to complete by program, the program can store in a kind of computer readable storage medium, storage medium mentioned above can be read-only memory, disk or CD etc..
The foregoing is merely the alternative embodiments of the application, and not to limit the application, within the spirit and principles of this application, any modification, equivalent replacement, improvement and so on be should be included within the scope of protection of this application.

Claims (25)

  1. A kind of buffer memory management method, which is characterized in that shared buffer memory includes volatile memory and nonvolatile storage, and the volatile memory includes at least two volatibility cache partitions, which comprises
    First thread is distributed into first volatibility cache partitions, relevant first data of the first thread are stored on first volatibility cache partitions, the first volatibility cache partitions described in other thread accesses are not allowed during the first thread occupies first volatibility cache partitions, first volatibility cache partitions are the either partition at least two volatibility cache partitions;
    Judge whether first thread needs to be implemented long delay operation, the long delay operation refers to that operation duration is greater than the operation of preset time threshold, and the first thread does not access first volatibility cache partitions during executing the long delay operation;
    If the first thread needs to be implemented long delay operation, the nonvolatile memory is written into first data in first volatibility cache partitions, and discharge the first thread to the occupancy of first volatibility cache partitions.
  2. According to the method for claim 1, it is characterized in that, each volatibility cache partitions lock a thread, and the thread of the locking of volatibility cache partitions described in any two is different, each volatibility cache partitions do not allow by unlocked thread accesses
    It is described that first thread is distributed into first volatibility cache partitions, comprising: setting first volatibility cache partitions lock the first thread;
    Occupancy of the release first thread to first volatibility cache partitions, comprising: release the locking relation of first volatibility cache partitions and the first thread;And/or setting first volatibility cache partitions lock the second thread of the volatile memory to be visited.
  3. According to the method for claim 2, it is characterized in that, the nonvolatile memory includes at least two non-volatile cache subregions, at least two volatibility cache partitions couple one by one at least two non-volatile caches subregion, the nonvolatile memory is written in first data by first volatibility cache partitions, comprising:
    First data are written to the first non-volatile cache subregion being coupled with first volatibility cache partitions.
  4. According to the method described in claim 3, it is characterized in that, the method also includes:
    During being written first data to the first non-volatile cache subregion, record the relevant information of first data, the relevant information of first data includes: the mark of the mark of first volatibility cache partitions, non-volatile memory mark and the first thread, and the non-volatile memory mark is used to indicate storage location of first data in the nonvolatile memory;
    After the first thread is finished the long time-consuming operation, according to the relevant information of first data, the first thread is distributed into first volatibility cache partitions, and first volatibility cache partitions are written into first data in the first non-volatile cache subregion.
  5. According to the method for claim 4, it is characterized in that, the relevant information according to first data, the first thread is distributed into first volatibility cache partitions, and first volatibility cache partitions are written into first data in the first non-volatile cache subregion, comprising:
    It is arranged in the relevant information of first data, first volatibility cache partitions indicated by the mark of first volatibility cache partitions lock the first thread indicated by the mark of the first thread;
    By in the relevant information of first data, first non-volatile memory identifies the first data in the first indicated non-volatile cache subregion, and first volatibility cache partitions indicated by the mark to first volatibility cache partitions are written;
    In the relevant information for indicating first data, the first thread indicated by the mark of the first thread continues to access first volatibility cache partitions indicated by the mark of first volatibility cache partitions.
  6. According to the method described in claim 5, it is characterized in that,
    In the relevant information according to first data, the first thread is distributed into first volatibility cache partitions, and by the first non-volatile cache subregion first data be written first volatibility cache partitions before, the method also includes:
    Judge whether first volatibility cache partitions are accessed;
    First volatibility cache partitions are distributed to the first thread, and first volatibility cache partitions are written in first data in the first non-volatile cache subregion by the relevant information according to first data, comprising:
    When first volatibility cache partitions are not visited, according to the relevant information of first data, the first thread is distributed into first volatibility cache partitions, and first volatibility cache partitions are written into first data in the first non-volatile cache subregion.
  7. According to the method for claim 6, it is characterized in that, the method is used for cache manager, the first non-volatile cache subregion includes multiple nonvolatile cache sub-districts, the capacity of each nonvolatile cache sub-district be all larger than or equal to first volatibility cache partitions capacity
    It is described that first data are written to the first non-volatile cache subregion being coupled with first volatibility cache partitions, it include: that first data are written into the multiple nonvolatile cache sub-district to the first idle nonvolatile cache sub-district, first data are being written to before the first non-volatile cache subregion being coupled with first volatibility cache partitions, the relevant information of the data of the cache manager record does not include: to be used to indicate the non-volatile memory mark of idle nonvolatile cache sub-district, non-volatile memory mark in the relevant information of first data is used to indicate the first nonvolatile cache sub-district;
    The relevant information for recording first data, it include: the relevant information that first data are recorded in preset cache list, the relevant information of first data further include: first identifier, the first identifier is used to indicate the long time-consuming operation and has not been executed, and the preset cache list is used to record the relevant information being written to the data of nonvolatile storage;
    The method also includes: after the long time-consuming operation is finished by the first thread, by the first identifier in the relevant information of first data of the mark in the preset cache list comprising the first thread, it is changed to second identifier, the second identifier is used to indicate the long time-consuming operation and has been finished;
    The relevant information according to first data, the first thread is distributed into first volatibility cache partitions, and first volatibility cache partitions are written into first data in the first non-volatile cache subregion, it include: successively according to the relevant information for including second identifier in the preset cache list, by volatibility cache partitions indicated by the mark of volatibility cache partitions in the relevant information comprising second identifier, distribute to thread indicated by the mark of thread in the relevant information comprising second identifier, and non-volatile memory in the relevant information comprising second identifier is identified to the data in indicated storage location, volatibility indicated by the mark of volatibility cache partitions in the write-in relevant information comprising second identifier Cache partitions.
  8. Method according to claim 4 or 5, it is characterized in that, in the relevant information according to first data, the first thread is distributed into first volatibility cache partitions, and by the first non-volatile cache subregion first data be written first volatibility cache partitions before, the method also includes:
    Judge second thread writes whether strategy is to write back strategy;
    If the strategy of writing to write back strategy, will have the data for having modified label to be written in first volatibility cache partitions: memory caches the other memory of cache level that rank is lower than the volatile memory.
  9. According to the method described in claim 5, it is characterized in that, the relevant information of first data further include: third mark, first data that the third mark is used to indicate on the nonvolatile storage have not been written to first volatibility cache partitions,
    In the relevant information of instruction first data, the first thread indicated by the mark of the first thread, before continuing to access first volatibility cache partitions indicated by the mark of first volatibility cache partitions, the method also includes:
    Third mark in the relevant information of first data is changed to the 4th mark, first data that the 4th mark is used to indicate on the nonvolatile storage have been written into first volatibility cache partitions.
  10. According to the method for claim 5, it is characterized in that, the long time-consuming operation is loss of data operation, in the relevant information of instruction first data, the first thread indicated by the mark of the first thread, before continuing to access first volatibility cache partitions indicated by the mark of first volatibility cache partitions, the method also includes:
    Receive the loss data that the first thread is sent;
    First volatibility cache partitions are written into the loss data.
  11. Method according to any one of claims 1 to 7, which is characterized in that
    First data include: the first data block and the second data block, wherein and the data portion in first data block is unrelated with the first thread, and the data portion in second data block is related to the first thread,
    The nonvolatile memory is written in first data by first volatibility cache partitions, comprising:
    The content of valid data position in first data block and second data block are written to the nonvolatile memory;
    After the nonvolatile memory is written in first data by first volatibility cache partitions, the method also includes:
    Remove the content of whole valid data positions in first volatibility cache partitions.
  12. A kind of cache manager, which is characterized in that shared buffer memory includes volatile memory and nonvolatile storage, and the volatile memory includes at least two volatibility cache partitions, and the cache manager includes:
    Distribution module, for first thread to be distributed in the first volatibility cache partitions, relevant first data of the first thread are stored on first volatibility cache partitions, the first volatibility cache partitions described in other thread accesses are not allowed during the first thread occupies first volatibility cache partitions, first volatibility cache partitions are at least two volatibility Either partition in cache partitions;
    First judgment module, for judging whether first thread needs to be implemented long delay operation, the long delay operation refers to that operation duration is greater than the operation of preset time threshold, and the first thread does not access first volatibility cache partitions during executing the long delay operation;
    First writing module, for when the first thread needs to be implemented long delay operation, the nonvolatile memory is written into first data in first volatibility cache partitions, and discharges the first thread to the occupancy of first volatibility cache partitions.
  13. Cache manager according to claim 12, it is characterized in that, each volatibility cache partitions lock a thread, and the thread of the locking of volatibility cache partitions described in any two is different, each volatibility cache partitions do not allow by unlocked thread accesses
    The distribution module is also used to: setting first volatibility cache partitions lock the first thread;
    First writing module is also used to: releasing the locking relation of first volatibility cache partitions and the first thread;And/or setting first volatibility cache partitions lock the second thread of the volatile memory to be visited.
  14. Cache manager according to claim 13, it is characterized in that, the nonvolatile memory includes at least two non-volatile cache subregions, and at least two volatibility cache partitions couple one by one at least two non-volatile caches subregion, and first writing module is also used to:
    First data are written to the first non-volatile cache subregion being coupled with first volatibility cache partitions.
  15. Cache manager according to claim 14, which is characterized in that the cache manager further include:
    Logging modle, for during being written first data to the first non-volatile cache subregion, record the relevant information of first data, the relevant information of first data includes: the mark of the mark of first volatibility cache partitions, non-volatile memory mark and the first thread, and the non-volatile memory mark is used to indicate storage location of first data in the nonvolatile memory;
    Second writing module, for after the first thread is finished the long time-consuming operation, according to the relevant information of first data, the first thread is distributed into first volatibility cache partitions, and first volatibility cache partitions are written into first data in the first non-volatile cache subregion.
  16. Cache manager according to claim 15, which is characterized in that second writing module is also used to:
    It is arranged in the relevant information of first data, first volatibility cache partitions indicated by the mark of first volatibility cache partitions lock the first thread indicated by the mark of the first thread;
    By in the relevant information of first data, first non-volatile memory identifies the first data in the first indicated non-volatile cache subregion, and first volatibility cache partitions indicated by the mark to first volatibility cache partitions are written;
    In the relevant information for indicating first data, the first thread indicated by the mark of the first thread continues to access first volatibility cache partitions indicated by the mark of first volatibility cache partitions.
  17. Cache manager according to claim 16, which is characterized in that
    The cache manager further include:
    Second judgment module, for judging whether first volatibility cache partitions are accessed;
    Second writing module is also used to:
    When first volatibility cache partitions are not visited, according to the relevant information of first data, the first thread is distributed into first volatibility cache partitions, and first volatibility cache partitions are written into first data in the first non-volatile cache subregion.
  18. Cache manager according to claim 17, which is characterized in that the first non-volatile cache subregion includes multiple nonvolatile cache sub-districts, the capacity of each nonvolatile cache sub-district be all larger than or equal to first volatibility cache partitions capacity,
    First writing module is also used to: first data are written into the multiple nonvolatile cache sub-district to the first idle nonvolatile cache sub-district, first data are being written to before the first non-volatile cache subregion being coupled with first volatibility cache partitions, the relevant information of the data of the cache manager record does not include: to be used to indicate the non-volatile memory mark of idle nonvolatile cache sub-district, and the non-volatile memory mark in the relevant information of first data is used to indicate the first nonvolatile cache sub-district;
    The logging modle is also used to: the relevant information of first data is recorded in preset cache list, the relevant information of first data further include: first identifier, the first identifier is used to indicate the long time-consuming operation and has not been executed, and the preset cache list is used to record the relevant information being written to the data of nonvolatile storage;
    The cache manager further includes the first change module, for after the long time-consuming operation is finished by the first thread, by the first identifier in the relevant information of first data of the mark in the preset cache list comprising the first thread, it is changed to second identifier, the second identifier is used to indicate the long time-consuming operation and has been finished;
    Second writing module is also used to: successively according to the relevant information in the preset cache list including second identifier, by volatibility cache partitions indicated by the mark of volatibility cache partitions in the relevant information comprising second identifier, distribute to thread indicated by the mark of thread in the relevant information comprising second identifier, and non-volatile memory in the relevant information comprising second identifier is identified to the data in indicated storage location, volatibility cache partitions indicated by the mark of volatibility cache partitions in the write-in relevant information comprising second identifier.
  19. Cache manager according to claim 15 or 16, which is characterized in that the cache manager further include:
    Third judgment module writes whether strategy is to write back strategy for judge second thread;
    Third writing module, for it is described write strategy for write back strategy when, will in first volatibility cache partitions have modified label data write-in: memory or caching rank be lower than the volatile memory the other memory of cache level.
  20. Cache manager according to claim 16, it is characterized in that, the relevant information of first data further include: third mark, first data that the third mark is used to indicate on the nonvolatile storage have not been written to first volatibility cache partitions, the cache manager further include:
    Second change module, for the third mark in the relevant information of first data to be changed to the 4th mark, first data that the 4th mark is used to indicate on the nonvolatile storage are had been written into first volatibility cache partitions.
  21. Cache manager according to claim 16, which is characterized in that the long time-consuming operation is loss of data operation, The cache manager further include:
    Receiving module, the loss data sent for receiving the first thread;
    4th writing module, for first volatibility cache partitions to be written in the loss data.
  22. 2 to 18 any cache manager according to claim 1, which is characterized in that
    First data include: the first data block and the second data block, wherein and the data portion in first data block is unrelated with the first thread, and the data portion in second data block is related to the first thread,
    First writing module is also used to: the content of the valid data position in first data block and second data block are written to the nonvolatile memory;
    The cache manager further includes removing module, for removing the content of whole valid data positions in first volatibility cache partitions.
  23. A kind of shared buffer memory, which is characterized in that the shared buffer memory includes: cache manager, volatile memory and nonvolatile memory,
    The cache manager is any cache manager of claim 12 to 22;The volatile memory includes at least two volatibility cache partitions.
  24. Shared buffer memory according to claim 23, which is characterized in that
    The nonvolatile memory includes at least two non-volatile cache subregions, and at least two volatibility cache partitions couple one by one at least two non-volatile caches subregion.
  25. A kind of terminal, which is characterized in that the terminal includes: processor and shared buffer memory,
    The processor includes at least two threads;
    The shared buffer memory is shared buffer memory described in claim 23 or 24.
CN201780022195.1A 2017-02-28 2017-02-28 Cache management method, cache manager, shared cache and terminal Active CN109196473B (en)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2017/075132 WO2018157278A1 (en) 2017-02-28 2017-02-28 Cache management method, cache manager, shared cache and terminal

Publications (2)

Publication Number Publication Date
CN109196473A true CN109196473A (en) 2019-01-11
CN109196473B CN109196473B (en) 2021-10-01

Family

ID=63369730

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201780022195.1A Active CN109196473B (en) 2017-02-28 2017-02-28 Cache management method, cache manager, shared cache and terminal

Country Status (2)

Country Link
CN (1) CN109196473B (en)
WO (1) WO2018157278A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110941449A (en) * 2019-11-15 2020-03-31 新华三半导体技术有限公司 Cache block processing method and device and processor chip
CN113849455A (en) * 2021-09-28 2021-12-28 致真存储(北京)科技有限公司 MCU based on hybrid memory and data caching method
CN114629748A (en) * 2022-04-01 2022-06-14 日立楼宇技术(广州)有限公司 Building data processing method, edge gateway of building and storage medium

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113596038B (en) * 2021-08-02 2023-04-07 武汉绿色网络信息服务有限责任公司 Data packet parsing method and server

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6728959B1 (en) * 1995-08-08 2004-04-27 Novell, Inc. Method and apparatus for strong affinity multiprocessor scheduling
CN101499028A (en) * 2009-03-18 2009-08-05 成都市华为赛门铁克科技有限公司 Data protection method and apparatus based on non-volatile memory
CN101697198A (en) * 2009-10-28 2010-04-21 浪潮电子信息产业股份有限公司 Method for dynamically regulating number of active processors in single computer system
CN103744623A (en) * 2014-01-10 2014-04-23 浪潮电子信息产业股份有限公司 Method for realizing intelligent degradation of data cached in SSD (Solid State Disk) of storage system
CN104881324A (en) * 2014-09-28 2015-09-02 北京匡恩网络科技有限责任公司 Memory management method in multi-thread environment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6728959B1 (en) * 1995-08-08 2004-04-27 Novell, Inc. Method and apparatus for strong affinity multiprocessor scheduling
CN101499028A (en) * 2009-03-18 2009-08-05 成都市华为赛门铁克科技有限公司 Data protection method and apparatus based on non-volatile memory
CN101697198A (en) * 2009-10-28 2010-04-21 浪潮电子信息产业股份有限公司 Method for dynamically regulating number of active processors in single computer system
CN103744623A (en) * 2014-01-10 2014-04-23 浪潮电子信息产业股份有限公司 Method for realizing intelligent degradation of data cached in SSD (Solid State Disk) of storage system
CN104881324A (en) * 2014-09-28 2015-09-02 北京匡恩网络科技有限责任公司 Memory management method in multi-thread environment

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110941449A (en) * 2019-11-15 2020-03-31 新华三半导体技术有限公司 Cache block processing method and device and processor chip
CN113849455A (en) * 2021-09-28 2021-12-28 致真存储(北京)科技有限公司 MCU based on hybrid memory and data caching method
CN113849455B (en) * 2021-09-28 2023-09-29 致真存储(北京)科技有限公司 MCU based on hybrid memory and data caching method
CN114629748A (en) * 2022-04-01 2022-06-14 日立楼宇技术(广州)有限公司 Building data processing method, edge gateway of building and storage medium
CN114629748B (en) * 2022-04-01 2023-08-15 日立楼宇技术(广州)有限公司 Building data processing method, building edge gateway and storage medium

Also Published As

Publication number Publication date
WO2018157278A1 (en) 2018-09-07
CN109196473B (en) 2021-10-01

Similar Documents

Publication Publication Date Title
CN111164566B (en) Nonvolatile memory system with host side command injection
CN109196473A (en) Buffer memory management method, cache manager, shared buffer memory and terminal
US10635355B1 (en) Bandwidth limiting in solid state drives
US9927999B1 (en) Trim management in solid state drives
KR20210001898A (en) Zone formation for zoned namespaces
US20210149575A1 (en) Locking structures in flash memory
US9123443B2 (en) Memory device, memory management device, and memory management method
CN110321249A (en) SSD with the lasting region DRAM for metadata
DE102020122182A1 (en) VIRTUAL MACHINE REPLICATION AND MIGRATION
EP3298495A1 (en) Cache architecture and algorithms for hybrid object storage devices
US20170310341A1 (en) Efficient data path architecture for flash devices
CN109165321B (en) Consistent hash table construction method and system based on nonvolatile memory
KR102574354B1 (en) Efficient data storage usage associated with ungraceful shutdown
TW201007462A (en) Memory controller, memory system, and control method for memory system
US10318205B2 (en) Managing data using a number of non-volatile memory arrays
CN112540931A (en) Method and processor for ensuring data breakdown consistency in secure nonvolatile memory
US20200043544A1 (en) Storage device and method for operating storage device
KR101070511B1 (en) Solid state drive controller and method for operating of the solid state drive controller
US20210373809A1 (en) Write Data-Transfer Scheduling in ZNS Drive
US11636034B2 (en) Write-back cache policy to limit data transfer time to a memory device
US11507508B2 (en) Prediction-based selective flushing of data to memory
CN115966242A (en) Parameter table protection for memory systems
DE102022101260A1 (en) Error detection event mechanism
CN115248745A (en) Data processing method and device
CN112328181A (en) Metadata reading and writing method and device of distributed storage system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant