WO2014090008A1 - 一种任务处理的方法和虚拟机 - Google Patents

一种任务处理的方法和虚拟机 Download PDF

Info

Publication number
WO2014090008A1
WO2014090008A1 PCT/CN2013/084128 CN2013084128W WO2014090008A1 WO 2014090008 A1 WO2014090008 A1 WO 2014090008A1 CN 2013084128 W CN2013084128 W CN 2013084128W WO 2014090008 A1 WO2014090008 A1 WO 2014090008A1
Authority
WO
WIPO (PCT)
Prior art keywords
task
global variable
snapshot
global
local
Prior art date
Application number
PCT/CN2013/084128
Other languages
English (en)
French (fr)
Inventor
顾磷
马志强
盛中华
文刘飞
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2014090008A1 publication Critical patent/WO2014090008A1/zh
Priority to US14/738,436 priority Critical patent/US9996401B2/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/52Program synchronisation; Mutual exclusion, e.g. by means of semaphores
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45583Memory management, e.g. access or allocation

Definitions

  • the present invention relates to the field of computer technologies, and in particular, to a method and a virtual machine for task processing.
  • virtual technology is a technology that provides an access method that is superior to the original resource configuration by combining or segmenting existing computer resources such that these resources behave as one or more operating environments.
  • multiple X86 systems are aggregated into a virtual symmetric multiprocessor by software.
  • the memory management of the virtual machine is implemented by software.
  • the memory in all physical resources is logically regarded as a whole memory, and the memory is divided according to the virtual page.
  • the virtual machine When the virtual machine is performing a task, it randomly selects the tasks in the waiting queue, and then allocates the memory addresses in order in the logical memory according to the memory space required by the related data involved in the task, which is an on-demand allocation of memory.
  • the prior art has at least the following problems: Since the virtual machine system divides whether there is data conflict according to the page, when the data involved in two different tasks are allocated in the same virtual After the page, the two tasks access the two different addresses in the virtual page at the same time. The virtual machine thinks that the two tasks access the same data, so it is considered that the data sharing conflict occurs between the two tasks, and the two tasks in the middle end The execution process, in fact, does not occur in the real sharing conflict, that is, the phenomenon of false sharing, affecting the execution of the task. Summary of the invention
  • an embodiment of the present invention provides a method and a virtual machine for task processing.
  • the technical solution is as follows:
  • a method for task processing includes:
  • the task in the synchronization task waiting queue is a queue in which the task triggered by the synchronization variable is located. After the synchronization variable of the task in the synchronization task waiting queue is triggered, the task is placed in the execution task waiting queue and queued for scheduling; The task in the execution task waiting queue is a queue in which the task waiting for the scheduling execution is located.
  • the determining, by the synchronization task, whether the synchronization variable of the task to be executed in the queue includes the global variable that has been updated, and if so, placing the task into the execution task Queue including:
  • Selecting a first specific task in the execution task waiting queue is run by the first idle resource, where the address information of the global variable involved in the first specific task and the address information of the global variable involved in all tasks currently executed are not Conflict; or,
  • Selecting a second specific task in the execution task waiting queue is run by the second idle resource.
  • the address information of the global variable involved in the second specific task is the same as or similar to the address information of the global variable involved in the task that has been executed by the second idle resource, so as to increase data affinity.
  • the global variable state information includes a memory address of the global variable, a creation time, and a version tag, where the creating a global variable snapshot for the global variable according to the global variable state information includes : copying the global variable state information according to the global variable state information, and generating a global variable snapshot of the global variable;
  • the obtaining the updated global variables according to the local global variable snapshot and the new global variable snapshot includes:
  • the method after the acquiring the updated global variable according to the local global variable snapshot and the new global variable snapshot, the method also includes:
  • the local global variable snapshot is saved in a common memory space in the resource performing the task, and the memory address of the global variable is updated to be a common memory space in the resource performing the task. Saving the memory address of the global variable snapshot, and updating the local global variable snapshot to the local global variable snapshot.
  • a second aspect of the present invention provides a task processing virtual machine, including: a scheduler node, a distributed shared memory management node, and a task execution container node;
  • the scheduler node includes:
  • a selection module configured to: when receiving an instruction to create a task delivered by the virtual instruction layer, select an idle resource for performing the task for the task, where the instruction includes at least the task runtime a start address, address information of the global variable involved in the task, and address information of the synchronization variable;
  • a first acquiring module configured to acquire a new global variable snapshot corresponding to the global variable, and obtain an updated global variable according to the local global variable snapshot and the new global variable snapshot;
  • a judging module configured to determine whether a synchronization variable of the to-be-executed task in the synchronization task waiting queue includes a global variable that is now updated, and if so, put the task into an execution task waiting queue; wherein the synchronization task waits in the queue
  • the task is a queue in which the task triggered by the synchronization variable is located. After the synchronization variable of the task in the synchronization task waiting queue is triggered, the task is placed in the execution task waiting queue to be queued for scheduling; the execution task waits for the task in the queue. Is the queue in which the task waiting for the scheduled execution is located;
  • the distributed shared memory management node includes:
  • a second obtaining module configured to acquire global variable state information corresponding to the global variable address information according to the address information of the global variable
  • the task execution container node includes:
  • an execution module configured to execute the task in a private memory space pre-allocated among the selected idle resources according to the local global variable snapshot.
  • the determining module includes: a first processing unit, configured to select a first specific task by performing a task waiting queue An idle resource is run, wherein the global variable involved in the first specific task does not conflict with global variables involved in all tasks currently executed;
  • a second processing unit configured to select, in the execution task waiting queue, a second specific task to be run by the second idle resource, where the global variable involved in the second specific task and the task in which the second idle resource has been executed
  • the global variables involved are as identical or similar as possible to increase data affinity.
  • the global variable status information includes a memory address, a creation time, and a version tag of the global variable.
  • the creating module includes: copying the global variable state information according to the global variable state information, and generating a global variable snapshot of the global variable;
  • the first acquiring module is specifically configured to:
  • the scheduler node further includes:
  • an update module configured to save the local global variable snapshot in a common memory space in a resource that executes the task, and update a memory address of the global variable to a resource that performs the task, when the global variable is not updated by other tasks
  • the memory address of the global variable snapshot is saved in the common memory space, and the local global variable snapshot is updated to the local global variable snapshot.
  • the task execution container node further includes :
  • the query module is configured to query the actual state of the memory address of the global variable snapshot when the page fault occurs when the task is executed;
  • a copy module configured to: when the memory address of the global variable snapshot corresponding to the task is in a common memory space of another resource, copy the actual content corresponding to the memory address of the global variable snapshot to the local;
  • the third obtaining module is configured to: when the memory address of the global variable snapshot corresponding to the task is in the local common memory space, obtain the local memory space.
  • the technical solution provided by the embodiment of the present invention has the beneficial effects of: properly allocating memory to the global variables involved in the task when scheduling the task, and as far as possible, the memory addresses of the global variables involved in the tasks do not conflict, reducing the virtual
  • the overhead of the machine system to maintain memory consistency increases the scalability of the virtual machine system.
  • FIG. 1 is a flowchart of a method for processing a task according to Embodiment 1 of the present invention
  • FIG. 2 is a schematic structural diagram of an overall architecture of a virtual machine in a method for processing a task according to Embodiment 1 of the present invention
  • FIG. 3 is a schematic structural diagram of each node of a virtual machine in a method for processing a task according to Embodiment 1 of the present invention
  • FIG. 5 is a schematic structural diagram of a virtual machine for task processing according to Embodiment 3 of the present invention.
  • FIG. 6 is a schematic structural diagram of a computer device according to Embodiment 4 of the present invention.
  • the embodiment of the invention provides a method for task processing, as shown in FIG. 1 .
  • the present invention implements a task-level virtual instruction set based on the application layer abstract virtualization technology (instruction set architecture) to implement a single system image of the cluster system at the middleware level, and establishes a single based on the instruction set.
  • System image Using a page-based distributed shared memory model, and by understanding the task, establish a relaxed memory consistency model, and optimize the memory distribution required by the task to reduce the system to maintain memory consistency. The overhead of improving the system's scalability.
  • the overall architecture of the virtual machine for processing tasks in the embodiment of the present invention is as shown in FIG. 2, specifically: the data center virtual machine (DVM) includes a data center virtual machine instruction set architecture (DISA), and a data center virtual machine virtual running environment.
  • DVM data center virtual machine
  • DISA data center virtual machine instruction set architecture
  • the underlying operating environment and upper-layer applications of the data center virtual machine are shown in FIG. 2, specifically: the data center virtual machine (DVM) includes a data center virtual machine instruction set architecture (DISA), and a data center virtual machine virtual running environment.
  • DISA data center virtual machine instruction set architecture
  • the Data Center Virtual Machine Instruction Set Architecture (DISA) is the virtual instruction layer for the Data Center Virtual Machine Architecture (DVM Architecture) that can be used to compute and control data center virtual machines. It is the programming interface that data center virtual machine DVM provides to programmers and compiler developers.
  • the underlying operating environment of the data center virtual machine including the hardware platform, instruction set, and operating system kernel for large-scale compute nodes.
  • Each node of the data center virtual machine (DVM) system includes: a distributed shared memory management node (DSM), a scheduler node, and a task execution container node, as shown in FIG. 3, specifically:
  • a distributed shared memory management (DSM home) node is used to support partial transaction memory implemented by the task-based snapshot mechanism to maintain memory consistency and provide a unified logical address space for upper layer applications.
  • the snapshot is a data structure that records the memory usage status represented by the page at a certain point in time, and can guarantee the transaction isolation of the data, and is a copy of the shared variable at a certain point in time.
  • Transaction memory is to ensure that each task has a transactional feature for memory write operations. It is a reference to the idea of things in the database.
  • the read and write of shared variables is encapsulated into a transaction. During the execution of the transaction, the data read by the current task will not be read. It is written by other threads, and the data written is not read by other threads.
  • the distributed shared memory management node implementation includes: global page element information (the actual storage location information of the page, etc.) and maintenance and management of the copy information; memory address and page conversion; local page information management, page table information update, Page fault processing; page information is copied and transmitted between nodes. Create snapshot-related management tasks such as memory snapshots, memory snapshots, and memory modification commits.
  • a scheduler node that is used to complete the management of tasks and synchronize data and tasks.
  • Task management includes scheduling of tasks, initialization of tasks, execution of tasks, and processing of task execution results.
  • Data, Task Synchronization involves synchronizing memory data and synchronizing tasks using a local distributed shared memory module.
  • the node includes a task management module and a memory module.
  • the function of the memory module is to convert the memory address and the page information, and forward the request for creating the snapshot of the task management module to the distributed shared memory management node.
  • the memory module of the corresponding task execution container node is notified to update the related memory page table entry.
  • the function of the task management module is mainly responsible for the management of tasks and the synchronization of data and tasks.
  • the specific functions of the scheduler node include 1 task scheduling: Selecting a specific task through a certain scheduling policy is performed on the corresponding task execution container. 2 Task preparation: Create a snapshot of the memory space of the task-related area by calling the local memory module. 3 tasks are distributed. 4 pairs of task execution result processing: such as processing the submitted memory modification; create a snapshot for the newly created task. 5 Through the memory module to transparently complete the synchronization of global data and tasks, maintaining memory consistency.
  • the task execution container node is used to perform tasks such as execution of tasks, feedback of execution results, and feedback for creating new tasks.
  • This type of node includes a task execution module and a memory module.
  • the functions of the task execution module include starting a local memory module, receiving tasks dispatched by the scheduler, establishing a local running context for the task, and performing tasks. Feedback the execution results to the scheduler, such as submitting memory modifications that may be required; or creating new tasks.
  • the memory module function manages the local page table information, including page table information update and page fault processing.
  • the method flow includes:
  • the instruction includes at least a start address of the task running time, The address information of the global variable involved in the task and the address information of the synchronization variable;
  • Step 102 Obtain global variable state information corresponding to the global variable address information according to the address information of the global variable.
  • the task in the synchronization task waiting queue is a queue in which the task triggered by the synchronization variable is located. After the synchronization variable of the task in the synchronization task waiting queue is triggered, the task is placed in the execution task waiting queue and queued for scheduling; The task in the execution task waiting queue is a queue in which the task waiting for the scheduling execution is located.
  • the embodiment of the present invention provides a method for processing a task.
  • the entire task processing is specifically performed by a scheduler node, a distributed shared memory management node, and a task execution container node. process.
  • the method flow includes:
  • the virtual machine includes: a scheduler node, a distributed shared memory management node, and a task execution container node.
  • the scheduler node when receiving an instruction to create a task delivered by the virtual instruction layer, the scheduler node is Selecting an idle task execution container node in the idle task execution container node may be that the entire task execution container node is in an idle state, or there may be free memory in the private memory space in the task execution container node for executing the scheduler node.
  • Assigned tasks Assign tasks to the task execution container node.
  • the instruction carries related information of the task, and at least includes a starting address of the task execution, address information of the global variable involved in the task, and address information of the synchronization variable, wherein the synchronization variable is also a type of the global variable, and is used to identify whether the task needs to be Other tasks are synchronized.
  • the scheduler node When synchronization with other tasks is required, the scheduler node puts the task into the synchronization task waiting queue and waits for the completion of other tasks to update the global variables, wherein the tasks in the synchronization task waiting queue are Waiting for the queue in which the task triggered by the synchronization variable is located, after the synchronization variable of the task in the synchronization task waiting queue is triggered, the task is placed in the execution task waiting queue and queued for scheduling; the task in the execution task waiting queue is waiting The queue in which the scheduled task is scheduled.
  • the task management module of the scheduler node is the entry point of the entire data center virtual machine system, and after initialization, establishes a connection with the task execution module of each task execution container node, starting from the first task of the system, and adopting a certain scheduling policy. After selecting the task execution container node that is currently idle, assign the task to the selected task execution container node.
  • the task execution module of the task execution container node When the task execution container node is started, the task execution module of the task execution container node first initializes the private memory area of the node, and then opens two types of server terminals. One function is to wait for a connection with the scheduler node; another type of function Is waiting to establish a connection with other task execution container nodes. The initialization of the local memory module is completed, and the shared memory area is set to be inaccessible. When different accesses occur, different page faults are caused and the local memory module is activated.
  • the global variable status information includes a memory address of the global variable, a creation time, and a version tag.
  • the global variable snapshot is created for the global variable according to the global variable status information.
  • the specific manner of creating a snapshot is: copying the global variable state information according to the global variable state information, and generating a global variable snapshot of the global variable.
  • the scheduler node initializes the operational data involved in the task, and schedules the points.
  • the cloth shared memory management node creates a snapshot of the global variables involved in the task.
  • the task management module of the scheduler node invokes the local memory module to implement the conversion of the memory address of the running data involved in the task to the page information, and sends the data packet to the distributed shared memory management node through the local memory module to complete the snapshot of the global variable involved in the task. Create, where the task involves the running data for the heap involved in the task, the initial data in the stack, the memory address of the global variable accessed, the starting address of the running instruction, and so on.
  • the page information corresponding to the memory address of the global variable involved in the task is sent to the distributed shared memory management node by the local memory module.
  • the distributed shared memory management node creates a snapshot of the global variables involved in the task, and saves the original page table information corresponding to the page where the memory address of the global variable involved in the task is located.
  • the task management module of the scheduler node calls the local memory module to send the snapshot as a data packet to the memory module of the previously selected task execution container node, and the task execution container node
  • the memory module updates the local page table information based on the snapshot.
  • the task management module of the scheduler node sends the running data related to the task to the task execution module of the corresponding task execution container node through the established connection, and listens for the message on the connection at this time. Complete the distribution of a task.
  • the task execution container node executes the task when receiving a message that the scheduler node notifies the execution of the task.
  • the pre-allocated private memory space and the common memory space are included, wherein the private memory space is invisible to the outside, and the local memory module of the container node is executed for the task, and is used in the task execution container node.
  • the task and the task execution container node itself need to execute tasks and programs; the common memory space is used for the virtual machine system to be called as needed.
  • the task execution module of the task execution container node executes the task after receiving the message.
  • the address information of the global variable that is, the memory address, is saved, so that when the global variable is called, it is found that the global variable may not execute the memory address of the container node in the local task, thereby triggering a different page fault.
  • the specific operation process is as follows:
  • the task execution container node sends the query information to the distributed shared memory management node, and receives the feedback information of the distributed shared memory management node.
  • the local memory module When a page fault occurs during the execution of a task, the local memory module sends a message to the distributed shared memory management node to query the actual location of the page information corresponding to the global variable snapshot. If the page information is in another container, the local The memory module copies the actual content of the page information to the local through the connection between the task execution container nodes.
  • the specific operation process is: when the page information of the global variable snapshot corresponding to the task in the feedback information is in another task execution container node, then the local task execution container node corresponds to the global variable snapshot through the connection between the task execution container nodes. The actual content corresponding to the page information is copied to the local.
  • the specific operation process is as follows: When the page information of the global variable snapshot corresponding to the task in the feedback information is in the local task execution container node, the local task execution container node's common memory space is cached.
  • the scheduler node obtains a new global variable snapshot saved in the distributed shared memory management node by taking a snapshot of the local global variable after the execution of the task and the global variable corresponding to the local global variable snapshot, wherein the new global variable snapshot is also the global
  • the copy corresponding to the variable because there may be other tasks to update the global variable, so the new global variable snapshot may not be the same as the local global variable snapshot.
  • This comparison is through the snapshot of each global variable.
  • the version tag is obtained after comparison. If the version tag is the same, then there is no other task to modify the global variable, so the global variable can be updated. If the version tags are not the same, then other tasks are already in the task.
  • the global variable is updated before the local global variable snapshot is modified, so the global variable cannot be updated to the local global variable snapshot at this time, so you need to compare the new global variable snapshot with the local global variable snapshot before updating the global variable. Can I update?
  • step 408 can be specifically as follows:
  • the node updates the global variable or discards the executed task and the snapshot of the global variables it involves based on the type of the message.
  • the task management module of the scheduler node After receiving the message returned by the task execution module of the task execution container node, the task management module of the scheduler node performs different processing according to different message contents.
  • the specific forms of the message are as follows: Normal exit; invalidation exit; Create subtask.
  • the specific operation process is as follows: When the task is executed, the scheduler node receives the message of the normal exit sent by the task execution container node.
  • the global variable snapshot is changed, determining whether the state information of the global variable in the global variable snapshot is the same as the current state information of the global variable, and if they are the same, the common memory space in the resource performing the task Saving the global variable snapshot, and updating the memory address of the global variable to store the memory address of the global variable snapshot in the common memory space in the resource performing the task; if not, performing the step of exiting the task .
  • the global variable snapshot corresponding to the task is modified, first determine whether the original global variable corresponding to the global variable snapshot has been updated at this time, and the state information and the original in the global variable snapshot. The status information of the global variable is compared. If it is the same, it means that it is not updated. At this time, the update operation can be performed. If it is not the same, it means that there are other tasks that have updated the global variable. At this time, the update operation cannot be performed. The task is invalidated, re-entered into the waiting queue, waiting to be re-executed. It ensures that the updated global variables will not be updated again by other tasks executing in parallel at the same time, which reduces the overhead of maintaining data consistency when global variables are concurrently read and written.
  • the scheduler node schedules the distributed shared memory management node to update the page information of the original global variables, and receives the page information of the updated global variables of the distributed shared memory management node.
  • the scheduler node sends a submit message to the task execution container node, and the commit message causes the task execution container node to save the modified global variable snapshot in the task execution container node, and notifies the page corresponding to the modified global variable snapshot page on the task execution container node. information.
  • the scheduler node receives the page information of the modified global variable snapshot sent by the task execution container node, writes the identifier of the task execution container into the page information, and sends the page information and the global variable snapshot to the distributed shared memory management node.
  • the distributed shared memory management node deletes the snapshot of the global variable based on the received page information and the global variable snapshot.
  • the distributed shared memory management node determines whether there is only one task currently executing the container node to modify the global variable snapshot. If only one task execution container node performs a task to modify the global variable snapshot corresponding to the task, the distributed shared memory management node replaces the page information of the original global variable with the page information of the modified global variable snapshot, and The scheduler node sends a message of successful submission, and the message submitted successfully carries the page information of the modified global variable.
  • the specific operation process is: if the global variable snapshot corresponding to the task is not modified, the scheduler node schedules the distributed shared memory management node to delete the global variable snapshot corresponding to the task, and schedules execution of the task waiting queue. Waiting for the task.
  • the message for creating the subtask includes at least the start address of the subtask, the address information of the global variable of the subtask; when the subtask needs to be synchronized with other tasks
  • the message for creating the subtask also includes address information of the synchronization variable.
  • the scheduler node When the task is executed, the scheduler node receives a message for creating a subtask sent by the task execution container node.
  • the specific operation process is as follows: The scheduler node adds a memory address range of the global variable involved in the subtask in the synchronization variable observation area, and puts the subtask into the global synchronization task waiting queue, waiting for other subtasks to update the global variable. Finished.
  • the scheduler node puts the subtask into the global task waiting queue and waits for the execution of the task.
  • the scheduler node assigns the task execution container node to the subtask, and creates a snapshot.
  • the global variable snapshot is deleted when the task is executed and a message to invalidate the exit is sent.
  • the specific operation process is as follows: The scheduler node schedules the distributed shared memory management node to delete the global variable snapshot corresponding to the task.
  • the task in the synchronization task waiting queue is a queue in which the task triggered by the synchronization variable is located.
  • the synchronization task of the synchronization task waits for the synchronization variable of the task, the task is placed in the execution.
  • the row task wait queue is queued for scheduling; the task in the execution task wait queue is the queue in which the task waiting for the schedule execution is located.
  • the virtual machine system When the task is executed, no matter whether the task is normally exited or invalidated after the task is executed, the virtual machine system needs to consider all the tasks currently being executed and the global tasks involved in the execution of the next task.
  • the memory address of the variable according to the global variables involved in the two types of tasks to determine which task to wait in the task waiting queue to enter the execution process. This process is performed as a scheduler node in the virtual machine system.
  • step 409 can be specifically as follows:
  • Selecting a second specific task in the execution task waiting queue is run by the second idle resource, where the address information of the global variable involved in the second specific task and the task completed by the second idle resource are involved.
  • the address information of global variables is as much the same or similar as possible to increase data affinity.
  • the address information is similar.
  • the memory address of the global variable is similar. For example, if the memory address of a global variable is 0x0010, the memory address such as 0x0011, 0x0012, or OxOOOf can be considered as "similar" memory address.
  • the memory address selected in the task waiting queue is as close as or similar to the memory address of the global variable involved in the previously ended task. The purpose is to increase the data affinity, and on the other hand, increase the hit rate of the Cache.
  • the global variable can be directly obtained from the current task execution container node according to the global variable snapshot when the task is executed.
  • the embodiment of the present invention provides a virtual machine for task processing.
  • the virtual machine includes: a scheduler node 501, a distributed shared memory management node 502, and a task execution container node 503.
  • the scheduler node 501 includes :
  • the selecting module 5011 is configured to: when receiving an instruction for creating a task that is sent by the virtual instruction layer, select an idle resource for performing the task for the task, where the instruction includes at least the running time of the task. a start address, address information of the global variable involved in the task, and address information of the synchronization variable;
  • a first obtaining module 5012 configured to acquire a new global variable snapshot corresponding to the global variable after the task is executed, and obtain an updated global variable according to the local global variable snapshot and the new global variable snapshot ;
  • the determining module 5013 is configured to determine whether the synchronization variable of the task to be executed in the synchronization task waiting queue includes the global variable that has been updated now, and if so, put the task into the execution task waiting queue;
  • the task in the synchronization task waiting queue is a queue in which the task triggered by the synchronization variable is located. After the synchronization variable of the task in the synchronization task waiting queue is triggered, the task is placed in the execution task waiting queue and queued for scheduling; The task in the execution task waiting queue is a queue in which the task waiting for the scheduling execution is located;
  • the distributed shared memory management node 502 includes:
  • the second obtaining module 5021 is configured to obtain global variable state information corresponding to the global variable address information according to the address information of the global variable.
  • a creating module 5022 configured to create a local global variable snapshot for the global variable according to the global variable status information
  • the task execution container node 503 includes: The executing module 5031 is configured to execute the task in a pre-allocated private memory space in the selected idle resource according to the local global variable snapshot.
  • the determining module 5013 includes:
  • the first processing unit 50131 is configured to select, in the execution task waiting queue, a first specific task to be run by the first idle resource, where the global variable involved in the first specific task and the global involved in all tasks currently executed Variables do not conflict;
  • the second processing unit 50132 is configured to select, in the execution task waiting queue, a second specific task to be run by the second idle resource, where the global variable involved in the second specific task and the second idle resource have completed the task
  • the global variables involved are as identical or similar as possible to increase data affinity.
  • the global variable status information includes a memory address, a creation time, and a version tag of the global variable.
  • the creating module 5022 includes: copying the global variable state information according to the global variable state information, and generating a global variable snapshot of the global variable;
  • the first obtaining module 5012 is specifically configured to:
  • the scheduler node 501 further includes:
  • An update module 5014 configured to save the local global variable snapshot in a common memory space in a resource that executes the task, and update a memory address of the global variable to perform the task, when the global variable is not updated by other tasks
  • the memory address of the global variable snapshot is saved in a common memory space in the resource, and the local global variable snapshot is updated to the local global variable snapshot.
  • the task execution container node 503 further includes:
  • the query module 5032 is configured to query, when the page fault occurs, the actual state of the memory address of the global variable snapshot;
  • the copy module 5033 is configured to: when the memory address of the global variable snapshot corresponding to the task is in a common memory space of another resource, copy the actual content corresponding to the memory address of the global variable snapshot Bay to local;
  • the third obtaining module 5034 is configured to: when the memory address of the global variable snapshot corresponding to the task is in the local common memory space, obtain the local memory space.
  • the embodiment further provides a computer device 60, including a processor 61, a memory 62, a memory stored in the memory, a processor for reading the code, and executing the method in the foregoing embodiments.
  • the processor executes the method
  • the functional unit on each involved software can be considered as each module in the third embodiment, and the specific implementation thereof
  • the method refer to the foregoing embodiments, and details are not described herein again.
  • a person skilled in the art may understand that all or part of the steps of implementing the above embodiments may be completed by hardware, or may be instructed by a program to execute related hardware, and the program may be stored in a computer readable storage medium.
  • the storage medium mentioned may be a read only memory, a magnetic disk or an optical disk or the like.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Retry When Errors Occur (AREA)

