WO2014169649A1 - 一种数据处理方法、装置及计算机系统 - Google Patents
一种数据处理方法、装置及计算机系统 Download PDFInfo
- Publication number
- WO2014169649A1 WO2014169649A1 PCT/CN2013/087402 CN2013087402W WO2014169649A1 WO 2014169649 A1 WO2014169649 A1 WO 2014169649A1 CN 2013087402 W CN2013087402 W CN 2013087402W WO 2014169649 A1 WO2014169649 A1 WO 2014169649A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- page
- backup
- working
- memory
- pages
- 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.)
- Ceased
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F12/00—Accessing, addressing or allocating within memory systems or architectures
- G06F12/02—Addressing or allocation; Relocation
- G06F12/08—Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
- G06F12/0802—Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
- G06F12/0806—Multiuser, multiprocessor or multiprocessing cache systems
- G06F12/0815—Cache consistency protocols
- G06F12/0817—Cache consistency protocols using directory methods
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F12/00—Accessing, addressing or allocating within memory systems or architectures
- G06F12/02—Addressing or allocation; Relocation
- G06F12/08—Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
- G06F12/0802—Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
- G06F12/0806—Multiuser, multiprocessor or multiprocessing cache systems
- G06F12/0842—Multiuser, multiprocessor or multiprocessing cache systems for multiprocessing or multitasking
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/14—Error detection or correction of the data by redundancy in operations
- G06F11/1446—Point-in-time backing up or restoration of persistent data
- G06F11/1448—Management of the data involved in backup or backup restore
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/903—Querying
- G06F16/90335—Query processing
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
- G06F9/544—Buffers; Shared memory; Pipes
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/16—Error detection or correction of the data by redundancy in hardware
- G06F11/1666—Error detection or correction of the data by redundancy in hardware where the redundant component is memory or memory area
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2201/00—Indexing scheme relating to error detection, to error correction, and to monitoring
- G06F2201/885—Monitoring specific for caches
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2212/00—Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
- G06F2212/10—Providing a specific technical effect
- G06F2212/1016—Performance improvement
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2212/00—Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
- G06F2212/10—Providing a specific technical effect
- G06F2212/1032—Reliability improvement, data loss prevention, degraded operation etc
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2212/00—Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
- G06F2212/62—Details of cache specific to multiprocessor cache arrangements
- G06F2212/621—Coherency control relating to peripheral accessing, e.g. from DMA or I/O device
Definitions
- the present invention relates to the field of computer technologies, and in particular, to a data processing method, apparatus, and computer system. Background technique
- each processor core since each processor core maintains its cache in a shared memory mode, it often causes a problem of cache inconsistency. This happens when: the cache of different processor cores stores data corresponding to the same physical memory address but different content, for example, in a shared memory system of a multi-core processor composed of two processor cores A and B, Each processor core maintains a separate Cache resource. Assume that processor core A and processor core B read data from the same physical memory address, that is, the data read back by the two processor cores corresponds to the same physical memory unit. If processor A writes data to this address afterwards, the Cache of processor core A will be updated and the Cache of processor core B will still store the old data, which will cause the cache content to be inconsistent.
- the cache coherency protocol is generally solved by a hardware cache coherency protocol.
- Common hardware cache coherency protocols include sniffing protocols, directory structure based protocols, token based protocols, and the like.
- sniffing protocols include sniffing protocols, directory structure based protocols, token based protocols, and the like.
- the DSM (Distributed Shared Memory) model is a mainstream memory model for implementing software cache coherency.
- an application has the same shared virtual memory between processes.
- Each process maps some or all of the virtual memory pages in the shared virtual memory to the private physical memory space maintained by the process.
- Each process sees a complete shared virtual memory space at the user level, and the shared data contained in a virtual memory page in the shared virtual memory space is not actually in the private physical memory space maintained by other processes.
- Each process can perform arbitrary data operations on the shared virtual memory.
- the underlying DSM synchronizes the data between the processes through the on-chip network or the system shared by all processes. Multiple processes of an application can run on a single processor core or each process can run on a separate processor core.
- the Regional Coherence Protocol is a mainstream DSM-based software coherency protocol with the advantages of simplicity and efficiency.
- the code range protected by the same lock lock by Acquire(lock)/Release(lock) in the application belongs to the same area (Scope).
- the area consistency protocol only guarantees that the shared variables in the same area are synchronized, different areas. Can not be synchronized.
- the Twin/Diff (Backup/Compare) mechanism is generally used in the area consistency protocol to maintain the consistency of shared data within the same area.
- the existing Twin/Diff mechanism is implemented based on the off-chip memory of the multi-core platform.
- the Twin page is Back up the page of the current work page. When the cache space is insufficient, the Twin page will be stored in the local off-chip memory.
- the modified work page is compared with the Twin page. The comparison result is sent to the home process of the work page, so that the home process updates the work page.
- Embodiments of the present invention provide a data processing method, apparatus, and computer system to ensure data consistency when accessing a shared virtual memory page, while reducing data access delay and improving program execution efficiency.
- an embodiment of the present invention provides a data processing method, including:
- the shared virtual The memory page is a virtual memory page in the shared virtual memory of the application to which the first process belongs, and the application runs on the computing node;
- the number of the shared virtual memory pages is N, N is a positive integer greater than or equal to 1;
- the number of working pages of the first process is M, M is a positive integer greater than or equal to 1;
- the method further includes:
- Determining whether the remaining space of the on-chip memory is less than a first threshold if the remaining space of the on-chip memory is less than the first threshold, triggering the first process to tamper with the M work pages of the first process
- the content synchronization update is released to the M shared virtual internals corresponding to the M work pages; if the remaining space of the on-chip memory is greater than or equal to the first threshold, executing the backup page to be created is stored in the The steps in the on-chip memory of the compute node.
- the method further includes: assigning, in the on-chip memory of the computing node, the first process to the on-chip storage area of a certain size in advance;
- the storing the created backup page in the on-chip memory of the computing node includes: storing the created backup page in an on-chip storage area pre-allocated for the first process.
- the first process Determining whether the remaining space of the on-chip storage area of the first process is smaller than the size of the created backup page, or less than a second threshold, if the remaining space of the on-chip storage area of the first process is smaller than the created backup page If the size is smaller than the second threshold, the first process is triggered to synchronously update the modified content of the M work pages of the first process to the M shared virtual memory pages corresponding to the M work pages.
- the step of storing the backup page to be created in the on-chip memory of the computing node is performed.
- the first threshold is a size of the created backup page.
- the data processing method further includes: if a remaining space of the on-chip memory of the computing node is smaller than a size of the created backup page Transmitting, in the application, at least one process other than the first process, the modified content in each work page of the other at least one process is the same as Steps are updated to the respective shared virtual memory pages corresponding to the respective work pages, and the first possible implementation manners of the first aspect are combined.
- the computing node is
- the on-chip memory includes a plurality of independent storage areas, all processes of the application are divided into at least one process group, and each process in each of the process groups shares one of the plurality of independent storage areas , as the on-chip public cache of the process group;
- the storing the created backup page in the on-chip memory of the computing node includes: storing the created backup page in an on-chip public cache area of a process group in which the first process is located;
- the step of the on-chip memory of the computing node includes: determining whether a remaining space of the on-chip public cache area of the process group in which the first process is located is smaller than a size of the created backup page, or smaller than the second threshold If the remaining space of the on-chip public buffer of the process group in which the first process is located is smaller than the size of the created backup page, or is smaller than the second threshold, triggering the first process to be the first
- the tampered content in the M work pages of a process is synchronously updated to the M shared space corresponding to the M work pages.
- the remaining space of the on-chip public buffer of the process group in which the first process is located is greater than or equal to the size of the created backup page, or is smaller than the second threshold, performing the backup to be created.
- the data processing method further comprises: creating the work Before the backup page of the page, searching for the backup page of the work page in the on-chip memory of the computing node;
- the creating a backup page of the work page includes: if a backup page of the work page is not found in the on-chip memory of the computing node, creating a backup page of the work page.
- the backup page information table is saved in the on-chip memory of the computing node, where the backup page cell data information includes: a page number and a version number of each of the backup pages, wherein a page number and a version number of each of the backup pages are the same as a page number and a version number of the work page corresponding to each of the backup pages;
- the finding, in the on-chip memory of the computing node, whether there is a backup page of the work page includes:
- the creating a backup page of the work page includes: if the metadata information of the page number and the version number respectively being the same as the page number and the version number of the work page is not found in the backup page information table, The backup page of the work page.
- the embodiment of the present invention further provides another data processing method, including:
- the shared virtual memory page is a virtual memory page in the shared virtual memory of the application to which the first process belongs, and the application runs on the computing node;
- the data processing method further includes: if not found, creating a backup page of the work page, and storing the created backup page in the calculation The on-chip memory of the node.
- the number of the shared virtual memory pages is N, and N is a positive integer greater than or equal to 1;
- the number of work pages is M, and M is a positive integer greater than or equal to 1;
- the method further includes:
- Determining whether the remaining space of the on-chip memory is less than a first threshold if yes, triggering the first process to synchronously update the modified content of the M work pages of the first process to the M work pages. And correspondingly, the M shared virtual memory pages are released, and the space occupied by the backup pages of the M work pages in the on-chip memory is released; if not, executing the backup page to be created is stored in the The steps in the on-chip memory of the compute node.
- the backup page information table is saved in the on-chip memory of the computing node, where the backup page is
- the metadata information includes: a page number and a version number of each of the backup pages, wherein a page number and a version number of each of the backup pages are respectively a page number and a version of a work page corresponding to each of the backup pages Same number;
- the backup page is the backup page of the work page.
- the on-chip memory includes a plurality of independent storage areas, and all processes of the application are divided into at least one process group, and each process in each process group shares the multiple independent storage areas.
- One of the storage areas as the on-chip public cache area of the process group, and each of the process groups has a separate backup page information table;
- the metadata information of the backup page of each process group includes: a page number and a version number of each of the backup pages, wherein the page number and the version number of each of the backup pages are the same as the page numbers and version numbers of the work pages corresponding to each of the backup pages;
- the backup page corresponding to the metadata information is a backup page of the work page.
- the embodiment of the present invention further provides a data processing apparatus, including:
- the shared virtual memory page is a virtual memory page in the shared virtual memory of the application to which the first process belongs, and the application runs on the computing node;
- a backup unit configured to create a backup page of the work page before the first process performs a write operation on the work page, and store the created backup page in an on-chip memory of the computing node, to Back up the raw data of the work page.
- the number of the shared virtual memory pages is N, and N is a positive integer greater than or equal to 1;
- the number of working pages of the first process is M, M is a positive integer greater than or equal to 1;
- the data processing device further includes: a determining unit, configured to determine, before the backup unit stores the created backup page in the on-chip memory of the computing node, whether the remaining space of the on-chip memory is less than a first threshold; When the threshold is triggered, the first process is triggered to synchronously update the modified content of the M work pages of the first process to the M shared virtual memory pages corresponding to the M work pages, and
- a determining unit configured to determine, before the backup unit stores the created backup page in the on-chip memory of the computing node, whether the remaining space of the on-chip memory is less than a first threshold;
- the first process is triggered to synchronously update the modified content of the M work pages of the first process to the M shared virtual memory pages corresponding to the M work pages, and
- the data processing apparatus further includes:
- a memory allocation unit configured to allocate a certain size of the on-chip storage area to each process of the application to which the first process belongs in advance in the on-chip memory of the computing node;
- the backup unit is specifically configured to store the created backup page in an on-chip storage area pre-allocated by the memory allocation unit to the first process.
- the determining unit is specifically configured to:
- the triggering unit is configured to: when the determining unit determines that the remaining space of the on-chip storage area of the first process is smaller than the size of the created backup page, or is smaller than a second threshold, triggering the first process Synchronizing the modified content of the M work pages of the first process to the M shared virtual memory pages corresponding to the M work pages, and combining the M work with the third aspect
- each process of the application program shares on-chip memory of the computing node;
- the determining unit is specifically configured to: determine that the remaining space of the on-chip memory of the computing node is No smaller than the size of the created backup page;
- the triggering unit is configured to trigger, when the determining unit determines that the remaining space of the on-chip memory of the computing node is smaller than the size of the created backup page, triggering, by the first process, the M of the first process.
- the modified content in the work pages is synchronously updated to the M shared virtual memory pages corresponding to the M work pages, and the space occupied by the M work pages in the backup page in the on-chip memory is released. .
- the data processing apparatus further includes: a query unit, configured to be in the backup unit Before creating the backup page of the work page, searching for the backup page of the work page in the on-chip memory of the computing node;
- the backup unit is specifically configured to create a backup page of the work page when the query unit does not find a backup page of the work page in the on-chip memory of the compute node.
- the backup page information table is saved in the on-chip memory of the computing node, where the backup page cell data information includes: a page number and a version number of each of the backup pages, wherein a page number and a version number of each of the backup pages are the same as a page number and a version number of the work page corresponding to each of the backup pages;
- the query unit is specifically configured to search, in the backup page information table, whether there is metadata information with a page number and a version number respectively being the same as a page number and a version number of the work page;
- the backup unit is specifically configured to: when the query unit does not find metadata information in the backup page information table that has the same page number and version number as the page number and the version number of the work page, respectively The backup page of the work page.
- the embodiment of the present invention further provides another data processing apparatus, including:
- a copy unit configured to copy the shared virtual memory page requested by the first process to the off-chip memory of the computing node, and copy the shared virtual memory page copied into the off-chip memory as the a working page of the first process;
- the shared virtual memory page is a virtual memory page in the shared virtual memory of the application to which the first process belongs, and the application runs on the computing node;
- a querying unit configured to: in the on-chip memory of the computing node, whether to find a backup page of the working page before the first process performs a writing operation on the working page;
- a backup unit configured to: when the query unit finds a backup page of the work page in an on-chip memory of the computing node, determining that the backup page that is found is a backup page of the work page, where The backup page is used to back up the original data in the work page.
- the backup unit is further configured to: when the query unit does not find a backup page of the work page in an on-chip memory of the computing node, A backup page of the work page, and the created backup page is stored in the on-chip memory of the compute node.
- the number of the shared virtual memory pages is N, and N is a positive integer greater than or equal to 1;
- the number of work pages is M, and M is a positive integer greater than or equal to 1;
- the data processing device further includes: a determining unit, configured to determine, before the backup unit stores the created backup page in the on-chip memory of the computing node, whether the remaining space of the on-chip memory is less than a first threshold; When the threshold is triggered, the first process is triggered to synchronously update the modified content of the M work pages of the first process to the M shared virtual memory pages corresponding to the M work pages, and In a third possible implementation manner, in a third possible implementation manner, in the on-chip memory of the computing node, a backup page information table is saved, and metadata information of the backup page is saved.
- the method includes: a page number and a version number of each of the backup pages, where The page number and the version number of each backup page are the same as the page numbers and version numbers of the work pages corresponding to each of the backup pages;
- the query unit is specifically configured to search, in the backup page information table, whether there is metadata information with a page number and a version number respectively being the same as a page number and a version number of the work page;
- the backup unit is specifically configured to: when the query unit finds the metadata information that the page number and the version number are the same as the page number and the version number of the work page, respectively, the metadata information that is found is corresponding to The backup page serves as a backup page for the work page.
- the on-chip memory includes multiple independent storage areas, and all processes of the application are divided into At least one process group, each process in each of the process groups shares one of the plurality of independent storage areas as an on-chip public cache area of the process group, and each of the process groups has one A separate backup page information table;
- the metadata information of the backup page of each process group includes: a page number and a version number of each of the backup pages, wherein the page number and the version number of each of the backup pages The page number and the version number of the work page corresponding to each of the backup pages are the same respectively;
- the query unit is specifically configured to search, in the backup page information table of the process group where the first process is located, whether there is metadata information whose page number and version number are respectively the same as the page number and the version number of the work page;
- the backup unit is specifically configured to: when the query unit finds metadata information whose page number and version number are the same as the page number and the version number of the work page, respectively, the metadata information information to be found The corresponding backup page serves as a backup page of the work page.
- an embodiment of the present invention provides a computer system, including: a processor, a first memory, and an operating system kernel; wherein the processor is configured to run an application, and the processor internally includes a second memory, The data access speed of the second memory is greater than the data access speed of the first memory;
- the operating system kernel is configured to copy a shared virtual memory page requested by the first process of the application to the first memory, and copy the shared virtual memory page copied to the first memory as a a work page of the first process; before the first process performs a write operation on the work page, creating a backup page of the work page, and storing the created backup page in the second memory, Backing up the original data of the work page; wherein the shared virtual memory page is a virtual memory page in the shared virtual memory of the application.
- the number of the shared virtual memory pages is N, N is a positive integer greater than or equal to 1; the number of working pages of the first process is M, M is a positive integer greater than or equal to 1;
- the operating system kernel is further configured to: before storing the created backup page in the first memory, determining whether a remaining space of the first memory is less than a first threshold, and if yes, triggering the first a process synchronously updating the modified content of the M work pages of the first process to the M shared virtual memory pages corresponding to the M work pages, and the M work pages are in the The space occupied by the backup page in a memory is released.
- the second memory includes a backup page information table, where the backup page information table includes The metadata information of all the backup pages in the second memory, the metadata information of each backup page includes: a page number and a version number of each of the backup pages, wherein the page number of each of the backup pages is The version number is the same as the page number and version number of the work page corresponding to each of the backup pages;
- the operating system kernel is specifically configured to: in the backup page information table, look up whether the page number and the version number respectively correspond to the work before the first process performs the first write operation on the work page. a backup page of the page, and storing the created backup page in the second memory to back up the original data of the work page; if found, the backup corresponding to the metadata information to be found
- the page is the backup page of the work page.
- the embodiment of the present invention copies the data content in the shared virtual page to the work page in the off-chip memory for the process to perform read and write operations, and simultaneously utilizes the programmable on-chip memory of the computing node, on the work page.
- the page data is backed up in the on-chip memory to ensure the data consistency of multiple processes when operating on the shared virtual memory page. Since the backup page is stored in the on-chip memory, it will not be cached with the work page. Space, more work pages can be stored in the cache, and cache and on-chip memory access speed is faster (5 ⁇ 10 times faster than access to off-chip memory), which can improve the performance of the program;
- the content of the shared virtual memory page is updated in time to ensure that when the operation is more arrogant, the work page is basically located in the cache, and no off-chip memory access is required, so the data update speed is very high. fast.
- FIG. 1 is a schematic diagram of a distributed shared memory model according to an embodiment of the present invention.
- FIG. 2 is a schematic flowchart of a Twin/Diff process according to an embodiment of the present invention
- FIG. 3 is a logical architecture diagram of a computing node according to an embodiment of the present invention.
- FIG. 4 is a flowchart of a data processing method according to an embodiment of the present invention.
- FIG. 5 is a schematic diagram of a shared virtual memory space according to an embodiment of the present invention.
- FIG. 6 is a flowchart of another data processing method according to an embodiment of the present invention.
- FIG. 7 is a schematic diagram of a data processing method according to an embodiment of the present disclosure.
- FIG. 8 is a schematic diagram of metadata information of a backup page according to an embodiment of the present invention.
- FIG. 9 is a flowchart of another data processing method according to an embodiment of the present invention.
- FIG. 10 is a schematic diagram of a data processing apparatus according to an embodiment of the present invention
- FIG. 11 is a schematic diagram of another data processing apparatus according to an embodiment of the present invention.
- FIG. 12 is a schematic diagram of a computing node according to an embodiment of the present disclosure.
- FIG. 13 is a schematic diagram of a computer system according to an embodiment of the present invention. detailed description
- the software cache coherency is achieved by improving the existing Twin/Diff mechanism, which is a computer or chip with a processor and memory, an operating system and supporting on-chip memory, such as Intel's SCC (Single Chip) Cloud Computer, a single-chip cloud computer, computes a node's processor that contains one or more processor cores, and each processor core maintains its cache (Cache) in shared memory mode.
- Twin/Diff mechanism which is a computer or chip with a processor and memory, an operating system and supporting on-chip memory, such as Intel's SCC (Single Chip) Cloud Computer, a single-chip cloud computer, computes a node's processor that contains one or more processor cores, and each processor core maintains its cache (Cache) in shared memory mode.
- the technical solutions of the embodiments of the present invention are applicable as long as the software cache consistency is involved.
- the product forms of the technical solutions of the embodiments of the present invention include, but are not limited to: an operating system, an LIB library, an application system using a third-party LIB library, and a computer deployed with an operating system and/or an LIB library.
- Twin/Diff mechanism process is as follows: Step 1, process A obtains lock lockl by executing Acquire(lockl), enters area 1; Step 2, if process A reads a shared virtual memory page P, and shared virtual memory page P does not exist in the address space of process A , the operating system triggers a page fault (Page Fault).
- Page Fault page fault
- the page A error handling function of the process A the data of the shared virtual memory page P is obtained from the home process of the shared virtual memory page P, and a physical memory page is requested from the off-chip memory.
- Step 3 If process A writes a shared virtual memory page P, and the shared virtual memory page P does not have a mapping in the address space of process A, the operating system triggers a page fault (Page Fault) and is in the page fault handling function of process A. Obtain the data of the shared virtual memory page P from the home process of the shared virtual memory page P, and apply for a physical memory page from the off-chip memory.
- Page Fault page fault
- the data is saved, and the physical memory page is the working page of the process A, and then the mapping relationship between the shared virtual memory page P and the physical memory page is established in the address space of the process A, and the shared virtual memory page is in the off-chip memory.
- P saves a Twin page (maintains a copy of the same data), and changes the access permission of Process A to the shared virtual memory page P to be readable and writable;
- Step 4 If the process A writes a shared virtual memory page P, and the shared virtual memory page P has a mapping in the address space of the process A, and the access permission of the process A to the shared virtual memory page P is read-only, the operating system triggers Page Fault, in the process A page error handling function, use a backup page (Twin page) in the off-chip memory to back up the original data in the shared virtual memory page P, modify the process A to share the virtual memory page P Access rights are readable and writable; go to step 5;
- Step 5 process A normally reads/writes the shared virtual memory page P;
- Step 6 process A triggers the comparison (Diff) operation by executing Release(lockl): compares the physical memory page (work page) mapped by the shared virtual memory page P with the data content of the Twin page, generates a Diff file, and updates the home process. Maintain the data of the shared virtual memory page P. After the Diff operation is completed, the process A releases the lock lockl and leaves the area 1.
- the present invention provides a data processing method for the existing problems of the existing Twin/Diff mechanism. First, the logical structure of the computing node applied by the data processing method provided by the embodiment of the present invention is introduced by using FIG. 3 as an example.
- the node may be a multi-core chip integrated with an operating system kernel, a general-purpose computer, a cloud computer, a computing node in a distributed system, a server or the like, or a mobile terminal such as a mobile phone or a tablet computer. As shown in FIG.
- the hardware layer of the computing node includes one or more processors (one processor may include multiple cores), such as a CPU, a GPU, and of course, may also include off-chip memory (off-chip memory, hard disk, etc.), Input/output devices, network interfaces, etc., wherein the processor memory is integrated with a cache and on-chip memory, and a cache is integrated in each core of the processor; an operating system kernel is run on the hardware layer (for example, a Linux kernel) And third-party library Libraries (such as display manager Surface Manager, media framework Media Framework, etc.), third-party libraries can be loaded into the memory by the operating system; in addition, the computing node can also include an application layer, the application layer Including one or more applications, etc., an application contains one or more processes, and a process contains one or more threads. The application runs on the compute node, and the hardware layer is controlled by the operating system kernel. To complete the corresponding function.
- processors one processor may include multiple cores
- off-chip memory off-chip memory, hard disk
- the data processing method provided by the embodiment of the present invention may be implemented by a third-party library Libraries layer and an application layer, or may be implemented at an operating system or a hypervisor level.
- the application accesses the virtual shared memory page by executing functions such as acquire, release, etc., and triggers the hardware layer to perform corresponding operations to ensure data consistency when multiple processes or threads running on the compute node operate on the shared virtual memory page. .
- the data processing method provided by the embodiment of the present invention includes:
- the shared virtual memory page is a virtual memory page in the shared virtual memory of the application to which the first process belongs, and the application runs on the computing node;
- Figure 5 shows the shared virtual memory space of the application 1 to which the first process P0 belongs.
- application 1 contains four processes: the first process ⁇ 0, and the second process ⁇ 1 ⁇ 3 respectively run on different processor cores of the compute nodes, they have a unified shared virtual memory for storing shared data, and Each process separately maintains a shared area in the shared virtual memory, each shared area containing one or more virtual memory pages; as shown in Figure 5, the first block in the virtual address space maps to the private physics of ⁇ 0 In memory, the second block area maps to P1's private physical memory, the third block area maps to ⁇ 2's private physical memory, and the fourth block area maps to ⁇ 3's private physical memory.
- Each process sees a complete shared virtual memory at the user level, and the shared data contained in a virtual memory page in the shared virtual memory is not actually in the private physical memory space maintained by other processes.
- Each process can perform arbitrary data operations on shared virtual memory, and the underlying nodes of the compute nodes pass the On-chip Network and the Internet.
- the second process in the embodiment of the present invention refers to one of all processes except the first process in the application 1, which is only used to distinguish from the first process, and is not used to specifically refer to a certain process. a process.
- the shared virtual memory page requested by the first process specifically refers to a shared virtual memory page that the first process requests to read or write; specifically, if the first process P0 reads or writes a shared virtual The memory page p, and the shared virtual memory page P does not have a mapping in the physical address space of the first process P0, the operating system triggers a page fault (Page Fault), in the page fault handling function of the first process P0, from the P
- Page Fault in the page fault handling function of the first process P0
- the home process obtains the data of the shared virtual memory page P, and requests a physical memory page from the off-chip memory of the computing node as a working page of the first process, and establishes a mapping relationship between the shared virtual memory page P and the physical memory page, and Writing the data of the shared virtual memory page P to the physical memory page; wherein, the work page is a page for the first process to read and write, and the first process is actually reading or writing when sharing the virtual page Write the work page corresponding to the shared virtual page
- the shared virtual page copied by the first process into the off-chip memory may be multiple, and the working pages of the first process are The number is also multiple. Generally speaking, the two numbers are the same, that is, each work page corresponds to one shared virtual memory page. It can be understood that, in another embodiment, the shared virtual memory page works and works. The page may not - correspondingly, the data of a shared virtual memory page may be stored in multiple work pages, or the data of multiple virtual memory pages may be stored in a work page.
- the first process may specifically obtain data of the shared virtual memory page P from the home process of the shared virtual memory page P.
- the first process does not need the home process from P when reading the shared virtual memory page P.
- the data of the page P is obtained, but the data of the shared virtual memory page P can be directly read.
- the off-chip memory described in the embodiment of the present invention refers to a memory external to the CPU of the computing node, such as a memory of a computing node, a hard disk, and the like.
- the backup page of the work page is created to back up the original data of the work page.
- the original data of the work page is the work page.
- the place is re-executed to read or write the data in the work page. Since the original data of the work page has been maintained in the on-chip memory, any subsequent modification of the work page by the first process may be performed by comparing the current data content of the work page with the backup page of the work page.
- the original data content determines which parts of the work page have been modified by the process, and then the modified content can be synchronously updated to the shared virtual memory page corresponding to the work page.
- the on-chip memory described in the embodiment of the present invention may be a memory inside a CPU of a computing node, such as a programmable on-chip memory (for example, an Intel SCC many-core platform provides a programmable on-chip memory MPB (Message Passing Buffer)); further, on-chip
- the memory may be internal to the CPU of the compute node, except for a cache (such as LI cache, L2 cache). If the CPU of the compute node has multiple cores, each core may share the on-chip memory.
- the on-chip memory space is not very large, but the access latency is similar to the L2 cache of the compute node's CPU's L2 cache, which is a good resource.
- the first process before reading or writing the shared virtual memory page P, the first process generally obtains the lock lockl by executing Acquire(lockl) to enter the shared virtual memory area 1 where the page P is located; meanwhile, the first process can pass Execute Release(lockl), exit the shared virtual memory area 1, and trigger the Diff operation: Compare the physical memory page (work page) mapped by the shared virtual memory page P with the data content of the backup page, and generate data content for recording both. The difference log file Diff, so that the home process of the shared virtual memory page P updates the data in the shared virtual memory page P. After the Diff operation is completed, the first process releases the lock lockl and leaves the area 1.
- each process of the application 1 to which the first process belongs has an exclusive on-chip storage area in the on-chip memory to store a backup page of the work page of the process.
- the method further includes: assigning, in the on-chip memory of the computing node, a certain size of the on-chip storage area to each process of the application 1; wherein, for each The size of the on-chip storage area allocated by the process can be determined by the total capacity of the on-chip memory, the available capacity, or can be set according to the empirical value.
- the size of the on-chip storage area of each process can be the same or different. .
- the created backup page is stored in the on-chip memory of the computing node, and includes: storing the created backup page in an on-chip storage area pre-allocated for the first process.
- the first process is taken as an example to illustrate the technical solution of the present invention, but it should not be construed as limiting the main body of the solution of the present invention.
- the execution entity of the scheme can be a process or a thread.
- the executing entity or The thread is a thread, or a process. It cannot represent a thread in the complete implementation method, and can also be implemented in the dimension corresponding to the process.
- the shared virtual memory page requested by the process to be read or written is first copied in the off-chip memory of the computing node as a work page for the process to perform read and write operations, and the CPU of the computing node is used on the chip.
- Memory before the process writes to the work page, the original data in the work page is backed up in the on-chip memory to ensure data consistency when multiple processes operate on the shared virtual memory page, because the backup page is stored on the chip. In the memory, the access speed of the page can be guaranteed.
- the backup page is stored separately from the work page, so that the backup page does not compete with the work page for the cache space, and more work pages can be stored in the cache, thereby improving the running of the program. Performance.
- An embodiment of the present invention provides a data processing method on another computing node. As shown in FIG. 6, the method includes:
- the shared virtual memory page is a virtual memory page in the shared virtual memory of the application to which the first process belongs, and M and N are positive integers greater than or equal to 1;
- M N, that is, each work page uniquely corresponds to one shared virtual memory page. It can be understood that, in another implementation manner, the shared virtual memory page and the work page may not correspond to,
- the data of a shared virtual memory page can be stored in multiple work pages, or the data of multiple virtual memory pages can be stored in a work page.
- the first process synchronously updates the modified content of the M work pages to each shared virtual memory page corresponding to each work page, and releases the space occupied by the backup pages of each work page in the on-chip memory.
- the process we call the "first process execution comparison (Diff) operation".
- the process A performing the comparison operation specifically includes: comparing each of the work pages of the process A with the backup page of the work page in the on-chip memory, and comparing the difference between the data contents of the two, that is, Find out the part that has been modified by the process A, the data changes, and generate a log file for recording the difference of the data content of the two, and update the content modified by the process A to each work page according to the log file to the work page.
- the operation of updating the shared virtual page according to the log file may be completed by the process A itself or by the home process of the updated shared virtual page, which needs to be determined according to the specific application scenario.
- the data of the work page cannot be backed up to the on-chip memory, thereby triggering the first process to perform a comparison operation, thereby releasing The on-chip memory space, and refresh the data of the corresponding page in the shared virtual memory space; it can be understood that a person skilled in the art can comprehensively consider the total capacity of the on-chip memory, the available storage space, and the like to set the first threshold. It can also be set according to the empirical value, which is not specifically limited here.
- the working page is backed up by calculating the on-chip memory space of the node.
- the on-chip memory space may be divided in different manners, and accordingly, according to different ways of dividing the on-chip memory space.
- the timing and method of triggering the first process to perform the comparison operation are also different:
- each process of the application has a separate on-chip memory area in the on-chip memory; that is, in the on-chip memory of the compute node, each process of the application is pre-assigned to a certain size on-chip.
- the storage area; wherein, the storage space allocated for on-chip memory for each process may be the same size or different.
- the first threshold may be the size of the backup page created in step S602; that is, the determining step in step S603 specifically includes: determining whether the remaining space of the on-chip memory of the computing node is smaller than that created in step S602. The size of a backup page.
- the triggering process performs a comparison operation.
- the on-chip memory space of the compute node is not globally shared, but is locally shared, that is, only some processes can share local regions in the on-chip memory.
- the on-chip memory is divided into: The entire on-chip memory space is divided into multiple independent storage areas, and all processes of the application 1 to which the first process belongs are divided into one or more process groups, each process group.
- the process in the process shares one of the multiple independent storage areas as the on-chip public cache area of the process group; that is, the processes in each process group can access the same on-chip memory space, and different process groups access different on-chip memory spaces. .
- on-chip memory 1 can be accessed by core 0 ⁇ core3
- on-chip memory 2 can be accessed by core4 ⁇ core7
- on-chip memory 3 can be accessed by core8 ⁇ corel 1
- on-chip memory 4 can be accessed by core 12 ⁇ core 15. All processes in a process group can save the backup page of their work page in a certain storage area in the on-chip memory.
- the created backup page is stored in the on-chip memory of the computing node, and specifically includes: storing the created backup page in a process that is the first process
- the determining step in step S603 specifically includes: determining whether the remaining space of the on-chip public buffer area of the process group in which the first process is located is smaller than the size of a backup page created in step S602. , or less than the second threshold.
- the backup page of the work page fails to be created.
- the threshold value can be set according to factors such as the total capacity of the on-chip memory, the available storage space, and the like, and can also be set according to the empirical value, which is not particularly limited herein.
- the on-chip memory space of the compute node is smaller than the L2 cache space, so the on-chip memory space cannot accommodate the next backup page as a trigger condition for the comparison operation; if the on-chip memory space is larger than the L2 cache, The triggering condition of the comparison operation is that the space occupied by the backup page is equal to the size of the L2 cache. In addition, other heuristic trigger condition judgments are also possible. If the compute node's on-chip memory is large, you can also consider saving the work page in the on-chip memory space.
- the shared virtual memory page requested by the process to be read or written is first copied in the off-chip memory of the computing node as a work page for the process to perform read and write operations, and the CPU of the computing node is used on the chip.
- Memory before the process writes to the work page, the original data in the work page is backed up in the on-chip memory to ensure data consistency when multiple processes operate on the shared virtual memory page, because the backup page is stored on the chip. In memory, page The access speed can be guaranteed.
- the backup page is stored separately from the work page, so that the backup page does not compete with the work page for cache space, and more work pages can be stored in the cache, thereby improving the performance of the program running; Ground, through the active trigger comparison operation, timely update the contents of the shared virtual memory page, to ensure that when the comparison operation, the work page is basically located in the cache, no need for off-chip memory access, so the comparison operation is fast .
- the first process A obtains lock lockl by executing Acquire(lockl), enters area 1; (2) if the first process A reads a shared virtual memory page P, and shares the virtual memory page
- the operating system triggers a page fault (Page Fault), and in the page fault handling function of the process , the shared virtual memory page P is obtained from the home process of the shared virtual memory page P.
- Page Fault page fault
- the shared virtual memory page P is obtained from the home process of the shared virtual memory page P.
- Data and apply a physical memory page from the off-chip memory to save the data, and then establish a mapping relationship between the shared virtual memory page P and the physical memory page in the address space of the process A, and work the physical memory page as the process A.
- Page while modifying the access of the process A to the shared virtual memory page P is read-only; go to step 5;
- process A writes a shared virtual memory page P, and the shared virtual memory page P does not have a mapping in the address space of process A
- the operating system triggers a page fault (Page Fault) and processes the page fault in process A.
- Page Fault page fault
- the data of the shared virtual memory page P is obtained from the home process of the shared virtual memory page P, and a physical memory page is requested from the off-chip memory to save the data, and then the shared virtual memory page P is established in the address space of the process A.
- the physical memory page The mapping relationship, the physical memory page as the work page of process A, and create a Twin page for the work page in the programmable on-chip memory (maintaining the same data, if the creation of the Twin page fails during this process, it will trigger Active Diff operation), modify the access permission of process A to the shared virtual memory page P to be readable and writable; go to step 5;
- Process A normally reads/writes the shared virtual memory page P;
- Process A triggers the Diff operation by executing Release(lockl): Compares the physical memory page (work page) mapped by the shared virtual memory page that has not been Diffed with the data content of the Twin page, and generates a log file Diff. Update the data of the shared virtual memory page maintained by the home process corresponding to each shared virtual memory page. After the Diff operation is completed, process A releases the lock lockl and leaves area 1.
- the embodiment of the present invention proposes a scheme for backing up the page resource pool.
- the backup page saved in the on-chip memory is also a shared resource that can be shared by different cores. For example, multiple processes (whether on the same core or on different cores) write to different locations of page X for a certain period of time. According to the scheme in the above embodiment, each process needs a separate backup page. This wastes memory space. Since the on-chip memory is accessible to all cores, the same version of the same shared virtual memory page of different processes only needs to save one on-chip memory space. A backup page is fine. Based on this, the data processing method of the embodiment of the present invention may be further optimized.
- the backup page of the work page may be searched for in the on-chip memory of the computing node, and if found, The step of creating a backup page in S602 may be skipped, and steps S603, S604; if not found, the step of creating a backup page in step S602 is performed, and steps S603, S604 are performed.
- a data structure such as a backup page queue or a backup page information table, may be used to record metadata information of each backup page in the on-chip memory, wherein the metadata information of the backup page includes: Page number Twin Page Id and version number Twin Page Version;
- the metadata information of the backup page may include: Twin Page Id, Twin Page Version, Twin Page Usage and Twin Page Addressong Where the meaning of each field is as follows:
- Twin Page Id The page number of the shared virtual memory page mapped by the work page corresponding to the backup page.
- the page number of the same shared virtual memory page is the same in different processes;
- Twin Page Version The version number of the backup page.
- the version number of the backup page corresponding to the same shared virtual memory page in different processes may be different;
- the version number of the backup page is the same as the version number of the work page corresponding to the backup page
- the version number of the work page is the shared virtual memory page corresponding to the work page when the process creates the work page. version number.
- the version number of the work page is the shared virtual memory page of the copy. Version number;
- the initial value of the version number of a shared virtual memory page is 1, and subsequent processes can read and write data in the shared virtual memory page, and the process updates the shared virtual each time.
- the version number of the shared virtual memory page is incremented. Therefore, the version number of the work page corresponding to the same shared virtual memory page may be different in different processes, which may result in different backup page version numbers.
- Twin Page Address The address of the backup page in the on-chip memory, the process can access the corresponding version of the backup page according to the address.
- the following may be used to find whether there is a backup page of a work page in the on-chip memory of the computing node: Before creating a backup page of the work page, according to the page number and version number of the work page Finding, in the backup page information table for recording the metadata information of each backup page in the backup page resource pool, whether there is metadata information having the same page number and version number as the page number and the version number of the work page;
- the step of creating a backup page specifically includes: if the page number and the version number are not found in the backup page information table, respectively, the same as the page number and the version number of the work page. And creating a backup page of the work page; then proceeding to the subsequent steps S603, S604; further, if the page number and the version number are respectively found to be the same as the page number and the version number of the work page, then the search is determined.
- the backup page corresponding to the metadata information is the backup page of the work page, and the step of creating the backup page in S602 is skipped, and steps S603 and S604 are performed.
- the page number and the version number of the work page may be recorded as the page number and the version number of the created backup page respectively to the backup page information table.
- the shared virtual memory page X has a version number of 1 in the Home process.
- Process A and Process B perform Acquire(lockl) and Acquire(lock2) operations respectively, and obtain a copy of the shared virtual memory page X from the Home process, and respectively perform a write operation.
- the process A is written first. Since the backup page X with the version number 1 corresponding to the shared virtual memory page X cannot be found in the backup page information table, a backup page X with the version number 1 is created in the on-chip memory, and is set. Page X's Twin Page Usage is 1.
- process B writes the shared virtual memory page X, since the backup page X with the version number 1 can be found in the backup page information table, Instead of creating the same backup page X, just change the Twin Page Usage of backup page X to 2.
- process A triggers the Diff operation through the Release operation, or updates the shared virtual memory page x of the Home process through the above active Diff operation, and the version number of the shared virtual memory page X of the Home process is sequentially incremented and changed. 2, at the same time, the Twin Page Usage of the backup page X in the backup page information table is changed to 1.
- Process C performs an Acquire (lock 3) operation, obtains a copy of the shared virtual memory page X from the Home process, and performs a write operation.
- the version number of the copy of the shared virtual memory page X obtained by the process C is 2, and the version number of the backup page X that can be found in the backup page information table is 1, and the two do not match, so the version number is created in the on-chip memory.
- Backup page X for 2 and set its Twin Page Usage to 1.
- the on-chip memory space of the computing node may not be globally shared, but locally shared, that is, the entire on-chip memory space is divided into multiple mutually independent storage areas; correspondingly, All processes of an application to which a process belongs are divided into at least one process group, and each process in each of the process groups shares one of the plurality of independent storage areas as an on-chip common to the process group
- the cache area, and each process group maintains a separate backup page information table, and the backup page information table of each process group contains metadata information of all backup pages of all processes in the process group.
- the specific definition of the metadata information of the backup page has been described above, and will not be described here.
- the on-chip memory is locally shared, it is found in the on-chip memory of the computing node whether there is a backup page of a certain work page, which specifically includes:
- the backup page information table of the process group where the first process is located it is found whether there is metadata information with the same page number and version number as the page number and the version number of the work page;
- the step of creating a backup page specifically includes: if the page number and the version number are not found in the backup page information table of the process group where the first process is located, respectively If the page number of the page and the metadata information with the same version number are the same, the backup page of the work page is created; then the subsequent steps S603, S604 are continued; if the page number and the version number are respectively found, the page number and the version number of the work page respectively For the same metadata information, it is determined that the backup page corresponding to the found metadata information is the backup page of the work page, and the step of creating the backup page in S602 is skipped, and steps S603 and S604 are performed.
- the page number and the version number of the work page are respectively recorded as the page number and the version number of the created backup page to the backup page information table of the process group where the first process is located.
- the optimization scheme based on the backup page sharing proposed in the embodiment of the present invention can further reduce the on-chip memory space occupied by the backup page and save system resources on the basis of the foregoing method embodiments.
- another embodiment of the present invention provides a data processing method, including:
- S901 copy the shared virtual memory page requested by the first process to the off-chip memory of the computing node, and copy the shared virtual memory page copied to the off-chip memory as the working page of the first process; wherein, the shared virtual memory page The virtual memory page in the shared virtual memory of the application to which the first process belongs, the application runs on the compute node;
- the data processing method may further include:
- the data processing method further includes:
- the metadata information of each backup page in the on-chip memory may be recorded by using a data structure stored in the on-chip memory, such as a backup page queue or a backup page information table, where the elements of the backup page are
- a data structure stored in the on-chip memory such as a backup page queue or a backup page information table
- the following may be used to find out whether there is a backup page of a work page: Before creating a backup page of the work page, according to the page number and the version number of the work page, the resource for recording the backup page is used. In the backup page information table of the metadata information of each backup page in the pool, it is found whether there is metadata information with the same page number and version number as the page number and the version number of the work page. Correspondingly, if it is found, it is determined that the backup page corresponding to the found metadata information is the backup page of the work page; if not found, the backup page of the work page is created, and the created backup page is stored in Compute the on-chip memory of the node.
- the page number and the version number of the work page may be recorded as the page number and the version number of the created backup page respectively to the backup page information table.
- the on-chip memory space of the computing node may not be globally shared, but locally shared, that is, the entire on-chip memory space is divided into multiple mutually independent storage areas; correspondingly, All processes of an application to which a process belongs are divided into at least one process group, and each process in each of the process groups shares one of the plurality of independent storage areas as an on-chip common to the process group
- the cache area, and each process group maintains a separate backup page information table, and the backup page information table of each process group contains metadata information of all backup pages of all processes in the process group.
- the specific definition of the metadata information of the backup page has been described above, and will not be described here. Partially shared on this slice of memory In the case of the on-chip memory of the compute node, it is found that there is a backup page of a work page, which includes:
- the backup page information table of the process group where the first process is located it is found whether there is metadata information with the same page number and version number as the page number and the version number of the work page;
- the backup page corresponding to the found metadata information is directly used as the backup page of the work page. If not found, the backup page of the work page is created and the created backup page is stored in the on-chip memory of the compute node.
- the page number and the version number of the work page are respectively recorded as the page number and the version number of the created backup page to the backup page information table of the process group where the first process is located.
- the data processing method based on the backup page sharing according to the embodiment of the present invention can further reduce the on-chip memory space occupied by the backup page and save system resources on the basis of the foregoing method embodiments.
- the embodiment of the invention further provides a data processing device, which can be implemented in the form of a library library, or can be implemented at an operating system or a hypervisor level.
- the data processing apparatus 90 includes: a copying unit 910, configured to copy a shared virtual memory page requested by the first process to an off-chip memory of the computing node, and copy the copy into the off-chip memory.
- the shared virtual memory page is used as the working page of the first process; wherein, the shared virtual memory page requested by the first process is specifically in the shared virtual memory of the application to which the first process belongs, and the first process requests to read or write one Or multiple virtual memory pages;
- the data processing apparatus triggers a page fault, and in the page fault handling function of the first process P0, the copy unit 910 obtains the shared virtual memory.
- the data of the page P requesting a physical memory page from the off-chip memory of the computing node as a working page of the first process, and establishing a mapping relationship between the shared virtual memory page P and the physical memory page (work page), and sharing the virtual
- the data of the memory page P is written into the physical memory page; wherein, the work page is for the first process to read and write operations
- Each work page corresponds to a shared virtual memory page. If the first process copies multiple shared virtual pages into the off-chip memory, the number of work pages of the first process is also multiple. It should be noted that, in one embodiment, different areas in the shared virtual memory of the application to which the first process belongs are separately maintained by different processes or threads (ie, the scenario described in FIG. 5). In this case, the copy unit 910 may specifically obtain the data of the shared virtual memory page P from the home process of the shared virtual memory page P. In another embodiment, if the shared virtual memory space of the application is jointly maintained by all processes of the application, the copy unit 910 does not need to obtain the P from the home process when reading or writing the shared virtual memory page P. The data of the page P, but can directly read the data of the shared virtual memory page P.
- the backup unit 920 is configured to create a backup page of the work page before the first process performs a write operation on the work page, and store the created backup page in the on-chip memory of the compute node to back up the original work page.
- the page fault handling function of the first process is automatically jumped, thereby triggering the first process from the place where the page fault is generated.
- the off-chip memory described in the embodiment of the present invention refers to a memory external to the CPU of the computing node, such as a memory of a computing node, a hard disk, and the like.
- the on-chip memory described in the embodiment of the present invention may be a CPU inside the computing node.
- Memory such as programmable on-chip memory (such as Intel SCC)
- the multi-core platform provides a programmable on-chip memory MPB (Message Passing Buffer);
- the on-chip memory can be a CPU inside the compute node, except for a cache (such as LI cache, L2 cache), if The compute node's CPU has multiple cores, and each core can share the on-chip memory.
- the on-chip memory space is not very large, but the access latency is similar to the L2 cache of the compute node's CPU's L2 cache, which is a good resource.
- the copy unit 910 copies N shared virtual memory pages into the off-chip memory of the computing node, and the working page of the first process is M, and M and N are both greater than 1.
- the data processing device 90 further includes:
- the determining unit 930 is configured to determine, before the backup unit 920 stores the created backup page in the on-chip memory of the computing node, whether the remaining space of the on-chip memory is less than a first threshold; the triggering unit 940 is configured to be in the determining unit 930.
- the first process is triggered to synchronously update the modified content of the M work pages of the first process to the M shared virtual memory pages corresponding to the M work pages, And translating the space occupied by the backup page of the M work pages; when the determining unit determines that the remaining space of the on-chip memory is not less than the first threshold, the trigger backup unit 920 stores the created backup page to the Compute the on-chip memory of the node.
- the first process synchronously updates the modified content of the M work pages to each shared virtual memory page corresponding to each work page, and releases the space occupied by the backup pages of each work page in the on-chip memory.
- the process we call the "first process execution comparison (Diff) operation".
- the process A performing the comparison operation specifically includes: comparing each of the work pages of the process A with the backup page of the work page in the on-chip memory, and comparing the difference between the data contents of the two, that is, Find out the part that has been modified by the process A, the data changes, and generate a log file for recording the difference of the data content of the two, and update the content modified by the process A to each work page according to the log file to the work page.
- the operation of updating the shared virtual page according to the log file may be completed by the process A itself or by the home process of the updated shared virtual page. The specific needs need to be determined according to specific application scenarios.
- the backup unit 920 creates a backup page of the work page
- the data of the work page cannot be backed up to the on-chip memory, so that the trigger unit 940 triggers the first process.
- the first threshold value may be set according to an empirical value, which is not particularly limited herein.
- the backup unit 920 stores the backup page of the work page by calculating the on-chip memory space of the node.
- the on-chip memory space may be divided into different manners, correspondingly, The judging unit 930 and the triggering unit 940 operate differently according to the manner in which the on-chip memory space is divided:
- each process of the application 1 to which the first process belongs has a separate on-chip storage area in the on-chip memory; that is, the data processing device 90 further includes: a memory allocation unit 970 for calculating In the on-chip memory of the node, a predetermined size of the on-chip storage area is allocated to each process of the application 1 in advance; in this case, the backup unit 920 is specifically configured to store the created backup page in the memory allocation unit.
- the first process is pre-allocated in the on-chip memory area.
- the determining unit 930 is specifically configured to: determine whether the remaining space of the on-chip storage area of the first process is smaller than the size of the backup page currently to be stored by the backup unit 920, or is smaller than the second threshold.
- the trigger unit 940 triggers the first process to perform the comparison operation.
- the determining unit 930 is specifically configured to: determine whether the remaining space of the on-chip memory of the computing node is smaller than a size of a backup page currently created by the backup unit 920 and to be stored, or less than a second threshold. Accordingly, if the determining unit 930 determines the calculation section The remaining space of the on-chip memory of the dot is smaller than the size of the backup page currently created by the backup unit 920 and to be stored, and the trigger unit 940 triggers the process to perform the comparison operation. Further, the trigger unit 940 triggers the process to perform a comparison operation with two strategies:
- the on-chip memory space of the compute node is not globally shared, but is locally shared, that is, only some processes can share local regions in the on-chip memory.
- the on-chip memory is divided into the following ways: The entire on-chip memory space is divided into multiple independent storage areas, and all processes of the application 1 are divided into one or more process groups, and the processes in each process group are shared.
- One of the block independent storage areas serves as the on-chip public cache of the process group; that is, the processes in each process group can access the same on-chip memory space, and different process groups access different on-chip memory spaces.
- on-chip memory 1 can be accessed by core 0 ⁇ core3
- on-chip memory 2 can be accessed by core4 ⁇ core7
- on-chip memory 3 can be accessed by core8 ⁇ corel l
- on-chip memory 4 can be accessed by corel2 ⁇ core 15. All processes in a process group can save backup pages of their own work pages on a block of memory in the on-chip memory.
- the backup unit 920 is configured to store the created backup page in an on-chip public cache area of the process group in which the first process is located.
- the determining unit 930 is specifically configured to: determine Whether the remaining space of the on-chip public buffer of the process group in which the first process is located is smaller than the size of the backup page currently created by the backup unit 920 and to be stored, or smaller than the second threshold.
- the trigger unit 940 triggers The process performs a comparison operation. Further, the trigger unit 940 triggers the process to perform a comparison operation. There are two strategies:
- the specific process of the process performing the comparison operation is the same as the previous description, and the other processes perform the comparison operation process, which is similar to the first process execution comparison process, and is not described here again. It can be set according to the total capacity of the on-chip memory, available storage space, etc., and can also be set according to the empirical value, which is not specifically limited here.
- the embodiment of the present invention proposes a scheme for backing up the page resource pool.
- the backup page saved in on-chip memory is also a shared resource that can be shared by different cores. For example, multiple processes (whether on the same core or different cores) write to different locations of page X for a certain period of time. According to the scheme in the above embodiment, each process needs a separate backup page. This wastes memory space. Since the on-chip memory is accessible to all cores, the same version of the same shared virtual memory page for different processes requires only one backup page to be saved on the on-chip memory space. Based on this, the embodiment of the present invention proposes a concept of backing up a page resource pool, and refers to a collection of all backup pages maintained in the on-chip memory as a backup page resource pool. Accordingly, the data processing device 90 further includes:
- the querying unit 950 is configured to: before the backup unit 920 creates the backup page of the work page, search for the backup page of the work page in the on-chip memory of the computing node; correspondingly, when the query unit 950 is not on the slice of the computing node When the backup page of the work page is found in the memory, the backup unit 920 performs the step of creating a backup page of the work page.
- a data structure such as a backup page queue or a backup page information table, may be used to record metadata information of each backup page in the on-chip memory in the on-chip memory of the computing node, where the backup page is
- the metadata information includes: the page number of the backup page Twin Page Id and the version number Twin Page Version;
- the metadata information of the backup page may include: Twin Page Id, Twin Page Version, Twin Page Usage and Twin Page Address.
- the specific definition of the metadata information of the backup page has been described above, and will not be described here. It can be understood that, because the on-chip memory resources of the computing node are valuable, in order to reduce the occupation of on-chip memory, the backup page information table may also be saved in the off-chip memory of the computing node.
- the query unit 90 determines whether the backup page information table is based on the backup page information table.
- the backup unit 920 is specifically configured to: when the query unit 950 does not find the metadata information that the page number and the version number are the same as the page number and the version number of the work page, respectively, create a backup page of the work page; when the query unit 950 searches When the page number and the version number are the same as the page number and the version number of the work page, the backup page corresponding to the found metadata information is used as the backup page of the work page;
- the data processing device 90 further includes: a recording unit 960, configured to use the page number and the version number of the work page as the created backup after the backup unit 920 creates the backup page of the work page The page number and version number of the page are recorded to the backup page information table.
- the on-chip memory space of the computing node may not be globally shared, but is locally shared, that is, the entire on-chip memory space is divided into multiple mutually independent storage areas; correspondingly, the first process All processes of the associated application 1 are divided into at least one process group, and each process in each of the process groups shares one of the plurality of independent storage areas as an on-chip public cache of the process group. Zones, and each process group maintains a separate backup page information table.
- the backup page information table of each process group contains metadata information of all backup pages of all processes in the process group. The specific definition of the metadata information of the backup page has been described above, and will not be described here.
- the query unit 950 of the data processing device 90 is specifically configured to search whether the page number and the version number are respectively associated with the page number in the backup page information table of the process group in which the first process is located.
- Page number and version of the work page The same metadata information of this number;
- the backup unit 920 is specifically configured to: when the query unit 950 does not find the metadata information that the page number and the version number are the same as the page number and the version number of the work page respectively, create a backup page of the work page; further, When the query unit 950 finds the metadata information that the page number and the version number are the same as the page number and the version number of the work page, respectively, the backup page corresponding to the found metadata information is used as the work page. Backup page.
- the recording unit 960 of the data processing device 90 is specifically configured to: after the backup unit 920 creates the backup page of the work page, the page number and the version number of the work page are respectively used as the page number and version number of the created backup page. Record the backup page information table of the process group where the first process is located. As shown in FIG.
- an embodiment of the present invention provides another data processing apparatus 11 , including: a copy unit 110, configured to copy a shared virtual memory page requested by a first process to an off-chip memory of a computing node, and Copying the shared virtual memory page into the off-chip memory as the work page of the first process; wherein, the shared virtual memory page is a virtual memory page in the shared virtual memory of the application to which the first process belongs, and the application runs on the On the compute node;
- the query unit 120 is configured to: in the on-chip memory of the computing node, find whether a backup page of the work page exists before the first process performs a write operation on the work page;
- the backup unit 130 is configured to: when the query unit 120 finds the backup page of the work page in the on-chip memory of the computing node, determine that the found backup page is the backup page of the work page; further, when the query unit 120 does not When the backup page of the work page is found in the on-chip memory, the backup unit 130 creates a backup page of the work page, and stores the created backup page in the on-chip memory of the computing node, where the work page is The backup page is used to back up the raw data of the work page.
- the number of shared virtual memory pages requested by the first process is N
- the number of working pages of the first process is M
- M and N are both greater than or equal to 1.
- the data processing apparatus 1 1 further includes: a determining unit 140, configured to determine, before the backup unit 130 stores the created backup page in the on-chip memory of the computing node, whether the remaining space of the on-chip memory is less than a first threshold;
- the triggering unit 150 is configured to: when the determining unit 140 determines that the remaining space of the on-chip memory is less than the first threshold, trigger the first process to synchronously update the modified content in the M working pages of the first process to In the M shared virtual memory pages corresponding to the M work pages, in a specific implementation manner, the on-chip memory of the node may be calculated, and a data structure, such as a backup page queue or a backup page information table, is used to record the slice.
- the metadata information of each backup page in the memory wherein the metadata information of the backup page includes: a page number of the backup page Twin Page Id and a version number Twin Page Version; In a more preferred embodiment, as shown in FIG.
- the metadata information of the backup page can include: Twin Page Id, Twin Page Version, Twin Page Usage, and Twin Page Address. Among them, the meaning of each field is as follows:
- Twin Page Id The page number of the shared virtual memory page mapped by the work page corresponding to the backup page.
- the page number of the same shared virtual memory page is the same in different processes;
- Twin Page Version The version number of the backup page.
- the version number of the backup page corresponding to the same shared virtual memory page in different processes may be different;
- the version number of the backup page is the same as the version number of the work page corresponding to the backup page, and the version number of the work page is the shared virtual memory corresponding to the work page when the backup unit 130 creates the work page.
- the version number of the page Specifically, when the backup unit 130 creates a work page, when a shared virtual memory page is copied into the off-chip memory of the computing node as a work page of the process, the version number of the work page is the shared virtual of the copy.
- the version number of the memory page Generally, the initial value of the version number of a shared virtual memory page is 1, and subsequent processes can read and write data in the shared virtual memory page, and the process updates the data each time. After sharing the content in the virtual memory page, the version of the shared virtual memory page This number will be incremented. Therefore, the version number of the work page corresponding to the same shared virtual memory page may be different in different processes, which may result in different backup page version numbers.
- Twin Page Usage The usage of the backup page, recording the number of processes currently using the backup page of this version;
- Twin Page Address The address of the backup page in the on-chip memory, the process can access the corresponding version of the backup page according to the address.
- the backup page information table may also be saved in the off-chip memory of the computing node; based on the backup page information table, the present invention is implemented.
- the query unit 120 is specifically configured to search, in the backup page information table, whether there is metadata information whose page number and version number are respectively the same as the page number and the version number of the work page;
- the backup unit 130 is specifically configured to: when the query unit 120 finds the metadata information that the page number and the version number are the same as the page number and the version number of the work page, respectively, the backup page corresponding to the found metadata information is used as the backup page The backup page for this work page.
- the data processing apparatus 11 further includes: a recording unit 160, configured to use the page number and the version number of the work page as the created backup page after the backup unit 130 creates the backup page of the work page The page number and version number are recorded to the backup page information table.
- the on-chip memory space of the computing node may not be globally shared, but is locally shared, that is, the entire on-chip memory space is divided into multiple mutually independent storage areas; correspondingly, the first process All processes of the associated application 1 are divided into at least one process group, and each process in each of the process groups shares one of the plurality of independent storage areas as an on-chip public cache of the process group. Zones, and each process group maintains a separate backup page information table.
- the backup page information table of each process group contains metadata information of all backup pages of all processes in the process group. The specific definition of the metadata information of the backup page has been described above, and will not be described here.
- the query unit 120 of the data processing device 1 is specifically used for the backup page of the process group where the first process is located.
- the face information table it is found whether there is metadata information with the same page number and version number as the page number and the version number of the work page;
- the backup unit 130 is specifically configured to: when the query unit 120 finds the metadata information that the page number and the version number are the same as the page number and the version number of the work page, respectively, the backup page corresponding to the found metadata information is used as the backup page The backup page for this work page.
- the recording unit 160 of the data processing device 11 is specifically configured to: after the backup unit 130 creates the backup page of the work page, the page number and the version number of the work page are respectively used as the page number and version number of the created backup page. Record the backup page information table of the process group where the first process is located.
- the data processing devices 90 and 11 of the embodiments of the present invention may be a computing node, in other words, a device having a processor and a memory (the schematic architecture of which may be referred to FIG. 3)
- the product form may be a general-purpose computer, a cloud computer, a computing node in a distributed system, an embedded platform, a server, etc., or may be a software system such as an operating system or an LIB library, which is not limited by the present invention.
- the shared virtual memory page requested by the process to be read or written is first copied in the off-chip memory of the computing node as a work page for the process to perform read and write operations, and the CPU of the computing node is used on the chip.
- Memory before the process writes to the work page, the original data in the work page is backed up in the on-chip memory to ensure data consistency when multiple processes operate on the shared virtual memory page, because the backup page is stored on the chip. In the memory, the access speed of the page can be guaranteed.
- the backup page is stored separately from the work page, so that the backup page does not compete with the work page for the cache space, and more work pages can be stored in the cache, thereby improving the running of the program.
- the content of the shared virtual memory page is updated in time to ensure that the work page is basically returned during the comparison operation. It is located in the cache and does not require off-chip memory access. Therefore, the Diff operation speed is fast. Further, by backing up the page resource pool scheme, the backup page can be fully shared between processes, thereby further reducing the on-chip memory space occupied by the backup page, saving system resource.
- FIG. 12 is a schematic diagram of a computing node according to an embodiment of the present invention.
- the computing node 100 includes: at least one processor 1001, a memory 1002, and a bus, wherein the processor 1001 internally includes an on-chip memory 1003. .
- the processor 1001 and the memory 1002 are connected by a bus and complete communication with each other.
- the bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component (PCI) bus, or an extended industry standard architecture ( Extended Industry Standard)
- EISA Evolved Architecture
- the bus can be divided into an address bus, a data bus, a control bus, and the like.
- a thick line is shown in Figure 12, but it does not mean that there is only one bus or one type of bus. among them:
- Memory 1002 is for storing data and executable program code, the program code including computer operating instructions.
- the memory 1002 may include a high speed RAM memory, and may also include a non-volatile memory, for example, at least one disk memory.
- the memory 1002 stores executable code corresponding to the application program 1, and the processor 1001 runs a program corresponding to the executable program code by reading the executable program code stored in the memory 1002, wherein the application Program 1 includes one or more processes, and each process of application 1 has an identical shared virtual memory, and each process maps some or all of the virtual memory pages in the shared virtual memory to the private physical memory maintained by the process. Further, the memory 1002 further stores an operating system corresponding executable code, and the processor 1001 reads and executes the executable code corresponding to the operating system in the memory 1002 for:
- the shared virtual memory page requested by the first process is a virtual memory page of the shared virtual memory of the application 1 that the first process requests to read or write; Before the first process writes the work page, the backup page of the work page is created, and the created backup page is stored in the on-chip memory 1003 to back up the original data of the work page.
- the processor 1001 may be a Central Processing Unit (CPU), or an Application Specific Integrated Circuit (ASIC), or may be configured to implement the embodiments of the present invention.
- CPU Central Processing Unit
- ASIC Application Specific Integrated Circuit
- the processor 1001 may include one or more cores, each of which shares the on-chip memory 1003 of the processor 1001.
- processor 1001 can be used to execute the executable code in addition to the above-mentioned method flow, so as to implement other steps in the method embodiment of the present invention, and details are not described herein again.
- the shared virtual memory page requested by the process to be read or written is first copied in the off-chip memory of the computing node as a work page for the process to perform read and write operations, and the CPU of the computing node is used on the chip.
- Memory before the process writes to the work page, the original data in the work page is backed up in the on-chip memory to ensure data consistency when multiple processes operate on the shared virtual memory page, because the backup page is stored on the chip. In the memory, the access speed of the page can be guaranteed.
- the backup page is stored separately from the work page, so that the backup page does not compete with the work page for the cache space, and more work pages can be stored in the cache, thereby improving the running of the program.
- the content of the shared virtual memory page is updated in time to ensure that when the comparison operation is performed, the work page is basically located in the cache, and no off-chip memory access is required, so the Diff operation is performed. Very fast; Further, by backing up the page resource pool solution, the backup page can be fully shared between processes, and the on-chip memory space occupied by the backup page is further reduced, thereby saving system resources.
- FIG. 13 is a schematic diagram of a computer system according to an embodiment of the present invention.
- the computer system 1 10 includes: a processor 1101, a first memory 1 102, and an operating system kernel. 1103; wherein, the processor 1101 internally includes a second memory 1104 and at least one processor core 1105, the processor core is used to run an application, and the second memory 1104 is an on-chip shared by each processor core of the processor 1101. Storage, whose data access speed is greater than the data access speed of the first memory 1102;
- the operating system kernel 1103 is configured to copy the first process requesting access to the shared virtual memory page into the first memory 1102, and copy the shared virtual memory page in the first memory 1 102 as the first a working page of the process; before the first process writes the work page, creating a backup page of the work page, and storing the created backup page in the second memory 1104 to back up the original data of the work page;
- the shared virtual memory page is a virtual memory page in the shared virtual memory of the application to which the first process belongs.
- the number of shared virtual memory pages is N, N is a positive integer greater than or equal to 1; the number of working pages of the first process is ⁇ , and ⁇ is a positive integer greater than or equal to 1;
- the operating system kernel 1 103 is further configured to: before storing the created backup page in the first memory, determining whether the remaining space of the first memory 1 102 is less than a first threshold, and if yes, triggering the first process to itself
- the modified content in the two work pages is synchronously updated to the shared virtual memory pages corresponding to the one work page, and the space occupied by the backup pages in the first memory 1 102 is occupied by the work pages. Release; if not, the step of storing the created backup page in the second memory 1 104 is performed.
- the second memory 1 104 stores a backup page information table, where the backup page information table includes metadata information of all backup pages in the second memory 1204, and each backup page
- the metadata information includes: a page number and a version number of each of the backup pages, wherein a page number and a version number of each of the backup pages are respectively different from a page number of the work page corresponding to each of the backup pages The same version number;
- the operating system kernel 1103 will find in the backup page information table whether there is metadata with the same page number and version number as the page number and the version number of the work page. Information, if found, will correspond to the metadata information found
- the backup page is the backup page for the work page.
- the backup page information table may also be saved in the first memory 1102; in another embodiment, the processor 1 101 further includes a cache (cache). 1 106, used to cache temporary data of each processor core.
- a cache cache
- the operating system management apparatus 1103 of the embodiment of the present invention refer to the foregoing various method embodiments, and details are not described herein again.
- the shared virtual memory page requested by the process to be read or written is first copied in the off-chip memory of the computing node as a work page for the process to perform read and write operations, and the CPU of the computing node is used on the chip.
- Memory before the process writes to the work page, the original data in the work page is backed up in the on-chip memory to ensure data consistency when multiple processes operate on the shared virtual memory page, because the backup page is stored on the chip. In the memory, the access speed of the page can be guaranteed.
- the backup page is stored separately from the work page, so that the backup page does not compete with the work page for the cache space, and more work pages can be stored in the cache, thereby improving the running of the program.
- the content of the shared virtual memory page is updated in time to ensure that when the comparison operation is performed, the work page is basically located in the cache, and no off-chip memory access is required, so the comparison operation is performed. Very fast; Further, by backing up the page sharing mode, the backup page can be fully shared between processes, and the on-chip memory space occupied by the backup page is further reduced, thereby saving system resources.
- the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solution of the embodiment.
- each functional unit in the network device provided by each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or may be two or more.
- the unit is integrated in one unit.
- the above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
- the integrated unit if implemented in the form of a software functional unit and sold or used as a standalone product, may be stored in a computer readable storage medium.
- the technical solution of the present invention may contribute to the prior art or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium.
- a number of instructions are included to cause a computer device (which may be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention.
- the foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and the like, which can store program codes. .
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Software Systems (AREA)
- Databases & Information Systems (AREA)
- Computational Linguistics (AREA)
- Data Mining & Analysis (AREA)
- Quality & Reliability (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Memory System Of A Hierarchy Structure (AREA)
Abstract
本发明实施例提供一种计算节点上的数据共享方法及装置,包括:将第一进程请求访问的共享虚拟内存页面拷贝至计算节点的片外内存中,并将拷贝到片外内存中的共享虚拟内存页面作为第一进程的工作页面;在第一进程对该工作页面进行写操作之前,在计算节点的片上内存中,创建该工作页面的备份页面,以备份该工作页面的原始数据;本发明实施例通过利用计算节点的可编程片上内存,在对工作页面进行写操作之前,将页面数据在片上内存中备份,以保证多个进程在对共享虚拟内存页面进行操作时的数据一致性,同时尽可能少的访问片外内存,提高程序的速度。
Description
一种数据处理方法、 装置及计算机系统
技术领域 本发明涉及计算机技术领域, 尤其涉及一种数据处理方法、 装置及计算 机系统。 背景技术
在多核处理器中, 由于各个处理器核都在共享内存方式下维护其高速緩冲 存储器(Cache ) , 因而常会产生緩存不一致的问题。 这种情况发生在: 不同处 理器核的緩存存储了对应于同一物理内存地址但不同内容的数据, 例如, 在一 个由 A和 B两个处理器核构成的多核处理器的共享内存系统中, 每个处理器核都 维护着独立的 Cache资源。假设处理器核 A和处理器核 B从同一物理内存地址中读 数据, 即这两个处理器核读回的数据对应于同一个物理内存单元。 如果之后处 理器核 A向这个地址写数据, 则处理器核 A的 Cache会得到更新而处理器核 B的 Cache依旧保存的是旧的数据, 这就会造成緩存内容不一致的问题。
在传统多核处理器中, 一般通过硬件緩存一致性协议来解决緩存一致性问 题, 常见的硬件緩存一致性协议有嗅探协议、 基于目录结构的协议、 基于令牌 的协议等。 然而随着众核芯片核数的增加, 使用硬件緩存一致性的代价随着核 数的增加而线性增长, 甚至最终抵消掉核数增加带来的收益, 其开销主要包括 :¾口下几个方面:
( 1 )通信代价: 为了实现緩存一致性, 需要通过緩存通信协议来进行状态 更新, 研究表明实现硬件緩存一致性协议的系统比非緩存一致性协议的系统片 上通信流量增加 20%。 随着核数的增加, 情况会更加糟糕;
难, 设计复杂度使设计和验证成本急剧上升。
虽然通过采用一些更加灵巧的设计能够减轻上述问题, 但无法根本解决,
因此抛弃硬件緩存一致性而采用软件緩存一致性成为了选择,比如 Intel的 SCC、 Teraflops等众核研究芯片已经最终放弃了硬件緩存一致性实现。
DSM ( Distributed Shared Memory )模型是一种用于实现软件緩存一致性的 主流的内存模型, 如图 1所示, 在这种内存模型中, 一个应用程序的各进程间拥 有一个相同的共享虚拟内存, 每个进程分别将共享虚拟内存中的部分或者全部 虚拟内存页映射到该进程维护的私有物理内存空间。 各个进程在用户层面看到 的是一个完整的共享虚拟内存空间, 而感知不到共享虚拟内存空间中某块虚拟 内存页包含的共享数据实际上是在其它进程维护的私有物理内存空间中。 各个 进程可以对共享虚拟内存进行任意数据操作, DSM底层通过片上网络( On-chip Network )或者所有进程都可以访问的系统共享物理内存在各进程间进行数据的 同步。 一个应用程序的多个进程可以运行于一个处理器核上, 也可以每个进程 运行于一个单独处理器核上。
区域一致性协议是一种主流的基于 DSM的软件一致性协议, 具有简单高效 的优点。 应用程序中通过 Acquire(lock)/Release(lock)利用同一个锁 lock进行保护 的代码范围属于同一个区域(Scope ) , 区域一致性协议只保证同一个区域中的 共享变量是同步的, 不同区域可以不同步。 并且, 区域一致性协议中一般采用 Twin/Diff (备份 /比较)机制来维护同一个区域内部共享数据的一致性, 现有 Twin/Diff机制是基于多核平台的片外内存实现的, Twin页面是备份当前工作页 面的页面, 当 cache空间不够时, Twin页面会存放在本地片外内存上, 当进程完 成对工作页面的写操作后, 再将修改后的工作页面与 Twin页面进行 diff比较操 作, 并将比较结果发送给工作页面的 home进程, 使得 home进程更新工作页面。
在现有的 Twin/Diff机制中, 如果在 Scope内部, 程序访问了大量的页面, 由 于 cache的大小限制, 根据 cache替换算法, 后面访问的页面会将前面访问的页面 (工作页面和 Twin页面)从 cache中移除, 这样, 当程序退出 Scope时, 对前面访 问的页面进行 Diff操作,就需要从片外内存中将工作页面和 Twin页面重新加载到 cache中, 这样会造成很大的片外访存开销, 同时也会增加数据访问的延时, 影
响程序的执行效率。 发明内容
本发明实施例提供一种数据处理方法、 装置及计算机系统, 以保证对共 享虚拟内存页面进行访问时的数据一致性, 同时减少数据访问的延时, 提高 程序的执行效率。
第一方面, 本发明实施例提供一种数据处理方法, 包括:
将第一进程请求访问的共享虚拟内存页面拷贝至计算节点的片外内存 中, 并将拷贝到所述片外内存中的共享虚拟内存页面作为第一进程的工作页 面; 其中, 所述共享虚拟内存页面为所述第一进程所属应用程序的共享虚拟 内存中的虚拟内存页面, 所述应用程序运行在所述计算节点上;
在所述第一进程对所述工作页面进行写操作之前, 创建所述工作页面的 备份页面, 并将创建的所述备份页面存储在所述计算节点的片上内存中, 以 备份所述工作页面的原始数据。
在第一方面的第一种可能的实施方式中, 所述共享虚拟内存页面的个数 为 N, N为大于或等于 1的正整数; 所述第一进程的工作页面的个数为 M, M为大于或等于 1的正整数;
在将创建的所述备份页面存储在所述计算节点的片上内存之前, 所述方 法还包括:
判断所述片上内存的剩余空间是否小于第一阈值, 如果所述片上内存的 剩余空间小于第一阈值,则触发所述第一进程将所述第一进程的 M个工作页 面中被爹改的内容同步更新到所述 M个工作页面所对应的 M个共享虚拟内 间释放; 如果所述片上内存的剩余空间大于或等于第一阈值, 则执行所述将 创建的所述备份页面存储在所述计算节点的片上内存中的步骤。
结合第一方面的第一种可能的实施方式, 在第二种可能的实施方式中,
在创建所述工作页面的备份页面之前, 还包括: 在所述计算节点的片上内存 中, 预先给所述第一进程分配特定大小的片上存储区;
所述将创建的所述备份页面存储在所述计算节点的片上内存中, 包括: 将创建的所述备份页面存储在为所述第一进程预先分配的片上存储区 中。
结合第一方面的第二种可能的实施方式, 在第三种可能的实施方式中, 所述判断所述片上内存的剩余空间是否小于第一阈值, 如果所述片上内存的 剩余空间小于第一阈值,则触发所述第一进程将所述第一进程的 M个工作页 面中被爹改的内容同步更新到所述 M个工作页面所对应的 M个共享虚拟内 间释放; 如果所述片上内存的剩余空间大于或等于第一阈值, 则执行所述将 创建的所述备份页面存储在所述计算节点的片上内存中的步骤, 包括:
判断所述第一进程的片上存储区的剩余空间是否小于创建的所述备份页 面的大小, 或者小于第二阈值, 如果所述第一进程的片上存储区的剩余空间 小于创建的所述备份页面的大小, 或者小于第二阈值, 则触发所述第一进程 将所述第一进程的 M个工作页面中被修改的内容同步更新到所述 M个工作 页面所对应的 M个共享虚拟内存页面中, 并将所述 M个工作页面在所述片 上内存中的备份页面所占用的空间释放; 如果所述第一进程的片上存储区的 剩余空间大于或等于创建的所述备份页面的大小, 或者小于第二阈值, 则执 行所述将创建的所述备份页面存储在所述计算节点的片上内存中的步骤。
结合第一方面的第一种可能的实施方式, 在第四种可能的实施方式中, 所述第一阈值为创建的所述备份页面的大小。
结合第一方面的第四种可能的实施方式, 在第五种可能的实施方式中, 该数据处理方法还包括: 如果所述计算节点的片上内存的剩余空间小于创建 的所述备份页面的大小, 则触发所述应用程序中, 除所述第一进程之外的其 它至少一个进程将所述其它至少一个进程的各个工作页面中被修改的内容同
步更新到所述各个工作页面所对应的各个共享虚拟内存页面中, 并将所述各 结合第一方面的第一种可能的实施方式, 在第六种可能的实施方式中, 所述计算节点的片上内存包括多个独立的存储区域, 所述应用程序的所有进 程被划分为至少一个进程组, 每个所述进程组中的各个进程共享所述多个独 立的存储区域中的一个存储区域, 以作为该进程组的片上公共緩存区;
所述将创建的所述备份页面存储在所述计算节点的片上内存中, 包括: 将创建的所述备份页面存储在为所述第一进程所在进程组的片上公共緩 存区中;
所述判断所述片上内存的剩余空间是否小于第一阈值, 如果所述片上内 存的剩余空间小于第一阈值,则触发所述第一进程将所述第一进程的 M个工 作页面中被修改的内容同步更新到所述 M个工作页面所对应的 M个共享虚 的空间译放; 如果所述片上内存的剩余空间大于或等于第一阈值, 则执行所 述将创建的所述备份页面存储在所述计算节点的片上内存中的步骤, 包括: 判断所述第一进程所在的进程组的片上公共緩存区的剩余空间是否小于 创建的所述备份页面的大小, 或者小于所述第二阈值, 如果所述第一进程所 在的进程组的片上公共緩存区的剩余空间是否小于创建的所述备份页面的大 小, 或者小于所述第二阈值时, 则触发所述第一进程将所述第一进程的 M个 工作页面中被爹改的内容同步更新到所述 M个工作页面所对应的 M个共享 用的空间释放; 如果所述第一进程所在的进程组的片上公共緩存区的剩余空 间大于或等于创建的所述备份页面的大小, 或者小于所述第二阈值时, 则执 行所述将创建的所述备份页面存储在所述计算节点的片上内存中的步骤。
结合第一方面的第一、 第二、 第三、 第四、 第五或第六种可能的实施方 式, 在第七种可能的实施方式中, 该数据处理方法还包括: 在创建所述工作
页面的备份页面之前, 在所述计算节点的片上内存中查找是否存在所述工作 页面的备份页面;
所述创建所述工作页面的备份页面, 包括: 如果没有在所述计算节点的 片上内存中查找到所述工作页面的备份页面, 则创建所述工作页面的备份页 面。
结合第一方面的第七种可能的实施方式, 在第八种可能的实施方式中, 所述计算节点的片上内存中保存有备份页面信息表, 其中, 所述备份页面信 元数据信息包括: 所述每一个备份页面的页号和版本号, 其中, 所述每一个 备份页面的页号和版本号分别与所述每一个备份页面所对应的工作页面的页 号和版本号相同;
所述在所述计算节点的片上内存中查找是否存在所述工作页面的备份页 面, 包括:
在所述备份页面信息表中查找是否有页号和版本号分别与所述工作页面 的页号以及版本号相同的元数据信息;
所述创建所述工作页面的备份页面, 包括: 如果没有在所述备份页面信 息表中查找到页号和版本号分别与所述工作页面的页号以及版本号相同的元 数据信息, 则创建所述工作页面的备份页面。
第二方面, 本发明实施例还提供另一种数据处理方法, 包括:
将第一进程请求访问的共享虚拟内存页面拷贝至计算节点的片外内存 中, 并将拷贝到所述片外内存中的共享虚拟内存页面作为所述第一进程的工 作页面; 其中, 所述共享虚拟内存页面为所述第一进程所属应用程序的共享 虚拟内存中的虚拟内存页面, 所述应用程序运行在所述计算节点上;
在所述第一进程对所述工作页面进行写操作之前, 在所述计算节点的片 上内存中查找是否存在所述工作页面的备份页面, 如果查找到, 则确定查找 到的所述备份页面为所述工作页面的备份页面。
在第二方面的第一种可能的实施方式中, 所述数据处理方法还包括: 如 果没有查找到, 则创建所述工作页面的备份页面, 并将创建的所述备份页面 存储在所述计算节点的片上内存中。
结合第二方面的第一种可能的实施方式, 在第二种可能的实施方式中, 所述共享虚拟内存页面的个数为 N, N为大于或等于 1的正整数; 所述第一 进程的工作页面的个数为 M, M为大于或等于 1的正整数;
在将创建的所述备份页面存储在所述计算节点的片上内存之前, 所述方 法还包括:
判断所述片上内存的剩余空间是否小于第一阈值, 如果是, 则触发所述 第一进程将所述第一进程的 M个工作页面中被修改的内容同步更新到所述 M个工作页面所对应的 M个共享虚拟内存页面中, 并将所述 M个工作页面 在所述片上内存中的备份页面所占用的空间释放; 如果否, 则执行所述将创 建的所述备份页面存储在所述计算节点的片上内存中的步骤。
结合第二方面的第一种, 或者第二种可能的实施方式, 在第三种可能的 实施方式中, 所述计算节点的片上内存中保存有备份页面信息表, 其中, 所 个备份页面的元数据信息包括: 所述每一个备份页面的页号和版本号, 其中, 所述每一个备份页面的页号和版本号分别与所述每一个备份页面所对应的工 作页面的页号和版本号相同;
所述在所述计算节点的片上内存中查找是否存在所述工作页面的备份页 面,如果查找到, 则确定查找到的所述备份页面为所述工作页面的备份页面, 包括:
在所述备份页面信息表中查找是否有页号和版本号分别与所述工作页面 的页号以及版本号相同的元数据信息, 如果查找到, 则确定查找到的所述元 数据信息所对应的备份页面为所述工作页面的备份页面。
结合第二方面的第一种, 或者第二种可能的实施方式, 在第四种可能的
实施方式中, 所述片上内存包括多个独立的存储区域, 所述应用程序的所有 进程被划分为至少一个进程组, 每个所述进程组中的各个进程共享所述多个 独立的存储区域中的一个存储区域, 以作为该进程组的片上公共緩存区, 且 每个所述进程组有一个单独的备份页面信息表; 每一个进程组的备份页面信 份页面的元数据信息包括: 所述每一个备份页面的页号和版本号, 其中, 所 述每一个备份页面的页号和版本号分别与所述每一个备份页面所对应的工作 页面的页号和版本号相同;
所述在所述计算节点的片上内存中查找是否存在所述工作页面的备份页 面,如果查找到, 则确定查找到的所述备份页面为所述工作页面的备份页面, 包括:
在所述第一进程所在进程组的备份页面信息表中查找是否有页号和版本 号分别与所述工作页面的页号以及版本号相同的元数据信息, 如果查找到, 则确定查找到的所述元数据信息所对应的备份页面为所述工作页面的备份页 面。
第三方面, 本发明实施例还提供一种数据处理装置, 包括:
拷贝单元, 用于将第一进程请求访问的共享虚拟内存页面拷贝至计算节 点的片外内存中, 并将拷贝到所述片外内存中的共享虚拟内存页面作为所述 第一进程的工作页面; 其中, 所述共享虚拟内存页面为所述第一进程所属应 用程序的的共享虚拟内存中的虚拟内存页面, 所述应用程序运行在所述计算 节点上;
备份单元, 用于在所述第一进程对所述工作页面进行写操作之前, 创建 所述工作页面的备份页面, 并将创建的所述备份页面存储在所述计算节点的 片上内存中, 以备份所述工作页面的原始数据。
在第三方面的第一种可能的实施方式中, 所述共享虚拟内存页面的个数 为 N, N为大于或等于 1的正整数; 所述第一进程的工作页面的个数为 M,
M为大于或等于 1的正整数;
所述数据处理装置还包括: 判断单元, 用于在所述备份单元将创建的所 述备份页面存储在所述计算节点的片上内存之前, 判断所述片上内存的剩余 空间是否小于第一阈值; 一阈值时,触发所述第一进程将所述第一进程的 M个工作页面中被修改的内 容同步更新到所述 M个工作页面所对应的 M个共享虚拟内存页面中, 并将 结合第三方面第一种可能的实施方式, 在第二种可能的实施方式中, 所 述数据处理装置还包括:
内存分配单元, 用于在所述计算节点的片上内存中, 预先给所述第一进 程所属的应用程序的各个进程分配特定大小的片上存储区;
所述备份单元, 具体用于将创建的所述备份页面存储在所述内存分配单 元为所述第一进程预先分配的片上存储区中。
结合第三方面第二种可能的实施方式, 在第三种可能的实施方式中, 所 述判断单元, 具体用于:
判断所述第一进程的片上存储区的剩余空间是否小于创建的所述备份页 面的大小, 或者小于第二阈值;
所述触发单元, 具体用于在所述判断单元判断出所述第一进程的片上存 储区的剩余空间小于创建的所述备份页面的大小, 或者小于第二阈值时, 触 发所述第一进程将所述第一进程的 M个工作页面中被修改的内容同步更新 到所述 M个工作页面所对应的 M个共享虚拟内存页面中, 并将所述 M个工 结合第三方面第一种可能的实施方式, 在第四种可能的实施方式中, 所 述应用程序的各个进程共享所述计算节点的片上内存;
所述判断单元, 具体用于: 判断所述计算节点的片上内存的剩余空间是
否小于创建的所述备份页面的大小;
所述触发单元, 具体用于在所述判断单元判断出所述计算节点的片上内 存的剩余空间小于创建的所述备份页面的大小时, 触发所述第一进程将所述 第一进程的 M个工作页面中被修改的内容同步更新到所述 M个工作页面所 对应的 M个共享虚拟内存页面中, 并将所述 M个工作页面在所述片上内存 中的备份页面所占用的空间释放。
结合第三方面的第一、 第二、 第三或第四种可能的实施方式, 在第五种 可能的实施方式中, 所述数据处理装置还包括: 查询单元, 用于在所述备份 单元创建所述工作页面的备份页面之前, 在所述计算节点的片上内存中查找 是否存在所述工作页面的备份页面;
所述备份单元, 具体用于在所述查询单元没有在所述计算节点的片上内 存中查找到所述工作页面的备份页面时, 创建所述工作页面的备份页面。
结合第三方面的第五种可能的实施方式, 在第六种可能的实施方式中, 所述计算节点的片上内存中保存有备份页面信息表, 其中, 所述备份页面信 元数据信息包括: 所述每一个备份页面的页号和版本号, 其中, 所述每一个 备份页面的页号和版本号分别与所述每一个备份页面所对应的工作页面的页 号和版本号相同;
所述查询单元, 具体用于在所述备份页面信息表中查找是否有页号和版 本号分别与所述工作页面的页号以及版本号相同的元数据信息;
所述备份单元, 具体用于在所述查询单元没有在所述备份页面信息表中 查找到页号和版本号分别与所述工作页面的页号以及版本号相同的元数据信 息时, 创建所述工作页面的备份页面。
第四方面, 本发明实施例还提供另一种数据处理装置, 包括:
拷贝单元, 用于将第一进程请求访问的共享虚拟内存页面拷贝至计算节 点的片外内存中, 并将拷贝到所述片外内存中的共享虚拟内存页面作为所述
第一进程的工作页面; 其中, 所述共享虚拟内存页面为所述第一进程所属应 用程序的的共享虚拟内存中的虚拟内存页面, 所述应用程序运行在所述计算 节点上;
查询单元, 用于在所述第一进程对所述工作页面进行写操作之前, 在所 述计算节点的片上内存中查找是否存在所述工作页面的备份页面;
备份单元, 用于在所述查询单元在所述计算节点的片上内存中查找到所 述工作页面的备份页面时, 确定查找到的所述备份页面为所述工作页面的备 份页面, 其中, 所述备份页面用于备份所述工作页面中的原始数据。
在第四方面的第一种可能的实施方式中, 所述备份单元还用, 在所述查 询单元没有在所述计算节点的片上内存中查找到所述工作页面的备份页面 时, 创建所述工作页面的备份页面, 并将创建的所述备份页面存储在所述计 算节点的片上内存中。
结合第四方面的第一种可能的实施方式, 在第二种可能的实施方式中, 所述共享虚拟内存页面的个数为 N, N为大于或等于 1的正整数; 所述第一 进程的工作页面的个数为 M, M为大于或等于 1的正整数;
所述数据处理装置还包括: 判断单元, 用于在所述备份单元将创建的所 述备份页面存储在所述计算节点的片上内存之前, 判断所述片上内存的剩余 空间是否小于第一阈值; 一阈值时,触发所述第一进程将所述第一进程的 M个工作页面中被修改的内 容同步更新到所述 M个工作页面所对应的 M个共享虚拟内存页面中, 并将 结合第四方面的第一种、 或者第二种可能的实施方式, 在第三种可能的 实施方式中, 所述计算节点的片上内存中, 保存有备份页面信息表, 所述备 份页面的元数据信息包括: 所述每一个备份页面的页号和版本号, 其中, 所
述每一个备份页面的页号和版本号分别与所述每一个备份页面所对应的工作 页面的页号和版本号相同;
所述查询单元, 具体用于在所述备份页面信息表中查找是否有页号和版 本号分别与所述工作页面的页号以及版本号相同的元数据信息;
所述备份单元, 具体用于当所述查询单元查找到页号和版本号分别与所 述工作页面的页号以及版本号相同的元数据信息时, 将查找到的所述元数据 信息所对应的备份页面作为所述工作页面的备份页面。
结合第四方面的第一种、 或者第二种可能的实施方式, 在第四种可能的 实施方式中, 所述片上内存包括多个独立的存储区域, 所述应用程序的所有 进程被划分为至少一个进程组, 每个所述进程组中的各个进程共享所述多个 独立的存储区域中的一个存储区域, 以作为该进程组的片上公共緩存区, 且 每个所述进程组有一个单独的备份页面信息表; 每一个进程组的备份页面信 份页面的元数据信息包括: 所述每一个备份页面的页号和版本号, 其中, 所 述每一个备份页面的页号和版本号分别与所述每一个备份页面所对应的工作 页面的页号和版本号相同;
所述查询单元, 具体用于在所述第一进程所在进程组的备份页面信息表 中查找是否有页号和版本号分别与所述工作页面的页号以及版本号相同的元 数据信息;
所述备份单元, 具体用于当所述查询单元查找到页号和版本号分别与所 述工作页面的页号以及版本号相同的元数据信息时, 则将查找到的所述元数 据信息所对应的备份页面作为所述工作页面的备份页面。
第五方面, 本发明实施例提供一种计算机系统, 包括: 处理器、 第一存 储器、 操作系统内核; 其中, 所述处理器用于运行应用程序, 且所述处理器 内部包含有第二存储器, 所述第二存储器的数据存取速度大于所述第一存储 器的数据存取速度;
所述操作系统内核, 用于将所述应用程序的第一进程请求访问的共享虚 拟内存页面拷贝至所述第一存储器中, 并将拷贝到所述第一存储器中的共享 虚拟内存页面作为所述第一进程的工作页面; 在所述第一进程对所述工作页 面进行写操作之前, 创建所述工作页面的备份页面, 并将创建的所述备份页 面存储在所述第二存储器中, 以备份所述工作页面的原始数据; 其中, 所述 共享虚拟内存页面为所述应用程序的共享虚拟内存中的虚拟内存页面。
在第五方面的第一种可能的实施方式中, 所述共享虚拟内存页面的个数 为 N, N为大于或等于 1的正整数; 所述第一进程的工作页面的个数为 M, M为大于或等于 1的正整数;
所述操作系统内核, 还用于, 在将创建的所述备份页面存储在所述第一 存储器之前, 判断所述第一存储器的剩余空间是否小于第一阈值, 如果是, 则触发所述第一进程将所述第一进程的 M个工作页面中被修改的内容同步 更新到所述 M个工作页面所对应的 M个共享虚拟内存页面中, 并将所述 M 个工作页面在所述第一存储器中的备份页面所占用的空间释放。
结合第五方面, 或者第五方面的第一种可能的实施方式, 在第二种可能 的实施方式中, 所述第二存储器中保存有备份页面信息表, 其中, 所述备份 页面信息表包含有所述第二存储器中所有备份页面的元数据信息, 每一个备 份页面的元数据信息包括: 所述每一个备份页面的页号和版本号, 其中, 所 述每一个备份页面的页号和版本号分别与所述每一个备份页面所对应的工作 页面的页号和版本号相同;
所述操作系统内核, 具体用于, 在所述第一进程对所述工作页面进行第 一次写操作之前, 在所述备份页面信息表中查找是否有页号和版本号分别与 所述工作页面的备份页面, 并将创建的所述备份页面存储在所述第二存储器 中, 以备份所述工作页面的原始数据; 如果查找到, 则将查找到的所述元数 据信息所对应的备份页面为所述工作页面的备份页面。
由上述技术方案可知, 本发明实施例将共享虚拟页面中的数据内容拷贝 到片外内存中的工作页面, 供进程进行读和写操作, 同时利用计算节点的可 编程片上内存, 在对工作页面进行写操作之前, 将页面数据在片上内存中备 份, 以保证多个进程在对共享虚拟内存页面进行操作时的数据一致性, 由于 备份页面存储在片上内存中, 不会与工作页面竟争緩存空间, 更多的工作页 面可以存放在緩存中, 而緩存和片上内存的访问速度都比较快 (比访问片外 内存快 5 ~ 10倍) , 从而可以提高程序运行的性能;
进一步地, 通过主动的比较机制, 及时更新共享虚拟内存页面的内容, 保证在进行比较傲操作时, 工作页面基本上都还位于 cache中, 不需要进行 片外内存访问, 因此数据更新的速度很快。 附图说明
为了更清楚地说明本发明的技术方案, 下面将对实施例中所需要使用的 附图作一简单地介绍, 显而易见地, 下面附图只是本发明的一些实施例的附 图, 对于本领域普通技术人员来讲, 在不付出创造性劳动性的前提下, 还可 以根据这些附图获得同样能实现本发明技术方案的其它附图。
图 1 为本发明实施例提供的分布式共享内存模型示意图;
图 2 为本发明实施例提供的 Twin/Diff流程示意图;
图 3为本发明实施例提供的计算节点的逻辑架构图;
图 4为本发明实施例提供的一种数据处理方法流程图;
图 5为本发明实施例提供的共享虚拟内存空间示意图;
图 6为本发明实施例提供的另一种数据处理方法流程图;
图 7为本发明实施例提供的一种的数据处理方法示意图;
图 8为本发明实施例提供的备份页面的元数据信息示意图;
图 9为本发明实施例提供的另一种数据处理方法流程图;
图 10为本发明实施例提供的一种数据处理装置示意图;
图 11为本发明实施例提供的另一种数据处理装置示意图;
图 12为本发明实施例提供的一种计算节点的示意图;
图 13为本发明实施例提供的一种计算机系统的示意图。 具体实施方式
为使本发明的目的、 技术方案和优点更加清楚, 下面将结合本发明实施 例中的附图, 对本发明的技术方案进行清楚、 完整地描述。 显然, 下述的各 个实施例都只是本发明一部分的实施例。 基于本发明下述的各个实施例, 本 领域普通技术人员即使没有作出创造性劳动, 也可以通过等效变换部分甚至 全部的技术特征, 而获得能够解决本发明技术问题, 实现本发明技术效果的 其它实施例, 而这些变换而来的各个实施例显然并不脱离本发明所公开的范 围。
为使本领域一般技术人员更好的了解本发明实施例提供的技术方案, 首 先对本发明实施例技术方案的应用场景做一些简单的介绍, 本发明实施例提 供的技术方案可应用于在计算节点上, 通过改进现有的 Twin/Diff机制以实 现软件緩存一致性, 其中, 计算节点是指具有处理器和存储器, 部署有操作 系统并支持片上内存的计算机或芯片, 比如 Intel的 SCC ( Single Chip Cloud Computer, 单芯片云计算机) , 计算节点的处理器包含有一个或多个处理器 核, 且各个处理器核都在共享内存方式下维护其高速緩冲存储器 (Cache ) 。 在其它的应用场景中, 只要涉及软件緩存一致性, 本发明实施例的技术方案 均适用。 在具体的实施过程中, 本发明实施例技术方案的产品形态包括但不 限于: 操作系统, LIB库、 使用第三方 LIB库的应用系统以及部署有操作系 统和 /或 LIB库的计算机。
进一步地, 为了使本领域一般技术人员更好的了解本发明实施例提供的 技术方案, 对现有技术中的 Twin/Diff机制做一些简单的介绍, 参见图 2, 现 有技术中, Twin/Diff机制流程如下:
步骤 1 , 进程 A通过执行 Acquire(lockl), 获得锁 lockl , 进入区域 1 ; 步骤 2,如果进程 A读一个共享虚拟内存页面 P,且共享虚拟内存页面 P 在进程 A的地址空间中不存在映射, 则操作系统触发页错误 (Page Fault ) , 在进程 A的页错误处理函数中, 从共享虚拟内存页面 P的 home进程获得共 享虚拟内存页面 P的数据,并从片外内存申请一个物理内存页面保存该数据, 然后在进程 A的地址空间中建立共享虚拟内存页面 P与该物理内存页面的映 射关系, 并修改进程 A对共享虚拟内存页面 P的访问权限为只读; 转步骤 5; 步骤 3 ,如果进程 A写一个共享虚拟内存页面 P,且共享虚拟内存页面 P 在进程 A的地址空间中不存在映射, 则操作系统触发页错误 (Page Fault ) , 并在进程 A的页错误处理函数中, 从共享虚拟内存页面 P的 home进程获得 共享虚拟内存页面 P的数据,从片外内存申请一个物理内存页面保存该数据, 该物理内存页面即为进程 A的工作页面,然后在进程 A的地址空间中建立共 享虚拟内存页面 P与该物理内存页面的映射关系, 并在片外内存中为共享虚 拟内存页面 P保存一个 Twin页面 (维护一份相同的数据 ) , 修改进程 A对 共享虚拟内存页面 P的访问权限为可读写; 转步骤 5;
步骤 4,如果进程 A写一个共享虚拟内存页面 P,且共享虚拟内存页面 P 在进程 A的地址空间中存在映射 ,且进程 A对共享虚拟内存页面 P的访问权 限为只读, 则操作系统触发页错误(Page Fault ) , 在进程 A 页错误处理函 数中, 在片外内存中用一个备份页面(Twin页面)来备份共享虚拟内存页面 P中的原始数据, 修改进程 A对共享虚拟内存页面 P的访问权限为可读写; 转步骤 5;
步骤 5 , 进程 A正常读 /写共享虚拟内存页面 P;
步骤 6, 进程 A通过执行 Release(lockl), 触发比较( Diff )操作: 比较 共享虚拟内存页面 P所映射的物理内存页面 (工作页面) 与 Twin页面的数 据内容, 生成 Diff文件, 更新 home进程所维护的共享虚拟内存页面 P的数 据。 Diff操作完成后, 进程 A译放锁 lockl , 离开区域 1。
针对现有的 Twin/Diff机制存在的问题, 本发明提出了一种数据处理方 法, 首先, 以图 3为例介绍本发明实施例提供的数据处理方法所应用的计算 节点的逻辑结构,该计算机节点具体可以是集成有操作系统内核的多核芯片、 通用计算机、 云计算机、 分布式系统中的计算节点、 服务器等大型计算设备、 也可以是手机、 平板电脑等移动终端。 如图 3所示, 计算节点的硬件层包括 一个或多个处理器 (一个处理器可能包含多个核) , 例如 CPU, GPU, 当 然还可以包括片外存储器(片外内存、 硬盘等) 、 输入 /输出设备、 网络接口 等, 其中, 处理器内存集成有緩存(cache )和片上内存, 处理器的各个核之 中也集成有 cache; 在硬件层之上运行有操作系统内核 (例如 Linux Kernel ) 以及第三方库 Libraries (例如显示管理器 Surface Manager, 媒体框架 Media Framework等) , 第三方库可以被操作系统载入内存执行; 除此之外, 该计 算节点还可以包括应用层, 该应用层包括一个或多个应用程序等, 一个应用 程序包含有一个或多个进程, 一个进程又包含有一个或多个线程, 应用程序 运行在该计算节点上, 通过操作系统内核实现对硬件层的控制, 以完成相应 的功能。
如图 3所示,本发明实施例提供的数据处理方法可以由第三方库 Libraries 层以及应用层实施, 也可以在操作系统或者超级管理程序(hypervisor)层面实 现。 应用程序通过执行 acquire, release等函数, 来访问虚拟共享内存页面, 并触发硬件层执行相应操作, 以保证计算节点上运行的多个进程或线程在对 共享虚拟内存页面进行操作时的数据一致性。
具体地, 如图 4所示, 本发明实施例提供的数据处理方法包括:
S401 , 将第一进程请求访问的共享虚拟内存页面拷贝至计算节点的片外 内存中, 并将拷贝到所述片外内存中的共享虚拟内存页面作为第一进程的工 作页面; 其中, 所述共享虚拟内存页面为所述第一进程所属应用程序的共享 虚拟内存中的虚拟内存页面, 且所述应用程序运行在所述计算节点上;
图 5所示的是第一进程 P0所属的应用程序 1的共享虚拟内存空间示意
图, 假设应用程序 1包含 4个进程: 第一进程 Ρ0, 以及第二进程 Ρ1〜Ρ3分别 运行在计算节点的不同的处理器核上, 它们有统一的共享虚拟内存用于存放 共享数据, 且每一个进程都单独维护该共享虚拟内存中的一块共享区域, 每 个共享区域包含一个或多个虚拟内存页面; 如图 5所示, 虚拟地址空间中的 第 1块区域映射到 Ρ0的私有物理内存中, 第 2块区域映射到 P1的私有物理 内存中, 第 3块区域映射到 Ρ2的私有物理内存中, 第 4块区域映射到 Ρ3的 私有物理内存中。 各个进程在用户层面看到的是一个完整的共享虚拟内存, 而感知不到共享虚拟内存中某块虚拟内存页包含的共享数据实际上是在其它 进程维护的私有物理内存空间中。 各个进程可以对共享虚拟内存进行任意数 据操作, 计算节点底层通过片上网络(On-chip Network ) 、 互联网络
( Interconnection Network )或者所有进程都可以访问的系统共享物理内存在 各进程间进行数据的同步。 其中, 本发明实施例所述的第二进程, 是指应用 程序 1中, 除第一进程之外的其它所有进程中的一个, 仅用于与第一进程所 区分, 并不用于特指某一个进程。
在本发明的各个实施例中, 第一进程请求访问的共享虚拟内存页面, 具 体是指第一进程请求读或写的共享虚拟内存页面; 具体地, 如果第一进程 P0 读或写一个共享虚拟内存页面 p ,且共享虚拟内存页面 P在第一进程 P0的物 理地址空间中不存在映射, 则操作系统触发页错误(Page Fault ) , 在第一进 程 P0的页错误处理函数中,从 P的 home进程获得共享虚拟内存页面 P的数 据, 并从计算节点的片外内存申请一个物理内存页面作为第一进程的一个工 作页面, 同时建立共享虚拟内存页面 P与该物理内存页面的映射关系, 并将 共享虚拟内存页面 P的数据写入该物理内存页面; 其中, 工作页面是可供第 一进程进行读和写操作的页面, 第一进程在读或者写共享虚拟页面的时候, 实际上是在读或者写该共享虚拟页面对应的工作页面, 这样保证了多个进程 在读写同一个共享虚拟页面时, 不会造成冲突。 另外需要说明的是, 第一进 程拷贝到片外内存中的共享虚拟页面可以为多个, 第一进程的工作页面的个
数也为多个, 一般而言, 两者个数相同, 即每一个工作页面都对应于一个共 享虚拟内存页面, 可以理解的是, 在另一种实施方式中, 共享虚拟内存页面 的和工作页面可以不——对应, 一个共享虚拟内存页面的数据可以存放到多 个工作页面中, 或者多个虚拟内存页面的数据可以存放到一个工作页面中。
需要说明的是, 在一个实施例中, 应用程序 1的共享虚拟内存中的不同 区域, 是由不同的进程或线程来单独维护的 (即图 5所描述的情形) , 在这 种情形下, 第一进程具体可以从共享虚拟内存页面 P的 home进程获得共享 虚拟内存页面 P的数据。 在另一个实施例中, 如果应用程序 1的整个共享虚 拟内存空间是由应用程序 1的所有进程共同维护的, 那么第一进程在读共享 虚拟内存页面 P的时候, 就不需要从 P的 home进程获得页面 P的数据, 而 是可以直接读取共享虚拟内存页面 P的数据。 还需要说明的是, 本发明实施 例所描述的片外内存,是指计算节点的 CPU外部的存储器, 比如计算节点的 内存、 硬盘等。
S402, 在第一进程对该工作页面进行写操作之前, 创建该工作页面的备 份页面, 并将创建的备份页面存储在所述计算节点的片上内存中, 以备份该 工作页面的原始数据;
具体地, 可以在第一进程首次写该工作页面的时候, 创建该工作页面的 备份页面, 以备份该工作页面的原始数据, 可以理解的是, 工作页面的原始 数据, 即为该工作页面在被进程进行读或写操作之前保存的数据; 当在片上 内存中成功创建了该工作页面的备份页面后, 操作系统跳出第一进程的页错 误处理函数,从而使得第一进程从产生 page fault错误的地方重新执行,进而 对该工作页面中的数据进行读或写操作。 由于在片上内存中已经维护了一份 该工作页面的原始数据, 后续无论第一进程对该工作页面作何修改, 均可以 通过比较该工作页面的当前数据内容与该工作页面的备份页面中的原始数据 内容, 确定该工作页面中哪些部分的内容已经被进程修改, 进而可以将被修 改的这些内容同步更新到该工作页面所对应的共享虚拟内存页面中。
本发明实施例所描述的片上内存, 可以是计算节点的 CPU内部的存储 器, 比如可编程片上内存 (例如 Intel SCC众核平台提供了可编程片上内存 MPB ( Message Passing Buffer ) ) ; 进一步地, 片上内存可以是计算节点的 CPU内部, 除緩存 (如 LI cache, L2 cache )之外的另一片存储区域, 如果 该计算节点的 CPU具有多个核, 则各个核可以共享该片上内存。 片上内存空 间不是很大, 但访问延时与计算节点的 CPU的二级緩存 L2 cache类似, 是 一种不错的资源。
需要说明的是, 第一进程在读或写共享虚拟内存页面 P之前, 一般会通 过执行 Acquire(lockl) , 获得锁 lockl , 以进入页面 P所在的共享虚拟内存区 域 1 ; 同时, 第一进程可通过执行 Release(lockl), 退出共享虚拟内存区域 1 , 同时触发 Diff操作: 比较共享虚拟内存页面 P所映射的物理内存页面(工作 页面) 与备份页面的数据内容, 生成用于记录两者的数据内容差异的日志文 件 Diff, 以使共享虚拟内存页面 P的 home进程更新共享虚拟内存页面 P中 的数据。 Diff操作完成后, 第一进程释放锁 lockl , 离开区域 1。
在一种更具体的实施方式中, 第一进程所属应用程序 1的每个进程, 在 该片上内存中分别独占一块片上存储区, 以存放该进程的工作页面的备份页 面。 在这种情形下, 在创建所述工作页面的备份页面之前, 还包括: 在所述 计算节点的片上内存中, 预先给应用程序 1的各个进程分配特定大小的片上 存储区; 其中, 为各个进程分配的片上存储区的大小, 本领域技术人员可以 根据片上内存的总容量, 可用容量来确定, 也可以根据经验值来设定, 另外, 各个进程的片上存储区大小可以相同, 也可以不同。
相应地, 将创建的所述备份页面存储在所述计算节点的片上内存中, 包 括: 将创建的所述备份页面存储在为第一进程预先分配的片上存储区中。
最后需要说明的是, 本发明实施例中以第一进程为例来阐述本发明技术 方案, 但不应理解为对本发明方案执行主体的限制, 本领域技术人员可以理 解的是, 本发明实施例方案的执行实体可以为进程或者线程。 该执行实体或
者为线程, 或者为进程, 不可以在完整的实现方法中既代表线程, 又代表进 也可以在进程对应的维度内实现。
本发明实施例通过以上技术方案, 将进程请求读或写的共享虚拟内存页 面先拷贝在计算节点片外内存中, 作为可供进程进行读写操作的工作页面, 同时利用计算节点的 CPU的片上内存, 在进程对工作页面进行写操作之前, 将工作页面中的原始数据在片上内存中备份, 以保证多个进程在对共享虚拟 内存页面进行操作时的数据一致性, 由于备份页面存储在片上内存中, 页面 的访问速度可以得到保证, 同时, 备份页面与工作页面分开存储, 使得备份 页面不会与工作页面竟争緩存空间, 更多的工作页面可以存放在緩存中, 从 而可以提高程序运行的性能。
本发明实施例提供了另一种计算节点上的数据处理方法, 如图 6所示, 该方法包括:
5601 ,将第一进程请求访问的 N个共享虚拟内存页面拷贝至计算节点的 片外内存中, 并将拷贝到片外内存中的 N共享虚拟内存页面作为第一进程的
M个工作页面; 其中, 共享虚拟内存页面为第一进程所属应用程序的共享虚 拟内存中的虚拟内存页面, M、 N均为大于或等于 1的正整数;
一般而言, M=N, 即每一个工作页面都唯一对应于一个共享虚拟内存页 面, 可以理解的是, 在另一种实施方式中, 共享虚拟内存页面的和工作页面 可以不——对应,一个共享虚拟内存页面的数据可以存放到多个工作页面中, 或者多个虚拟内存页面的数据可以存放到一个工作页面中。
5602, 在第一进程对 M个工作页面的任一个进行写操作之前, 创建该工 作页面的备份页面;
5603 , 判断该计算节点的片上内存的剩余空间是否小于第一阈值, 如果 是, 则触发第一进程将 M个工作页面中被修改的内容同步更新到该 M个工 作页面所对应的各个共享虚拟内存页面中,并将该 M个工作页面在片上内存
中的备份页面所占用的空间释放。
其中,第一进程将自身的 M个工作页面中被修改的内容同步更新到各个 工作页面所对应的各个共享虚拟内存页面中, 并将各个工作页面在片上内存 中的备份页面所占用的空间释放的过程, 我们称之为 "第一进程执行比较 ( Diff )操作" 。 在一个实施例中, 进程 A执行比较操作具体包括: 将进程 A的所有工作页面中的每一个工作页面与该工作页面在片上内存中的备份页 面进行比较, 比较两者的数据内容差异, 即找出被进程 A修改过, 数据发生 变化的部分, 并生成用于记录两者的数据内容差异的日志文件, 根据所述日 志文件将进程 A对每一个工作页面修改的内容更新到该工作页面所对应的共 享虚拟页面中。 需要说明的是, 根据日志文件更新共享虚拟页面的操作, 可 以由进程 A自身来完成, 也可以由被更新的共享虚拟页面的 home进程来完 成, 具体需要根据具体的应用场景来确定。
具体地, 在创建一个工作页面的备份页面后, 如果片上内存的剩余空间 小于第一阈值, 会导致该工作页面的数据无法备份到片上内存中, 从而触发 第一进程执行比较操作, 从而可以释放片上内存空间, 并刷新共享虚拟内存 空间中相应页面的数据; 可以理解的是, 本领域技术人员可将片上内存的总 容量、 可用存储空间等因素综合考虑后, 来设定该第一阈值, 也可根据经验 值来设置, 此处不对其做特别的限定。
需要说明的是, 本发明实施例通过计算节点的片上内存空间来备份工作 页面, 在不同的应用实例中, 片上内存空间的划分可以采用不同的方式, 相 应地, 根据片上内存空间的划分方式不同, 触发第一进程执行比较操作的时 机和方式也有所不同:
在第一种可能的实施方式中, 应用程序的每个进程在片上内存中有单独 的片上存储区; 即在所述计算节点的片上内存中, 预先给应用程序的各个进 程分配特定大小的片上存储区; 其中, 为各个进程在片上内存分配的存储空 间大小可以相同, 也可以不同。 在这种情形下, 步骤 S603中的判断步骤,
就具体包括: 判断所述第一进程的片上存储区的剩余空间是否小于步骤 S602 中创建的一个备份页面的大小, 或者小于第二阈值。 相应地, 如果判断出第 一进程的片上存储区的剩余空间小于一个备份页面的大小, 或者小于第二阈 值, 则触发第一进程执行比较操作。
在第二种可能的实施方式中, 应用程序的所有进程共享整个片上内存, 或者片上内存中的局部区域, 即计算节点上的所有进程都可以将备份页面保 存在片上内存中。 在这种情形下, 第一阈值可以为步骤 S602中创建的备份 页面的大小; 即步骤 S603中的判断步骤, 就具体包括: 判断所述计算节点 的片上内存的剩余空间是否小于步骤 S602中创建的一个备份页面的大小。 相应地, 如果判断出所述计算节点的片上内存的剩余空间小于步骤 S602中 创建的一个备份页面的大小, 则触发进程执行比较操作。 进一步地, 触发进 程执行比较操作有两种策略:
( 1 )仅触发第一进程执行比较操作, 应用程序的其它进程不受影响。
( 2 ) 触发第一进程所属应用程序 1的所有进程执行比较操作。
在第三种可能的实施方式中,计算节点的片上内存空间不是全局共享的, 而是局部共享的, 即只有部分进程可以共享片上内存中的局部区域。 这种片 上内存的划分方式具体为: 整个片上内存空间被划分为多块相互独立的存储 区域, 第一进程所属的应用程序 1的所有进程被划分为一个或多个进程组, 每个进程组中的进程共享多块独立的存储区域中的一个, 以作为该进程组的 片上公共緩存区; 即每个进程组中的进程可以访问相同的片上内存空间, 不 同进程组访问不同的片上内存空间。 比如片上内存 1可以被 core 0 ~ core3访 问, 片上内存 2可以被 core4 ~ core7访问, 片上内存 3可以被 core8 ~ corel 1 访问, 片上内存 4可以被 core 12 ~ core 15访问。 一个进程组中的所有进程都 可以将自身工作页面的备份页面保存在片上内存中的某块存储区域上。 在这 种片上内存划分方式下, 将创建的所述备份页面存储在所述计算节点的片上 内存中, 具体包括: 将创建的所述备份页面存储在为所述第一进程所在进程
组的片上公共緩存区中; 相应地, 步骤 S603中的判断步骤, 就具体包括: 判断第一进程所在的进程组的片上公共緩存区的剩余空间是否小于步骤 S602中创建的一个备份页面的大小, 或者小于第二阈值。 相应地, 如果判断 出第一进程所在的进程组的片上公共緩存区的剩余空间小于步骤 S602中创 建的一个备份页面的大小, 或者小于第二阈值, 则会导致创建该工作页面的 备份页面失败, 进而触发进程执行比较操作, 同样, 触发进程执行比较操作 有有两种策略:
( 1 )仅触发第一进程执行比较操作, 第一进程所在的进程组中的其它进 程不受影响。
( 2 )在第一进程所在的进程组中广播失败信息,触发进程组中所有进程 执行比较操作。
需要说明的是, 进程执行比较操作的具体流程与之前的描述相同, 其它 进程执行比较操作的流程, 与第一进程执行比较操作流程类似, 此处不再贅 述, 还需要说明的是, 第二阈值可根据片上内存的总容量、 可用存储空间等 因素来设定, 也可根据经验值来设定, 此处不对其做特别的限定。
本发明实施例中, ^殳计算节点的片上内存空间比 L2 cache空间要小, 因此以片上内存空间无法容纳下一个备份页面为比较操作的触发条件; 如果 片上内存空间比 L2 cache大,则可以以备份页面所占空间与 L2 cache大小相 等为比较操作的触发条件。 另外, 其它启发式的触发条件判断也是可行的。 如果计算节点的片上内存比较大, 也可以考虑将工作页面保存在片上内存空 间中。
本发明实施例通过以上技术方案, 将进程请求读或写的共享虚拟内存页 面先拷贝在计算节点片外内存中, 作为可供进程进行读写操作的工作页面, 同时利用计算节点的 CPU的片上内存, 在进程对工作页面进行写操作之前, 将工作页面中的原始数据在片上内存中备份, 以保证多个进程在对共享虚拟 内存页面进行操作时的数据一致性, 由于备份页面存储在片上内存中, 页面
的访问速度可以得到保证, 同时, 备份页面与工作页面分开存储, 使得备份 页面不会与工作页面竟争緩存空间, 更多的工作页面可以存放在緩存中, 从 而可以提高程序运行的性能; 进一步地, 通过主动触发的比较操作, 及时更 新共享虚拟内存页面的内容, 保证在进行比较操作时, 工作页面基本上都还 位于 cache中, 不需要进行片外内存访问, 因此比较操作的速度很快。
S604, 将创建的所述备份页面存储在所述计算节点的片上内存中, 以备 份所述该工作页面的原始数据;
其中, 步骤 S601、 S602、 S604的具体实施细节可以参照上述方法实施 例中的步骤 S401、 S402, 此处不再贅述。
基于上述方法实施例, 下面通过一个具体的应用实例来描述本发明技术 方案, 假设应用程序的各个进程各自维护共享虚拟内存中的一片区域, 即是 不同区域内的虚拟内存页面有不同的 home进程, 如图 7所示, 基于这种场 景的方法流程如下:
( 1 ) 第一进程 A通过执行 Acquire(lockl), 获得锁 lockl , 进入区域 1; ( 2 )如果第一进程 A读一个共享虚拟内存页面 P,且共享虚拟内存页面
P在进程 A的地址空间中不存在映射,则操作系统触发页错误 ( Page Fault ) , 并在进程 Α的页错误处理函数中, 从共享虚拟内存页面 P的 home进程获得 共享虚拟内存页面 P的数据, 并从片外内存申请一个物理内存页面保存该数 据, 然后在进程 A的地址空间中建立共享虚拟内存页面 P与该物理内存页面 的映射关系, 并将该物理内存页面作为进程 A的工作页面, 同时修改进程 A 对共享虚拟内存页面 P的访问权限为只读; 转步骤 5;
( 3 ) 如果进程 A写一个共享虚拟内存页面 P, 且共享虚拟内存页面 P 在进程 A的地址空间中不存在映射, 则操作系统触发页错误 (Page Fault ) , 并在进程 A的页错误处理函数中, 从共享虚拟内存页面 P的 home进程获得 共享虚拟内存页面 P的数据, 并从片外内存申请一个物理内存页面保存该数 据, 然后在进程 A的地址空间中建立共享虚拟内存页面 P与该物理内存页面
的映射关系, 将该物理内存页面作为进程 A的工作页面, 并在可编程片上内 存中为该工作页面创建一个 Twin页面 (维护一份相同的数据, 这个过程中 如果创建 Twin页面失败, 会触发主动的 Diff操作) , 修改进程 A对共享虚 拟内存页面 P的访问权限为可读写; 转步骤 5;
( 4 ) 如果进程 A写一个共享虚拟内存页面 P, 且共享虚拟内存页面 P 在进程 A的地址空间中存在映射 ,且进程 A对共享虚拟内存页面 P的访问权 限为只读, 则操作系统触发页错误(Page Fault ) , 并在进程 A的页错误处理 函数中,在可编程片上内存中为共享虚拟内存页面 P保存一个 Twin页面(维 护一份相同的数据, 这个过程中可能会触发积极主动的 Diff操作) , 修改进 程 A对共享虚拟内存页面 P的访问权限为可读写; 转步骤 5;
( 5 ) 进程 A正常读 /写共享虚拟内存页面 P;
( 6 )进程 A通过执行 Release(lockl) , 触发 Diff操作: 对还未进行 Diff 操作的共享虚拟内存页面所映射的物理内存页面 (工作页面) 与 Twin页面 的数据内容进行比较, 生成日志文件 Diff, 更新各共享虚拟内存页面所对应 home进程维护的共享虚拟内存页面的数据。 Diff操作完成后, 进程 A释放 锁 lockl , 离开区域 1。
需要说明的是,其它共享虚拟内存页面处理方式同共享虚拟内存页面 P。 进一步地, 由于计算节点的片上内存, 一般都是全局共享的, 也就是说 可以被计算节点的所有 core访问, 因此, 本发明实施例提出了备份页面资源 池的方案。
由于可编程片上内存是所有 core都可以访问的, 因此可编程片上内存中 保存的备份页面也是一种共享资源,可以被不同 core共享。比如多个进程(不 管在相同 core上或者不同 core上)在某个时间段都对页面 X的不同位置进行 了写操作,按照上述实施例中的方案,每个进程都需要一个单独的备份页面, 这样浪费了内存空间。 由于片上内存是所有 core都可以访问的, 因此不同进 程的同一个共享虚拟内存页面的同一个版本, 在片上内存空间只需要保存一
份备份页面即可。 基于此, 可以对本发明实施例的数据处理方法做进一步优 化, 在步骤创建工作页面的备份页面之前, 可以先在计算节点的片上内存中 查找是否存在该工作页面的备份页面, 如果查找到, 就可以跳过 S602中创 建备份页面的步骤, 以及步骤 S603、 S604; 如果没有查找到, 才执行步骤 S602中创建备份页面的步骤, 以及步骤 S603、 S604。
在一种具体的实现方式中, 可以用一个数据结构, 比如备份页面队列或 备份页面信息表来记录片上内存中各个备份页面的元数据信息, 其中, 备份 页面的元数据信息包括: 备份页面的页号 Twin Page Id和版本号 Twin Page Version; 在一个更优的实施例中, 如图 8所示, 备份页面的元数据信息可以 包括: Twin Page Id, Twin Page Version, Twin Page Usage和 Twin Page Address„ 其中, 各个字段的含义如下:
Twin Page Id:备份页面所对应的工作页面所映射的共享虚拟内存页面的 页号, 不同进程中同一个共享虚拟内存页面的页号相同;
Twin Page Version: 备份页面的版本号, 不同进程中同一个共享虚拟内 存页面所对应的备份页面版本号可能不同;
需要说明的是, 备份页面的版本号与备份页面所对应的工作页面的版本 号相同, 而工作页面的版本号, 是进程在创建该工作页面时, 该工作页面所 对应的共享虚拟内存页面的版本号。 具体地, 进程在创建一个工作页面时, 即将一个共享虚拟内存页面拷贝至计算节点的片外内存中作为该进程的一个 工作页面时,该工作页面的版本号即为该拷贝的共享虚拟内存页面的版本号; 一般来说, 一个共享虚拟内存页面的版本号的初始值为 1 , 后续不同的进程 均可以对该共享虚拟内存页面中的数据进行读和写操作, 进程每次更新该共 享虚拟内存页面中的内容之后, 该共享虚拟内存页面的版本号就会递增。 因 此, 同一个共享虚拟内存页面在不同进程中所对应的工作页面的版本号可能 不同, 进而导致其所对应的备份页面版本号也不同。
Twin Page Usage: 备份页面的使用情况, 记录当前使用该版本的备份页
面的进程数目;
Twin Page Address: 备份页面在可编程片上内存中的地址, 进程可以根 据该地址访问相应版本的备份页面。
在这种情形下, 具体可以采用如下方式, 在计算节点的片上内存中查找 是否存在某个工作页面的备份页面: 在创建一个工作页面的备份页面之前, 根据该工作页面的页号以及版本号, 在用于记录备份页面资源池中各个备份 页面的元数据信息的备份页面信息表中查找是否有页号和版本号分别与该工 作页面的页号以及版本号相同的元数据信息;
相应地, 在步骤 S602中, 创建备份页面的步骤具体包括: 如果没有在 所述备份页面信息表中查找到页号和版本号分别与所述工作页面的页号以及 版本号相同的元数据信息, 则创建该工作页面的备份页面; 然后继续执行后 续步骤 S603、 S604; 进一步地, 如果查找到页号和版本号分别与该工作页面 的页号以及版本号相同的元数据信息, 则确定查找到的元数据信息所对应的 备份页面为该工作页面的备份页面, 并跳过 S602中创建备份页面的步骤, 以及步骤 S603、 S604。
进一步地, 在所述创建该工作页面的备份页面之后, 还可以将该工作页 面的页号以及版本号分别作为创建的备份页面的页号和版本号记录到备份页 面信息表。
下面通过具体的实例对上述方案进行说明:
( 1 ) 初始阶段, 共享虚拟内存页面 X在 Home进程的版本号为 1。
( 2 )某个时刻,进程 A、进程 B分别进行 Acquire(lockl) , Acquire(lock2) 操作, 从 Home进程获得了共享虚拟内存页面 X的拷贝, 并且分别进行了写 操作。 假设进程 A先写, 由于在备份页面信息表中找不到共享虚拟内存页面 X所对应的版本号为 1的备份页面 X ,则在片上内存中创建版本号为 1的备份 页面 X , 并设置页面 X的 Twin Page Usage为 1。 当进程 B写共享虚拟内存页 面 X时, 由于可以在备份页面信息表中找到版本号为 1的备份页面 X , 因此
不用再创建同样的备份页面 X ,只需要将备份页面 X的 Twin Page Usage修改 为 2。
( 3 )后续某个时刻, 进程 A通过 Release操作触发 Diff操作, 或者通过 上述主动的 Diff操作 , 更新 Home进程的共享虚拟内存页面 x , Home进程 的共享虚拟内存页面 X的版本号顺序递增, 变为 2, 同时, 备份页面信息表 中备份页面 X的 Twin Page Usage修改为 1。
( 4 ) 进程 C进行 Acquire(lock3)操作, 从 Home进程获得了共享虚拟内 存页面 X的拷贝, 并且进行了写操作。 进程 C获得的共享虚拟内存页面 X的 拷贝的版本号为 2, 而备份页面信息表中能够查找到的备份页面 X的版本号 为 1 , 两者不匹配, 所以会在片上内存中创建版本号为 2的备份页面 X , 并设 置其 Twin Page Usage为 1。
进一步地, 在另一个实施例中, 计算节点的片上内存空间可以不是全局 共享的, 而是局部共享的, 也就是说整个片上内存空间被划分为多块相互独 立的存储区域; 相应地, 第一进程所属的应用程序的所有进程被划分为至少 一个进程组, 每个所述进程组中的各个进程共享所述多个独立的存储区域中 的一个存储区域, 以作为该进程组的片上公共緩存区, 且每个进程组维护有 一个单独的备份页面信息表, 每一个进程组的备份页面信息表包含有该进程 组中所有进程的所有备份页面的元数据信息。 其中, 备份页面的元数据信息 的具体定义前面已经做了说明, 此处不再贅述。 在这种片上内存局部共享的 情形下, 在计算节点的片上内存中查找是否存在某个工作页面的备份页面, 具体包括:
根据工作页面的页号以及版本号, 在第一进程所在进程组的备份页面信 息表中查找是否有页号和版本号分别与该工作页面的页号以及版本号相同的 元数据信息;
相应地, 在步骤 S602中, 创建备份页面的步骤具体包括: 如果没有在 第一进程所在进程组的备份页面信息表中查找到页号和版本号分别与该工作
页面的页号以及版本号相同的元数据信息, 则创建该工作页面的备份页面; 然后继续执行后续步骤 S603、 S604; 如果查找到页号和版本号分别与该工作 页面的页号以及版本号相同的元数据信息, 则确定查找到的元数据信息所对 应的备份页面为该工作页面的备份页面, 并跳过 S602中创建备份页面的步 骤, 以及步骤 S603、 S604。
进一步地, 在创建该工作页面的备份页面之后, 可以将该工作页面的页 号以及版本号分别作为创建的备份页面的页号和版本号记录到第一进程所在 进程组的备份页面信息表。
本发明实施例提出的基于备份页面共享的优化方案, 可在前述方法实施 例的基础上, 进一步减少备份页面占用的片上内存空间, 节约系统资源。
如图 9所示, 本发明实施例提供另一种数据处理方法, 包括:
S901 , 将第一进程请求访问的共享虚拟内存页面拷贝至计算节点的片外 内存中, 并将拷贝到片外内存中的共享虚拟内存页面作为第一进程的工作页 面; 其中, 共享虚拟内存页面为第一进程所属应用程序的共享虚拟内存中的 虚拟内存页面, 该应用程序运行在该计算节点上;
5802 , 在第一进程对该工作页面进行写操作之前, 在该计算节点的片上 内存中查找是否存在该工作页面的备份页面, 如果查找到, 则确定查找到的 备份页面为所述工作页面的备份页面, 其中, 该备份页面保存有该工作页面 中的原始数据。
可选地, 该数据处理方法还可以包括:
5803 , 如果没有查找到, 则创建该工作页面的备份页面, 并将创建的该 备份页面存储在该计算节点的片上内存中, 其中, 该备份页面用于备份该工 作页面中的原始数据。
进一步地, 如果第一进程请求访问的共享虚拟内存页面的个数为 N; 第 一进程的工作页面的个数为 M, 则该数据处理方法还包括:
在将创建的该备份页面存储在计算节点的片上内存之前, 判断片上内存
的剩余空间是否小于第一阈值, 如果是, 则触发第一进程将自身的 M个工作 页面中被修改的内容同步更新到该 M个工作页面所对应的 M个共享虚拟内 存页面中, 并将该 M个工作页面在片上内存中的备份页面所占用的空间译 放; 如果否, 则执行 S803中将备份页面存储在片上内存中的步骤。
在一种具体的实现方式中,可以在用保存在片上内存中的一个数据结构, 比如备份页面队列或备份页面信息表来记录片上内存中各个备份页面的元数 据信息, 其中, 备份页面的元数据信息的具体定义前面已经做了说明, 此处 不再赘述。
在这种情形下, 具体可以采用如下方式查找是否存在某个工作页面的备 份页面: 在创建一个工作页面的备份页面之前, 根据该工作页面的页号以及 版本号, 在用于记录备份页面资源池中各个备份页面的元数据信息的备份页 面信息表中查找是否有页号和版本号分别与该工作页面的页号以及版本号相 同的元数据信息。 相应地, 如果查找到, 则确定查找到的元数据信息所对应 的备份页面为该工作页面的备份页面; 如果没有查找到, 则创建该工作页面 的备份页面, 并将创建的备份页面存储在计算节点的片上内存中。
进一步地, 在所述创建该工作页面的备份页面之后, 还可以将该工作页 面的页号以及版本号分别作为创建的备份页面的页号和版本号记录到备份页 面信息表。
进一步地, 在另一个实施例中, 计算节点的片上内存空间可以不是全局 共享的, 而是局部共享的, 也就是说整个片上内存空间被划分为多块相互独 立的存储区域; 相应地, 第一进程所属的应用程序的所有进程被划分为至少 一个进程组, 每个所述进程组中的各个进程共享所述多个独立的存储区域中 的一个存储区域, 以作为该进程组的片上公共緩存区, 且每个进程组维护有 一个单独的备份页面信息表, 每一个进程组的备份页面信息表包含有该进程 组中所有进程的所有备份页面的元数据信息。 其中, 备份页面的元数据信息 的具体定义前面已经做了说明, 此处不再贅述。 在这种片上内存局部共享的
情形下, 在计算节点的片上内存中查找是否存在某个工作页面的备份页面, 具体包括:
根据工作页面的页号以及版本号, 在第一进程所在进程组的备份页面信 息表中查找是否有页号和版本号分别与该工作页面的页号以及版本号相同的 元数据信息;
相应地, 如果查找到, 则直接将查找到的元数据信息所对应的备份页面 作为该工作页面的备份页面。 如果没有查找到, 则创建该工作页面的备份页 面, 并将创建的备份页面存储在计算节点的片上内存中。
进一步地, 在创建该工作页面的备份页面之后, 可以将该工作页面的页 号以及版本号分别作为创建的备份页面的页号和版本号记录到第一进程所在 进程组的备份页面信息表。
本发明实施例提出的基于备份页面共享的数据处理方法, 可在前述方法 实施例的基础上,进一步减少备份页面占用的片上内存空间, 节约系统资源。
本发明实施例还提供了一种数据处理装置, 该数据处理装置可以以 library库形式实现, 也可以在操作系统或者超级管理程序(hypervisor)层面实 现。 如图 10所示, 该数据处理装置 90包括: 拷贝单元 910, 用于将第一进 程请求访问的共享虚拟内存页面拷贝至计算节点的片外内存中, 并将拷贝到 所述片外内存中的共享虚拟内存页面作为第一进程的工作页面; 其中, 第一 进程请求访问的共享虚拟内存页面, 具体为第一进程所属应用程序的的共享 虚拟内存中, 第一进程请求读或者写的一个或多个虚拟内存页面;
具体地, 如果第一进程 P0读或者写一个共享虚拟内存页面 P , 则数据处 理装置会触发页错误 (Page Fault ) , 在第一进程 P0的页错误处理函数中, 拷贝单元 910获得共享虚拟内存页面 P的数据, 从计算节点的片外内存申请 一个物理内存页面作为第一进程的一个工作页面, 同时建立共享虚拟内存页 面 P与该物理内存页面 (工作页面) 的映射关系, 并将共享虚拟内存页面 P 的数据写入该物理内存页面; 其中, 工作页面是可供第一进程进行读和写操
作的页面, 第一进程在读或者写共享虚拟页面的时候, 实际上是在读或者写 该共享虚拟页面对应的工作页面, 这样保证了多个进程在读写同一个共享虚 拟页面时, 不会造成冲突。每一个工作页面都对应于一个共享虚拟内存页面, 如果第一进程拷贝到片外内存中的共享虚拟页面为多个, 那么第一进程的工 作页面的个数也为多个。 需要说明的是, 在一个实施例中, 第一进程所属应 用程序的共享虚拟内存中的不同区域, 是由不同的进程或线程来单独维护的 (即图 5所描述的情形) , 在这种情形下, 拷贝单元 910具体可以从共享虚 拟内存页面 P的 home进程获得共享虚拟内存页面 P的数据。 在另一个实施 例中, 如果应用程序的共享虚拟内存空间是由应用程序的所有进程共同维护 的, 那么拷贝单元 910在读或写共享虚拟内存页面 P的时候, 就不需要从 P 的 home进程获得页面 P的数据, 而是可以直接读取共享虚拟内存页面 P的 数据。
备份单元 920, 用于在第一进程对该工作页面进行写操作之前, 创建该 工作页面的备份页面,并将创建的备份页面存储在该计算节点的片上内存中, 以备份该工作页面的原始数据;
如果备份单元 920成功创建了一个工作页面的备份页面, 并将该备份页 面存放到在片上内存之后, 会自动跳出第一进程的页错误处理函数, 从而触 发第一进程从产生 page fault错误的地方重新执行,进而对该工作页面中的数 据进行读或写操作。 由于在片上内存中已经维护了一份该工作页面的原始数 据, 后续无论第一进程对该工作页面作何修改, 均可以通过比较该工作页面 的当前数据内容与该工作页面的备份页面中的原始数据内容, 确定该工作页 面中哪些部分的内容已经被进程修改, 进而可以将被修改的这些内容同步更 新到该工作页面所对应的共享虚拟内存页面中。
具体地, 本发明实施例所描述的片外内存, 是指计算节点的 CPU外部的 存储器, 比如计算节点的内存、 硬盘等; 本发明实施例所描述的片上内存, 可以是计算节点的 CPU内部的存储器,比如可编程片上内存(例如 Intel SCC
众核平台提供了可编程片上内存 MPB ( Message Passing Buffer ) ) ; 进一步 地, 片上内存可以是计算节点的 CPU内部, 除緩存(如 LI cache, L2 cache ) 之外的另一片存储区域, 如果该计算节点的 CPU具有多个核, 则各个核可以 共享该片上内存。 片上内存空间不是很大, 但访问延时与计算节点的 CPU的 二级緩存 L2 cache类似, 是一种不错的资源。
进一步地, 在另一个实施例中, 假设拷贝单元 910拷贝了 N个共享虚拟 内存页面到计算节点的片外内存中, 第一进程的工作页面为 M个, M、 N均 为大于 1的正整数, 则数据处理装置 90还包括:
判断单元 930, 用于在备份单元 920将创建的备份页面存储在所述计算 节点的片上内存之前, 判断所述片上内存的剩余空间是否小于第一阈值; 触发单元 940, 用于在判断单元 930判断出片上内存的剩余空间小于第 一阈值时,触发第一进程将第一进程的 M个工作页面中被修改的内容同步更 新到该 M个工作页面所对应的 M个共享虚拟内存页面中, 并将该 M个工作 页面的备份页面所占用的空间译放; 当所述判断单元判断出所述片上内存的 剩余空间不小于第一阈值时, 触发备份单元 920将创建的备份页面存储到该 计算节点的片上内存中。
其中,第一进程将自身的 M个工作页面中被修改的内容同步更新到各个 工作页面所对应的各个共享虚拟内存页面中, 并将各个工作页面在片上内存 中的备份页面所占用的空间释放的过程, 我们称之为 "第一进程执行比较 ( Diff )操作" 。 在一个实施例中, 进程 A执行比较操作具体包括: 将进程 A的所有工作页面中的每一个工作页面与该工作页面在片上内存中的备份页 面进行比较, 比较两者的数据内容差异, 即找出被进程 A修改过, 数据发生 变化的部分, 并生成用于记录两者的数据内容差异的日志文件, 根据所述日 志文件将进程 A对每一个工作页面修改的内容更新到该工作页面所对应的共 享虚拟页面中。 需要说明的是, 根据日志文件更新共享虚拟页面的操作, 可 以由进程 A自身来完成, 也可以由被更新的共享虚拟页面的 home进程来完
成, 具体需要根据具体的应用场景来确定。
具体地, 在备份单元 920创建一个工作页面的备份页面后, 如果片上内 存的剩余空间小于第一阈值, 会导致该工作页面的数据无法备份到片上内存 中, 从而使得触发单元 940触发第一进程执行比较操作, 从而释放片上内存 空间, 并刷新共享虚拟内存空间中相应页面的数据; 可以理解的是, 本领域 技术人员可将片上内存的总容量、 可用存储空间等因素综合考虑后, 来设定 该第一阈值, 也可根据经验值来设置, 此处不对其做特别的限定。
需要说明的是, 本发明实施例中, 备份单元 920通过计算节点的片上内 存空间来存储工作页面的备份页面, 在不同的应用实例中, 片上内存空间的 划分可以采用不同的方式, 相应地, 根据片上内存空间的划分方式不同, 判 断单元 930和触发单元 940的工作方式也有所不同:
在第一种可能的实施方式中, 第一进程所属的应用程序 1的每个进程在 片上内存中有单独的片上存储区; 即数据处理装置 90还包括: 内存分配单元 970 ,用于在计算节点的片上内存中,预先给应用程序 1的各个进程分配特定 大小的片上存储区; 在这种情形下, 备份单元 920, 具体用于将创建的备份 页面存储在所述内存分配单元为所述第一进程预先分配的片上存储区中。 进 一步地, 判断单元 930, 具体用于: 判断第一进程的片上存储区的剩余空间 是否小于备份单元 920当前要存储的备份页面的大小, 或者小于第二阈值。 相应地, 如果判断单元 930判断出第一进程的片上存储区的剩余空间小于备 份单元 920当前要存储的备份页面的大小, 或者小于第二阈值, 则触发单元 940触发第一进程执行比较操作。
在第二种可能的实施方式中,应用程序 1的所有进程共享整个片上内存, 或者片上内存中的局部区域, 即计算节点上的所有进程都可以将备份页面保 存在片上内存中。 在这种情形下, 判断单元 930, 具体用于: 判断该计算节 点的片上内存的剩余空间是否小于备份单元 920当前创建并要存储的备份页 面的大小, 或者小于第二阈值。 相应地, 如果判断单元 930判断出该计算节
点的片上内存的剩余空间小于备份单元 920当前创建并要存储的备份页面的 大小, 则触发单元 940触发进程执行比较操作。 进一步地, 触发单元 940触 发进程执行比较操作有两种策略:
( 1 )仅触发第一进程执行比较操作, 应用程序的其它进程不受影响。 ( 2 ) 触发第一进程所属应用程序 1的所有进程执行比较操作。
在第三种可能的实施方式中,计算节点的片上内存空间不是全局共享的, 而是局部共享的, 即只有部分进程可以共享片上内存中的局部区域。 这种片 上内存的划分方式具体为: 整个片上内存空间被划分为多块相互独立的存储 区域, 应用程序 1的所有进程被划分为一个或多个进程组, 每个进程组中的 进程共享多块独立的存储区域中的一个,以作为该进程组的片上公共緩存区; 即每个进程组中的进程可以访问相同的片上内存空间, 不同进程组访问不同 的片上内存空间。 比如片上内存 1可以被 core 0 ~ core3访问, 片上内存 2可 以被 core4 ~ core7访问, 片上内存 3可以被 core8 ~ corel l访问, 片上内存 4 可以被 corel2 ~ core 15访问。 一个进程组中的所有进程都可以将自身工作页 面的备份页面保存在片上内存中的某块存储区域上。 在这种片上内存划分方 式下, 备份单元 920, 具体用于将创建的所述备份页面存储在为所述第一进 程所在进程组的片上公共緩存区中; 判断单元 930, 具体用于: 判断第一进 程所在的进程组的片上公共緩存区的剩余空间是否小于备份单元 920当前创 建并要存储的备份页面的大小, 或者小于第二阈值。 相应地, 如果判断单元 930判断出第一进程所在的进程组的片上公共緩存区的剩余空间小于备份单 元 920当前创建并要存储的备份页面的大小, 或者小于第二阈值, 则触发单 元 940触发进程执行比较操作。 进一步地, 触发单元 940触发进程执行比较 操作有两种策略:
( 1 )仅触发第一进程执行比较操作, 第一进程所在的进程组中的其它进 程不受影响。
( 2 )在第一进程所在的进程组中广播失败信息,触发该进程组中所有进
程执行主动的比较操作。
需要说明的是, 进程执行比较操作的具体流程与之前的描述相同, 其它 进程执行比较操作流程, 与第一进程执行比较操作流程类似,此处不再贅述, 还需要说明的是, 第二阈值可根据片上内存的总容量、 可用存储空间等因素 来设定, 也可根据经验值来设定, 此处不对其做特别的限定。
进一步地, 由于计算节点的片上内存, 一般都是全局共享的, 也就是说 可以被计算节点的所有 core访问, 因此, 本发明实施例提出了备份页面资源 池的方案。
由于片上内存是所有 core都可以访问的, 因此片上内存中保存的备份页 面也是一种共享资源,可以被不同 core共享。比如多个进程(不管在相同 core 上或者不同 core上)在某个时间段都对页面 X的不同位置进行了写操作, 按 照上述实施例中的方案, 每个进程都需要一个单独的备份页面, 这样浪费了 内存空间。 由于片上内存是所有 core都可以访问的, 因此不同进程的同一个 共享虚拟内存页面的同一个版本, 在片上内存空间只需要保存一份备份页面 即可。 基于此, 本发明实施例提出了备份页面资源池的概念, 将片上内存中 维护的所有备份页面集合叫作备份页面资源池。 相应地, 数据处理装置 90 还包括:
查询单元 950 , 用于在备份单元 920创建工作页面的备份页面之前, 在 计算节点的片上内存中查找是否存在该工作页面的备份页面; 相应地, 当查 询单元 950没有在所述计算节点的片上内存中查找到该工作页面的备份页面 时, 备份单元 920才会执行创建该工作页面的备份页面的步骤。
具体地, 在一个实施例中, 可以在计算节点的片上内存中, 用一个数据 结构, 比如备份页面队列或备份页面信息表来记录片上内存中各个备份页面 的元数据信息,其中,备份页面的元数据信息包括:备份页面的页号 Twin Page Id和版本号 Twin Page Version; 在一个更优的实施例中, 如图 8所示, 备份 页面的元数据信息可以包括: Twin Page Id、 Twin Page Version, Twin Page
Usage和 Twin Page Address。 其中, 备份页面的元数据信息的具体定义前面 已经做了说明, 此处不再贅述。 可以理解的是, 由于计算节点的片上内存资 源宝贵, 为了减少对片上内存的占用, 也可以将备份页面信息表保存在计算 节点的片外内存中。
基于备份页面信息表, 本发明实施例提供的据处理装置 90中, 查询单元
950,具体用于在备份页面信息表中查找是否有页号和版本号分别与该工作页 面的页号以及版本号相同的元数据信息;
备份单元 920 , 具体用于当查询单元 950没有查找到页号和版本号分别 与该工作页面的页号以及版本号相同的元数据信息时, 创建该工作页面的备 份页面; 当查询单元 950查找到页号和版本号分别与该工作页面的页号以及 版本号相同的元数据信息时, 则将查找到的元数据信息所对应的备份页面作 为该工作页面的备份页面; 。
进一步地, 在一个实施例中, 数据处理装置 90还包括: 记录单元 960 , 用于在备份单元 920创建该工作页面的备份页面之后, 将该工作页面的页号 及版本号分别作为创建的备份页面的页号和版本号记录到所述备份页面信息 表。
在另一个实施例中,如果计算节点的片上内存空间可以不是全局共享的, 而是局部共享的, 也就是说整个片上内存空间被划分为多块相互独立的存储 区域; 相应地, 第一进程所属的应用程序 1的所有进程被划分为至少一个进 程组, 每个所述进程组中的各个进程共享所述多个独立的存储区域中的一个 存储区域, 以作为该进程组的片上公共緩存区, 且每个进程组维护有一个单 独的备份页面信息表, 每一个进程组的备份页面信息表包含有该进程组中所 有进程的所有备份页面的元数据信息。 其中, 备份页面的元数据信息的具体 定义前面已经做了说明, 此处不再贅述。在这种片上内存局部共享的情形下, 数据处理装置 90的查询单元 950, 具体用于在所述第一进程所在进程组的备 份页面信息表中查找是否有页号和版本号分别与所述工作页面的页号以及版
本号相同的元数据信息;
备份单元 920 , 具体用于当查询单元 950没有查找到页号和版本号分别 与所述工作页面的页号以及版本号相同的元数据信息时, 创建所述工作页面 的备份页面; 进一步地, 当查询单元 950查找到页号和版本号分别与所述工 作页面的页号以及版本号相同的元数据信息时, 则将查找到的所述元数据信 息所对应的备份页面作为所述工作页面的备份页面。
相应地, 数据处理装置 90的记录单元 960, 具体用于在备份单元 920创 建该工作页面的备份页面之后, 将该工作页面的页号以及版本号分别作为创 建的备份页面的页号和版本号记录到第一进程所在进程组的备份页面信息 表。 如图 11所示, 本发明实施例提供另一种数据处理装置 11 , 包括: 拷贝单元 110 , 用于将第一进程请求访问的共享虚拟内存页面拷贝至计 算节点的片外内存中, 并将拷贝到片外内存中的共享虚拟内存页面作为第一 进程的工作页面; 其中, 共享虚拟内存页面为第一进程所属应用程序的的共 享虚拟内存中的虚拟内存页面, 且该应用程序运行在该计算节点上;
查询单元 120 , 用于在第一进程对该工作页面进行写操作之前, 在该计 算节点的片上内存中查找是否存在所述工作页面的备份页面;
备份单元 130 , 用于在查询单元 120在该计算节点的片上内存中查找到 该工作页面的备份页面时,确定查找到的备份页面为该工作页面的备份页面; 进一步地, 当查询单元 120没有在片上内存中查找到该工作页面的备份页面 时, 备份单元 130创建该工作页面的备份页面, 并将创建的所述备份页面存 储在所述计算节点的片上内存中, 其中, 该工作页面的备份页面用于备份该 工作页面的原始数据。
优选地, 在一个实施例中, 如果第一进程请求访问的共享虚拟内存页面 的个数为 N, 第一进程的工作页面的个数为 M, M、 N均为大于或等于 1的
正整数;
数据处理装置 1 1还包括: 判断单元 140, 用于在备份单元 130将创建的 所述备份页面存储在所述计算节点的片上内存之前, 判断所述片上内存的剩 余空间是否小于第一阈值;
触发单元 150 , 用于在判断单元 140判断出所述片上内存的剩余空间小 于第一阈值时,触发所述第一进程将所述第一进程的 M个工作页面中被修改 的内容同步更新到所述 M个工作页面所对应的 M个共享虚拟内存页面中, 在一种具体的实现方式中, 可以计算节点的片上内存中, 用一个数据结 构, 比如备份页面队列或备份页面信息表来记录片上内存中各个备份页面的 元数据信息, 其中, 备份页面的元数据信息包括: 备份页面的页号 Twin Page Id和版本号 Twin Page Version; 在一个更优的实施例中, 如图 8所示, 备份 页面的元数据信息可以包括: Twin Page Id、 Twin Page Version, Twin Page Usage和 Twin Page Address。 其中, 各个字段的含义如下:
Twin Page Id:备份页面所对应的工作页面所映射的共享虚拟内存页面的 页号, 不同进程中同一个共享虚拟内存页面的页号相同;
Twin Page Version: 备份页面的版本号, 不同进程中同一个共享虚拟内 存页面所对应的备份页面版本号可能不同;
需要说明的是, 备份页面的版本号与备份页面所对应的工作页面的版本 号相同, 而工作页面的版本号, 是备份单元 130在创建该工作页面时, 该工 作页面所对应的共享虚拟内存页面的版本号。 具体地, 备份单元 130在创建 一个工作页面时, 即将一个共享虚拟内存页面拷贝至计算节点的片外内存中 作为该进程的一个工作页面时, 该工作页面的版本号即为该拷贝的共享虚拟 内存页面的版本号; 一般来说, 一个共享虚拟内存页面的版本号的初始值为 1 , 后续不同的进程均可以对该共享虚拟内存页面中的数据进行读和写操作, 进程每次更新该共享虚拟内存页面中的内容之后, 该共享虚拟内存页面的版
本号就会递增。 因此, 同一个共享虚拟内存页面在不同进程中所对应的工作 页面的版本号可能不同, 进而导致其所对应的备份页面版本号也不同。
Twin Page Usage: 备份页面的使用情况, 记录当前使用该版本的备份页 面的进程数目;
Twin Page Address: 备份页面在可编程片上内存中的地址, 进程可以根 据该地址访问相应版本的备份页面。
可以理解的是, 由于计算节点的片上内存资源宝贵, 为了减少对片上内 存的占用, 也可以将备份页面信息表保存在计算节点的片外内存中; 基于所 述备份页面信息表, 本发明实施例提供的据处理装置 11中, 查询单元 120 , 具体用于在所述备份页面信息表中查找是否有页号和版本号分别与所述工作 页面的页号以及版本号相同的元数据信息;
备份单元 130 , 具体用于当查询单元 120查找到页号和版本号分别与该 工作页面的页号以及版本号相同的元数据信息时, 则将查找到的元数据信息 所对应的备份页面作为该工作页面的备份页面。
进一步地, 在一个实施例中, 数据处理装置 11还包括: 记录单元 160 , 用于在备份单元 130创建工作页面的备份页面之后, 将该工作页面的页号及 版本号分别作为创建的备份页面的页号和版本号记录到备份页面信息表。
在另一个实施例中,如果计算节点的片上内存空间可以不是全局共享的, 而是局部共享的, 也就是说整个片上内存空间被划分为多块相互独立的存储 区域; 相应地, 第一进程所属的应用程序 1的所有进程被划分为至少一个进 程组, 每个所述进程组中的各个进程共享所述多个独立的存储区域中的一个 存储区域, 以作为该进程组的片上公共緩存区, 且每个进程组维护有一个单 独的备份页面信息表, 每一个进程组的备份页面信息表包含有该进程组中所 有进程的所有备份页面的元数据信息。 其中, 备份页面的元数据信息的具体 定义前面已经做了说明, 此处不再贅述。在这种片上内存局部共享的情形下, 数据处理装置 1 1的查询单元 120, 具体用于在第一进程所在进程组的备份页
面信息表中查找是否有页号和版本号分别与该工作页面的页号以及版本号相 同的元数据信息;
备份单元 130, 具体用于当查询单元 120查找到页号和版本号分别与该 工作页面的页号以及版本号相同的元数据信息时, 则将查找到的元数据信息 所对应的备份页面作为该工作页面的备份页面。
相应地, 数据处理装置 11的记录单元 160, 具体用于在备份单元 130创 建该工作页面的备份页面之后, 将该工作页面的页号以及版本号分别作为创 建的备份页面的页号和版本号记录到第一进程所在进程组的备份页面信息 表。
需要说明的是, 图 10和 11所示数据处理装置中, 其各个模块的具体实 施过程以及各个模块之间的信息交互等内容, 由于与本发明方法实施例基于 同一发明构思, 可以参见方法实施例, 在此不——贅述。
需要说明的是, 在实际应用中, 本发明实施例的数据处理装置 90和 11 , 可以为计算节点, 换言之, 即具有处理器和存储器的的设备 (其示意性的架构 可参考附图 3), 其产品形态可以是通用计算机、 云计算机、 分布式系统中的 计算节点、 嵌入式平台、 服务器等等, 也可以是操作系统、 LIB库等软件系 统, 本发明对此不作限定。
本发明实施例通过以上技术方案, 将进程请求读或写的共享虚拟内存页 面先拷贝在计算节点片外内存中, 作为可供进程进行读写操作的工作页面, 同时利用计算节点的 CPU的片上内存, 在进程对工作页面进行写操作之前, 将工作页面中的原始数据在片上内存中备份, 以保证多个进程在对共享虚拟 内存页面进行操作时的数据一致性, 由于备份页面存储在片上内存中, 页面 的访问速度可以得到保证, 同时, 备份页面与工作页面分开存储, 使得备份 页面不会与工作页面竟争緩存空间, 更多的工作页面可以存放在緩存中, 从 而可以提高程序运行的性能; 进一步地, 通过主动触发的比较操作, 及时更 新共享虚拟内存页面的内容, 保证在进行比较操作时, 工作页面基本上都还
位于 cache中, 不需要进行片外内存访问, 因此 Diff操作的速度很快; 进一 步地, 通过备份页面资源池方案, 可以使得进程间充分共享备份页面, 进一 步减少备份页面占用的片上内存空间, 节约系统资源。
图 12示出了本发明实施例提供的一种计算节点的示意图,如图 12所示, 计算节点 100包括: 至少一个处理器 1001、 存储器 1002和总线, 其中处理 器 1001内部包含有片上内存 1003。 处理器 1001和存储器 1002通过总线连 接并完成相互间的通信。 该总线可以是工业标准体系结构( Industry Standard Architecture , 简称为 ISA ) 总线、 夕卜部设备互连 ( Peripheral Component, 简 称为 PCI ) 总线或扩展工业标准体系结构 ( Extended Industry Standard
Architecture, 简称为 EISA ) 总线等。 该总线可以分为地址总线、 数据总线、 控制总线等。 为便于表示, 图 12中仅用一条粗线表示, 但并不表示仅有一根 总线或一种类型的总线。 其中:
存储器 1002用于存储数据和可执行程序代码,该程序代码包括计算机操 作指令。 存储器 1002可能包含高速 RAM存储器, 也可能还包括非易失性存 者器 ( non-volatile memory ) , 例:¾口至少一个磁盘存 4诸器。
在一个实施例中,存储器 1002存储有应用程序 1对应的可执行代码, 处 理器 1001通过读取存储器 1002中存储的可执行程序代码来运行与所述可执 行程序代码对应的程序, 其中, 应用程序 1包括一个或多个进程, 且应用程 序 1的各进程间拥有一个相同的共享虚拟内存, 每个进程分别将共享虚拟内 存中的部分或者全部虚拟内存页面映射到该进程维护的私有物理内存空间; 进一步地, 存储器 1002还存储有操作系统对应可执行代码, 处理器 1001通 过读取并执行存储器 1002中的操作系统对应的可执行代码, 以用于:
将应用程序 1的第一进程请求访问的共享虚拟内存页面拷贝至计算节点 的存储器 1002中, 并将拷贝到存储器 1002中的共享虚拟内存页面作为应用 程序 1的第一进程的工作页面; 其中, 第一进程请求访问的共享虚拟内存页 面为应用程序 1的共享虚拟内存中, 第一进程请求读或写的虚拟内存页面;
在第一进程对该工作页面进行写操作之前,创建该工作页面的备份页面, 并将创建的备份页面存储在片上内存 1003中, 以备份该工作页面的原始数 据。
其中, 上述流程的具体细节可参照上述方法及装置实施例, 此处不再贅 述。
需要说明的是,处理器 1001可以是中央处理器( Central Processing Unit, 简称为 CPU ) , 或者是特定集成电路 ( Application Specific Integrated Circuit, 简称为 ASIC ) , 或者是被配置成实施本发明实施例的一个或多个集成电路, 并且, 处理器 1001可以包括一个或者多个核, 各个核共享处理器 1001的片 上内存 1003。
另外上述处理器 1001除了执行上述方法流程之外,还可用于执行可执行 代码, 以实现本发明方法实施例中的其他步骤, 在此不再贅述。
本发明实施例通过以上技术方案, 将进程请求读或写的共享虚拟内存页 面先拷贝在计算节点片外内存中, 作为可供进程进行读写操作的工作页面, 同时利用计算节点的 CPU的片上内存, 在进程对工作页面进行写操作之前, 将工作页面中的原始数据在片上内存中备份, 以保证多个进程在对共享虚拟 内存页面进行操作时的数据一致性, 由于备份页面存储在片上内存中, 页面 的访问速度可以得到保证, 同时, 备份页面与工作页面分开存储, 使得备份 页面不会与工作页面竟争緩存空间, 更多的工作页面可以存放在緩存中, 从 而可以提高程序运行的性能; 进一步地, 通过主动触发的比较操作, 及时更 新共享虚拟内存页面的内容, 保证在进行比较操作时, 工作页面基本上都还 位于 cache中, 不需要进行片外内存访问, 因此 Diff操作的速度很快; 进一 步地, 通过备份页面资源池方案, 可以使得进程间充分共享备份页面, 进一 步减少备份页面占用的片上内存空间, 节约系统资源。
图 13示出了本发明实施例提供的一种计算机系统的示意图, 如图 13所 示, 该计算机系统 1 10包括: 处理器 1101、 第一存储器 1 102、 操作系统内核
1 103 ; 其中, 处理器 1101 内部包含有第二存储器 1104和至少一个处理器核 1 105 , 处理器核用于运行应用程序, 第二存储器 1104是处理器 1 101的各个 处理器核共用的片上存储,其数据存取速度大于第一存储器 1102的数据存取 速度;
其中, 操作系统内核 1103 , 用于将所述应用程序的第一进程请求访问共 享虚拟内存页面拷贝至第一存储器 1102中, 并将拷贝到第一存储器 1 102中 的共享虚拟内存页面作为第一进程的工作页面; 在第一进程对该工作页面进 行写操作之前, 创建该工作页面的备份页面, 并将创建的备份页面存储在第 二存储器 1104中, 以备份该工作页面的原始数据; 其中, 共享虚拟内存页面 为第一进程所属应用程序的共享虚拟内存中的虚拟内存页面。
在一个实施例中, 共享虚拟内存页面的个数为 N, N为大于或等于 1的 正整数;所述第一进程的工作页面的个数为 Μ, Μ为大于或等于 1的正整数; 操作系统内核 1 103 , 还用于, 在将创建的备份页面存储在所述第一存储器之 前, 判断第一存储器 1 102的剩余空间是否小于第一阈值, 如果是, 则触发第 一进程将自身的 Μ个工作页面中被修改的内容同步更新到该 Μ个工作页面 所对应的 Μ个共享虚拟内存页面中,并将该 Μ个工作页面在第一存储器 1 102 中的备份页面所占用的空间释放; 如果否, 则执行将创建的所述备份页面存 储在第二存储器 1 104中的步骤。
进一步地,在另一个实施例中, 第二存储器 1 104中保存有备份页面信息 表,其中, 所述备份页面信息表包含有第二存储器 1204中所有备份页面的元 数据信息, 每一个备份页面的元数据信息包括: 所述每一个备份页面的页号 和版本号, 其中, 所述每一个备份页面的页号和版本号分别与所述每一个备 份页面所对应的工作页面的页号和版本号相同;
在这种情形下,操作系统内核 1103在创建工作页面的备份页面之前,会 在该备份页面信息表中查找是否有页号和版本号分别与该工作页面的页号以 及版本号相同的元数据信息, 如果查找到, 则将查找到的元数据信息所对应
的备份页面为该工作页面的备份页面。
可以理解的是, 为了减少对第二存储器 1104存储空间的占用,也可以将 备份页面信息表保存在第一存储器 1102中;在另一个实施例中,处理器 1 101 中还包括有緩存 (cache ) 1 106, 用于緩存各个处理器核的临时数据。 另夕卜, 本发明实施例的操作系统管理装置 1103的具体操作步骤,可以参见前述各个 方法实施例, 此处不再贅述。
本发明实施例通过以上技术方案, 将进程请求读或写的共享虚拟内存页 面先拷贝在计算节点片外内存中, 作为可供进程进行读写操作的工作页面, 同时利用计算节点的 CPU的片上内存, 在进程对工作页面进行写操作之前, 将工作页面中的原始数据在片上内存中备份, 以保证多个进程在对共享虚拟 内存页面进行操作时的数据一致性, 由于备份页面存储在片上内存中, 页面 的访问速度可以得到保证, 同时, 备份页面与工作页面分开存储, 使得备份 页面不会与工作页面竟争緩存空间, 更多的工作页面可以存放在緩存中, 从 而可以提高程序运行的性能; 进一步地, 通过主动触发的比较操作, 及时更 新共享虚拟内存页面的内容, 保证在进行比较操作时, 工作页面基本上都还 位于 cache中, 不需要进行片外内存访问, 因此比较操作的速度很快; 进一 步地, 通过备份页面共享的方式, 可以使得进程间充分共享备份页面, 进一 步减少备份页面占用的片上内存空间, 节约系统资源。
在本申请所提供的几个实施例中, 应该理解到, 所揭露的装置和方法, 可以通过其它的方式实现。例如, 以上所描述的装置实施例仅仅是示意性的。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的, 作 为单元显示的部件可以是或者也可以不是物理单元, 即可以位于一个地方, 或者也可以分布到多个网络单元上。 可以根据实际的需要选择其中的部分或 者全部单元来实现本实施例方案的目的。
另外, 在本发明各个实施例提供的网络设备中的各功能单元可以集成在 一个处理单元中, 也可以是各个单元单独物理存在, 也可以两个或两个以上
单元集成在一个单元中。 上述集成的单元既可以采用硬件的形式实现, 也可 以采用软件功能单元的形式实现。
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售 或使用时, 可以存储在一个计算机可读取存储介质中。 基于这样的理解, 本 发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的 全部或部分可以以软件产品的形式体现出来, 该计算机软件产品存储在一个 存储介质中, 包括若干指令用以使得一台计算机设备(可以是个人计算机, 服务器, 或者网络设备等)执行本发明各个实施例所述方法的全部或部分步 骤。 而前述的存储介质包括: U盘、移动硬盘、只读存储器(ROM, Read-Only Memory ) 、 随机存取存储器 (RAM, Random Access Memory ) 、 磁碟或者 光盘等各种可以存储程序代码的介质。
最后应说明的是: 以上实施例仅用以说明本发明的技术方案, 而非对其 限制; 尽管参照前述实施例对本发明进行了详细的说明, 本领域的普通技术 人员应当理解: 其依然可以对前述各实施例所记载的技术方案进行修改, 或 者对其中部分技术特征进行等同替换; 而这些修改或者替换, 并不使相应技 术方案的本质脱离本发明各实施例技术方案的精神和范围。
Claims
1、 一种数据处理方法, 其特征在于, 包括:
将第一进程请求访问的共享虚拟内存页面拷贝至计算节点的片外内存 中,并将拷贝到所述片外内存中的共享虚拟内存页面作为第一进程的工作页 面; 其中, 所述共享虚拟内存页面为所述第一进程所属应用程序的共享虚拟 内存中的虚拟内存页面, 所述应用程序运行在所述计算节点上;
在所述第一进程对所述工作页面进行写操作之前,创建所述工作页面的 备份页面, 并将创建的所述备份页面存储在所述计算节点的片上内存中, 以 备份所述工作页面的原始数据。
2、 根据权利要求 1 所述的方法, 其特征在于, 所述共享虚拟内存页面 的个数为 N, N为大于或等于 1的正整数; 所述第一进程的工作页面的个数 为 M, M为大于或等于 1的正整数;
在将创建的所述备份页面存储在所述计算节点的片上内存之前,所述方 法还包括:
判断所述片上内存的剩余空间是否小于第一阈值,如果所述片上内存的 剩余空间小于第一阈值, 则触发所述第一进程将所述第一进程的 M个工作 页面中被修改的内容同步更新到所述 M个工作页面所对应的 M个共享虚拟 的空间释放; 如果所述片上内存的剩余空间大于或等于第一阈值, 则执行所 述将创建的所述备份页面存储在所述计算节点的片上内存中的步骤。
3、 根据权利要求 2所述的方法, 其特征在于, 在创建所述工作页面的 备份页面之前, 还包括: 在所述计算节点的片上内存中, 预先给所述第一进 程分配特定大小的片上存储区;
所述将创建的所述备份页面存储在所述计算节点的片上内存中, 包括: 将创建的所述备份页面存储在为所述第一进程预先分配的片上存储区 中。
4、 根据权利要求 3所述的方法, 其特征在于, 所述判断所述片上内存 的剩余空间是否小于第一阈值, 如果所述片上内存的剩余空间小于第一阈 值, 则触发所述第一进程将所述第一进程的 M个工作页面中被修改的内容 同步更新到所述 M个工作页面所对应的 M个共享虚拟内存页面中, 并将所 述片上内存的剩余空间大于或等于第一阈值,则执行所述将创建的所述备份 页面存储在所述计算节点的片上内存中的步骤, 包括:
判断所述第一进程的片上存储区的剩余空间是否小于创建的所述备份 页面的大小, 或者小于第二阈值, 如果所述第一进程的片上存储区的剩余空 间小于创建的所述备份页面的大小, 或者小于第二阈值, 则触发所述第一进 程将所述第一进程的 M个工作页面中被修改的内容同步更新到所述 M个工 作页面所对应的 M个共享虚拟内存页面中, 并将所述 M个工作页面在所述 片上内存中的备份页面所占用的空间释放;如果所述第一进程的片上存储区 的剩余空间大于或等于创建的所述备份页面的大小, 或者小于第二阈值, 则 执行所述将创建的所述备份页面存储在所述计算节点的片上内存中的步骤。
5、 根据权利要求 2所述的方法, 其特征在于, 所述应用程序的各个进 程共享所述计算节点的片上内存;
所述第一阈值为创建的所述备份页面的大小。
6、 根据权利要求 5所述的方法, 其特征在于, 还包括: 如果所述计算 节点的片上内存的剩余空间小于创建的所述备份页面的大小,则触发所述应 用程序中,除所述第一进程之外的其它至少一个进程将所述其它至少一个进 程的各个工作页面中被修改的内容同步更新到所述各个工作页面所对应的 各个共享虚拟内存页面中,并将所述各个工作页面在所述片上内存中的备份 页面所占用的空间释放。
7、 根据权利要求 2所述的方法, 其特征在于, 所述计算节点的片上内 存包括多个独立的存储区域,所述应用程序的所有进程被划分为至少一个进
程组,每个所述进程组中的各个进程共享所述多个独立的存储区域中的一个 存储区域, 以作为该进程组的片上公共緩存区;
所述将创建的所述备份页面存储在所述计算节点的片上内存中, 包括: 将创建的所述备份页面存储在为所述第一进程所在进程组的片上公共 緩存区中;
所述判断所述片上内存的剩余空间是否小于第一阈值,如果所述片上内 存的剩余空间小于第一阈值, 则触发所述第一进程将所述第一进程的 M个 工作页面中被修改的内容同步更新到所述 M个工作页面所对应的 M个共享 占用的空间译放; 如果所述片上内存的剩余空间大于或等于第一阈值, 则执 行所述将创建的所述备份页面存储在所述计算节点的片上内存中的步骤, 包 括:
判断所述第一进程所在的进程组的片上公共緩存区的剩余空间是否小 于创建的所述备份页面的大小, 或者小于所述第二阈值, 如果所述第一进程 所在的进程组的片上公共緩存区的剩余空间是否小于创建的所述备份页面 的大小, 或者小于所述第二阈值时, 则触发所述第一进程将所述第一进程的 M个工作页面中被爹改的内容同步更新到所述 M个工作页面所对应的 M个 面所占用的空间释放;如果所述第一进程所在的进程组的片上公共緩存区的 剩余空间大于或等于创建的所述备份页面的大小, 或者小于所述第二阈值 时,则执行所述将创建的所述备份页面存储在所述计算节点的片上内存中的 步骤。
8、 根据权利要求 7所述的方法, 其特征在于, 还包括: 如果所述第一 进程所在的进程组的片上公共緩存区的剩余空间小于创建的所述备份页面 的大小, 或者小于所述第二阈值, 则触发所述第一进程所在进程组中, 除所 述第一进程之外的其它进程将所述其它进程的各个工作页面中被修改的内
容同步更新到所述各个工作页面所对应的各个共享虚拟内存页面中,并将所
9、 根据权利要求 2-8任一项所述的方法, 其特征在于, 所述将所述第 一进程的 M个工作页面中被修改的内容同步更新到所述 M个工作页面所对 应的 M个共享虚拟内存页面中, 包括: 将所述第一进程的 M个工作页面中 的每一个工作页面与该工作页面在片上内存中的备份页面进行比较,生成用 于记录两者的数据内容差异的日志文件,根据所述日志文件将所述第一进程 对所述 M个工作页面爹改的内容更新到所述 M个工作页面所对应的 M个共 享虚拟内存页面中。
10、 根据权利要求 2-8任一项所述的方法, 其特征在于, 还包括: 在创 建所述工作页面的备份页面之前,在所述计算节点的片上内存中查找是否存 在所述工作页面的备份页面;
所述创建所述工作页面的备份页面, 包括: 如果没有在所述计算节点的 片上内存中查找到所述工作页面的备份页面,则创建所述工作页面的备份页 面。
11、 根据权利要求 10所述的方法, 其特征在于, 所述计算节点的片上 内存中保存有备份页面信息表, 其中, 所述备份页面信息表包含有所述片上 内存中所有备份页面的元数据信息, 每一个备份页面的元数据信息包括: 所 述每一个备份页面的页号和版本号, 其中, 所述每一个备份页面的页号和版 本号分别与所述每一个备份页面所对应的工作页面的页号和版本号相同; 所述在所述计算节点的片上内存中查找是否存在所述工作页面的备份 页面, 包括:
在所述备份页面信息表中查找是否有页号和版本号分别与所述工作页 面的页号以及版本号相同的元数据信息;
所述创建所述工作页面的备份页面, 包括: 如果没有在所述备份页面信 息表中查找到页号和版本号分别与所述工作页面的页号以及版本号相同的
元数据信息, 则创建所述工作页面的备份页面。
12、 根据权利要求 1 1所述的方法, 其特征在于, 在所述创建所述工作 页面的备份页面之后, 还包括: 号和版本号记录到所述备份页面信息表。
13、 根据权利要求 10所述的方法, 其特征在于, 所述片上内存包括多 个独立的存储区域, 所述应用程序的所有进程被划分为至少一个进程组, 每 个所述进程组中的各个进程共享所述多个独立的存储区域中的一个存储区 域, 以作为该进程组的片上公共緩存区, 且每个所述进程组有一个单独的备 份页面信息表;每一个进程组的备份页面信息表包含有所述进程组中所有进 程的所有备份页面的元数据信息, 每一个备份页面的元数据信息包括: 所述 每一个备份页面的页号和版本号, 其中, 所述每一个备份页面的页号和版本 号分别与所述每一个备份页面所对应的工作页面的页号和版本号相同; 所述在所述计算节点的片上内存中查找是否存在所述工作页面的备份 页面, 包括:
在所述第一进程所在进程组的备份页面信息表中查找是否有页号和版 本号分别与所述工作页面的页号以及版本号相同的元数据信息;
所述创建所述工作页面的备份页面, 包括: 如果没有在所述第一进程所 在进程组的备份页面信息表中查找到页号和版本号分别与所述工作页面的 页号以及版本号相同的元数据信息, 则创建所述工作页面的备份页面。
14、 根据权利要求 13所述的方法, 其特征在于, 在所述创建所述工作 页面的备份页面之后, 还包括: 号和版本号记录到所述第一进程所在进程组的备份页面信息表。
15、 一种数据处理方法, 其特征在于, 包括:
将第一进程请求访问的共享虚拟内存页面拷贝至计算节点的片外内存 中,并将拷贝到所述片外内存中的共享虚拟内存页面作为所述第一进程的工 作页面; 其中, 所述共享虚拟内存页面为所述第一进程所属应用程序的共享 虚拟内存中的虚拟内存页面, 所述应用程序运行在所述计算节点上;
在所述第一进程对所述工作页面进行写操作之前,在所述计算节点的片 上内存中查找是否存在所述工作页面的备份页面, 如果查找到, 则确定查找 到的所述备份页面为所述工作页面的备份页面, 其中, 所述备份页面保存有 所述工作页面中的原始数据。
16、 根据权利要求 15所述的方法, 其特征在于, 还包括:
如果没有查找到, 则创建所述工作页面的备份页面, 并将创建的所述备 份页面存储在所述计算节点的片上内存中。
17、 根据权利要求 16所述的方法, 其特征在于, 所述共享虚拟内存页 面的个数为 N, N为大于或等于 1的正整数; 所述第一进程的工作页面的个 数为 M, M为大于或等于 1的正整数;
在将创建的所述备份页面存储在所述计算节点的片上内存之前,所述方 法还包括:
判断所述片上内存的剩余空间是否小于第一阈值, 如果是, 则触发所述 第一进程将所述第一进程的 M个工作页面中被修改的内容同步更新到所述 M个工作页面所对应的 M个共享虚拟内存页面中, 并将所述 M个工作页面 在所述片上内存中的备份页面所占用的空间释放; 如果否, 则执行所述将创 建的所述备份页面存储在所述计算节点的片上内存中的步骤。
18、 根据权利要求 16或 17所述的方法, 其特征在于, 所述计算节点的 片上内存中保存有备份页面信息表, 其中, 所述备份页面信息表包含有所述 片上内存中所有备份页面的元数据信息, 每一个备份页面的元数据信息包 括: 所述每一个备份页面的页号和版本号, 其中, 所述每一个备份页面的页 号和版本号分别与所述每一个备份页面所对应的工作页面的页号和版本号
相同;
所述在所述计算节点的片上内存中查找是否存在所述工作页面的备份 页面, 如果查找到, 则确定查找到的所述备份页面为所述工作页面的备份页 面, 包括:
在所述备份页面信息表中查找是否有页号和版本号分别与所述工作页 面的页号以及版本号相同的元数据信息, 如果查找到, 则确定查找到的所述 元数据信息所对应的备份页面为所述工作页面的备份页面。
19、 根据权利要求 16或 17所述的方法, 其特征在于, 所述片上内存包 括多个独立的存储区域, 所述应用程序的所有进程被划分为至少一个进程 组,每个所述进程组中的各个进程共享所述多个独立的存储区域中的一个存 储区域, 以作为该进程组的片上公共緩存区, 且每个所述进程组有一个单独 的备份页面信息表;每一个进程组的备份页面信息表包含有所述进程组中所 有进程的所有备份页面的元数据信息, 每一个备份页面的元数据信息包括: 所述每一个备份页面的页号和版本号, 其中, 所述每一个备份页面的页号和 版本号分别与所述每一个备份页面所对应的工作页面的页号和版本号相同; 所述在所述计算节点的片上内存中查找是否存在所述工作页面的备份 页面, 如果查找到, 则确定查找到的所述备份页面为所述工作页面的备份页 面, 包括:
在所述第一进程所在进程组的备份页面信息表中查找是否有页号和版 本号分别与所述工作页面的页号以及版本号相同的元数据信息, 如果查找 到,则确定查找到的所述元数据信息所对应的备份页面为所述工作页面的备 份页面。
20、 一种数据处理装置, 其特征在于, 包括:
拷贝单元,用于将第一进程请求访问的共享虚拟内存页面拷贝至计算节 点的片外内存中,并将拷贝到所述片外内存中的共享虚拟内存页面作为所述
第一进程的工作页面; 其中, 所述共享虚拟内存页面为所述第一进程所属应 用程序的的共享虚拟内存中的虚拟内存页面,所述应用程序运行在所述计算 节点上;
备份单元, 用于在所述第一进程对所述工作页面进行写操作之前, 创建 所述工作页面的备份页面,并将创建的所述备份页面存储在所述计算节点的 片上内存中, 以备份所述工作页面的原始数据。
21、 根据权利要求 20所述的数据处理装置, 其特征在于, 所述共享虚 拟内存页面的个数为 N, N为大于或等于 1的正整数; 所述第一进程的工作 页面的个数为 M, M为大于或等于 1的正整数;
所述数据处理装置还包括: 判断单元, 用于在所述备份单元将创建的所 述备份页面存储在所述计算节点的片上内存之前,判断所述片上内存的剩余 空间是否小于第一阈值; 一阈值时, 触发所述第一进程将所述第一进程的 M个工作页面中被修改的 内容同步更新到所述 M个工作页面所对应的 M个共享虚拟内存页面中, 并
22、 根据权利要求 21所述的数据处理装置, 其特征在于, 还包括: 内存分配单元, 用于在所述计算节点的片上内存中, 预先给所述第一进 程所属的应用程序的各个进程分配特定大小的片上存储区;
所述备份单元,具体用于将创建的所述备份页面存储在所述内存分配单 元为所述第一进程预先分配的片上存储区中。
23、 根据权利要求 22所述的数据处理装置, 其特征在于, 所述判断单 元, 具体用于:
判断所述第一进程的片上存储区的剩余空间是否小于创建的所述备份 页面的大小, 或者小于第二阈值;
所述触发单元,具体用于在所述判断单元判断出所述第一进程的片上存
储区的剩余空间小于创建的所述备份页面的大小, 或者小于第二阈值时, 触 发所述第一进程将所述第一进程的 M个工作页面中被修改的内容同步更新 到所述 M个工作页面所对应的 M个共享虚拟内存页面中,并将所述 M个工
24、 根据权利要求 21所述的数据处理装置, 其特征在于, 所述应用程 序的各个进程共享所述计算节点的片上内存;
所述判断单元, 具体用于: 判断所述计算节点的片上内存的剩余空间是 否小于创建的所述备份页面的大小;
所述触发单元,具体用于在所述判断单元判断出所述计算节点的片上内 存的剩余空间小于创建的所述备份页面的大小时,触发所述第一进程将所述 第一进程的 M个工作页面中被修改的内容同步更新到所述 M个工作页面所 对应的 M个共享虚拟内存页面中, 并将所述 M个工作页面在所述片上内存 中的备份页面所占用的空间释放。
25、 根据权利要求 24所述的数据处理装置, 其特征在于, 所述触发单 元, 还用于: 在所述判断单元判断出所述计算节点的片上内存的剩余空间小 于创建的所述备份页面的大小时, 触发所述应用程序中, 除所述第一进程之 外的其它至少一个进程将所述其它至少一个进程的各个工作页面中被修改 的内容同步更新到所述各个工作页面所对应的各个共享虚拟内存页面中,并
26、 根据权利要求 21所述的数据处理装置, 其特征在于, 所述计算节 点的片上内存包括多个独立的存储区域,所述应用程序的所有进程被划分为 至少一个进程组,每个所述进程组中的各个进程共享所述多个独立的存储区 域中的一个存储区域, 以作为该进程组的片上公共緩存区;
所述备份单元,具体用于将创建的所述备份页面存储在为所述第一进程 所在进程组的片上公共緩存区中;
所述判断单元, 具体用于: 判断所述第一进程所在的进程组的片上公共
緩存区的剩余空间是否小于创建的所述备份页面的大小,或者小于所述第二 阈值;
所述触发单元,具体用于在所述判断单元判断出所述第一进程所在的进 程组的片上公共緩存区的剩余空间小于创建的所述备份页面的大小,或者小 于所述第二阈值时, 触发所述第一进程将所述第一进程的 M个工作页面中 被修改的内容同步更新到所述 M个工作页面所对应的 M个共享虚拟内存页 释放。
27、 根据权利要求 26所述的数据处理装置, 其特征在于, 所述触发单 元, 还用于: 如果所述判断单元判断出所述第一进程所在的进程组的片上公 共緩存区的剩余空间是否小于创建的所述备份页面的大小,或者小于所述第 二阈值时, 触发所述第一进程所在进程组中, 除所述第一进程之外的其它进 程将所述其它进程的各个工作页面中被修改的内容同步更新到所述各个工 作页面所对应的各个共享虚拟内存页面中,并将所述各个工作页面在所述片 上内存中的备份页面所占用的空间译放。
28、 根据权利要求 20-26任一项所述的数据处理装置, 其特征在于, 还 包括: 查询单元, 用于在所述备份单元创建所述工作页面的备份页面之前, 在所述计算节点的片上内存中查找是否存在所述工作页面的备份页面;
所述备份单元,具体用于在所述查询单元没有在所述计算节点的片上内 存中查找到所述工作页面的备份页面时, 创建所述工作页面的备份页面。
29、 根据权利要求 28所述的数据处理装置, 其特征在于, 所述计算节 点的片上内存中保存有备份页面信息表, 其中, 所述备份页面信息表包含有 所述片上内存中所有备份页面的元数据信息,每一个备份页面的元数据信息 包括: 所述每一个备份页面的页号和版本号, 其中, 所述每一个备份页面的 页号和版本号分别与所述每一个备份页面所对应的工作页面的页号和版本 号相同;
所述查询单元,具体用于在所述备份页面信息表中查找是否有页号和版 本号分别与所述工作页面的页号以及版本号相同的元数据信息;
所述备份单元,具体用于在所述查询单元没有在所述备份页面信息表中 查找到页号和版本号分别与所述工作页面的页号以及版本号相同的元数据 信息时, 创建所述工作页面的备份页面。
30、 根据权利要求 29所述的数据处理装置, 其特征在于, 还包括: 备份页面的页号和版本号记录到所述备份页面信息表。
31、 根据权利要求 28所述的数据处理装置, 其特征在于, 所述片上内 存包括多个独立的存储区域,所述应用程序的所有进程被划分为至少一个进 程组,每个所述进程组中的各个进程共享所述多个独立的存储区域中的一个 存储区域, 以作为该进程组的片上公共緩存区, 且每个所述进程组有一个单 独的备份页面信息表;每一个进程组的备份页面信息表包含有所述进程组中 所有进程的所有备份页面的元数据信息, 每一个备份页面的元数据信息包 括: 所述每一个备份页面的页号和版本号, 其中, 所述每一个备份页面的页 号和版本号分别与所述每一个备份页面所对应的工作页面的页号和版本号 相同;
所述查询单元,具体用于在所述第一进程所在进程组的备份页面信息表 中查找是否有页号和版本号分别与所述工作页面的页号以及版本号相同的 元数据信息;
所述备份单元,具体用于在所述查询单元没有在所述第一进程所在进程 组的备份页面信息表中查找到页号和版本号分别与所述工作页面的页号以 及版本号相同的元数据信息时, 创建所述工作页面的备份页面。
32、 根据权利要求 31所述的数据处理装置, 其特征在于, 还包括: 备份页面的页号和版本号记录到所述第一进程所在进程组的备份页面信息
表。
33、 一种数据处理装置, 其特征在于, 包括:
拷贝单元,用于将第一进程请求访问的共享虚拟内存页面拷贝至计算节 点的片外内存中,并将拷贝到所述片外内存中的共享虚拟内存页面作为所述 第一进程的工作页面; 其中, 所述共享虚拟内存页面为所述第一进程所属应 用程序的的共享虚拟内存中的虚拟内存页面,所述应用程序运行在所述计算 节点上;
查询单元, 用于在所述第一进程对所述工作页面进行写操作之前, 在所 述计算节点的片上内存中查找是否存在所述工作页面的备份页面;
备份单元,用于在所述查询单元在所述计算节点的片上内存中查找到所 述工作页面的备份页面时,确定查找到的所述备份页面为所述工作页面的备 份页面, 其中, 所述备份页面用于备份所述工作页面中的原始数据。
34、 根据权利要求 33所述的数据处理装置, 其特征在于, 所述备份单 元还用,在所述查询单元没有在所述计算节点的片上内存中查找到所述工作 页面的备份页面时, 创建所述工作页面的备份页面, 并将创建的所述备份页 面存储在所述计算节点的片上内存中。
35、 根据权利要求 34所述的数据处理装置, 其特征在于, 所述共享虚 拟内存页面的个数为 N, N为大于或等于 1的正整数; 所述第一进程的工作 页面的个数为 M, M为大于或等于 1的正整数;
所述数据处理装置还包括: 判断单元, 用于在所述备份单元将创建的所 述备份页面存储在所述计算节点的片上内存之前,判断所述片上内存的剩余 空间是否小于第一阈值; 一阈值时, 触发所述第一进程将所述第一进程的 M个工作页面中被修改的 内容同步更新到所述 M个工作页面所对应的 M个共享虚拟内存页面中, 并 间释放。
36、 根据权利要求 34或 35所述的数据处理装置, 其特征在于, 所述计 算节点的片上内存中, 保存有备份页面信息表, 所述备份页面信息表包含有 所述片上内存中所有备份页面的元数据信息,每一个备份页面的元数据信息 包括: 所述每一个备份页面的页号和版本号, 其中, 所述每一个备份页面的 页号和版本号分别与所述每一个备份页面所对应的工作页面的页号和版本 号相同;
所述查询单元,具体用于在所述备份页面信息表中查找是否有页号和版 本号分别与所述工作页面的页号以及版本号相同的元数据信息;
所述备份单元,具体用于当所述查询单元查找到页号和版本号分别与所 述工作页面的页号以及版本号相同的元数据信息时,将查找到的所述元数据 信息所对应的备份页面作为所述工作页面的备份页面。
37、 根据权利要求 34或 35所述的数据处理装置, 其特征在于, 所述片 上内存包括多个独立的存储区域,所述应用程序的所有进程被划分为至少一 个进程组,每个所述进程组中的各个进程共享所述多个独立的存储区域中的 一个存储区域, 以作为该进程组的片上公共緩存区, 且每个所述进程组有一 个单独的备份页面信息表;每一个进程组的备份页面信息表包含有所述进程 组中所有进程的所有备份页面的元数据信息,每一个备份页面的元数据信息 包括: 所述每一个备份页面的页号和版本号, 其中, 所述每一个备份页面的 页号和版本号分别与所述每一个备份页面所对应的工作页面的页号和版本 号相同;
所述查询单元,具体用于在所述第一进程所在进程组的备份页面信息表 中查找是否有页号和版本号分别与所述工作页面的页号以及版本号相同的 元数据信息;
所述备份单元,具体用于当所述查询单元查找到页号和版本号分别与所 述工作页面的页号以及版本号相同的元数据信息时,则将查找到的所述元数 据信息所对应的备份页面作为所述工作页面的备份页面。
38、 一种计算机系统, 其特征在于, 包括: 处理器、 第一存储器、 操作 系统内核; 其中, 所述处理器用于运行应用程序, 且所述处理器内部包含有 第二存储器,所述第二存储器的数据存取速度大于所述第一存储器的数据存 取速度;
所述操作系统内核,用于将所述应用程序的第一进程请求访问的共享虚 拟内存页面拷贝至所述第一存储器中,并将拷贝到所述第一存储器中的共享 虚拟内存页面作为所述第一进程的工作页面;在所述第一进程对所述工作页 面进行写操作之前, 创建所述工作页面的备份页面, 并将创建的所述备份页 面存储在所述第二存储器中, 以备份所述工作页面的原始数据; 其中, 所述 共享虚拟内存页面为所述应用程序的共享虚拟内存中的虚拟内存页面。
39、 根据权利要求 38所述的计算机系统, 其特征在于, 所述共享虚拟 内存页面的个数为 N, N为大于或等于 1的正整数; 所述第一进程的工作页 面的个数为 M, M为大于或等于 1的正整数;
所述操作系统内核, 还用于, 在将创建的所述备份页面存储在所述第一 存储器之前, 判断所述第一存储器的剩余空间是否小于第一阈值, 如果是, 则触发所述第一进程将所述第一进程的 M个工作页面中被修改的内容同步 更新到所述 M个工作页面所对应的 M个共享虚拟内存页面中, 并将所述 M 个工作页面在所述第一存储器中的备份页面所占用的空间释放。
40、 根据权利要求 38或 39所述的计算机系统, 其特征在于, 所述第二 存储器中保存有备份页面信息表, 其中, 所述备份页面信息表包含有所述第 二存储器中所有备份页面的元数据信息, 每一个备份页面的元数据信息包 括: 所述每一个备份页面的页号和版本号, 其中, 所述每一个备份页面的页 号和版本号分别与所述每一个备份页面所对应的工作页面的页号和版本号 相同;
所述操作系统内核, 具体用于, 在所述第一进程对所述工作页面进行第
一次写操作之前,在所述备份页面信息表中查找是否有页号和版本号分别与 所述工作页面的备份页面,并将创建的所述备份页面存储在所述第二存储器 中, 以备份所述工作页面的原始数据; 如果查找到, 则将查找到的所述元数 据信息所对应的备份页面为所述工作页面的备份页面。
Priority Applications (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| EP13882376.0A EP2985702B1 (en) | 2013-04-16 | 2013-11-19 | Data processing method and device, and computer system |
| US14/880,587 US9824011B2 (en) | 2013-04-16 | 2015-10-12 | Method and apparatus for processing data and computer system |
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201310131430.2A CN104111897B (zh) | 2013-04-16 | 2013-04-16 | 一种数据处理方法、装置及计算机系统 |
| CN201310131430.2 | 2013-04-16 |
Related Child Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| US14/880,587 Continuation US9824011B2 (en) | 2013-04-16 | 2015-10-12 | Method and apparatus for processing data and computer system |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2014169649A1 true WO2014169649A1 (zh) | 2014-10-23 |
Family
ID=51708695
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2013/087402 Ceased WO2014169649A1 (zh) | 2013-04-16 | 2013-11-19 | 一种数据处理方法、装置及计算机系统 |
Country Status (4)
| Country | Link |
|---|---|
| US (1) | US9824011B2 (zh) |
| EP (1) | EP2985702B1 (zh) |
| CN (1) | CN104111897B (zh) |
| WO (1) | WO2014169649A1 (zh) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US11436033B2 (en) | 2019-10-11 | 2022-09-06 | International Business Machines Corporation | Scalable virtual memory metadata management |
Families Citing this family (31)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103902459B (zh) * | 2012-12-25 | 2017-07-28 | 华为技术有限公司 | 确定共享虚拟内存页面管理模式的方法和相关设备 |
| US10019373B2 (en) * | 2014-12-19 | 2018-07-10 | Mediatek Inc. | Memory management method for supporting shared virtual memories with hybrid page table utilization and related machine readable medium |
| CN104571955A (zh) * | 2014-12-27 | 2015-04-29 | 华为技术有限公司 | 提高存储容量的方法和装置 |
| US9870248B2 (en) * | 2015-08-13 | 2018-01-16 | Red Hat Israel, Ltd. | Page table based dirty page tracking |
| US9875058B2 (en) | 2015-11-05 | 2018-01-23 | International Business Machines Corporation | Prioritizing pages to transfer for memory sharing |
| CN106713392B (zh) * | 2015-11-13 | 2020-10-27 | 阿里巴巴集团控股有限公司 | 数据同步方法、装置和系统 |
| CN105354011B (zh) * | 2015-12-08 | 2017-10-27 | 中国人民解放军国防科学技术大学 | 面向多核并行程序的确定性懒惰释放一致性实现方法 |
| CN106909512B (zh) * | 2015-12-23 | 2021-08-13 | 研祥智能科技股份有限公司 | 存储设备的使用方法和系统 |
| US10120709B2 (en) * | 2016-02-29 | 2018-11-06 | Red Hat Israel, Ltd. | Guest initiated atomic instructions for shared memory page host copy on write |
| US10534935B2 (en) * | 2016-07-01 | 2020-01-14 | Intel Corporation | Migration of trusted security attributes to a security engine co-processor |
| US11119923B2 (en) * | 2017-02-23 | 2021-09-14 | Advanced Micro Devices, Inc. | Locality-aware and sharing-aware cache coherence for collections of processors |
| US10503613B1 (en) * | 2017-04-21 | 2019-12-10 | Amazon Technologies, Inc. | Efficient serving of resources during server unavailability |
| CN107277104A (zh) * | 2017-05-04 | 2017-10-20 | 上海斐讯数据通信技术有限公司 | 一种网页访问数据的处理方法及无线路由器 |
| WO2019010084A1 (en) | 2017-07-07 | 2019-01-10 | Blodgett Greg A | IMPROVEMENTS IN IMPORTED RPMB BLOCKS ON MANAGED NAND DEVICES |
| CN109471671B (zh) * | 2017-09-06 | 2023-03-24 | 武汉斗鱼网络科技有限公司 | 一种程序冷启动方法和系统 |
| CN108153492B (zh) * | 2017-12-22 | 2021-09-14 | 联想(北京)有限公司 | 数据处理方法、系统和电子设备 |
| CN109033420B (zh) * | 2018-08-08 | 2020-11-03 | 北京奇艺世纪科技有限公司 | 一种数据处理方法和装置 |
| US11487674B2 (en) | 2019-04-17 | 2022-11-01 | Rankin Labs, Llc | Virtual memory pool within a network which is accessible from multiple platforms |
| CN110389863A (zh) * | 2019-07-26 | 2019-10-29 | 苏州浪潮智能科技有限公司 | 一种数据恢复方法、装置、设备及计算机可读存储介质 |
| CN112306371A (zh) * | 2019-07-30 | 2021-02-02 | 伊姆西Ip控股有限责任公司 | 存储管理的方法、设备和计算机程序产品 |
| CN110633223B (zh) * | 2019-09-18 | 2021-07-13 | 北京机电工程研究所 | 面向高速信号平台的多级内存管理方法 |
| WO2021113626A1 (en) * | 2019-12-06 | 2021-06-10 | John Rankin | High-level programming language which utilizes virtual memory |
| CN111124316B (zh) * | 2019-12-30 | 2023-12-19 | 青岛海尔科技有限公司 | 存储空间的共享方法和装置及计算机可读存储介质 |
| CN112347059B (zh) * | 2020-09-04 | 2023-12-22 | 北京浪潮数据技术有限公司 | 存储系统数据缩减业务日志管理方法及相关组件 |
| CN112363779A (zh) * | 2020-11-25 | 2021-02-12 | 王志平 | 一种动态链接程序的安全控制方法 |
| CN113630341B (zh) * | 2021-08-03 | 2023-06-06 | 武汉绿色网络信息服务有限责任公司 | 数据信息处理的方法和服务器 |
| US12613776B2 (en) * | 2022-01-19 | 2026-04-28 | Micron Technology, Inc. | Parity cache for raid reliability, accessibility, and serviceability of a memory device |
| US12093272B1 (en) * | 2022-04-29 | 2024-09-17 | Splunk Inc. | Retrieving data identifiers from queue for search of external data system |
| CN115983306B (zh) * | 2022-12-09 | 2023-09-15 | 江苏稻源科技集团有限公司 | 一种带纠错能力的rfid卡写入方法 |
| CN116939228B (zh) * | 2023-07-27 | 2024-07-23 | 北京和德宇航技术有限公司 | 遥感影像的分布式处理方法、装置、设备及存储介质 |
| CN118070865B (zh) * | 2024-04-25 | 2024-07-23 | 北京壁仞科技开发有限公司 | 人工智能模型的优化方法及装置、电子设备与存储介质 |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1818874A (zh) * | 2004-12-29 | 2006-08-16 | 英特尔公司 | 高效同步多线程 |
| CN101430705A (zh) * | 2008-11-29 | 2009-05-13 | 中兴通讯股份有限公司 | 基于嵌入式数据库的存储方法和装置 |
| WO2011090515A2 (en) * | 2009-12-30 | 2011-07-28 | Empire Technology Development Llc | Data storage and access in multi-core processor architectures |
| US20110265090A1 (en) * | 2010-04-22 | 2011-10-27 | Moyer William C | Multiple core data processor with usage monitoring |
| CN102907055A (zh) * | 2010-03-26 | 2013-01-30 | 思杰系统有限公司 | 用于在多核装置上进行链路负载平衡的系统和方法 |
Family Cites Families (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US8868848B2 (en) * | 2009-12-21 | 2014-10-21 | Intel Corporation | Sharing virtual memory-based multi-version data between the heterogenous processors of a computer platform |
| US8694755B1 (en) * | 2010-03-17 | 2014-04-08 | Ambarella, Inc. | Virtual memory management for real-time embedded devices |
-
2013
- 2013-04-16 CN CN201310131430.2A patent/CN104111897B/zh active Active
- 2013-11-19 EP EP13882376.0A patent/EP2985702B1/en active Active
- 2013-11-19 WO PCT/CN2013/087402 patent/WO2014169649A1/zh not_active Ceased
-
2015
- 2015-10-12 US US14/880,587 patent/US9824011B2/en active Active
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1818874A (zh) * | 2004-12-29 | 2006-08-16 | 英特尔公司 | 高效同步多线程 |
| CN101430705A (zh) * | 2008-11-29 | 2009-05-13 | 中兴通讯股份有限公司 | 基于嵌入式数据库的存储方法和装置 |
| WO2011090515A2 (en) * | 2009-12-30 | 2011-07-28 | Empire Technology Development Llc | Data storage and access in multi-core processor architectures |
| CN102907055A (zh) * | 2010-03-26 | 2013-01-30 | 思杰系统有限公司 | 用于在多核装置上进行链路负载平衡的系统和方法 |
| US20110265090A1 (en) * | 2010-04-22 | 2011-10-27 | Moyer William C | Multiple core data processor with usage monitoring |
Non-Patent Citations (1)
| Title |
|---|
| See also references of EP2985702A4 * |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US11436033B2 (en) | 2019-10-11 | 2022-09-06 | International Business Machines Corporation | Scalable virtual memory metadata management |
Also Published As
| Publication number | Publication date |
|---|---|
| EP2985702A4 (en) | 2016-05-11 |
| EP2985702A1 (en) | 2016-02-17 |
| EP2985702B1 (en) | 2022-06-22 |
| CN104111897A (zh) | 2014-10-22 |
| CN104111897B (zh) | 2017-06-13 |
| US20160034397A1 (en) | 2016-02-04 |
| US9824011B2 (en) | 2017-11-21 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN104111897B (zh) | 一种数据处理方法、装置及计算机系统 | |
| CN110795206B (zh) | 用于促进集群级缓存和内存空间的系统和方法 | |
| CN113674133B (zh) | Gpu集群共享显存系统、方法、装置及设备 | |
| US10552337B2 (en) | Memory management and device | |
| CN103198028B (zh) | 一种内存数据迁移方法、装置及系统 | |
| US10909072B2 (en) | Key value store snapshot in a distributed memory object architecture | |
| US20210374157A1 (en) | System and method for near-synchronous replication for object store | |
| AU2011348835B2 (en) | Method and device for implementing memory migration | |
| CN108351860A (zh) | 低延迟的基于rdma的分布式存储装置 | |
| CN108292235A (zh) | 使用选择性资源迁移的网络附连存储器 | |
| WO2024230779A1 (zh) | 一种文件访问方法、系统、电子设备及机器可读存储介质 | |
| WO2018157602A1 (zh) | 一种同步活动事务表的方法及装置 | |
| CN106537364A (zh) | 存储事务 | |
| US11061609B2 (en) | Distributed memory object method and system enabling memory-speed data access in a distributed environment | |
| CN115516436B (zh) | 存储器中的推理 | |
| WO2018120810A1 (zh) | 一种解决数据冲突的方法和系统 | |
| WO2023231572A1 (zh) | 一种容器的创建方法、装置及存储介质 | |
| CN117493044A (zh) | 基于有界锁的松弛一致性分布式共享内存同步方法及系统 | |
| CN119718539B (zh) | 服务器无感知安全容器的内存热插拔控制方法及电子设备 | |
| CN120492157A (zh) | 内存管理方法及相关设备 | |
| WO2025256379A1 (zh) | 数据管理 | |
| CN113590309B (zh) | 一种数据处理方法、装置、设备及存储介质 | |
| CN117785020A (zh) | 一种数据存储方法、装置和系统 | |
| CN111858516A (zh) | 数据处理方法及装置 | |
| CN121411708B (zh) | 一种数据写入方法、读取方法、装置及电子设备 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 13882376 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| WWE | Wipo information: entry into national phase |
Ref document number: 2013882376 Country of ref document: EP |