Abstract

本发明公开了一种任务处理的方法和虚拟机,属于计算机技术领域。所述方法包括:为任务在选取一个空闲资源;为全局变量创建全局变量快照;在选取的空闲资源中的私有内存空间中执行任务;当任务执行完毕后,获取全局变量对应的新的全局变量快照,根据本地全局变量快照以及新的全局变量快照获取已更新的全局变量;判断同步任务等待队列中的待执行任务的同步变量是否包括了现在已更新的全局变量,如果有,把这个任务放入执行任务等待队列。本发明通过虚拟机执行任务时对任务涉及的全局变量的感知,以及在调度任务时对任务涉及的全局变量合理的分配内存,使各任务之间涉及的全局变量的内存地址不冲突,减少虚拟机系统为维护内存一致性所产生的开销。

Description

一种任务处理的方法和虚拟机 本申请要求于 2012 年 12 月 14 日提交中国专利局、 申请号为 201210543870.4、发明名称为"一种任务处理的方法和虚拟机,,的中国专利申请 的优先权, 上述专利申请的全部内容通过引用结合在本申请中。
技术领域
本发明涉及计算机技术领域, 特别涉及一种任务处理的方法和虚拟机。
背景技术
在计算机技术领域中, 虚拟技术是一种通过组合或分割现有的计算机资 源, 使得这些资源表现为一个或多个操作环境, 从而提供优于原有资源配置 的访问方式的技术。
现有技术中通过软件的方式将多个 X86系统聚合成一个虚拟的对称多处 理机。 使用一个虚拟机监视器或者虚拟机仿真器实现单个结点的物理资源的 虚拟化, 提供统一的运行环境。 虚拟机对内存的管理是通过软件的方式实现 的, 将所有物理资源中的内存在逻辑上视为一个整体的内存, 内存是按照虚 拟页面划分的。 当虚拟机在执行任务时, 会随机选取等待队列中的任务, 然 后按照任务涉及的相关数据所需的内存空间, 在逻辑内存中为任务按顺序的 分配内存地址, 是一种按需分配内存的机制。
在实现本发明的过程中, 发明人发现现有技术至少存在以下问题: 由于虚拟机系统是按照页面来划分是否存在数据冲突的, 当两个不同的 任务所涉及的数据被分配在同一个虚拟页面之后, 两个任务同时访问该虚拟 页面中的两个不同地址, 虚拟机会认为两个任务访问的是同一个数据, 因此 会认为两个任务发生了数据共享冲突, 会中端两个任务的执行过程, 而事实 上并未发生真正的共享冲突, 即产生了假共享现象, 影响任务的执行。 发明内容
为了解决现有技术的问题, 本发明实施例提供了一种任务处理的方法和 虚拟机。 所述技术方案如下:
第一方面, 本发明实施例提供的一种任务处理的方法, 包括:
当接收到虚拟指令层下发的创建任务的指令时, 为所述任务选取一个用 于执行所述任务的空闲资源, 其中所述指令中至少包括所述任务运行时的起 始地址, 所述任务涉及的全局变量的地址信息和同步变量的地址信息;
根据所述全局变量的地址信息获取与所述全局变量地址信息对应的全局 变量状态信息;
才艮据全局变量状态信息为全局变量创建本地全局变量快照;
根据所述本地全局变量快照在选取的所述空闲资源中预先分配的私有内 存空间中执行所述任务;
当所述任务执行完毕后, 获取所述全局变量对应的新的全局变量快照, 根据所述本地全局变量快照以及所述新的全局变量快照获取已更新的全局变 量;
判断同步任务等待队列中的待执行任务的同步变量是否包括了现在已更 新的全局变量, 如果有, 把这个任务放入执行任务等待队列;
其中所述同步任务等待队列中的任务是等待同步变量触发的任务所在的 队列, 当同步任务等待队列中的任务的同步变量触发后, 将任务放入所述执 行任务等待队列中排队等待调度; 所述执行任务等待队列中的任务是等待调 度执行的任务所在的队列。
在第一方面的第一种可能的实现方式中, 所述判断同步任务等待队列中 的待执行任务的同步变量是否包括了现在已更新的全局变量, 如果有, 把这 个任务放入执行任务等待队列, 包括:
在执行任务等待队列中选取一个第一特定任务由第一空闲资源来运行, 其中, 所述第一特定任务涉及的全局变量的地址信息与当前执行的所有任务 所涉及的全局变量的地址信息不冲突; 或,
在执行任务等待队列中选取一个第二特定任务由第二空闲资源来运行, 其中, 所述第二特定任务涉及的全局变量的地址信息与第二空闲资源已执行 完毕的任务所涉及的全局变量的地址信息尽可能多的相同或相近, 以增加数 据亲和性。
在第一方面的第二种可能的实现方式中, 所述全局变量状态信息包括所 述全局变量的内存地址, 创建时间以及版本标记, 所述根据全局变量状态信 息为全局变量创建全局变量快照包括: 根据所述全局变量状态信息, 将所述 全局变量状态信息进行复制, 生成所述全局变量的全局变量快照;
相应的, 所述根据所述本地全局变量快照以及所述新的全局变量快照获 取已更新的全局变量包括:
判断所述本地全局变量快照中的版本标记与所述新的全局变量快照的版 本标记是否相同, 如果相同则表示所述全局变量未被其他任务更新; 如果不 相同则表示所述全局变量已被其他任务更新。
根据第一方面的第二种可能的实现方式, 在第三种可能的实现方式中, 所述根据所述本地全局变量快照以及所述新的全局变量快照获取已更新的全 局变量之后, 所述方法还包括:
当全局变量未被其他任务更新时, 在执行所述任务的资源中的公用内存 空间中保存所述本地全局变量快照, 并更新全局变量的内存地址为执行所述 任务的资源中的公用内存空间中保存所述全局变量快照的内存地址, 将所述 本地全局变量快照更新为所述本地全局变量快照。
结合第一方面或第一方面的第一种可能的实现方式或第二种可能的实现 方式中任一项的实现方式, 在第四种可能的实现方式中, 所述根据所述全局 变量快照在选取的所述空闲资源中预先分配的私有内存空间中执行所述任务 之后, 所述方法还包括:
执行所述任务发生缺页错误时, 则查询所述全局变量快照的内存地址实 际的状态;
当所述任务对应的全局变量快照的内存地址在其他资源的公用内存空间 中, 将所述全局变量快照的内存地址对应的实际内容拷贝到本地;
当所述任务对应的全局变量快照的内存地址在本地的公用内存空间中, 则在本地的公用内存空间中进行获取。 第二方面, 本发明实施例提供的一种任务处理的虚拟机, 包括: 调度器节点, 分布式共享内存管理节点, 任务执行容器节点;
所述调度器节点包括:
选取模块, 用于当接收到虚拟指令层下发的创建任务的指令时, 为所述 任务选取一个用于执行所述任务的空闲资源, 其中所述指令中至少包括所述 任务运行时的起始地址, 所述任务涉及的全局变量的地址信息和同步变量的 地址信息;
第一获取模块, 用于当所述任务执行完毕后, 获取所述全局变量对应的 新的全局变量快照, 根据所述本地全局变量快照以及所述新的全局变量快照 获取已更新的全局变量;
判断模块, 用于判断同步任务等待队列中的待执行任务的同步变量是否 包括了现在已更新的全局变量, 如果有, 把这个任务放入执行任务等待队列; 其中所述同步任务等待队列中的任务是等待同步变量触发的任务所在的 队列, 当同步任务等待队列中的任务的同步变量触发后, 将任务放入所述执 行任务等待队列中排队等待调度; 所述执行任务等待队列中的任务是等待调 度执行的任务所在的队列;
所述分布式共享内存管理节点包括:
第二获取模块, 用于根据所述全局变量的地址信息获取与所述全局变量 地址信息对应的全局变量状态信息;
创建模块, 用于根据全局变量状态信息为全局变量创建本地全局变量快 照;
所述任务执行容器节点包括:
执行模块, 用于根据所述本地全局变量快照在选取的所述空闲资源中预 先分配的私有内存空间中执行所述任务。
在第二方面的第一种可能的实现方式中, 所述判断模块, 包括: 第一处理单元, 用于在执行任务等待队列中选取一个第一特定任务由第 一空闲资源来运行, 其中, 所述第一特定任务涉及的全局变量与当前执行的 所有任务所涉及的全局变量不冲突;
第二处理单元, 用于在执行任务等待队列中选取一个第二特定任务由第 二空闲资源来运行, 其中, 所述第二特定任务涉及的全局变量与第二空闲资 源已执行完毕的任务所涉及的全局变量尽可能多的相同或相近, 以增加数据 亲和性。
在第二方面的第二种可能的实现方式中, 所述全局变量状态信息包括所 述全局变量的内存地址, 创建时间以及版本标记,
所述创建模块包括: 根据所述全局变量状态信息, 将所述全局变量状态 信息进行复制, 生成所述全局变量的全局变量快照;
相应的, 所述第一获取模块具体用于:
判断所述本地全局变量快照中的版本标记与所述新的全局变量快照的版 本标记是否相同, 如果相同则表示所述全局变量未被其他任务更新; 如果不 相同则表示所述全局变量已被其他任务更新。
根据第二方面的第二种可能的实现方式, 在第三种可能的实现方式中, 所述调度器节点还包括:
更新模块, 用于当全局变量未被其他任务更新时, 在执行所述任务的资 源中的公用内存空间中保存所述本地全局变量快照, 并更新全局变量的内存 地址为执行所述任务的资源中的公用内存空间中保存所述全局变量快照的内 存地址, 将所述本地全局变量快照更新为所述本地全局变量快照。
结合第二方面或第二方面的第一种可能的实现方式或第二种可能的实现 方式中任一项的实现方式, 在第四种可能的实现方式中, 所述任务执行容器 节点还包括:
查询模块, 用于执行所述任务发生缺页错误时, 则查询所述全局变量快 照的内存地址实际的状态;
拷贝模块, 用于当所述任务对应的全局变量快照的内存地址在其他资源 的公用内存空间中, 将所述全局变量快照的内存地址对应的实际内容拷贝到 本地; 第三获取模块, 用于当所述任务对应的全局变量快照的内存地址在本地 的公用内存空间中, 则在本地的公用内存空间中进行获取。
本发明实施例提供的技术方案带来的有益效果是: 在调度任务时对任务涉及的全局变量合理的分配内存, 尽可能使各任务之间 所涉及的全局变量的内存地址不冲突, 减少虚拟机系统为维护内存一致性所 产生的开销, 提高虚拟机系统的可扩展性。
附图说明
为了更清楚地说明本发明实施例的技术方案, 下面将对本发明实施例或 现有技术描述中所需要使用的附图作简单地介绍, 显而易见地, 下面所描述 的附图仅仅是本发明的一些实施例, 对于本领域普通技术人员来讲, 在不付 出创造性劳动的前提下, 还可以根据这些附图获得其他的附图。
图 1是本发明实施例一提供的任务处理的方法流程图;
图 2是本发明实施例一提供的任务处理的方法中虚拟机的整体架构的结 构示意图;
图 3 是本发明实施例一提供的任务处理的方法中虚拟机各节点的结构示 意图;
图 4是本发明实施例二提供的任务处理的方法流程图;
图 5是本发明实施例三提供的任务处理的虚拟机结构示意图;
图 6为本发明实施例四提供的计算机设备的结构示意图。
具体实施方式
为使本发明的目的、 技术方案和优点更加清楚, 下面将结合附图对本发 明实施方式作进一步地详细描述。
实施例一
本发明实施例提供了一种任务处理的方法, 参见图 1。 需要说明的是, 本发明基于应用层抽象虚拟化技术(指令集架构)在中 间件级实现机群系统的单一系统映像, 提出了一种任务层次的虚拟指令集, 并基于该指令集建立一个单一的系统镜像。 釆用基于页面的分布式共享内存 模型, 并通过对任务的感知, 建立一种松弛的事物内存一致性模型, 通过对 任务所需的内存分布进行合理优化, 减少系统为维护内存一致性所产生的开 销, 提高系统的可扩展性。
本发明实施例所进行处理任务的虚拟机的整体架构如图 2所示, 具体为: 数据中心虚拟机 (DVM)包括数据中心虚拟机指令集架构 (DISA ) 、 数据 中心虚拟机虚拟运行环境, 数据中心虚拟机底层运行环境和上层应用。
数据中心虚拟机指令集架构 (DISA ) 即虚拟指令层, 用于数据中心虚拟 机架构( DVM Architecture ) , 可用于计算和控制数据中心虚拟机。 它是数据 中心虚拟机 DVM提供给程序员以及编译器开发人员的编程接口。
数据中心虚拟机底层运行环境, 包括大规模计算结点的硬件平台、 指令 集和操作系统内核。
数据中心虚拟机(DVM ) 系统各节点包括: 分布式共享内存管理节点 (DSM), 调度器节点, 任务执行容器节点, 如图 3所示, 具体为:
分布式共享内存管理(DSM home )节点, 用于支持以基于任务的快照机 制实现的部分事务内存来实现内存一致性的维护, 为上层应用提供统一的逻 辑地址空间。 其中, 快照是记录某个时间点以页面表示的内存使用状态, 可 以保证数据的事务隔离的一种数据结构, 是共享变量在某一时间点的一份拷 贝。 事务内存是保证各任务对内存的写操作具有事务特性, 是借鉴数据库中 事物的思想, 把对共享变量的读写封装到一个事物中, 事务的执行过程中, 当前任务所读的数据不会被其他线程写, 写的数据则不会被其他线程读, 在 事务结束时, 对共享变量的修改才为其他事务所见。 为了支持对共享变量的 并发读写以及降低数据副本一致性开销, 本发明釆用快照来实现对共享变量 的并发读写, 并釆用延迟更新的方法降低一致性开销。 分布式共享内存管理 节点具体实现包括:全局页元信息 (页面的实际存储位置信息等)和拷贝信息的 维护和管理; 内存地址与页面的转化; 本地页面信息的管理, 页表信息更新、 缺页处理; 页面信息在结点间的复制和传输。 创建内存快照、 删除内存快照、 内存修改提交等与快照相关的管理工作。
调度器节点, 用于完成任务的管理和数据、 任务的同步。 任务管理包括 任务的调度、 任务的初始化、 任务的执行、 任务执行结果处理。 数据、 任务 同步包括使用本地的分布式共享内存模块完成内存数据的同步和任务的同 步。 该节点包括任务管理模块和内存模块。 其中, 内存模块的功能为内存地 址与页面信息的转化, 把任务管理模块的创建快照的请求, 转发给分布式共 享内存管理节点。 任务准备执行时, 通知对应的任务执行容器节点的内存模 块更新相关的内存页表项。 其中任务管理模块的功能主要是负责任务的管理 以及数据和任务的同步。 调度器节点具体的功能包括①任务调度: 通过一定 的调度策略选择特定的任务在相应的任务执行容器上执行。 ②任务的执行准 备: 通过调用本地的内存模块对任务涉及区域的内存空间创建快照。 ③任务 派发。 ④对任务执行结果处理: 如处理提交的内存修改; 为新建的任务建立 快照。 ⑤通过内存模块透明地完成全局数据和任务的同步, 维护内存的一致 性。
任务执行容器节点, 用于完成任务的执行、 执行结果的反馈、 创建新任 务的反馈等功能。 该类节点包括任务执行模块和内存模块。 任务执行模块的 功能包括启动本地的内存模块, 接收调度器派发的任务, 为任务建立本地运 行的上下文, 执行任务。 向调度器反馈执行结果, 例如提交可能需要的内存 修改; 或者建立新任务。 内存模块功能为本地页表信息的管理, 包括页表信 息更新、 缺页处理。
上层应用, 用于数据中心虚拟机指令集架构编写的指令序列。
方法流程包括:
101 : 当接收到虚拟指令层下发的创建任务的指令时, 为所述任务选取一 个用于执行所述任务的空闲资源, 其中所述指令中至少包括所述任务运行时 的起始地址, 所述任务涉及的全局变量的地址信息和同步变量的地址信息;
102: 才艮据所述全局变量的地址信息获取与所述全局变量地址信息对应的 全局变量状态信息; 103: 4艮据全局变量状态信息为全局变量创建本地全局变量快照;
104: 根据所述本地全局变量快照在选取的所述空闲资源中预先分配的私 有内存空间中执行所述任务;
105: 当所述任务执行完毕后, 获取所述全局变量对应的新的全局变量快 照, 根据所述本地全局变量快照以及所述新的全局变量快照获取已更新的全 局变量;
106: 判断同步任务等待队列中的待执行任务的同步变量是否包括了现在 已更新的全局变量, 如果有, 把这个任务放入执行任务等待队列;
其中所述同步任务等待队列中的任务是等待同步变量触发的任务所在的 队列, 当同步任务等待队列中的任务的同步变量触发后, 将任务放入所述执 行任务等待队列中排队等待调度; 所述执行任务等待队列中的任务是等待调 度执行的任务所在的队列。 的感知, 以及在调度任务时对任务涉及的全局变量合理的分配内存, 尽可能 使得各任务之间涉及的全局变量的内存地址不冲突, 减少虚拟机系统为维护 内存一致性所产生的开销, 提高虚拟机系统的可扩展性。 实施例二
本发明实施例提供了一种任务处理的方法, 参见图 4, 需要说明的是, 本 发明实施例是通过调度器节点、 分布式共享内存管理节点、 任务执行容器节 点具体执行对任务处理的整个过程。
方法流程包括:
所述虚拟机包括: 调度器节点, 分布式共享内存管理节点以及任务执行 容器节点。
401 : 当接收到虚拟指令层下发的创建任务的指令时, 为所述任务选取一 个用于执行所述任务的空闲资源, 其中所述指令中至少包括所述任务运行时 的起始地址, 所述任务涉及的全局变量的地址信息和同步变量的地址信息。
具体的, 当接收到虚拟指令层下发的创建任务的指令时, 调度器节点在 空闲的任务执行容器节点中选择一个空闲的任务执行容器节点, 可以是整个 任务执行容器节点处于空闲状态, 也可以是任务执行容器节点中的私有内存 空间中存在空闲内存, 用于执行调度器节点分配的任务。 并将任务分配给任 务执行容器节点。 指令中携带任务的相关信息, 至少包括任务执行的起始地 址, 任务涉及的全局变量的地址信息和同步变量的地址信息, 其中同步变量 也是全局变量的一种, 用于标识该任务是否需要和其他任务进行同步, 当需 要与其他任务同步时, 则调度器节点将该任务放入同步任务等待队列中等待 其他任务的完成对全局变量进行更新完毕, 其中所述同步任务等待队列中的 任务是等待同步变量触发的任务所在的队列, 当同步任务等待队列中的任务 的同步变量触发后, 将任务放入所述执行任务等待队列中排队等待调度; 所 述执行任务等待队列中的任务是等待调度执行的任务所在的队列。
调度器节点的任务管理模块是整个数据中心虚拟机系统的入口点, 初始 化后建立与各任务执行容器节点的任务执行模块之间的连接, 从系统的第一 个任务开始, 通过一定的调度策略选择当前处于空闲状态的任务执行容器节 点后, 并将任务分配给选择的任务执行容器节点。
任务执行容器节点在启动时, 任务执行容器节点的任务执行模块首先初 始化该节点的私有内存区域, 然后开启两类服务器端, 一类的功能是等待与 调度器节点建立连接; 另一类的功能是等待与其它任务执行容器节点建立连 接。 完成本地内存模块的初始化, 将共享的内存区域设置为不可访问, 当发 生不同访问时, 会引发不同的缺页错误, 而激活本地的内存模块。
402: 才艮据所述全局变量的地址信息获取与所述全局变量地址信息对应的 全局变量状态信息。
其中全局变量状态信息包括所述全局变量的内存地址, 创建时间以及版 本标记。
403: 所述 4艮据全局变量状态信息为全局变量创建全局变量快照。
创建快照的具体方式为: 根据所述全局变量状态信息, 将所述全局变量 状态信息进行复制, 生成所述全局变量的全局变量快照。
具体实施方式为调度器节点初始化所述任务涉及的运行数据, 并调度分 布式共享内存管理节点为所述任务涉及的全局变量创建快照。
调度器节点的任务管理模块调用本地内存模块实现任务涉及的运行数据 的内存地址到页面信息的转化, 并通过本地内存模块发送数据包给分布式共 享内存管理节点, 完成任务涉及的全局变量快照的创建, 其中任务所涉及的 运行数据的为任务涉及的堆、 栈中的初始数据, 所访问的全局变量的内存地 址, 运行指令的起始地址等信息。
通过本地内存模块将任务涉及的全局变量的内存地址对应的页面信息发 送至所述分布式共享内存管理节点。 分布式共享内存管理节点为任务涉及的 全局变量创建快照, 并保存任务涉及的全局变量的内存地址所在页面对应的 原始的页表信息。
分布式共享内存管理节点创建全局变量快照后, 调度器节点的任务管理 模块再调用本地内存模块将快照以数据包的形式发送给之前已经选择好的任 务执行容器节点的内存模块, 任务执行容器节点的内存模块根据快照更新本 地的页表信息。 页表信息更新完毕后, 调度器节点的任务管理模块通过已建 立的连接将任务涉及的运行数据以消息形式发送给对应的任务执行容器节点 的任务执行模块, 并一直监听连接上的消息, 至此完成一个任务的分发。
404: 根据所述本地全局变量快照在选取的所述空闲资源中预先分配的私 有内存空间中执行所述任务。
当接收到调度器节点通知执行所述任务的消息时, 任务执行容器节点执 行任务。 在每一个任务执行容器节点中, 都包含预先分配的私有内存空间和 公用内存空间, 其中私有内存空间是对外不可见的, 为任务执行容器节点的 本地内存模块, 用于在任务执行容器节点被分配任务后执行任务以及任务执 行容器节点自身需要执行的任务和程序; 公用内存空间用于虚拟机系统整体 根据需要进行调用。
405: 执行所述任务发生缺页错误时, 则查询所述全局变量快照的内存地 址实际的状态。
任务执行容器节点的任务执行模块接收到消息后会执行任务。 在执行任 务过程中, 当调用任务所涉及到的全局变量快照时, 由于该全局变量快照仅 保存了全局变量的地址信息, 即内存地址, 因此会导致调用全局变量时发现 该全局变量可能不在本地任务执行容器节点的内存地址, 由此会触发不同的 页面错误。
具体操作过程为: 任务执行容器节点向分布式共享内存管理节点发送查 询信息, 并接收分布式共享内存管理节点的反馈信息。
406: 当所述任务对应的全局变量快照的内存地址在其他资源的公用内存 空间中, 将所述全局变量快照的内存地址对应的实际内容拷贝到本地。
执行任务过程中发生缺页错误时, 本地的内存模块通过向分布式共享内 存管理节点发送消息, 查询该全局变量快照对应的页面信息实际所在的位置, 若页面信息在别的容器内, 本地的内存模块通过任务执行容器节点之间的连 接将页面信息实际内容拷贝到本地。
具体操作过程为: 当反馈信息中所述任务对应的全局变量快照的页面信 息在其他任务执行容器节点时, 则本地的任务执行容器节点通过任务执行容 器节点之间的连接将全局变量快照对应的页面信息对应的实际内容拷贝到本 地。
407: 当所述任务对应的全局变量快照的内存地址在本地的公用内存空间 中, 则在本地的公用内存空间中进行获取。
具体操作过程为: 当反馈信息中任务对应的全局变量快照的页面信息在 本地的任务执行容器节点时, 则在本地的任务执行容器节点的公用内存空间 的緩存中进行获取。
408: 当所述任务执行完毕后, 获取所述全局变量对应的新的全局变量快 照, 根据所述本地全局变量快照以及所述新的全局变量快照获取已更新的全 局变量。
调度器节点通过获取任务执行完毕后的本地全局变量快照, 以及该本地 全局变量快照对应的全局变量在分布式共享内存管理节点中保存的新的全局 变量快照, 其中新的全局变量快照也是该全局变量对应的副本, 由于可能存 在其他任务执行对该全局变量进行了更新的情况, 因此新的全局变量快照与 本地的全局变量快照有可能不相同, 这个对比是通过各个全局变量快照中的 版本标记来进行比对后得到的, 如果版本标记相同, 那么说明没有其他任务 对该全局变量进行修改, 因此可以对该全局变量进行更新; 如果版本标记不 相同, 那么说明其他任务已经在该任务修改本地全局变量快照前对全局变量 进行了更新, 因此此时的全局变量无法更新为本地的全局变量快照, 因此在 更新全局变量前需要通过新的全局变量快照和本地全局变量快照对比, 查询 一下是否可以进行更新。
因此步骤 408可以具体为:
判断所述本地全局变量快照中的版本标记与所述新的全局变量快照的版 本标记是否相同, 如果相同则表示所述全局变量未被其他任务更新; 如果不 相同则表示所述全局变量已被其他任务更新。 节点会根据消息的类型对执行完的任务以及其所涉及的全局变量快照进行更 新全局变量的操作或抛弃处理。
调度器节点的任务管理模块接收到任务执行容器节点的任务执行模块返 回的消息后, 根据不同的消息内容做不同的处理。 消息具体形式有如下几种: 正常退出; 作废退出; 创建子任务。
当消息类型为正常退出的任务时:
当所述任务执行完毕且发送正常退出的消息时, 判断所述全局变量快照 在所述任务执行后是否被修改。
具体操作过程为: 当任务执行完毕, 调度器节点接收所述任务执行容器 节点发送的正常退出的消息。
若所述全局变量快照被^ ί 改, 判断所述全局变量快照中的全局变量的状 态信息与该全局变量的当前状态信息是否相同, 如果相同则在执行所述任务 的资源中的公用内存空间中保存所述全局变量快照, 并更新全局变量的内存 地址为执行所述任务的资源中的公用内存空间中保存所述全局变量快照的内 存地址; 如果不相同则执行作废退出所述任务的步骤。
若任务对应的全局变量快照被修改, 首先判断此时该全局变量快照对应 的原始全局变量是否已经被更新过, 通过全局变量快照中的状态信息与原始 全局变量的状态信息进行对比, 如果相同则代表未更新, 此时可以进行更新 操作; 如果不相同则代表已经有其他任务对该全局变量进行了更新, 此时不 可进行更新操作, 需要对执行后的任务进行作废处理, 重新进入等待队列, 等待重新执行。 保证了被更新的全局变量不会被其他同时并行执行的任务再 一次进行更新, 降低了全局变量并发读写时维护数据一致性的系统开销。
对于可以更新的全局变量, 调度器节点调度分布式共享内存管理节点更 新原始全局变量的页面信息, 并接收分布式共享内存管理节点更新后的全局 变量的页面信息。
具体操作过程为:
调度器节点向任务执行容器节点发送提交消息, 提交消息使得任务执行 容器节点将被修改全局变量快照在任务执行容器节点中进行保存, 并通知任 务执行容器节点上 被修改全局变量快照页面对应的页面信息。
调度器节点接收任务执行容器节点发送的被修改的全局变量快照的页面 信息, 将任务执行容器的标识写入页面信息中, 并将页面信息以及全局变量 快照发送至分布式共享内存管理节点。
分布式共享内存管理节点根据接收到的页面信息以及全局变量快照, 删 除建立全局变量快照。 分布式共享内存管理节点判断当前是否只有一个任务 执行容器节点对全局变量快照进行了修改。 若只有一个任务执行容器节点执 行的任务对所述任务对应的全局变量快照进行了修改, 则分布式共享内存管 理节点将被修改的全局变量快照所在页面信息替换原始全局变量的页面信 息, 并向调度器节点发送提交成功的消息, 提交成功的消息中携带被修改的 全局变量的页面信息。
若所述全局变量快照未被^ ί 改, 则删除所述全局变量快照。
具体操作过程为: 若所述任务对应的全局变量快照未被修改, 则所述调 度器节点调度所述分布式共享内存管理节点删除所述任务对应的全局变量快 照, 并调度执行任务等待队列中等待的任务。
当消息类型为创建子任务时:
当所述任务执行完毕且发送创建子任务的消息时, 判断所述子任务的同 步变量地址信息是否为空, 其中所述创建子任务的消息中至少包括所述子任 务的起始地址, 所述子任务的全局变量的地址信息; 当所述子任务需要和其 他任务进行同步时, 所述创建子任务的消息中还包括同步变量的地址信息。
当所述任务执行完毕, 所述调度器节点接收所述任务执行容器节点发送 的创建子任务的消息。
如果不为空, 则所述子任务的同步变量观察区中添加所述子任务的同步 变量的地址信息, 并将所述子任务放入全局同步任务等待队列, 等待其他任 务对所述子任务涉及的同步变量更新完毕后进入执行所述子任务的流程。
具体操作过程为: 调度器节点在同步变量观察区中添加所述子任务所涉 及到的全局变量的内存地址范围, 并将子任务放入全局同步任务等待队列, 等待其他子任务对全局变量更新完毕。
若同步变量观察区为空, 则代表其他子任务对全局变量更新完毕, 此时 调度器节点将子任务放入全局任务等待队列, 排队等待执行任务。 当轮到执 行该子任务时, 调度器节点为子任务分配任务执行容器节点, 以及创建快照 等步骤。
如果为空, 则为所述子任务选择一个空闲资源, 将所述子任务的全局变 量的地址信息中的全局变量的状态信息和全局变量的内存地址进行复制, 为 所述子任务创建全局变量快照, 并将所述子任务的全局变量快照与所述任务 的全局变量快照合并, 并在选取的所述空闲资源中执行所述子任务。
本步骤的具体操作过程如其父任务执行过程相同, 在此不再赘述。
当消息类型为作废退出时:
当所述任务执行完毕且发送作废退出的消息时, 删除所述全局变量快照。 具体操作过程为: 调度器节点调度分布式共享内存管理节点删除任务对 应的全局变量快照。
409: 判断同步任务等待队列中的待执行任务的同步变量是否包括了现在 已更新的全局变量, 如果有, 把这个任务放入执行任务等待队列。
其中所述同步任务等待队列中的任务是等待同步变量触发的任务所在的 队列, 当同步任务等待队列中的任务的同步变量触发后, 将任务放入所述执 行任务等待队列中排队等待调度; 所述执行任务等待队列中的任务是等待调 度执行的任务所在的队列。
当任务执行完毕, 此时无论该任务执行后是否为正常退出或者是作废退 出, 虚拟机系统在选取下一个执行的任务时, 需要考虑到当前正在执行的所 有任务以及执行完毕的任务涉及的全局变量的内存地址, 根据这两类任务涉 及的全局变量来确定调度哪一个在任务等待队列中等待的任务进入执行流 程。 执行本过程的为虚拟机系统中的调度器节点。
根据当前执行的所有任务所涉及的全局变量的内存地址, 执行完毕的任 务涉及的全局变量的内存地址, 存在两种调度机制。 因此步骤 409可以具体 为:
4091: 在执行任务等待队列中选取一个第一特定任务由第一空闲资源来 运行, 其中, 所述第一特定任务涉及的全局变量的地址信息与当前执行的所 有任务所涉及的全局变量的地址信息不冲突。
此种情况为优先选取当前正在执行任务所访问全局变量不冲突的任务执 行。
4092: 在执行任务等待队列中选取一个第二特定任务由第二空闲资源来 运行, 其中, 所述第二特定任务涉及的全局变量的地址信息与第二空闲资源 已执行完毕的任务所涉及的全局变量的地址信息尽可能多的相同或相近, 以 增加数据亲和性。
此种情况为釆取数据就近的原则, 其中地址信息的相近, 具体为全局变 量所在的内存地址相近, 例如某全局变量的内存地址为 0x0010 , 则可以认为 0x0011 , 0x0012 , 或者 OxOOOf等内存地址为 "相近的" 内存地址。 在任务等 待队列中选择的任务与之前结束的任务所涉及的全局变量的内存地址尽可能 的相同或相近, 其目的是为了增加数据亲和性, 一方面可以增加 Cache 的命 中率, 另一方面当选择的任务与之前结束的任务所涉及的全局变量相同, 那 么在执行任务时则可以根据全局变量快照直接从当前的任务执行容器节点中 获取该全局变量。
-调.—一 的感知, 以及在调度任务时对任务涉及的全局变量合理的分配内存, 尽可能 使得各任务之间涉及的全局变量的内存地址不冲突, 减少虚拟机系统为维护 内存一致性所产生的开销, 提高虚拟机系统的可扩展性。 实施例三
本发明实施例提供了一种任务处理的虚拟机,参见图 5 ,所述虚拟机包括: 调度器节点 501 , 分布式共享内存管理节点 502,任务执行容器节点 503; 所述调度器节点 501包括:
选取模块 5011 , 用于当接收到虚拟指令层下发的创建任务的指令时, 为 所述任务选取一个用于执行所述任务的空闲资源, 其中所述指令中至少包括 所述任务运行时的起始地址, 所述任务涉及的全局变量的地址信息和同步变 量的地址信息;
第一获取模块 5012, 用于当所述任务执行完毕后, 获取所述全局变量对 应的新的全局变量快照, 根据所述本地全局变量快照以及所述新的全局变量 快照获取已更新的全局变量;
判断模块 5013 , 用于判断同步任务等待队列中的待执行任务的同步变量 是否包括了现在已更新的全局变量, 如果有, 把这个任务放入执行任务等待 队列;
其中所述同步任务等待队列中的任务是等待同步变量触发的任务所在的 队列, 当同步任务等待队列中的任务的同步变量触发后, 将任务放入所述执 行任务等待队列中排队等待调度; 所述执行任务等待队列中的任务是等待调 度执行的任务所在的队列;
所述分布式共享内存管理节点 502包括:
第二获取模块 5021 , 用于根据所述全局变量的地址信息获取与所述全局 变量地址信息对应的全局变量状态信息;
创建模块 5022, 用于根据全局变量状态信息为全局变量创建本地全局变 量快照;
所述任务执行容器节点 503包括: 执行模块 5031 , 用于根据所述本地全局变量快照在选取的所述空闲资源 中预先分配的私有内存空间中执行所述任务。
其中在具体实施方式中, 所述判断模块 5013 , 包括:
第一处理单元 50131 ,用于在执行任务等待队列中选取一个第一特定任务 由第一空闲资源来运行, 其中, 所述第一特定任务涉及的全局变量与当前执 行的所有任务所涉及的全局变量不冲突;
第二处理单元 50132 ,用于在执行任务等待队列中选取一个第二特定任务 由第二空闲资源来运行, 其中, 所述第二特定任务涉及的全局变量与第二空 闲资源已执行完毕的任务所涉及的全局变量尽可能多的相同或相近, 以增加 数据亲和性。
其中, 所述全局变量状态信息包括所述全局变量的内存地址, 创建时间 以及版本标记,
所述创建模块 5022包括: 根据所述全局变量状态信息, 将所述全局变量 状态信息进行复制, 生成所述全局变量的全局变量快照;
相应的, 所述第一获取模块 5012具体用于:
判断所述本地全局变量快照中的版本标记与所述新的全局变量快照的版 本标记是否相同, 如果相同则表示所述全局变量未被其他任务更新; 如果不 相同则表示所述全局变量已被其他任务更新。
其中, 所述调度器节点 501还包括:
更新模块 5014, 用于当全局变量未被其他任务更新时, 在执行所述任务 的资源中的公用内存空间中保存所述本地全局变量快照, 并更新全局变量的 内存地址为执行所述任务的资源中的公用内存空间中保存所述全局变量快照 的内存地址, 将所述本地全局变量快照更新为所述本地全局变量快照。
其中, 所述任务执行容器节点 503还包括:
查询模块 5032, 用于执行所述任务发生缺页错误时, 则查询所述全局变 量快照的内存地址实际的状态;
拷贝模块 5033 , 用于当所述任务对应的全局变量快照的内存地址在其他 资源的公用内存空间中, 将所述全局变量快照的内存地址对应的实际内容拷 贝到本地;
第三获取模块 5034, 用于当所述任务对应的全局变量快照的内存地址在 本地的公用内存空间中, 则在本地的公用内存空间中进行获取。 的感知, 以及在调度任务时对任务涉及的全局变量合理的分配内存, 尽可能 使得各任务之间涉及的全局变量的内存地址不冲突, 减少虚拟机系统为维护 内存一致性所产生的开销, 提高虚拟机系统的可扩展性。 实施例四
参见图 6, 本实施例还提供了一种计算机设备 60, 包括处理器 61 , 存储 器 62, 存储器中存储有代码, 处理器用于读取代码, 并执行上述各实施例中 的方法; 其中, 本实施例中, 处理器执行方法时, 各个涉及的软件上的功能 单元(或者在代码层面, 可认为是几个不同功能的代码段)可以认为是实施 例三中的各个模块, 其具体执行的方法可参见上述各实施例, 这里不再赘述。
上述本发明实施例序号仅仅为了描述, 不代表实施例的优劣。
本领域普通技术人员可以理解实现上述实施例的全部或部分步骤可以通 过硬件来完成, 也可以通过程序来指令相关的硬件完成, 所述的程序可以存 储于一种计算机可读存储介质中, 上述提到的存储介质可以是只读存储器, 磁盘或光盘等。
以上所述仅为本发明的较佳实施例, 并不用以限制本发明, 凡在本发明 的精神和原则之内, 所作的任何修改、 等同替换、 改进等, 均应包含在本发 明的保护范围之内。

Claims

权 利 要求 书
1、 一种任务处理的方法, 其特征在于, 所述方法包括:
当接收到虚拟指令层下发的创建任务的指令时, 为所述任务选取一个用于 执行所述任务的空闲资源, 其中所述指令中至少包括所述任务运行时的起始地 址, 所述任务涉及的全局变量的地址信息和同步变量的地址信息;
根据所述全局变量的地址信息获取与所述全局变量地址信息对应的全局变 量状态信息;
才艮据全局变量状态信息为全局变量创建本地全局变量快照;
根据所述本地全局变量快照在选取的所述空闲资源中预先分配的私有内存 空间中执行所述任务;
当所述任务执行完毕后, 获取所述全局变量对应的新的全局变量快照, 根 据所述本地全局变量快照以及所述新的全局变量快照获取已更新的全局变量; 判断同步任务等待队列中的待执行任务的同步变量是否包括了现在已更新 的全局变量, 如果有, 把这个任务放入执行任务等待队列;
其中所述同步任务等待队列中的任务是等待同步变量触发的任务所在的队 列, 当同步任务等待队列中的任务的同步变量触发后, 将任务放入所述执行任 务等待队列中排队等待调度; 所述执行任务等待队列中的任务是等待调度执行 的任务所在的队列。
2、 根据权利要求 1所述的方法, 其特征在于, 所述判断同步任务等待队列 中的待执行任务的同步变量是否包括了现在已更新的全局变量, 如果有, 把这 个任务放入执行任务等待队列, 包括:
在执行任务等待队列中选取一个第一特定任务由第一空闲资源来运行, 其 中, 所述第一特定任务涉及的全局变量的地址信息与当前执行的所有任务所涉 及的全局变量的地址信息不冲突; 或,
在执行任务等待队列中选取一个第二特定任务由第二空闲资源来运行, 其 中, 所述第二特定任务涉及的全局变量的地址信息与第二空闲资源已执行完毕 的任务所涉及的全局变量的地址信息尽可能多的相同或相近, 以增加数据亲和 性。
3、 根据权利要求 1所述的方法, 其特征在于, 所述全局变量状态信息包括 所述全局变量的内存地址, 创建时间以及版本标记, 所述根据全局变量状态信 息为全局变量创建全局变量快照包括: 根据所述全局变量状态信息, 将所述全 局变量状态信息进行复制, 生成所述全局变量的全局变量快照;
相应的, 所述根据所述本地全局变量快照以及所述新的全局变量快照获取 已更新的全局变量包括:
判断所述本地全局变量快照中的版本标记与所述新的全局变量快照的版本 标记是否相同, 如果相同则表示所述全局变量未被其他任务更新; 如果不相同 则表示所述全局变量已被其他任务更新。
4、 根据权利要求 3所述的方法, 其特征在于, 所述根据所述本地全局变量 快照以及所述新的全局变量快照获取已更新的全局变量之后, 所述方法还包括: 当全局变量未被其他任务更新时, 在执行所述任务的资源中的公用内存空 间中保存所述本地全局变量快照, 并更新全局变量的内存地址为执行所述任务 的资源中的公用内存空间中保存所述全局变量快照的内存地址, 将所述本地全 局变量快照更新为所述本地全局变量快照。
5、 根据权利要求 1-3任一项所述的方法, 其特征在于, 所述根据所述全局 变量快照在选取的所述空闲资源中预先分配的私有内存空间中执行所述任务之 后, 所述方法还包括:
执行所述任务发生缺页错误时, 则查询所述全局变量快照的内存地址实际 的状态;
当所述任务对应的全局变量快照的内存地址在其他资源的公用内存空间 中, 将所述全局变量快照的内存地址对应的实际内容拷贝到本地;
当所述任务对应的全局变量快照的内存地址在本地的公用内存空间中, 则 在本地的公用内存空间中进行获取。
6、 一种任务处理的虚拟机, 其特征在于, 所述虚拟机包括:
调度器节点, 分布式共享内存管理节点, 任务执行容器节点;
所述调度器节点包括:
选取模块, 用于当接收到虚拟指令层下发的创建任务的指令时, 为所述任 务选取一个用于执行所述任务的空闲资源, 其中所述指令中至少包括所述任务 运行时的起始地址, 所述任务涉及的全局变量的地址信息和同步变量的地址信 息;
第一获取模块, 用于当所述任务执行完毕后, 获取所述全局变量对应的新 的全局变量快照, 根据所述本地全局变量快照以及所述新的全局变量快照获取 已更新的全局变量;
判断模块, 用于判断同步任务等待队列中的待执行任务的同步变量是否包 括了现在已更新的全局变量, 如果有, 把这个任务放入执行任务等待队列; 其中所述同步任务等待队列中的任务是等待同步变量触发的任务所在的队 列, 当同步任务等待队列中的任务的同步变量触发后, 将任务放入所述执行任 务等待队列中排队等待调度; 所述执行任务等待队列中的任务是等待调度执行 的任务所在的队列;
所述分布式共享内存管理节点包括:
第二获取模块, 用于根据所述全局变量的地址信息获取与所述全局变量地 址信息对应的全局变量状态信息;
创建模块, 用于 4艮据全局变量状态信息为全局变量创建本地全局变量快照; 所述任务执行容器节点包括:
执行模块, 用于根据所述本地全局变量快照在选取的所述空闲资源中预先 分配的私有内存空间中执行所述任务。
7、 根据权利要求 6所述的虚拟机, 其特征在于, 所述判断模块, 包括: 第一处理单元, 用于在执行任务等待队列中选取一个第一特定任务由第一 空闲资源来运行, 其中, 所述第一特定任务涉及的全局变量与当前执行的所有 任务所涉及的全局变量不冲突;
第二处理单元, 用于在执行任务等待队列中选取一个第二特定任务由第二 空闲资源来运行, 其中, 所述第二特定任务涉及的全局变量与第二空闲资源已 执行完毕的任务所涉及的全局变量尽可能多的相同或相近, 以增加数据亲和性。
8、 根据权利要求 6所述的虚拟机, 其特征在于, 所述全局变量状态信息包 括所述全局变量的内存地址, 创建时间以及版本标记,
所述创建模块包括: 根据所述全局变量状态信息, 将所述全局变量状态信 息进行复制, 生成所述全局变量的全局变量快照;
相应的, 所述第一获取模块具体用于:
判断所述本地全局变量快照中的版本标记与所述新的全局变量快照的版本 标记是否相同, 如果相同则表示所述全局变量未被其他任务更新; 如果不相同 则表示所述全局变量已被其他任务更新。
9、 根据权利要求 8所述的虚拟机, 其特征在于, 所述调度器节点还包括: 更新模块, 用于当全局变量未被其他任务更新时, 在执行所述任务的资源 中的公用内存空间中保存所述本地全局变量快照, 并更新全局变量的内存地址 为执行所述任务的资源中的公用内存空间中保存所述全局变量快照的内存地 址, 将所述本地全局变量快照更新为所述本地全局变量快照。
10、根据权利要求 6-8任一项所述的虚拟机, 其特征在于, 所述任务执行容 器节点还包括:
查询模块, 用于执行所述任务发生缺页错误时, 则查询所述全局变量快照 的内存地址实际的状态;
拷贝模块, 用于当所述任务对应的全局变量快照的内存地址在其他资源的 公用内存空间中, 将所述全局变量快照的内存地址对应的实际内容拷贝到本地; 第三获取模块, 用于当所述任务对应的全局变量快照的内存地址在本地的 公用内存空间中, 则在本地的公用内存空间中进行获取。
PCT/CN2013/084128 2012-12-14 2013-09-24 一种任务处理的方法和虚拟机 WO2014090008A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US14/738,436 US9996401B2 (en) 2012-12-14 2015-06-12 Task processing method and virtual machine

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201210543870.4A CN103049334B (zh) 2012-12-14 2012-12-14 一种任务处理的方法和虚拟机
CN201210543870.4 2012-12-14

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US14/738,436 Continuation US9996401B2 (en) 2012-12-14 2015-06-12 Task processing method and virtual machine

Publications (1)

Publication Number Publication Date
WO2014090008A1 true WO2014090008A1 (zh) 2014-06-19

Family

ID=48061984

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2013/084128 WO2014090008A1 (zh) 2012-12-14 2013-09-24 一种任务处理的方法和虚拟机

Country Status (3)

Country Link
US (1) US9996401B2 (zh)
CN (1) CN103049334B (zh)
WO (1) WO2014090008A1 (zh)

Families Citing this family (26)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103049334B (zh) 2012-12-14 2015-09-30 华为技术有限公司 一种任务处理的方法和虚拟机
CN103473272B (zh) * 2013-08-20 2017-06-16 小米科技有限责任公司 数据处理方法、装置及系统
JP6344675B2 (ja) * 2014-08-12 2018-06-20 華為技術有限公司Huawei Technologies Co.,Ltd. ファイル管理方法、分散記憶システムおよび管理ノード
CN104461706B (zh) * 2014-11-24 2019-03-26 上海华为技术有限公司 一种将共享全局变量共享的方法和多处理装置
CN106339254B (zh) * 2015-07-15 2020-06-12 中兴通讯股份有限公司 一种虚拟机快速启动方法、装置及管理节点
US9619366B1 (en) * 2015-11-12 2017-04-11 International Business Machines Corporation Object monitoring in code debugging
CN107391239B (zh) * 2016-03-11 2021-06-22 阿里巴巴集团控股有限公司 一种基于容器服务的调度方法和设备
CN105871603B (zh) * 2016-03-29 2019-01-18 中国科学院软件研究所 一种基于内存数据网格的实时流式数据处理失效恢复系统及方法
CN106066830B (zh) * 2016-05-31 2018-11-13 中国航空工业集团公司西安飞机设计研究所 一种内存管理方法
CN107544899B (zh) * 2016-06-24 2020-04-24 深圳市中兴微电子技术有限公司 一种执行测试用例的方法及装置
CN107871194B (zh) * 2016-09-28 2020-10-16 北京北方华创微电子装备有限公司 一种生产线设备的调度方法和装置
US10528479B2 (en) * 2017-06-02 2020-01-07 Huawei Technologies Co., Ltd. Global variable migration via virtual memory overlay technique for multi-version asynchronous dynamic software update
CN109981310B (zh) * 2017-12-27 2022-02-11 杭州海康威视数字技术股份有限公司 资源管理方法、装置及存储介质
US20190386928A1 (en) * 2018-06-19 2019-12-19 R-Stor Inc. System and method for utilizing idle network resources
CN109062658B (zh) * 2018-06-29 2021-06-04 优刻得科技股份有限公司 实现计算资源服务化的调度方法、装置、介质、设备及系统
CN110737503B (zh) * 2018-07-20 2021-09-14 华为技术有限公司 容器服务快照的管理方法和装置
US10725822B2 (en) * 2018-07-31 2020-07-28 Advanced Micro Devices, Inc. VMID as a GPU task container for virtualization
CN109885377B (zh) * 2018-11-23 2023-04-28 中国银联股份有限公司 统一资源调度协调器及其创建虚拟机和/或容器的方法、统一资源调度系统
US10409641B1 (en) * 2018-11-26 2019-09-10 Palantir Technologies Inc. Module assignment management
US11120007B2 (en) 2018-11-26 2021-09-14 Palantir Technologies Inc. Module expiration management
CN112465129B (zh) * 2019-09-09 2024-01-09 上海登临科技有限公司 片内异构人工智能处理器
CN111158860B (zh) * 2019-12-30 2024-02-23 咪咕文化科技有限公司 数据操作方法、电子设备及存储介质
CN112910973B (zh) * 2021-01-21 2022-11-25 云账户技术(天津)有限公司 一种应用程序页面选择方法及装置
CN114637576A (zh) * 2022-03-22 2022-06-17 支付宝(杭州)信息技术有限公司 用于生成容器分配方案的方法及装置
CN114510337B (zh) * 2022-04-15 2023-03-21 深圳美云集网络科技有限责任公司 任务执行方法、系统及计算机可读存储介质
CN114546629B (zh) * 2022-04-24 2023-01-24 深圳美云集网络科技有限责任公司 任务执行系统、方法、服务器及计算机可读存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE19728971A1 (de) * 1997-07-07 1999-01-14 Bosch Gmbh Robert Datenverarbeitungsvorrichtung und -verfahren
CN101807157A (zh) * 2010-03-30 2010-08-18 南京恩瑞特实业有限公司 基于函数访问全局变量的防御性编程方法
CN101908002A (zh) * 2010-08-17 2010-12-08 中兴通讯股份有限公司 一种任务路径切换方法及装置
CN102629221A (zh) * 2012-02-28 2012-08-08 华为技术有限公司 用于分布式共享存储的任务同步方法、装置及系统
CN103049334A (zh) * 2012-12-14 2013-04-17 华为技术有限公司 一种任务处理的方法和虚拟机

Family Cites Families (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6721775B1 (en) * 1999-08-12 2004-04-13 International Business Machines Corporation Resource contention analysis employing time-ordered entries in a blocking queue and waiting queue
US6839816B2 (en) * 2002-02-26 2005-01-04 International Business Machines Corporation Shared cache line update mechanism
US7237241B2 (en) * 2003-06-23 2007-06-26 Microsoft Corporation Methods and systems for managing access to shared resources using control flow
US9020801B2 (en) 2003-08-11 2015-04-28 Scalemp Inc. Cluster-based operating system-agnostic virtual computing system
US7669015B2 (en) * 2006-02-22 2010-02-23 Sun Microsystems Inc. Methods and apparatus to implement parallel transactions
JP4612710B2 (ja) * 2008-06-02 2011-01-12 株式会社日立製作所 トランザクション並行制御方法、データベース管理システム、およびプログラム
CN101339527B (zh) * 2008-07-28 2011-02-09 华中科技大学 影子内存的备份方法及装置
US7941616B2 (en) * 2008-10-21 2011-05-10 Microsoft Corporation System to reduce interference in concurrent programs
US8069446B2 (en) * 2009-04-03 2011-11-29 Microsoft Corporation Parallel programming and execution systems and techniques
CN101631328B (zh) * 2009-08-14 2011-11-16 北京星网锐捷网络技术有限公司 一种对共享资源互斥访问的同步方法、装置和网络设备
US8595191B2 (en) * 2009-12-31 2013-11-26 Commvault Systems, Inc. Systems and methods for performing data management operations using snapshots
US9009726B2 (en) * 2010-12-10 2015-04-14 Microsoft Technology Licensing, Llc Deterministic sharing of data among concurrent tasks using pre-defined deterministic conflict resolution policies
US8990536B2 (en) * 2011-06-01 2015-03-24 Schneider Electric It Corporation Systems and methods for journaling and executing device control instructions

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE19728971A1 (de) * 1997-07-07 1999-01-14 Bosch Gmbh Robert Datenverarbeitungsvorrichtung und -verfahren
CN101807157A (zh) * 2010-03-30 2010-08-18 南京恩瑞特实业有限公司 基于函数访问全局变量的防御性编程方法
CN101908002A (zh) * 2010-08-17 2010-12-08 中兴通讯股份有限公司 一种任务路径切换方法及装置
CN102629221A (zh) * 2012-02-28 2012-08-08 华为技术有限公司 用于分布式共享存储的任务同步方法、装置及系统
CN103049334A (zh) * 2012-12-14 2013-04-17 华为技术有限公司 一种任务处理的方法和虚拟机

Also Published As

Publication number Publication date
US9996401B2 (en) 2018-06-12
CN103049334B (zh) 2015-09-30
CN103049334A (zh) 2013-04-17
US20150277993A1 (en) 2015-10-01

Similar Documents

Publication Publication Date Title
US9996401B2 (en) Task processing method and virtual machine
Akkus et al. {SAND}: Towards {High-Performance} serverless computing
US20200081745A1 (en) System and method for reducing cold start latency of serverless functions
CN105579961B (zh) 数据处理系统及操作方法、用于数据处理系统的硬件单元
US9652247B2 (en) Capturing snapshots of offload applications on many-core coprocessors
JP4769484B2 (ja) 仮想計算機をマイグレーションするための方法およびシステム
US9497264B2 (en) Apparatus, method and system for aggregating computing resources
Lu et al. AzureBlast: a case study of developing science applications on the cloud
US9235435B2 (en) Direct memory access filter for virtualized operating systems
JP6089349B2 (ja) マルチコアアーキテクチャでのリソース分離を支援するための方法およびシステム
Nukada et al. NVCR: A transparent checkpoint-restart library for NVIDIA CUDA
US6393459B1 (en) Multicomputer with distributed directory and operating system
WO2015169145A1 (zh) 内存管理方法和设备
US9201691B2 (en) Method, apparatus and system for coordinating execution of tasks in a computing system having a distributed shared memory
JP2016508647A5 (zh)
Li et al. A new disk I/O model of virtualized cloud environment
WO2021022964A1 (zh) 一种基于多核系统的任务处理方法、装置及计算机可读存储介质
US20220229688A1 (en) Virtualized i/o
US10579419B2 (en) Data analysis in storage system
US20080134187A1 (en) Hardware scheduled smp architectures
Shi et al. DFlow: Efficient Dataflow-based Invocation Workflow Execution for Function-as-a-Service
Quesnel et al. Operating systems and virtualization frameworks: From local to distributed similarities
Russinovich Inside windows server 2008 kernel changes
Katz Popcorn Linux: Cross Kernel Process and Thread Migration in a Linux-Based Multikernel
JP6439887B1 (ja) 情報処理装置

Legal Events

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

Ref document number: 13862857

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 13862857

Country of ref document: EP

Kind code of ref document: A1