WO2015051488A1 - Memory sharing method, device and system in aggregation virtualization - Google Patents

Memory sharing method, device and system in aggregation virtualization Download PDF

Info

Publication number
WO2015051488A1
WO2015051488A1 PCT/CN2013/084821 CN2013084821W WO2015051488A1 WO 2015051488 A1 WO2015051488 A1 WO 2015051488A1 CN 2013084821 W CN2013084821 W CN 2013084821W WO 2015051488 A1 WO2015051488 A1 WO 2015051488A1
Authority
WO
WIPO (PCT)
Prior art keywords
memory
cache
host
processor
information
Prior art date
Application number
PCT/CN2013/084821
Other languages
French (fr)
Chinese (zh)
Inventor
陈立钢
郑伟
卢广
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to CN201380001624.9A priority Critical patent/CN103858111B/en
Priority to PCT/CN2013/084821 priority patent/WO2015051488A1/en
Publication of WO2015051488A1 publication Critical patent/WO2015051488A1/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/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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/0802Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
    • G06F12/0806Multiuser, multiprocessor or multiprocessing cache systems
    • G06F12/0815Cache consistency protocols

Definitions

  • Embodiments of the present invention relate to the field of computers, and in particular, to a method, device, and system for implementing memory sharing in aggregate virtualization.
  • aggregation virtualization technology is generally applied to applications of large servers. Multiple independent servers are interconnected through physical connections, and aggregated virtualization technology is used to make multiple servers appear as one server. After the aggregation virtualization technology is used, resources such as a central processing unit (CPU), a memory (Mem), and an output output (10) can be formed into a resource pool. External presentation, used for high performance computing and cloud computing infrastructure.
  • CPU central processing unit
  • Mem memory
  • output output 10
  • the hypervisor software runs on each server, and the hypervisor is the cornerstone of virtualization.
  • DomainO is a special virtual machine (Virtual Machine) on top of the Hypervisor. This virtual machine is used to complete the interaction of each virtual machine and some peripheral analog and peripheral access functions.
  • an Inf iniband (IB) card or an Ethernet card is installed on multiple servers, and these servers are interconnected through an Inf iniband switch or an Ethernet switch, and Hypervi sor runs on each server.
  • IB Inf iniband
  • Ethernet card an Ethernet card
  • the aggregation virtualization software implements the Cache Coherent (CC) processing through the software itself, and accesses the memory on other servers through the Inf iniband switch or the Ethernet switch after the CC processing is completed. In this way, the memory sharing of each server in the aggregation virtualization is realized, and the aggregation virtualization software realizes the memory aggregation of a server externally presented by one server.
  • CC Cache Coherent
  • the aggregation virtualization software is used for CC transaction processing to solve the cache consistency conflict caused by the memory sharing, and the CC transaction processing takes up more processor resources. If the system is large, CC transaction processing will become a system performance bottleneck. Aggregate virtualization single-time memory access operation delay is about 100 microseconds (us) level, and even at some time it is millisecond (ms) level, and Converged virtualization software for CC processing takes up most of the time. Therefore, the method of memory sharing in the existing aggregation virtualization scheme leads to system performance degradation.
  • embodiments of the present invention provide a method, a device, and a system for implementing memory sharing in an aggregated virtualization, which can improve system processing performance and thereby shorten memory access time.
  • an embodiment of the present invention provides a method for memory sharing in an aggregate virtualization, including:
  • the cache coherency processor receives the memory processing command sent by the virtual machine manager of the host; if the memory processing command is the cache status update information, the cache coherency processor updates the local cache coherency according to the cache status update information.
  • the directory is updated, and the cache status update information includes memory block address information and cache status information;
  • the memory processing command is a memory access request of the virtual machine on the host
  • the cache coherency processor performs cache coherency processing to access a memory corresponding to the memory address information in the memory access request.
  • the cache coherency processor updates the local cache coherency directory according to the cache status update information, specifically:
  • the cache coherency processor performs cache coherency processing, and accesses a memory address in the memory access request
  • the memory corresponding to the information is specifically:
  • the cache coherency processor performs cache coherency processing to access the memory of the host; Or the memory corresponding to the memory address information is a memory on a host other than the host, and the cache coherency processor performs cache coherency processing, and accesses the other host corresponding to the memory address information by using a switching network. Memory on.
  • the cache coherency processor accesses the memory on the other host corresponding to the memory address information by using a switching network, specifically For:
  • the cache coherency processor communicates with the cache coherency processor of the other host connection corresponding to the memory address information by the switching network, and accesses memory on the other host corresponding to the memory address information.
  • the method further includes:
  • the cache coherency processor sends the memory access result to the virtual machine manager of the host.
  • the cache coherency processor receives the memory sent by the virtual machine manager of the host Before processing the command, it also includes:
  • the virtual machine manager of the host obtains the memory access request of the virtual machine; the virtual machine manager of the host determines, according to the memory address information in the memory access request, whether the memory that the memory access request needs to access is Is the memory on the host, if it is the memory on the host, accessing the memory on the host according to the memory access request, and sending the cache status update information to the cache consistency processor; If not the memory on the host, the memory access request is sent to the cache coherency processor.
  • an embodiment of the present invention provides a method for memory sharing in an aggregate virtualization, including:
  • the virtual machine manager of the host obtains a memory access request of the virtual machine
  • the virtual machine manager of the host determines, according to the memory address information in the memory access request, whether the memory that the memory access request needs to access is the memory on the host, and if it is the memory on the host, The memory access request accesses the memory on the host, and sends the cache status update information to the cache coherency processor when the memory access request is a memory write instruction. So that the cache coherency processor updates the cache state information corresponding to the memory block in the cache coherency directory in the cache coherency directory; if the memory access request is a read command, And the memory access request is sent to the cache coherency processor, so that the cache coherency processor performs cache coherency processing and accesses memory corresponding to the memory address information in the memory access request;
  • the virtual machine manager of the host sends the memory access request to the cache coherency processor, so that the cache coherency processor performs cache coherency processing and accesses a memory address in the memory access request.
  • the memory corresponding to the information.
  • the memory access request is a read instruction
  • the virtual machine manager of the host sends the memory access request to the cache coherency processor, Also includes:
  • the virtual machine manager of the host receives the memory access result returned by the cache coherency processor.
  • an embodiment of the present invention provides a cache coherency processor, including: an input and output unit, configured to receive a memory processing command sent by a virtual machine manager of a host; a cache coherency processing unit, if the memory processing The command is a cache status update information, configured to send a cache consistent directory update command to the directory management unit according to the cache status update information, or the memory processing command is a memory access request of the virtual machine on the host, And performing cache coherency processing, accessing memory corresponding to the memory address information in the memory access request, where the cache state update information includes memory block address information and cache state information;
  • the directory management unit is configured to update a local cache coherency directory according to the cache coherency directory update instruction.
  • the directory management unit is configured to update a local cache consistency directory according to the cache consistency directory update instruction, specifically:
  • the directory management unit is configured to determine, according to the memory block address information, a record of a memory block corresponding to the memory block address information in the local cache coherency directory, and update a cache status according to the cache status update information.
  • the information is updated with the cache state information in the record of the memory block, and according to the current copy information in the record of the memory block, another host that saves the copy of the memory block is determined, and the cache corresponding to the other host is notified to be consistent.
  • Scaling processors update their local caches Consistent directory.
  • the cache coherency processing unit is configured to perform cache coherency processing, and access the memory access request.
  • the memory corresponding to the memory address information is specifically:
  • the cache coherency processing unit if the memory corresponding to the memory address information is a memory on the host, is used for performing cache coherency processing, and accessing the memory of the host, if the memory address information corresponds to The memory is the memory on the host other than the host, and the cache coherency processing unit is configured to perform cache coherency processing, and the network interface unit accesses the other host corresponding to the memory address information via the switching network.
  • the cache coherency processor further includes:
  • the network interface unit is configured to provide communication between the cache coherency processing unit and the other host, and send information of the cache coherency processing unit to the other host through the switching network, The information of the other host received by the switching network is passed to the cache coherency processing unit.
  • the cache coherency processing unit is configured to perform cache coherency processing, and access the memory address by using a network interface unit through a switching network.
  • the memory on the other host corresponding to the information is specifically:
  • the cache coherency processing unit is configured to perform cache coherency processing, and the network interface unit communicates with the cache coherency processor connected to the other host corresponding to the memory address information through the switching network.
  • the cache coherency processing unit is further configured to: if the memory access request is a read memory instruction, send a memory access result to the virtual machine manager of the host by using the input and output unit.
  • the cache coherency processing unit includes:
  • a pre-processing sub-module configured to be connected to the input and output unit, the local proxy sub-module, and the remote proxy sub-module, and configured to be responsible for the input and output unit and the local proxy sub-module, the remote end Message passing between proxy submodules;
  • the local proxy sub-module configured to process a memory access request to the host, perform cache coherency processing, and send the cache coherency directory update command to the directory management unit; For processing a memory access request to a host other than the host, performing cache coherency processing, and accessing, by the network interface unit, the memory of the other host via the switching network.
  • the embodiment of the present invention further provides a computer system, including: at least two hosts, at least two cache coherency processors, and a switching network, wherein each of the at least two hosts respectively Connected to one of the at least two cache coherency processors, the at least two cache coherency processors being connected by the switching network;
  • a first one of the at least two hosts configured to send a memory processing command to the first cache coherency processor of the at least two cache coherency processors connected;
  • the first cache coherency processor if the memory processing command is cache status update information, the first cache coherency processor is configured to update a local cache coherency directory according to the cache status update information, the cache The status update information includes the memory block address information and the cache status information, or the memory processing command is a memory access request of the virtual machine on the first host, configured to perform cache consistency processing, and access the memory access request.
  • the memory corresponding to the memory address information.
  • the first cache coherency processor is configured to update a local cache coherency directory according to the cache status update information, specifically:
  • the first cache coherency processor is configured to determine, according to the memory block address information, a record of a memory block corresponding to the memory block address information in the local cache coherency directory, and update information according to the cache status
  • the cache state information in the cache updates the cache state information in the record of the memory block, and determines, according to the current copy information in the record of the memory block, the at least two hosts in which the copy of the memory block is saved
  • the other hosts other than the first host notify the cache coherency processors corresponding to the other hosts to update their respective local cache coherency directories.
  • the first cache coherency processor is configured to perform cache coherency processing, and access the memory access
  • the memory corresponding to the memory address information in the request is specifically:
  • the first cache coherency processor if the memory corresponding to the memory address information is the first a memory on the host, configured to perform cache coherency processing, to access the memory of the first host, or the memory corresponding to the memory address information is other than the first host in the at least two hosts
  • the memory on the other host is used for cache coherency processing, and the memory on the other host corresponding to the memory address information is accessed through the switching network.
  • the first cache coherency processor is configured to perform cache coherency processing, and access the memory by using the switching network.
  • the memory on the other host corresponding to the address information is specifically:
  • the first cache coherency processor is configured to perform cache coherency processing, and communicate, by the switching network, with a cache coherency processor connected to the other host corresponding to the memory address information, and access the memory address.
  • the memory on the other host corresponding to the information is configured to perform cache coherency processing, and communicate, by the switching network, with a cache coherency processor connected to the other host corresponding to the memory address information, and access the memory address.
  • the first cache coherency processor if the memory access request is a read memory instruction, is further configured to send a memory access result to a virtual machine manager of the first host.
  • the virtual machine manager of the first host is further configured to obtain the memory access request of the virtual machine, and determine, according to the memory address information in the memory access request, whether the memory that the memory access request needs to access is The memory on the first host, if it is the memory on the first host, accessing the memory on the first host according to the memory access request, and sending the cache status update information to the first a cache coherency processor; if not the memory on the first host, transmitting the memory access request to the first cache coherency processor.
  • the memory processing command is sent to the cache coherency processor by the virtual machine manager of the host, and cached by the cache coherency processor.
  • Consistency processing avoids the problem of occupying more processor resources caused by CC processing on the host in the aggregation virtualization, resulting in system performance degradation, thereby improving system processing performance and shortening memory access time.
  • FIG. 1 is a system architecture diagram of an aggregated virtualization application according to an embodiment of the present invention.
  • FIG. 2 is a flowchart of a method for memory sharing in an aggregated virtualization according to Embodiment 1 of the present invention
  • FIG. 3 is a flowchart of a method for memory sharing in an aggregated virtualization according to Embodiment 2 of the present invention
  • FIG. 5 is a flowchart of a method for memory sharing in an aggregated virtualization according to Embodiment 4 of the present invention
  • FIG. 6 is a structural diagram of a cache coherency processor according to Embodiment 5 of the present invention.
  • FIG. 7 is a structural diagram of a cache coherency processor according to Embodiment 6 of the present invention.
  • FIG 8 is a system diagram of a computer of Embodiment 7 of the present invention.
  • the technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention. It is obvious that the described embodiments are a part of the embodiments of the present invention, but not all embodiments. . All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present invention without making creative labor are within the scope of the present invention.
  • FIG. 1 is a system architecture diagram of an aggregated virtualization application according to an embodiment of the present invention.
  • the system includes: multiple hosts, each processor on the host can support memory access sensitive instruction interception, and captures each host. All access to shared memory, and to ensure the correctness of the memory data.
  • Each host's processor is interconnected by a high-speed peripheral component (Peripheral Component)
  • PCIE Interconnect Express
  • QPI QuickPath Interconnect
  • HyperTransport
  • PCIE cache coherency processor
  • BIOS Basic Input Output System
  • the aggregation virtualization software running on the host implements aggregation virtualization, so that multiple hosts can externally present one host, thereby establishing and running a large number of virtual machines on the aggregated virtualized device resource pool.
  • the host in the system architecture applied in the embodiment of the present invention may be an ordinary computer or a mobile device.
  • the mobile terminal, the workstation or the server, the dedicated server, and the like, such as an X86 processor, are not specifically limited in the present invention.
  • the system also includes a plurality of CC processors, and the CC processor can perform CC processing.
  • One end of each CC processor is connected to a host processor, and can be connected through a PCIE interface, a QPI interface or an HT interface, and the other end is connected and exchanged.
  • the internet Preferably, the CC processor is a physical entity that is independent of the host.
  • the switching network interconnects multiple CC processors, so that each host can communicate through the CC processor.
  • the switching network can be a PCIE switch, an Infiniband switch, or an Ethernet switch, and is processed by the PCIE interface, the Infiniband interface, or the Ethernet interface. Connected.
  • FIG. 2 is a flowchart of a method for memory sharing in aggregate virtualization according to Embodiment 1 of the present invention. As shown in the figure, this method is:
  • Step 101 The cache coherency processor receives a memory processing command sent by the host's virtual machine manager.
  • Aggregate virtualization presents the virtual machine as a contiguous memory address on the independent memory of each host.
  • the virtual machine manager (Hyvistor) on the host intercepts the memory access of the virtual machine.
  • the event that is, the memory access request of the virtual machine is obtained, and the memory access request contains the memory address information to be accessed, and the memory read command or the memory write command.
  • the Distributed Shared Memory (DSM) interface in the virtual machine manager calls the PCIE to memory (PCIE to MEM) driver in the DomainO, and passes the PCIE port to the cache consistency according to the obtained memory access request.
  • the processor sends a memory processing command, and the cache coherency processor receives the memory processing command.
  • the PCIE port here refers to the port that communicates using the PCIE protocol.
  • the virtual machine manager may also send a memory processing command to the cache coherency processor using a communication protocol port other than the PCIE port.
  • the PCIE protocol is used as a general-purpose international standard.
  • the use of the PCIE port can avoid the incompatible upgrade risk and cost caused by the proprietary protocol.
  • the PCIE port is used for description in the embodiment of the present invention, and the present invention is not protected. The scope creates limits.
  • the virtual machine manager of the host obtains a memory access request of the virtual machine, and first determines, according to the memory address information in the memory access request, whether the memory that the memory access request needs to access is the memory on the host, and if so, according to Memory access requests access memory on this machine:
  • the virtual machine manager When writing instructions for memory, the virtual machine manager writes the contents to be written to the corresponding memory address, and sends the cache status update information to the cache coherency processor through the PC IE port, where the cache status is updated.
  • the information includes the memory block address information and the Cache status information.
  • the value of the Cache status information indicates what state the Cache is after the Cache writes the data, which may be: one of the Cache states such as exclusive, shared, invalid, etc.;
  • the virtual machine manager queries the cache coherency directory in the cache coherency processor, and reads the content to be accessed from the memory according to the Cache state information of the corresponding memory block in the CC directory. If the memory that needs to be accessed is not the memory on the host, the virtual machine's memory access request is sent to the cache coherency processor.
  • the virtual machine manager of the host obtains the memory access request of the virtual machine, and does not judge, and directly sends the virtual machine memory access request to the cache coherency processor through the PC IE port. It can be seen that the memory processing command sent by the virtual machine manager on the host received by the cache coherency processor may be a memory access request of the virtual machine, or may be a Cache status update sent by the host virtual machine manager after performing a memory access. information.
  • Step 1 02 The cache consistency processor performs cache consistency processing according to the received memory processing command, specifically:
  • the cache coherency processor updates the local cache coherency directory according to the Cache status update information.
  • the Cache Consistency Directory records the Cache status of the shared memory in the entire system, and records the Cache status information and current copy information of the memory block.
  • the Cache status information indicates the status of the local Cache, such as exclusive, shared, invalid, etc. status.
  • the current copy information indicates which hosts have a copy of the memory block, and the cache coherency processor corresponding to the host has the information of the memory block in the local cache coherency directory.
  • Each cache coherency processor maintains its own local cache coherency directory.
  • the cache coherency processor needs to update the Cache state information of the memory block of the memory in the local cache coherency directory, and notifies the memory block in which the memory is saved according to the current copy information of the memory block in the cache coherency directory.
  • the corresponding CC processor of the other hosts of the copy also refreshes their respective cache coherency directories.
  • the cache coherency processor updates the local cache coherency directory according to the received Cache status update information, which may be based on the cache shape.
  • the memory block address information carried in the state update information (ie, the address information of the memory block in which the write operation is performed) and the Cache state information update the Cache state information of the memory block in which the write operation is performed in the cache coherency directory.
  • the cache coherency processor determines the record of the memory block corresponding to the memory block address information in the local cache coherency directory according to the memory block address information in the cache status update information, and then updates the cache status information in the information according to the cache status.
  • the cache coherency processor performs cache coherency processing, and accesses the memory corresponding to the memory address information in the memory access request.
  • the memory corresponding to the memory address information herein refers to the memory on the host where the memory resource corresponding to the memory address information in the memory processing request is located.
  • the cache consistency processor performs cache coherency processing, and accesses the memory of the host: if the memory access request is a write memory instruction, the cache is consistent The processor writes the content to the memory of the host, and the cache coherency processor notifies the Hyperv i sor to write the content into the local memory, or the cache coherency processor directly writes the content into the local memory, and Further, the cache coherency processor refreshes the Cache state information of the memory block corresponding to the write operation in the local CC directory; if the memory access request is a read memory instruction, the cache coherency processor according to the corresponding memory in the cache coherency directory The Cache Status information of the memory block notifies the host's virtual machine manager to perform a memory read, and the host's virtual machine manager sends the read information to the virtual machine that issued the memory access request.
  • the cache coherency processor accesses the memory on the host where the memory corresponding to the memory address information of the memory processing request is accessed through the exchange network.
  • a remote host a host that issues a memory access request
  • the switching network here may be a PCI E switch, an Inf iniband switch or an Ethernet switch, and the cache coherency processor corresponding to the local host communicates with the cache coherency processor corresponding to the remote host through the switching network, thereby realizing the remote end Access to memory on the host.
  • the cache coherency processor needs to refresh the Cache status information of the memory block corresponding to the memory in the local CC directory, and notify the remote host of the corresponding CC processor, and Need to write The content is written to the memory of the remote host; if the memory access request is a read memory instruction, the CC processor that issues the memory access request notifies the remote host of the corresponding CC processor to perform memory access, and the cache consistency processing corresponding to the remote host Receives the memory access result and sends it to the virtual machine manager of the local host that issued the memory access request, and the virtual machine manager sends the read information to the virtual machine that issues the memory access request, where the memory access result is the remote end.
  • the corresponding cache coherency processor connected to the host reads from memory based on the memory access request and its local CC directory. Further technical details of the CC processing performed by the CC processor follow the general CC processing protocol of the industry, and will not be described herein.
  • the method for sharing memory in the aggregation virtualization receives the memory processing command sent by the Hyperv i sor of the host by the cache consistency processor, and the cache consistency processing is performed by the cache consistency processor according to the memory processing command, thereby avoiding The problem of occupying more processor resources caused by CC processing in the aggregation virtualization by the software on the host, causing system performance degradation, thereby improving system processing performance and shortening memory access time.
  • FIG. 3 is a flowchart of a method for memory sharing in aggregate virtualization according to Embodiment 2 of the present invention. As shown in the figure, this method is:
  • Step 201 The virtual machine manager of the host obtains a memory access request of the virtual machine.
  • the Hyperv i sor on the host intercepts the memory access event of the virtual machine, that is, obtains the memory access request of the virtual machine.
  • Step 202 The virtual machine manager of the host sends a memory processing command to the cache coherency processor, so that the cache coherency processor performs cache coherency processing according to the received memory processing command.
  • the virtual machine manager of the host obtains the memory access request of the virtual machine, and may first determine, according to the memory address information in the memory access request, whether the memory that the memory access request needs to access is the local memory on the host: If yes, Accessing the local memory on the local device according to the memory access request, when writing the instruction for the memory, writing the content to be written to the corresponding memory address, and sending the cache status update information to the cache coherency processor, so as to The cache coherency processor updates the local cache coherency directory according to the received cache state update information, where the cache state update information includes the memory block address information and the Cache state information; when the memory read command, the virtual machine management Query the cache coherency directory in the cache coherency processor, and read the content to be accessed from the cache according to the Cache state information of the corresponding memory block in the CC directory.
  • the consistency processor in order to cache the consistency processor for cache coherency processing and access the memory corresponding to the memory address information in the memory access request.
  • the virtual machine manager of the host obtains the memory access request of the virtual machine, does not perform the judgment of the memory address information, and directly sends the memory access request of the virtual machine to the cache consistency processor, so that the cache consistency processor performs the same.
  • the cache coherency processor performs the cache coherency processing and accesses the memory corresponding to the memory address information in the memory access request and the embodiment 1 Similar in the matter, we will not repeat them here.
  • the memory processing command sent by the host's virtual machine manager to the cache coherency processor may be a virtual machine's memory access request, or may be a cache state information after the host's virtual machine manager performs a memory access.
  • the DSM interface in the host's virtual machine manager invokes the PCI E to MEM driver in the Doma inO, and sends a memory processing command to the cache coherency processor through the PCI E port according to the obtained memory access request.
  • the host's virtual machine manager communicates with the cache coherency processor through the PCI E port.
  • the PC IE port can avoid the risk and cost of incompatible upgrades caused by the proprietary protocol. Of course, other communication protocol ports can also be used.
  • the host virtual machine manager receives the memory access result returned by the cache coherency processor and sends the result to the virtual machine that issues the memory access request.
  • the method for sharing memory in the aggregation virtualization sends a memory processing command to the cache coherency processor through the Hyperv i sor of the host, so that the CPU is processed by the cache coherency processor, thereby avoiding aggregation virtualization.
  • the CPU processing on the host implements CPU processing, which causes more processor resources and causes system performance degradation. This improves system processing performance and shortens memory access time.
  • FIG. 4 is a flowchart of a method for memory sharing in an aggregated virtualization according to Embodiment 3 of the present invention. As shown in the figure, the method is specifically as follows:
  • Step 301 A virtual machine on the host initiates a memory access event. Aggregation virtualization presents the virtual machine as a contiguous memory address for the independent memory on each host. When the virtual machine on the host needs to access the memory, it initiates a memory access event.
  • Step 302 The virtual machine manager on the host intercepts the memory access event.
  • memory access sensitive instructions In aggregate virtualization, in order to ensure the correctness of memory data, memory access sensitive instructions must be captured. Hyperv i sor Intercept the memory access event of the virtual machine, that is, obtain the memory access request of the virtual machine.
  • Step 303 Hyper V i s or determine whether the memory access request is accessing the memory on the host.
  • the Hyperv i sor determines whether the memory that the memory access request needs to access is the memory on the host according to the memory address information in the memory access request.
  • the DSM interface in the Hyperv i sor processes the obtained memory access request, and determines whether to access the memory on the host according to the memory address information in the memory access request.
  • Step 304 If the memory on the host is accessed, the Hyperv i sor of the host accesses the memory on the host according to the memory address information in the memory access request.
  • Step 305 When writing an instruction for the memory, the host's Hyperv i sor sends the cache status update information to the local cache coherency processor, where the cache status update information includes the memory block address information and the Cache status information, and the value of the Cache status information. Indicates the state of the Cache after the data is written. It can be: one of the Cache states such as exclusive, shared, and invalid.
  • This step is specifically: when the memory is written, the host virtual machine manager writes the memory, and the DSM interface in the virtual machine manager calls the PC IE to MEM driver in the Doma inO, through the PC IE port.
  • the local cache coherency processor sends the cache status update information, and the input and output (Input Out put, 10 for short) interface unit in the local cache coherency processor receives the cache status update information.
  • the cache coherency processor corresponding to the host that issues the memory request command is referred to as a local cache coherency processor, and the cache coherency processor corresponding to the remote host where the memory to be accessed is located.
  • Step 306 The local cache coherency processor updates its own cache coherency directory according to the received Cache status update information.
  • the local proxy (Loca Proxy, LP) sub-module in the local cache coherency processor is responsible for updating the local CC directory according to the memory block address information and the Cache state information carried in the Cache status update information of the received host. , that is, updating the Cache state information of the memory block of the memory that is written in the local cache coherency directory, and further notifying the cached memory according to the current copy information of the memory block of the memory in the cache coherency directory
  • the CC processor corresponding to the other host of the copy of the memory block also refreshes the respective local cache coherency directory.
  • the cache coherency processor determines, according to the memory block address information in the cache status update information, a record of the memory block corresponding to the memory block address information in the local cache coherency directory, and then updates the information according to the cache status.
  • Cache status information is more The cache state information in the record of the memory block is newly added, and further, according to the current copy information in the record of the block, another host that saves the copy of the memory block is determined, and the cache consistency processing corresponding to the other host is notified. Updates their respective local cache coherency directories. Go to step 315.
  • Step 307 If the memory on the host is not accessed, the DSM interface in the host virtual machine manager calls the PC IE to MEM driver in the Doma inO, and sends a memory access request to the local cache coherency processor through the PC IE port. .
  • the 10 interface unit responsible for the interface with the host side in the cache coherency processor receives the memory access request.
  • Step 308 The local cache coherency processor accesses the remote cache coherency processor through the switched network. After receiving the memory access request, the local cache coherency processor hands over the memory access request that needs to access the memory on the other host to the remote proxy (Remo te Proxy, RP for short) sub-module in the cache coherency processor. The submodule accesses the remote cache coherency processor through the switching network through the network interface unit.
  • the remote cache coherency processor here refers to the CC processor responsible for managing the remote host, which is the host where the memory to be accessed is located.
  • Step 309 After receiving the memory access request, the remote cache coherency processor hands the memory access request to the local proxy sub-module for processing.
  • Step 31 0 The local proxy submodule of the remote cache coherency processor determines whether its local CC directory hits.
  • the local proxy submodule of the remote cache coherency processor queries its local CC directory according to the memory address of the memory access request, and determines whether the Cache state of the memory block of the memory to be accessed is readable, and if it is in a readable state, That is, the local Cache directory hits, the Cache is available, otherwise it is a miss, and the Cache is unavailable.
  • Step 31 If the CC directory does not hit, the local proxy submodule in the remote cache coherency processor requests the remote host to perform memory access through the 10 interface module that interfaces with the host.
  • the remote cache coherency processor sends a request to the remote host to access the memory of the memory address in the memory access request: for the read instruction, obtain the content of the memory address in the memory access request, and write the content to be written for the write instruction Host memory address.
  • Step 312 The remote cache coherency processor updates its local CC directory.
  • the remote cache coherency processor updates the Cache status information of the memory block corresponding to the memory in the local CC directory corresponding to the memory read operation or the write operation, and writes the content of the current memory read and write to the cache, and updates CC directory for subsequent memory access.
  • Step 313 If the CC directory hits, for the read command, the remote cache coherency processor directly reads the corresponding memory value from the Cache to obtain a memory access result. If it is a write instruction, the remote cache coherency processor writes the value to be written to the memory of the remote host, updating the local cache.
  • Step 314 For the read instruction, the remote cache coherency processor returns the obtained memory access result to the local cache coherency processor.
  • the remote cache coherency processor returns the content of the read memory to the local cache coherency processor through the network interface unit through the switching network, and the local cache coherency processor updates the Cache state in the CC directory.
  • Step 315 For the read instruction, the local cache coherency processor returns the memory access result to the virtual machine that initiated the memory access event.
  • the local cache coherency processor receives the memory access result returned by the remote cache coherency processor, and feeds the memory access result to the host's Doma in 0 through the 10-interface unit responsible for the interface with the host, and the feedback is processed by Doma in 0.
  • Doma the host's Doma in 0
  • the 10-interface unit responsible for the interface with the host and the feedback is processed by Doma in 0.
  • Hyperv i sor Hyperv i sor , and ultimately returned to the VM that initiated the memory access event.
  • the method for sharing memory in the aggregation virtualization sends the memory processing command to the cache coherency processor through the Hyperv i sor of the host, and performs CC processing by the cache coherency processor, thereby avoiding aggregation virtualization.
  • the CPU processing on the host implements CPU processing, which causes more processor resources and causes system performance degradation. This improves system processing performance and shortens memory access time.
  • FIG. 5 is a flowchart of a method for memory sharing in an aggregated virtualization according to Embodiment 4 of the present invention. As shown in the figure, the method is specifically as follows:
  • the steps 401-402 are the same as the steps 301-302 of the embodiment 3 of the present invention, and are not described here.
  • Step 403 The DSM interface in the host virtual machine manager invokes the PC IE to MEM driver in the Doma inO, and sends a memory access request to the local cache coherency processor through the PCI E port.
  • the 10 interface unit responsible for interfacing with the host in the cache coherency processor receives the memory access request.
  • Step 404 The local cache coherency processor determines whether the memory access request is accessing the memory on the host.
  • the local cache coherency processor receives the memory access request and determines whether to access the memory on the host according to the memory address information in the memory access request.
  • Step 405 if the memory on the host is accessed, the local cache coherency processor will store the memory.
  • the local proxy submodule to which the access request is handed over is processed.
  • Step 406 The local proxy sub-module of the local cache coherency processor determines whether the local CC directory is hit.
  • the local proxy sub-module queries its local CC directory, queries the local CC directory according to the memory address of the memory access request, and determines whether the Cache state of the memory block of the memory to be accessed is readable. If it is in a readable state, it indicates local.
  • the Cache directory hits, the Cache is available, otherwise it is a miss.
  • Step 407 If the CC directory does not hit, the local cache coherency processor requests the host to perform memory access.
  • the cache coherency processor sends a request to the host to access the memory of the memory address in the memory access request to obtain the memory access result.
  • Step 408 The local cache coherency processor updates its local CC directory according to the memory access result.
  • the local cache coherency processor writes the content to the host's memory and flushes the Cache status information of the corresponding memory block in the local CC directory.
  • Step 409 If the CC directory hits, the local cache coherency processor directly performs cache access, obtains a memory access result for the read command, writes the content to the host memory for the write command, and updates the content in the original cache. .
  • Step 410 If the memory on the host is not accessed, the local cache coherency processor accesses the remote cache coherency processor through the switched network.
  • the local cache coherency processor handles the remote proxy sub-module to which the memory access request for accessing the memory on other hosts is handled.
  • the RP sub-module accesses the remote cache coherency processor through the switching network through the network interface unit.
  • the remote cache coherency processor here refers to the CC processor responsible for managing the remote host, which is the host where the memory access request is to be accessed.
  • the cache coherency processor corresponding to the host that issues the memory request command is referred to as a local cache coherency processor, and the cache coherency corresponding to the remote host where the memory to be accessed is located is processed. This is called the remote cache coherency processor.
  • the method for sharing memory in the aggregation virtualization provided by the embodiment of the present invention sends a memory processing command to the cache coherency processor through the host hypervisor, and performs CC processing by the cache coherency processor, thereby avoiding the host in the aggregation virtualization process.
  • CC processing Through software It takes up more processor resources and causes system performance degradation, which can improve system processing performance and shorten memory access time.
  • FIG. 6 is a structural diagram of a cache coherency processor according to Embodiment 5 of the present invention, as shown in FIG. 6.
  • the cache coherency processor 50 includes an input/output unit (referred to as 10 units) 51 and a directory management unit 52, and the cache is consistent. Sex processing unit 53. among them,
  • the 10 unit 51 used to receive the memory processing command sent by the host's virtual machine manager.
  • the 10 unit provides an interface for the cache coherency processing unit to interact with the host. Its main function is to complete communication between the cache coherency processing unit and the host (specifically, the central processor in the host).
  • the Hyperv i sor on the host intercepts the memory access event of the virtual machine, that is, obtains the memory access request of the virtual machine, and the memory access request includes the memory address information to be accessed, which may be Memory read instruction or memory write instruction.
  • the virtual machine manager sends a memory processing command to the 10 units in the cache coherency processor through the PCI E port according to the obtained memory access request, and the 10 unit receives the memory processing command.
  • the PC IE port here refers to the port that uses the PCIE protocol for communication.
  • the virtual machine manager may also send memory processing commands to 10 units using other communication protocol ports other than the PC IE port.
  • the PCI E protocol is a more general international. In the standard, the use of the PC IE port in the 10th unit can avoid the risk of the incompatible upgrade caused by the proprietary protocol. For the convenience of description, the description is made by using the PC IE port in the embodiment of the present invention, which does not limit the protection scope of the present invention.
  • the cache consistency processing unit 53 is configured to perform cache consistency processing according to the memory processing command received by the 10 unit 51, and if the received memory processing command is the Cache status update information sent by the host virtual machine manager, the cache consistency is performed.
  • the processing unit is configured to send a cache consistent directory update command to the directory management unit 52 to update the local cache consistent directory according to the Cache status update information; if the received memory processing command is a memory access request of the virtual machine on the host
  • the cache coherency processing unit 53 is configured to perform cache coherency processing, and access the memory corresponding to the memory address information in the memory access request, where the memory corresponding to the memory address information refers to the memory corresponding to the memory address information in the memory processing request. The memory on the host where the resource is located.
  • the directory management unit 52 is configured to update the local cache coherency directory according to the cache coherency directory update instruction of the cache coherency processing unit 53.
  • the cache consistency directory records the Cache status of the shared memory in the entire system, and records the Cache status information of the memory block of the memory and when Pre-copy information, where the Cache status information indicates the status of the local Cache, such as exclusive, shared, invalid, and so on.
  • the current copy information indicates which hosts have a copy of the memory block, and the cache coherency processor corresponding to the host has the information of the memory block in the local cache coherency directory.
  • the directory management unit of each cache coherency processor is used to maintain its own local cache coherency directory.
  • the directory management unit is used to update the Cache status information of the memory block of the memory in the local cache coherency directory that has been written.
  • the directory management unit is configured to update the cache state information of the memory block in the cache consistency directory according to the memory block address information and the Cache state information in the cache consistency directory update instruction.
  • the directory management unit is configured to determine, according to the memory block address information, a record of the memory block corresponding to the memory block address information in the local cache coherency directory, and update the record of the memory block according to the cache status information in the cache status update information.
  • the cache state information in the cache and according to the current copy information in the record of the memory block, determine other hosts that hold the copy of the memory block, and notify the cache coherency processors corresponding to other hosts to update their respective local cache coherency directories.
  • the cache coherency processing unit 53 is configured to perform cache coherency processing, and access the memory corresponding to the memory address information in the memory access request, specifically: if access is required
  • the memory corresponding to the memory address information is the memory on the host, used for cache coherency processing, and accesses the memory of the host: If the memory access request is a write memory instruction, the cache coherency processing unit is used to write the content into the host.
  • the corresponding memory on the host can be notified by the cache coherency processing unit through 10 units to capture the memory of the local writer, or the cache coherency processing unit directly writes the content into the memory of the host through 10 units.
  • the cache consistency processing unit is further configured to send a cache consistency directory update instruction to notify the directory management unit to refresh the Cache state information of the memory block corresponding to the memory in the local CC directory corresponding to the write operation.
  • a directory management unit configured to notify, according to the received cache consistency directory update instruction, the Cache status information of the memory block corresponding to the memory in the local CC directory corresponding to the write operation; if the memory access request is a read memory instruction, the cache consistency processing The unit is configured to notify the host's virtual machine manager of the memory reading according to the Cache status information of the corresponding memory block in the cache coherency directory, and the host virtual machine manager sends the read information to the issuing memory. Access the requested virtual machine.
  • the cache coherency processing unit is configured to perform cache coherency processing, and access the memory on the host where the memory corresponding to the memory address information of the memory processing request is accessed by the network interface unit 54 via the switching network.
  • the cache coherency processor 50 further includes a network interface unit 54 for providing communication between the cache coherency processing unit and other cache coherency processors, and transmitting the information of the cache coherency processing unit to the exchange network.
  • Other cache coherency processors pass information from other cache coherency processors received from the switched network to the cache coherency processing unit.
  • the switching network here may be a PCI E switch, an Inf iniband switch, or an Ethernet switch.
  • the cache coherency processor 50 communicates by using a cache coherency processor connected to the host where the memory corresponding to the memory address information is exchanged.
  • the access of the memory on the host where the memory corresponding to the memory address information is located specifically, the cache consistency processing unit is configured to perform cache consistency processing, and the network interface unit corresponds to the memory address information through the switching network.
  • the cache coherency processor connected to the other host communicates to access the memory on the other host corresponding to the memory address information.
  • other hosts in which the memory corresponding to the memory address information is located may be referred to as a remote host, and a host that issues a memory access request is referred to as a local host.
  • the cache coherency processing unit needs to notify the directory management unit to refresh the Cache state information of the memory block corresponding to the memory in the local CC directory corresponding to the write operation, and notify the remote host correspondingly through the 10 unit.
  • the CC processor writes the content to be written to the memory of the remote host. If the memory access request is a read memory instruction, the cache coherency processing unit that issues the memory access request is further used to notify the remote host of the corresponding CC processor to perform memory.
  • CC processing Accessing, and receiving a memory access result from a cache coherency processor connected to the remote host, and sending the result to the virtual machine manager of the host that issued the memory access request, and the virtual machine manager sends the read information to the memory access The requested virtual machine, wherein the memory access result is that the cache coherency processing of the remote host is read from the memory according to the memory access request and its local CC directory. Further technical details of CC processing follow the industry-wide CC processing protocol, and will not be repeated here.
  • the directory management unit is configured to update the Cache state information of the memory block of the memory in the local cache coherency directory according to the received cache coherency directory update instruction, and according to the cache coherency directory
  • the current copy information of the memory block of the memory notifies that the CC processor corresponding to the other host that caches the copy of the memory block of the memory also refreshes the local cache coherency directory, and may send a message to the cache coherency processing unit.
  • the port unit sends relevant messages to other CC processors.
  • the virtual machine manager of the host obtains a memory access request of the virtual machine, and first determines, according to the memory address information in the memory access request, whether the memory that the memory access request needs to access is the memory on the host, and if so, according to The memory access request accesses the memory on the local device:
  • the virtual machine manager When writing the instruction for the memory, the virtual machine manager writes the content to be written to the corresponding memory address, and sends the cache status update information to the cache consistency processing through the PC IE port. 10 units in the device, wherein the cache status update information includes memory block address information and Cache status information, and the value of the Cache status information indicates what state the Cache is after writing the data, which may be: exclusive, shared, invalid, etc.
  • the virtual machine manager when reading instructions for memory, queries the cache coherency directory in the directory management unit in the cache coherency processor through the 10-unit, cache coherency processing unit, according to the corresponding memory in the CC directory. Cache status information of the memory block is read from the memory to be accessed. Content. If the memory to be accessed is not the memory on the host, the virtual machine's memory access request is sent to the cache coherency processing unit through 10 units. It can also be processed as follows. After the virtual machine manager of the host obtains the memory access request of the virtual machine, the memory access request of the virtual machine is directly sent to the cache coherency processor through the PC I E port through the PC I E port. It can be seen that the memory processing command sent by the virtual machine manager on the host received by the cache unit of the cache coherency processor may be a memory access request of the virtual machine, or may be a cache after the memory access of the host virtual machine manager. Status update information.
  • the cache coherency processor provided by the embodiment of the present invention receives the memory processing command sent by the host's Hyperv i sor, performs cache coherency processing according to the memory processing command, and avoids implementing CC processing in the aggregate virtualization by software on the host. As a result, it takes up more processor resources and causes system performance degradation, which can improve system processing performance and shorten memory access time.
  • FIG. 7 is a structural diagram of a cache coherency processor according to Embodiment 6 of the present invention.
  • the cache coherency processing unit 53 of the embodiment of the present invention includes:
  • the pre-processing sub-module 530 is configured to be connected to the 10-unit, the local proxy sub-module 531, and the remote proxy sub-module 532, and is responsible for packet transmission between the 10-unit and the local proxy sub-module and the remote proxy sub-module, and receives 10 units.
  • the sent information is forwarded to the local proxy submodule or the remote proxy submodule, and the information sent by the local proxy submodule or the remote proxy submodule is received and forwarded to the 10 unit.
  • the local proxy submodule 5 31 is configured to process a memory access request to the host.
  • the method is configured to perform cache consistency processing according to the memory processing command sent by the 10 units received by the preprocessing submodule, and if the received memory processing command is the Cache status update information sent by the virtual machine manager of the host, according to the Cache Status update information, the send cache coherency directory update command to the directory management unit 52 to update the local cache coherency directory; if the received memory processing command is a memory access request of the virtual machine on the host, and the memory access request here
  • the memory corresponding to the memory address information is the memory on the host, and the local proxy sub-module is used for cache coherency processing to access the memory of the host: If the memory access request is a write memory instruction, the local proxy sub-module is used The content is written into the corresponding memory on the host, and the content of the Hyperv i sor can be written to the local memory through the pre-processing sub-module via the 10-unit unit, or the content can be directly directly processed by the local proxy sub-module through the pre-processing sub-module through 10
  • cache coherency directory managing unit For transmitting a directory update instruction cache coherency directory managing unit notifies the refresh local directory corresponding CC were Cache memory state information of memory block write operation. If the memory access request is a read memory instruction, the local proxy sub-module is configured to notify the host's virtual machine manager of the memory read by the pre-processing sub-module according to the Cache state information of the corresponding memory block in the cache coherency directory. The read information is sent by the host's virtual machine manager to the virtual machine that issued the memory access request.
  • the local proxy sub-module can also receive the memory access request of other hosts transmitted by the network interface unit 54, and the memory corresponding to the memory address information in the memory access request is the memory on the host, and the local proxy sub-module is used according to other The host's memory access request is cache-consistent and accesses the host's memory.
  • the remote proxy submodule 5 32 is configured to process a memory access request to other hosts. If the received memory processing command sent by the 10 units sent by the preprocessing module is a memory access request of the virtual machine on the host, and the memory corresponding to the memory address information in the memory access request is the memory on the other host, then the far The end proxy sub-module performs cache coherency processing, accesses the memory on the host where the memory corresponding to the memory address information of the memory processing request is accessed through the network interface unit 54, and transfers the information of other hosts received from the switching network to the pre-processing Submodule. Further technical details of CC processing follow the industry-wide CC processing protocol, and will not be repeated here.
  • the cache coherency processor receives the memory processing command sent by the Hypervi sor of the host, and performs cache coherency processing according to the memory processing command, thereby avoiding the CC processing in the aggregate virtualization by the software on the host. Occupy more processor resources, causing system performance degradation, which can improve system processing performance, shorten memory access time, and handle local memory access and remote memory access through local proxy sub-modules and remote proxy sub-modules, respectively. Further improve the processing performance of the processor.
  • the computer system includes: at least two hosts, at least two cache coherency processors, and a switching network, wherein the at least two hosts are Each host is connected to a cache coherency processor of the at least two cache coherency processors, respectively, and the at least two cache coherency processors are connected by a switched network communication.
  • the first host of the at least two hosts is configured to send a memory processing command to the first one of the at least two CC processors that are connected.
  • the Hyperv i sor on the first host intercepts a memory access event of the virtual machine, that is, obtains a memory access request of the virtual machine, and the memory access request includes accessing
  • the memory address information may be a memory read command or a memory write command, and the first host sends a memory processing command to the first cache coherency processor connected thereto through the PCI E port.
  • the first host may also send a memory processing command to the first cache coherency processor by using a communication protocol port other than the PCI E port.
  • the PC IE protocol is a relatively common international standard, and the PC IE port can be used to avoid private use.
  • the incompatibility upgrade risk and cost brought by the protocol are described in the embodiment of the present invention by using the PCI E port for convenience of description, and do not limit the protection scope of the present invention.
  • the "first host” and the "first cache coherency processor" described in the embodiments of the present invention are only for convenience of description, and represent multiple hosts or multiple cache coherency processors. An unspecified host or cache coherency processor, not a special host or CC processor.
  • the first cache coherency processor is configured to perform cache coherency processing according to the received memory processing command, where: if the memory processing command is the Cache status update information sent by the virtual machine manager of the first host, A cache coherency processor is used to update the local cache coherency directory according to the Cache status update information.
  • the Cache Consistency Directory records the Cache status of the shared memory in the entire system, and records the Cache status information and current copy information of the memory block.
  • the Cache status information indicates the status of the local Cache, such as exclusive, shared, Invalid state.
  • the current copy information indicates which hosts have a copy of the memory block.
  • the first cache coherency processor is configured to update the local cache coherency directory according to the received Cache status update information, and specifically may be the memory block address information carried in the update information according to the Cache status (ie, the memory block that has been written) And Cache status information, updating the Cache status information of the memory block in the cache coherency directory. Further, the first cache coherency processor is further configured to notify, according to current copy information of the memory block of the memory in the cache coherency directory, CC processing of other hosts in the at least one host that have a copy of the memory block in which the memory is cached. The device also refreshes its local cache coherency directory.
  • the first cache consistency processor is configured to determine, according to the memory block address information, a record of the memory block corresponding to the memory block address information in the local cache coherency directory, and update the cache status information in the information according to the cache status. Updating the cache state information in the record of the memory block, and determining, according to the current copy information in the record of the memory block, another host other than the first host of the at least two hosts storing the copy of the memory block, notifying other The cache coherency processor corresponding to the host updates its own local cache coherency directory.
  • the virtual machine manager of the first host obtains a memory access request of the virtual machine, and may first determine, according to the memory address information in the memory access request, whether the memory that the memory access request needs to access is the memory on the host, and if so, Accessing the memory on the local device according to the memory access request:
  • the virtual machine manager of the first host is used to write the content to be written to the corresponding memory address, and the cache status update information is cached.
  • the Cache status update information includes the memory block address information and the Cache status information, where the value of the Cache status information indicates the status of the Cache after the data is written, which may be: One of Cache states: exclusive, shared, invalid, etc.; when reading instructions in memory, the virtual machine manager of the first host queries the cache coherency directory in the first cache coherency processor, according to the corresponding memory in the CC directory The Cache status information of the memory block reads the content to be accessed from the memory. If the memory to be accessed is not the memory on the host, the first host is used to send the virtual machine's memory access request to the first cache coherency processor. Alternatively, after the virtual machine manager of the first host obtains the memory access request of the virtual machine, the virtual machine manager sends the memory access request of the virtual machine to the first cache coherency processor directly through the PC I E port.
  • the first cache coherency processor is configured to perform cache coherency processing, and access the memory access Ask the memory corresponding to the memory address information in the request.
  • the memory corresponding to the memory address information herein refers to the memory on the host where the memory resource corresponding to the memory address information in the memory processing request is located.
  • the first cache coherency processor performs cache coherency processing to access the memory on the first host: if the memory access request is a write a memory instruction, the first cache coherency processor writes the content to the memory of the first host, and the first cache coherency processor notifies the first host of the Hyperv i sor to write the content into the local memory, or by the first The cache coherency processor directly writes the content to the memory of the first host, and further, the first cache coherency processor refreshes the Cache state information of the memory block corresponding to the memory in the local CC directory corresponding to the write operation.
  • the first cache coherency processor notifies the first host's virtual machine manager to perform memory read according to the Cache state information of the corresponding memory block in the cache coherency directory, and is configured by the first host The virtual machine manager sends the read information to the virtual machine that issued the memory access request. If the memory to be accessed is the memory on the host other than the first host, the first cache coherency processor accesses the memory on the other host where the memory corresponding to the memory address information of the memory processing request is accessed through the exchange network.
  • the switching network here may be a PCI E switch, an Inf iniband switch or an Ethernet switch, and the first cache coherency processor communicates by using a cache coherency processor connected to another host where the memory corresponding to the memory address information is exchanged, Access to memory on other hosts where the memory corresponding to the memory address information is located. If the memory access request is a write memory instruction, the first cache coherency processor is configured to refresh the Cache state information of the memory block corresponding to the memory in the local CC directory, and notify the other host where the memory corresponding to the memory address information is located. The corresponding CC processor writes the content to be written to the cache of the other host.
  • the first cache coherency processor that issues the memory access request notifies the memory corresponding to the memory address information.
  • the CC processor corresponding to the other host performs memory access, receives the memory access result from the cache coherency processor connected to the other host, and sends the result to the virtual machine manager of the first host that issues the memory access request, by the virtual machine
  • the manager sends the read information to the virtual machine that issued the memory access request, wherein the memory access result is that the cache coherency processor connected to the other host reads from the memory according to the memory access request and its local CC directory.
  • the cache coherency processor in this embodiment may be implemented in accordance with the present invention.
  • the cache coherency processor described in Embodiment 5 and Embodiment 6 is not described herein again.
  • the computer system provided by the embodiment of the present invention sends a memory processing command to a cache coherency processor through a Hyperv i sor of the host, and the cache coherency processor performs cache coherency processing according to the memory processing command, thereby avoiding passing the software on the host.
  • the CPU processing in the aggregation virtualization process occupies more processor resources and causes system performance degradation, thereby improving system processing performance and shortening memory access time.
  • Computer readable media includes both computer storage media and communication media including any medium that facilitates transfer of a computer program from one location to another.
  • a storage medium may be any available media that can be accessed by a computer.
  • the computer readable medium can comprise RAM, ROM, EEPROM, CD-ROM or other optical disk storage, disk storage media or other magnetic storage device, or can be used to carry or store an instruction or data structure.
  • Any connection may suitably be a computer readable medium.
  • the software is transmitted from a website, server, or other remote source using coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL), or wireless technologies such as infrared, radio, and microwave
  • coaxial cable , fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, wireless, and microwaves are included in the fixing of the associated media.
  • a disc (D i sk ) and a disc (CD) include a compact disc (CD), a laser disc, a compact disc, a digital versatile disc (DVD), a floppy disc, and a Blu-ray disc, wherein the disc is usually magnetically replicated,
  • the disc uses a laser to optically replicate the data. Combinations of the above should also be included within the scope of the computer readable media.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

An embodiment of the present invention discloses a memory sharing method in aggregation virtualization. The method comprises: a cache coherence processor receiving a memory processing command sent by a virtual machine manager of a host; if the memory processing command is cache state update information, the cache coherence processor updating a local cache coherence catalog according to the cache state update information; or, if the memory processing command is a memory access request of a virtual machine on the host, the cache coherence processor performing cache coherence processing and accessing a memory corresponding to memory address information in the memory access request. A memory processing command is sent to a cache coherence processor through a virtual machine manager of a host, and the cache coherence processing is performed by the cache coherence processor, thereby improving system processing performance, and shortening the memory access time. Embodiments of the present invention also disclose a memory sharing device and system in aggregation virtualization.

Description

一种实现聚合虚拟化中内存共享的方法、 设备和系统 技术领域  Method, device and system for realizing memory sharing in aggregate virtualization
本发明实施例涉及计算机领域, 尤其涉及实现聚合虚拟化中内存共享的方 法、 设备和系统。  Embodiments of the present invention relate to the field of computers, and in particular, to a method, device, and system for implementing memory sharing in aggregate virtualization.
背景技术 目前, 聚合虚拟化技术普遍应用于大型服务器的应用。 多台独立的服务器 通过物理连接互连, 运用聚合虚拟化技术, 使多台服务器对外呈现为一台服务 器。 使用聚合虚拟化技术后, 可以使多台服务器的中央处理器 ( Central Processing Unit, 简称 CPU) 、 内存 (Memory, 简称 Mem) 、 输出输出 ( Input Output, 简称 10)设备等资源形成资源池, 统一对外呈现, 用于做高性能计算 以及云计算基础设施等。 Background Art Currently, aggregation virtualization technology is generally applied to applications of large servers. Multiple independent servers are interconnected through physical connections, and aggregated virtualization technology is used to make multiple servers appear as one server. After the aggregation virtualization technology is used, resources such as a central processing unit (CPU), a memory (Mem), and an output output (10) can be formed into a resource pool. External presentation, used for high performance computing and cloud computing infrastructure.
在虚拟化应用场景下,每个服务器上都会运行虚拟机管理器( Hypervisor ) 软件, Hypervisor是虚拟化的基石出软件。 DomainO为 Hypervisor之上的一个 特殊虚拟机 (Virtual Machine, 简称 VM) , 该虚拟机用来完成对各个虚拟机 的交互以及一些外设模拟、 外设访问等功能。 在聚合虚拟化技术方案中, 在多 台服务器上安装有无限带宽 ( Inf iniband, 简称 IB )卡或者以太网卡, 通过 Inf iniband交换机或者以太网交换机使得这些服务器互连, 同时各服务器运行 的 Hypervi sor中包括聚合虚拟化软件,聚合虚拟化软件通过软件本身实现緩存 一致性( Cache Coherent, 简称 CC)处理,并在完成 CC处理后,通过 Inf iniband 交换机或者以太网交换机访问其他服务器上的内存。 从而实现各服务器在聚合 虚拟化中的内存共享, 通过聚合虚拟化软件实现了多个服务器对外呈现一个服 务器的内存聚合。  In the virtualized application scenario, the hypervisor software runs on each server, and the hypervisor is the cornerstone of virtualization. DomainO is a special virtual machine (Virtual Machine) on top of the Hypervisor. This virtual machine is used to complete the interaction of each virtual machine and some peripheral analog and peripheral access functions. In the aggregation virtualization solution, an Inf iniband (IB) card or an Ethernet card is installed on multiple servers, and these servers are interconnected through an Inf iniband switch or an Ethernet switch, and Hypervi sor runs on each server. The aggregation virtualization software is included. The aggregation virtualization software implements the Cache Coherent (CC) processing through the software itself, and accesses the memory on other servers through the Inf iniband switch or the Ethernet switch after the CC processing is completed. In this way, the memory sharing of each server in the aggregation virtualization is realized, and the aggregation virtualization software realizes the memory aggregation of a server externally presented by one server.
现有聚合虚拟化方案中, 使用聚合虚拟化软件进行 CC事务处理, 解决内存 共享带来的緩存一致性冲突, CC事务处理会占用较多处理器资源。 如果系统规 模较大, CC事务处理将成为系统性能瓶颈。 聚合虚拟化单次的内存互访操作延 时约在 100微秒(us )级别, 甚至在某些时候会是毫秒(ms)级别的, 而其中 聚合虚拟化软件进行 CC处理占用了其中绝大部分时间。 所以, 现有的聚合虚拟 化方案中内存共享的方法导致系统性能下降。 发明内容 有鉴于此, 本发明实施例提供了一种实现聚合虚拟化中内存共享的方法、 设备和系统, 能够提升系统处理性能, 从而缩短内存访问时间。 In the existing aggregation virtualization solution, the aggregation virtualization software is used for CC transaction processing to solve the cache consistency conflict caused by the memory sharing, and the CC transaction processing takes up more processor resources. If the system is large, CC transaction processing will become a system performance bottleneck. Aggregate virtualization single-time memory access operation delay is about 100 microseconds (us) level, and even at some time it is millisecond (ms) level, and Converged virtualization software for CC processing takes up most of the time. Therefore, the method of memory sharing in the existing aggregation virtualization scheme leads to system performance degradation. SUMMARY OF THE INVENTION In view of this, embodiments of the present invention provide a method, a device, and a system for implementing memory sharing in an aggregated virtualization, which can improve system processing performance and thereby shorten memory access time.
第一方面, 本发明实施例提供了一种聚合虚拟化中内存共享的方法,包 括:  In a first aspect, an embodiment of the present invention provides a method for memory sharing in an aggregate virtualization, including:
緩存一致性处理器接收主机的虚拟机管理器发送的内存处理命令; 若所述内存处理命令为緩存状态更新信息, 所述緩存一致性处理器根据 所述緩存状态更新信息对本地的緩存一致性目录进行更新, 所述緩存状态更 新信息中包括内存块地址信息和緩存状态信息;  The cache coherency processor receives the memory processing command sent by the virtual machine manager of the host; if the memory processing command is the cache status update information, the cache coherency processor updates the local cache coherency according to the cache status update information. The directory is updated, and the cache status update information includes memory block address information and cache status information;
或者, 所述内存处理命令为所述主机上的虚拟机的内存访问请求, 所述 緩存一致性处理器进行緩存一致性处理, 访问所述内存访问请求中的内存地 址信息对应的内存。  Alternatively, the memory processing command is a memory access request of the virtual machine on the host, and the cache coherency processor performs cache coherency processing to access a memory corresponding to the memory address information in the memory access request.
在第一方面的第一种可能的实现方式中, 所述緩存一致性处理器根据所 述緩存状态更新信息对本地的緩存一致性目录进行更新, 具体为:  In a first possible implementation manner of the first aspect, the cache coherency processor updates the local cache coherency directory according to the cache status update information, specifically:
所述緩存一致性处理器根据所述内存块地址信息, 确定所述本地的緩存 一致性目录中所述内存块地址信息对应的内存块的记录;  Determining, by the cache coherency processor, a record of a memory block corresponding to the memory block address information in the local cache coherency directory according to the memory block address information;
根据所述緩存状态更新信息中的緩存状态信息更新所述内存块的记录中 的緩存状态信息;  Updating cache state information in the record of the memory block according to the cache state information in the cache state update information;
根据所述内存块的记录中的当前拷贝信息, 确定保存有所述内存块的拷 贝的其他主机, 通知所述其他主机对应的緩存一致性处理器更新各自本地的 緩存一致性目录。  And determining, according to the current copy information in the record of the memory block, another host that stores the copy of the memory block, and notifying the cache coherency processor corresponding to the other host to update the local cache coherency directory.
结合第一方面或第一方面的第一种可能的实现方式, 在第二种可能的实 现方式中, 所述緩存一致性处理器进行緩存一致性处理, 访问所述内存访问 请求中的内存地址信息对应的内存, 具体为:  With reference to the first aspect or the first possible implementation manner of the first aspect, in a second possible implementation manner, the cache coherency processor performs cache coherency processing, and accesses a memory address in the memory access request The memory corresponding to the information is specifically:
若所述内存地址信息对应的内存是所述主机上的内存, 所述緩存一致性 处理器进行緩存一致性处理, 对所述主机的内存进行访问; 或者所述内存地址信息对应的内存是所述主机以外的其他主机上的内 存, 则所述緩存一致性处理器进行緩存一致性处理, 通过交换网络访问所述 内存地址信息对应的所述其他主机上的内存。 If the memory corresponding to the memory address information is the memory on the host, the cache coherency processor performs cache coherency processing to access the memory of the host; Or the memory corresponding to the memory address information is a memory on a host other than the host, and the cache coherency processor performs cache coherency processing, and accesses the other host corresponding to the memory address information by using a switching network. Memory on.
结合第一方面的第二种可能的实现方式,在第三种可能的实现方式中,所 述緩存一致性处理器通过交换网络访问所述内存地址信息对应的所述其他主 机上的内存, 具体为:  In conjunction with the second possible implementation of the first aspect, in a third possible implementation, the cache coherency processor accesses the memory on the other host corresponding to the memory address information by using a switching network, specifically For:
所述緩存一致性处理器通过所述交换网络与所述内存地址信息对应的所 述其他主机连接的緩存一致性处理器进行通信, 访问所述内存地址信息对应 的所述其他主机上的内存。  The cache coherency processor communicates with the cache coherency processor of the other host connection corresponding to the memory address information by the switching network, and accesses memory on the other host corresponding to the memory address information.
结合第一方面的第二种或第三种可能的实现方式, 在第四种可能的实现 方式中, 还包括:  In combination with the second or third possible implementation of the first aspect, in a fourth possible implementation manner, the method further includes:
若所述内存访问请求为读内存指令, 所述緩存一致性处理器将内存访问 结果发送给所述主机的虚拟机管理器。  And if the memory access request is a read memory instruction, the cache coherency processor sends the memory access result to the virtual machine manager of the host.
结合第一方面或第一方面的第一种至第四种任一可能的实现方式, 在第 五种可能的实现方式中, 所述緩存一致性处理器接收主机的虚拟机管理器发 送的内存处理命令之前, 还包括:  With reference to the first aspect, or any one of the first to fourth possible implementation manners of the first aspect, in a fifth possible implementation, the cache coherency processor receives the memory sent by the virtual machine manager of the host Before processing the command, it also includes:
所述主机的虚拟机管理器获得所述虚拟机的所述内存访问请求; 所述主机的虚拟机管理器根据所述内存访问请求中的内存地址信息判断 所述内存访问请求需要访问的内存是否是所述主机上的内存, 如果是所述主 机上的内存, 则根据所述内存访问请求访问所述主机上的内存, 并将所述緩 存状态更新信息发送给所述緩存一致性处理器;如果不是所述主机上的内存, 则将所述内存访问请求发送给所述緩存一致性处理器。  The virtual machine manager of the host obtains the memory access request of the virtual machine; the virtual machine manager of the host determines, according to the memory address information in the memory access request, whether the memory that the memory access request needs to access is Is the memory on the host, if it is the memory on the host, accessing the memory on the host according to the memory access request, and sending the cache status update information to the cache consistency processor; If not the memory on the host, the memory access request is sent to the cache coherency processor.
第二方面, 本发明实施例提供了一种聚合虚拟化中内存共享的方法,包 括:  In a second aspect, an embodiment of the present invention provides a method for memory sharing in an aggregate virtualization, including:
主机的虚拟机管理器获得虚拟机的内存访问请求;  The virtual machine manager of the host obtains a memory access request of the virtual machine;
所述主机的虚拟机管理器根据所述内存访问请求中的内存地址信息判断 所述内存访问请求需要访问的内存是否是所述主机上的内存, 如果是所述主 机上的内存, 则根据所述内存访问请求访问所述主机上的内存, 并在所述内 存访问请求为内存写指令时, 发送緩存状态更新信息给緩存一致性处理器, 以便所述緩存一致性处理器更新所述緩存一致性处理器本地的緩存一致性目 录中进行了写操作的内存块对应的緩存状态信息; 如果所述内存访问请求为 读指令, 则将所述内存访问请求发送给所述緩存一致性处理器, 以便所述緩 存一致性处理器进行緩存一致性处理并访问所述内存访问请求中的内存地址 信息对应的内存; The virtual machine manager of the host determines, according to the memory address information in the memory access request, whether the memory that the memory access request needs to access is the memory on the host, and if it is the memory on the host, The memory access request accesses the memory on the host, and sends the cache status update information to the cache coherency processor when the memory access request is a memory write instruction. So that the cache coherency processor updates the cache state information corresponding to the memory block in the cache coherency directory in the cache coherency directory; if the memory access request is a read command, And the memory access request is sent to the cache coherency processor, so that the cache coherency processor performs cache coherency processing and accesses memory corresponding to the memory address information in the memory access request;
或者, 所述主机的虚拟机管理器将所述内存访问请求发送给所述緩存一 致性处理器, 以便所述緩存一致性处理器进行緩存一致性处理并访问所述内 存访问请求中的内存地址信息对应的内存。  Or the virtual machine manager of the host sends the memory access request to the cache coherency processor, so that the cache coherency processor performs cache coherency processing and accesses a memory address in the memory access request. The memory corresponding to the information.
在第二方面的第一种可能的实现方式中, 如果是所述内存访问请求为读 指令, 所述主机的虚拟机管理器将所述内存访问请求发送给所述緩存一致性 处理器之后, 还包括:  In a first possible implementation manner of the second aspect, if the memory access request is a read instruction, after the virtual machine manager of the host sends the memory access request to the cache coherency processor, Also includes:
所述主机的虚拟机管理器接收所述緩存一致性处理器返回的内存访问结 果。  The virtual machine manager of the host receives the memory access result returned by the cache coherency processor.
第三方面, 本发明实施例提供了一种緩存一致性处理器, 包括: 输入输出单元, 用于接收主机的虚拟机管理器发送的内存处理命令; 緩存一致性处理单元, 若所述内存处理命令为緩存状态更新信息, 用于 根据所述緩存状态更新信息,发送緩存一致性目录更新指令给目录管理单元, 或者, 所述内存处理命令为所述主机上的虚拟机的内存访问请求, 用于进行 緩存一致性处理, 访问所述内存访问请求中的内存地址信息对应的内存, 其 中, 所述緩存状态更新信息中包括内存块地址信息和緩存状态信息;  In a third aspect, an embodiment of the present invention provides a cache coherency processor, including: an input and output unit, configured to receive a memory processing command sent by a virtual machine manager of a host; a cache coherency processing unit, if the memory processing The command is a cache status update information, configured to send a cache consistent directory update command to the directory management unit according to the cache status update information, or the memory processing command is a memory access request of the virtual machine on the host, And performing cache coherency processing, accessing memory corresponding to the memory address information in the memory access request, where the cache state update information includes memory block address information and cache state information;
所述目录管理单元, 用于根据所述緩存一致性目录更新指令更新本地的 緩存一致性目录。  The directory management unit is configured to update a local cache coherency directory according to the cache coherency directory update instruction.
在第三方面的第一种可能的实现方式中, 所述目录管理单元, 用于根据 所述緩存一致性目录更新指令更新本地的緩存一致性目录, 具体为:  In a first possible implementation manner of the third aspect, the directory management unit is configured to update a local cache consistency directory according to the cache consistency directory update instruction, specifically:
所述目录管理单元, 用于根据所述内存块地址信息, 确定所述本地的緩 存一致性目录中所述内存块地址信息对应的内存块的记录, 根据所述緩存状 态更新信息中的緩存状态信息更新所述内存块的记录中的緩存状态信息, 并 根据所述内存块的记录中的当前拷贝信息, 确定保存有所述内存块的拷贝的 其他主机, 通知所述其他主机对应的緩存一致性处理器更新各自本地的緩存 一致性目录。 The directory management unit is configured to determine, according to the memory block address information, a record of a memory block corresponding to the memory block address information in the local cache coherency directory, and update a cache status according to the cache status update information. The information is updated with the cache state information in the record of the memory block, and according to the current copy information in the record of the memory block, another host that saves the copy of the memory block is determined, and the cache corresponding to the other host is notified to be consistent. Scaling processors update their local caches Consistent directory.
结合第三方面或第三方面的第一种可能的实现方式, 在第二种可能的实 现方式中, 所述緩存一致性处理单元, 用于进行緩存一致性处理, 访问所述 内存访问请求中的内存地址信息对应的内存, 具体为:  With reference to the third aspect, or the first possible implementation manner of the third aspect, in a second possible implementation, the cache coherency processing unit is configured to perform cache coherency processing, and access the memory access request. The memory corresponding to the memory address information is specifically:
所述緩存一致性处理单元, 若所述内存地址信息对应的内存是所述主机 上的内存, 用于进行緩存一致性处理, 对所述主机的内存进行访问, 若所述 内存地址信息对应的内存是所述主机以外的其他主机上的内存, 则所述緩存 一致性处理单元用于进行緩存一致性处理, 通过网络接口单元经交换网络访 问所述内存地址信息对应的所述其他主机上的内存;  The cache coherency processing unit, if the memory corresponding to the memory address information is a memory on the host, is used for performing cache coherency processing, and accessing the memory of the host, if the memory address information corresponds to The memory is the memory on the host other than the host, and the cache coherency processing unit is configured to perform cache coherency processing, and the network interface unit accesses the other host corresponding to the memory address information via the switching network. RAM;
则, 所述緩存一致性处理器, 还包括:  The cache coherency processor further includes:
所述网络接口单元, 用于提供所述緩存一致性处理单元与所述其他主机 间的通信, 将所述緩存一致性处理单元的信息通过所述交换网络发送给所述 其他主机, 将从所述交换网络接收的所述其他主机的信息传递给所述緩存一 致性处理单元。  The network interface unit is configured to provide communication between the cache coherency processing unit and the other host, and send information of the cache coherency processing unit to the other host through the switching network, The information of the other host received by the switching network is passed to the cache coherency processing unit.
结合第三方面的第二种可能的实现方式, 在第三种可能的实现方式中, 所述緩存一致性处理单元用于进行緩存一致性处理, 通过网络接口单元经交 换网络访问所述内存地址信息对应的所述其他主机上的内存, 具体为:  With reference to the second possible implementation of the third aspect, in a third possible implementation, the cache coherency processing unit is configured to perform cache coherency processing, and access the memory address by using a network interface unit through a switching network. The memory on the other host corresponding to the information is specifically:
所述緩存一致性处理单元, 用于进行緩存一致性处理, 通过所述网络接 口单元经所述交换网络与所述内存地址信息对应的所述其他主机连接的緩存 一致性处理器进行通信, 访问所述内存地址信息对应的所述其他主机上的内 存。  The cache coherency processing unit is configured to perform cache coherency processing, and the network interface unit communicates with the cache coherency processor connected to the other host corresponding to the memory address information through the switching network. The memory on the other host corresponding to the memory address information.
结合第三方面的第二种或第三种可能的实现方式, 在第四种可能的实现 方式中:  In combination with the second or third possible implementation of the third aspect, in a fourth possible implementation:
所述緩存一致性处理单元,还用于,若所述内存访问请求为读内存指令, 将内存访问结果通过所述输入输出单元发送给所述主机的虚拟机管理器。  The cache coherency processing unit is further configured to: if the memory access request is a read memory instruction, send a memory access result to the virtual machine manager of the host by using the input and output unit.
结合第三方面的第二种至第四种任一可能的实现方式, 在第五种可能的 实现方式中, 所述緩存一致性处理单元, 包括:  With the second to fourth possible implementations of the third aspect, in a fifth possible implementation, the cache coherency processing unit includes:
预处理子模块, 用于与所述输入输出单元、 本地代理子模块、 远端代理 子模块连接, 用于负责所述输入输出单元与所述本地代理子模块、 所述远端 代理子模块之间的报文传递; a pre-processing sub-module, configured to be connected to the input and output unit, the local proxy sub-module, and the remote proxy sub-module, and configured to be responsible for the input and output unit and the local proxy sub-module, the remote end Message passing between proxy submodules;
所述本地代理子模块, 用于处理对所述主机的内存访问请求, 进行緩存 一致性处理, 以及发送所述緩存一致性目录更新指令给所述目录管理单元; 所述远端代理子模块, 用于处理对所述主机以外的其他主机的内存访问 请求, 进行緩存一致性处理, 通过所述网络接口单元经所述交换网络访问所 述其他主机的内存。  The local proxy sub-module, configured to process a memory access request to the host, perform cache coherency processing, and send the cache coherency directory update command to the directory management unit; For processing a memory access request to a host other than the host, performing cache coherency processing, and accessing, by the network interface unit, the memory of the other host via the switching network.
第四方面, 本发明实施例还提供了一种计算机系统, 包括: 至少两个主 机, 至少两个緩存一致性处理器和一个交换网络, 其中, 所述至少两个主机 中的每个主机分别与所述至少两个緩存一致性处理器中的一个緩存一致性处 理器相连, 所述至少两个緩存一致性处理器通过所述交换网络相连;  In a fourth aspect, the embodiment of the present invention further provides a computer system, including: at least two hosts, at least two cache coherency processors, and a switching network, wherein each of the at least two hosts respectively Connected to one of the at least two cache coherency processors, the at least two cache coherency processors being connected by the switching network;
所述至少两个主机中的第一主机, 用于发送内存处理命令给相连的所述 至少两个緩存一致性处理器中的第一緩存一致性处理器;  a first one of the at least two hosts, configured to send a memory processing command to the first cache coherency processor of the at least two cache coherency processors connected;
所述第一緩存一致性处理器,若所述内存处理命令为緩存状态更新信息, 所述第一緩存一致性处理器用于根据所述緩存状态更新信息更新本地的緩存 一致性目录,所述緩存状态更新信息中包括内存块地址信息和緩存状态信息, 或者, 所述内存处理命令为所述第一主机上的虚拟机的内存访问请求, 用于 进行緩存一致性处理,访问所述内存访问请求中的内存地址信息对应的内存。  The first cache coherency processor, if the memory processing command is cache status update information, the first cache coherency processor is configured to update a local cache coherency directory according to the cache status update information, the cache The status update information includes the memory block address information and the cache status information, or the memory processing command is a memory access request of the virtual machine on the first host, configured to perform cache consistency processing, and access the memory access request. The memory corresponding to the memory address information.
在第四方面的第一种可能的实现方式中, 所述第一緩存一致性处理器, 用于根据所述緩存状态更新信息更新本地的緩存一致性目录, 具体为:  In a first possible implementation manner of the fourth aspect, the first cache coherency processor is configured to update a local cache coherency directory according to the cache status update information, specifically:
所述第一緩存一致性处理器, 用于根据所述内存块地址信息, 确定所述 本地的緩存一致性目录中所述内存块地址信息对应的内存块的记录, 根据所 述緩存状态更新信息中的緩存状态信息更新所述内存块的记录中的緩存状态 信息, 并根据所述内存块的记录中的当前拷贝信息, 确定保存有所述内存块 的拷贝的所述至少两个主机中所述第一主机以外的其他主机, 通知所述其他 主机对应的緩存一致性处理器更新各自本地的緩存一致性目录。  The first cache coherency processor is configured to determine, according to the memory block address information, a record of a memory block corresponding to the memory block address information in the local cache coherency directory, and update information according to the cache status The cache state information in the cache updates the cache state information in the record of the memory block, and determines, according to the current copy information in the record of the memory block, the at least two hosts in which the copy of the memory block is saved The other hosts other than the first host notify the cache coherency processors corresponding to the other hosts to update their respective local cache coherency directories.
结合第四方面或第四方面的第一种可能的实现方式, 在第二种可能的实 现方式中, 所述第一緩存一致性处理器, 用于进行緩存一致性处理, 访问所 述内存访问请求中的内存地址信息对应的内存, 具体为:  With reference to the fourth aspect, or the first possible implementation manner of the fourth aspect, in a second possible implementation, the first cache coherency processor is configured to perform cache coherency processing, and access the memory access The memory corresponding to the memory address information in the request is specifically:
所述第一緩存一致性处理器, 若所述内存地址信息对应的内存是所述第 一主机上的内存, 用于进行緩存一致性处理, 对所述第一主机的内存进行访 问, 或者, 所述内存地址信息对应的内存是所述至少两个主机中所述第一主 机以外的其他主机上的内存, 用于进行緩存一致性处理, 通过所述交换网络 访问所述内存地址信息对应的所述其他主机上的内存。 The first cache coherency processor, if the memory corresponding to the memory address information is the first a memory on the host, configured to perform cache coherency processing, to access the memory of the first host, or the memory corresponding to the memory address information is other than the first host in the at least two hosts The memory on the other host is used for cache coherency processing, and the memory on the other host corresponding to the memory address information is accessed through the switching network.
结合第四方面的第二种可能的实现方式, 在第三种可能的实现方式中, 所述第一緩存一致性处理器, 用于进行緩存一致性处理, 通过所述交换网络 访问所述内存地址信息对应的所述其他主机上的内存, 具体为:  With the second possible implementation of the fourth aspect, in a third possible implementation, the first cache coherency processor is configured to perform cache coherency processing, and access the memory by using the switching network. The memory on the other host corresponding to the address information is specifically:
所述第一緩存一致性处理器, 用于进行緩存一致性处理, 通过所述交换 网络与所述内存地址信息对应的所述其他主机连接的緩存一致性处理器进行 通信, 访问所述内存地址信息对应的所述其他主机上的内存。  The first cache coherency processor is configured to perform cache coherency processing, and communicate, by the switching network, with a cache coherency processor connected to the other host corresponding to the memory address information, and access the memory address. The memory on the other host corresponding to the information.
结合第四方面的第二种或第三种可能的实现方式, 在第四种可能的实现 方式中:  In combination with the second or third possible implementation of the fourth aspect, in a fourth possible implementation:
所述第一緩存一致性处理器, 若所述内存访问请求为读内存指令, 还用 于将内存访问结果发送给所述第一主机的虚拟机管理器。  The first cache coherency processor, if the memory access request is a read memory instruction, is further configured to send a memory access result to a virtual machine manager of the first host.
结合第四方面或第四方面的第一种至第四种任一可能的实现方式, 在第 五种可能的实现方式中:  In combination with the fourth aspect or any of the first to fourth possible implementations of the fourth aspect, in a fifth possible implementation:
所述第一主机的虚拟机管理器, 还用于获得所述虚拟机的所述内存访问 请求, 根据所述内存访问请求中的内存地址信息判断所述内存访问请求需要 访问的内存是否是所述第一主机上的内存, 如果是所述第一主机上的内存, 则根据所述内存访问请求对所述第一主机上的内存进行访问, 并发送所述緩 存状态更新信息给所述第一緩存一致性处理器; 如果不是所述第一主机上的 内存, 则将所述内存访问请求发送给所述第一緩存一致性处理器。  The virtual machine manager of the first host is further configured to obtain the memory access request of the virtual machine, and determine, according to the memory address information in the memory access request, whether the memory that the memory access request needs to access is The memory on the first host, if it is the memory on the first host, accessing the memory on the first host according to the memory access request, and sending the cache status update information to the first a cache coherency processor; if not the memory on the first host, transmitting the memory access request to the first cache coherency processor.
通过上述方案, 本发明实施例提供的聚合虚拟化中内存共享的方法、 设 备和系统, 通过主机的虚拟机管理器将内存处理命令发送给緩存一致性处理 器, 由緩存一致性处理器进行緩存一致性处理, 避免了聚合虚拟化中在主机 上通过软件实现 CC处理而造成的占用较多处理器资源,导致系统性能下降的 问题, 从而能够提升系统处理性能, 缩短内存访问时间。 附图说明 为了更清楚地说明本发明实施例的技术方案, 下面将对实施例描述中所 需要使用的附图作简单地介绍, 显而易见地, 下面描述中的附图仅仅是本发 明的一些实施例, 对于本领域普通技术人员来讲, 在不付出创造性劳动的前 提下, 还可以根据这些附图获得其他的附图。 The method, device, and system for memory sharing in the aggregate virtualization provided by the embodiment of the present invention, the memory processing command is sent to the cache coherency processor by the virtual machine manager of the host, and cached by the cache coherency processor. Consistency processing avoids the problem of occupying more processor resources caused by CC processing on the host in the aggregation virtualization, resulting in system performance degradation, thereby improving system processing performance and shortening memory access time. DRAWINGS In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments will be briefly described below. It is obvious that the drawings in the following description are only some embodiments of the present invention, Those skilled in the art can also obtain other drawings based on these drawings without paying any creative work.
图 1 为本发明实施例中聚合虚拟化应用的系统架构图;  1 is a system architecture diagram of an aggregated virtualization application according to an embodiment of the present invention;
图 2为本发明实施例 1的聚合虚拟化中内存共享的方法流程图; 图 3为本发明实施例 2的聚合虚拟化中内存共享的方法流程图; 图 4为本发明实施例 3的聚合虚拟化中内存共享的方法流程图; 图 5为本发明实施例 4的聚合虚拟化中内存共享的方法流程图; 图 6为本发明实施例 5的緩存一致性处理器的结构图;  2 is a flowchart of a method for memory sharing in an aggregated virtualization according to Embodiment 1 of the present invention; FIG. 3 is a flowchart of a method for memory sharing in an aggregated virtualization according to Embodiment 2 of the present invention; FIG. 5 is a flowchart of a method for memory sharing in an aggregated virtualization according to Embodiment 4 of the present invention; FIG. 6 is a structural diagram of a cache coherency processor according to Embodiment 5 of the present invention;
图 7为本发明实施例 6的緩存一致性处理器的结构图;  7 is a structural diagram of a cache coherency processor according to Embodiment 6 of the present invention;
图 8为本发明实施例 7的计算机的系统图。 具体实施方式 下面将结合本发明实施例中的附图, 对本发明实施例中的技术方案进行 清楚、 完整地描述, 显然, 所描述的实施例是本发明一部分实施例, 而不是 全部的实施例。 基于本发明中的实施例, 本领域普通技术人员在没有作出创 造性劳动前提下所获得的所有其他实施例, 都属于本发明保护的范围。  Figure 8 is a system diagram of a computer of Embodiment 7 of the present invention. The technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention. It is obvious that the described embodiments are a part of the embodiments of the present invention, but not all embodiments. . All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present invention without making creative labor are within the scope of the present invention.
图 1为本发明实施例中聚合虚拟化应用的系统架构图, 如图所示, 系统 中包括: 多台主机, 每台主机上的处理器能够支持内存访问敏感指令截获, 实现捕获对各主机中的共享内存的所有访问, 并保障内存数据的正确性。 每 个主机的处理器通过高速夕卜围组件互连 ( Peripheral Component  1 is a system architecture diagram of an aggregated virtualization application according to an embodiment of the present invention. As shown in the figure, the system includes: multiple hosts, each processor on the host can support memory access sensitive instruction interception, and captures each host. All access to shared memory, and to ensure the correctness of the memory data. Each host's processor is interconnected by a high-speed peripheral component (Peripheral Component)
Interconnect Express, 简称 PCIE)接口、 快速通道互联( QuickPath Interconnect, 简称 QPI )接口或超传输 ( HyperTranspor t , 简称 ΗΤ)接口 等与一个緩存一致性处理器(简称 CC处理器)连接; 每个主机有各自独立的 基本输入输出系统 (Basic Input Output System, 简称 BIOS) , 运行聚合 虚拟化软件。 在主机上运行的聚合虚拟化软件实现聚合虚拟化, 使多个主机 对外呈现一个主机, 从而在聚合虚拟化的设备资源池上建立并运行大量的虚 拟机。 本发明实施例中应用的系统架构中的主机具体可以为普通的计算机、 移 动终端、 工作站或服务器、 专用服务器等, 如 X86处理器, 本发明不作具体限 定。 Interconnect Express (PCIE) interface, QuickPath Interconnect (QPI) interface or HyperTransport (ΗΤ) interface is connected to a cache coherency processor (CC processor); each host has Each of the independent Basic Input Output System (BIOS) runs the aggregate virtualization software. The aggregation virtualization software running on the host implements aggregation virtualization, so that multiple hosts can externally present one host, thereby establishing and running a large number of virtual machines on the aggregated virtualized device resource pool. The host in the system architecture applied in the embodiment of the present invention may be an ordinary computer or a mobile device. The mobile terminal, the workstation or the server, the dedicated server, and the like, such as an X86 processor, are not specifically limited in the present invention.
系统还包括多个 CC处理器, CC处理器能够进行 CC处理, 每个 CC处理 器的一端与一个主机的处理器连接,具体可以通过 PCIE接口、 QPI接口或 HT 接口等连接, 另一端连接交换网络。 优选的, CC处理器是独立于主机的物理 实体。  The system also includes a plurality of CC processors, and the CC processor can perform CC processing. One end of each CC processor is connected to a host processor, and can be connected through a PCIE interface, a QPI interface or an HT interface, and the other end is connected and exchanged. The internet. Preferably, the CC processor is a physical entity that is independent of the host.
交换网络将多个 CC处理器互连, 使得各主机能够通过 CC处理器进行通 信, 交换网络具体可以为 PCIE交换机、 Infiniband交换机或者以太网交换机, 通过 PCIE接口、 Infiniband接口或者以太网接口与 CC处理器连接。  The switching network interconnects multiple CC processors, so that each host can communicate through the CC processor. The switching network can be a PCIE switch, an Infiniband switch, or an Ethernet switch, and is processed by the PCIE interface, the Infiniband interface, or the Ethernet interface. Connected.
图 2为本发明实施例 1的一种聚合虚拟化中内存共享的方法流程图。 如 图所示, 本方法为:  FIG. 2 is a flowchart of a method for memory sharing in aggregate virtualization according to Embodiment 1 of the present invention. As shown in the figure, this method is:
步骤 101, 緩存一致性处理器接收主机的虚拟机管理器发送的内存处理 命令。  Step 101: The cache coherency processor receives a memory processing command sent by the host's virtual machine manager.
聚合虚拟化将各主机上独立的内存对虚拟机呈现为一片连续的内存地 址,当主机上的虚拟机进行内存访问时,主机上的虚拟机管理器( Hypervisor ) 会截获到虚拟机的内存访问事件,即获得虚拟机的内存访问请求,内存访问请 求中包含要访问的内存地址信息, 可以为内存读指令或内存写指令。优选的, 虚拟机管理器中的分布式共享内存 ( Distributed Shared Memory , 简称 DSM) 接口调用 DomainO中的 PCIE到内存 ( PCIE to MEM) 的驱动, 根据获得的内 存访问请求通过 PCIE端口向緩存一致性处理器发送内存处理命令,緩存一致 性处理器接收到内存处理命令。 这里的 PCIE端口指采用 PCIE协议进行通信 的端口, 当然,虚拟机管理器也可能采用 PCIE端口以外的其他通信协议端口 向緩存一致性处理器发送内存处理命令。 PCIE协议作为一种较为通用的国际 标准, 采用 PCIE端口可以避免采用私有协议带来的不兼容升级风险和成本, 为便于描述,本发明实施例中采用 PCIE端口进行描述, 并不对本发明的保护 范围造成限制。  Aggregate virtualization presents the virtual machine as a contiguous memory address on the independent memory of each host. When the virtual machine on the host performs memory access, the virtual machine manager (Hyvistor) on the host intercepts the memory access of the virtual machine. The event, that is, the memory access request of the virtual machine is obtained, and the memory access request contains the memory address information to be accessed, and the memory read command or the memory write command. Preferably, the Distributed Shared Memory (DSM) interface in the virtual machine manager calls the PCIE to memory (PCIE to MEM) driver in the DomainO, and passes the PCIE port to the cache consistency according to the obtained memory access request. The processor sends a memory processing command, and the cache coherency processor receives the memory processing command. The PCIE port here refers to the port that communicates using the PCIE protocol. Of course, the virtual machine manager may also send a memory processing command to the cache coherency processor using a communication protocol port other than the PCIE port. The PCIE protocol is used as a general-purpose international standard. The use of the PCIE port can avoid the incompatible upgrade risk and cost caused by the proprietary protocol. For the convenience of description, the PCIE port is used for description in the embodiment of the present invention, and the present invention is not protected. The scope creates limits.
优选的, 主机的虚拟机管理器获得虚拟机的内存访问请求, 可以先根据 内存访问请求中的内存地址信息判断该内存访问请求需要访问的内存是否为 本主机上的内存, 如果是, 则根据内存访问请求对本机上的内存进行访问: 当为内存写指令时, 虚拟机管理器将需要写入的内容写到相应的内存地址, 并将緩存 (Cache ) 状态更新信息通过 PC I E端口发送给緩存一致性处理器, 其中, 緩存状态更新信息中包括内存块地址信息和 Cache状态信息, Cache 状态信息的值表明了 Cache写入数据后, Cache是什么状态, 可以为: 独占、 共享、 无效等 Cache状态中的一种; 当为内存读指令时, 虚拟机管理器查询 緩存一致性处理器中的緩存一致性目录,根据 CC目录中相应内存的内存块的 Cache状态信息从内存中读取要访问的内容。 如果需要访问的内存不是本主 机上的内存, 则将虚拟机的内存访问请求发送给緩存一致性处理器。 也可以 按照如下处理, 主机的虚拟机管理器获得虚拟机的内存访问请求后, 不进行 判断, 直接通过 PC I E端口将虚拟机的内存访问请求发送给緩存一致性处理 器。 可见, 緩存一致性处理器接收到的主机上的虚拟机管理器发送的内存处 理命令, 可能为虚拟机的内存访问请求, 也可能是主机的虚拟机管理器进行 内存访问后发送的 Cache状态更新信息。 Preferably, the virtual machine manager of the host obtains a memory access request of the virtual machine, and first determines, according to the memory address information in the memory access request, whether the memory that the memory access request needs to access is the memory on the host, and if so, according to Memory access requests access memory on this machine: When writing instructions for memory, the virtual machine manager writes the contents to be written to the corresponding memory address, and sends the cache status update information to the cache coherency processor through the PC IE port, where the cache status is updated. The information includes the memory block address information and the Cache status information. The value of the Cache status information indicates what state the Cache is after the Cache writes the data, which may be: one of the Cache states such as exclusive, shared, invalid, etc.; When instructing, the virtual machine manager queries the cache coherency directory in the cache coherency processor, and reads the content to be accessed from the memory according to the Cache state information of the corresponding memory block in the CC directory. If the memory that needs to be accessed is not the memory on the host, the virtual machine's memory access request is sent to the cache coherency processor. The virtual machine manager of the host obtains the memory access request of the virtual machine, and does not judge, and directly sends the virtual machine memory access request to the cache coherency processor through the PC IE port. It can be seen that the memory processing command sent by the virtual machine manager on the host received by the cache coherency processor may be a memory access request of the virtual machine, or may be a Cache status update sent by the host virtual machine manager after performing a memory access. information.
步骤 1 02 , 緩存一致性处理器根据接收到的内存处理命令进行緩存一致 性处理, 具体为:  Step 1 02: The cache consistency processor performs cache consistency processing according to the received memory processing command, specifically:
若内存处理命令为主机的虚拟机管理器发送的 Cache状态更新信息, 緩 存一致性处理器根据 Cache状态更新信息对本地的緩存一致性目录进行更 新。 緩存一致性目录中记录了整个系统中共享内存的 Cache状态, 记录着内 存的内存块的 Cache状态信息和当前拷贝信息, 其中, Cache状态信息表示 本地的 Cache的状态, 例如独占、 共享、 无效等状态。 当前拷贝信息指明哪 些主机保存有该内存块的拷贝, 这些主机对应的緩存一致性处理器的本地的 緩存一致性目录中会有该内存块的信息。 每个緩存一致性处理器维护自己本 地的緩存一致性目录, 当内存状态发生改变时, 緩存一致性目录的 Cache状 态信息也需要进行刷新: 在对应的主机执行了内存写操作以后, 緩存一致性 处理器需要更新其本地的緩存一致性目录中进行了写操作的内存的内存块的 Cache状态信息, 并根据緩存一致性目录中该内存的内存块的当前拷贝信息 通知保存了该内存的内存块的拷贝的其他主机对应的 CC处理器也进行各自 本地的緩存一致性目录的刷新。这里,緩存一致性处理器根据接收到的 Cache 状态更新信息对本地的緩存一致性目录进行更新, 具体可以为根据 Cache状 态更新信息中携带的内存块地址信息(即进行了写操作的内存块的地址信息) 和 Cache状态信息, 更新緩存一致性目录中进行了写操作的内存块的 Cache 状态信息。 首先, 緩存一致性处理器根据緩存状态更新信息中的内存块地址 信息,确定本地的緩存一致性目录中该内存块地址信息对应的内存块的记录, 然后根据緩存状态更新信息中的緩存状态信息更新该内存块的记录中的緩存 状态信息, 并进一步的, 根据该内存块的记录中的当前拷贝信息, 确定保存 有该内存块的拷贝的其他主机, 通知其他主机对应的緩存一致性处理器更新 各自本地的緩存一致性目录。 If the memory processing command is the Cache status update information sent by the host's virtual machine manager, the cache coherency processor updates the local cache coherency directory according to the Cache status update information. The Cache Consistency Directory records the Cache status of the shared memory in the entire system, and records the Cache status information and current copy information of the memory block. The Cache status information indicates the status of the local Cache, such as exclusive, shared, invalid, etc. status. The current copy information indicates which hosts have a copy of the memory block, and the cache coherency processor corresponding to the host has the information of the memory block in the local cache coherency directory. Each cache coherency processor maintains its own local cache coherency directory. When the memory state changes, the Cache state information of the cache coherency directory also needs to be refreshed: After the corresponding host performs a memory write operation, the cache coherency The processor needs to update the Cache state information of the memory block of the memory in the local cache coherency directory, and notifies the memory block in which the memory is saved according to the current copy information of the memory block in the cache coherency directory. The corresponding CC processor of the other hosts of the copy also refreshes their respective cache coherency directories. Here, the cache coherency processor updates the local cache coherency directory according to the received Cache status update information, which may be based on the cache shape. The memory block address information carried in the state update information (ie, the address information of the memory block in which the write operation is performed) and the Cache state information update the Cache state information of the memory block in which the write operation is performed in the cache coherency directory. First, the cache coherency processor determines the record of the memory block corresponding to the memory block address information in the local cache coherency directory according to the memory block address information in the cache status update information, and then updates the cache status information in the information according to the cache status. Updating the cache state information in the record of the memory block, and further, determining, according to the current copy information in the record of the memory block, another host that stores the copy of the memory block, and notifying the cache coherency processor corresponding to the other host Update their local cache coherency directories.
若内存处理命令为主机上的虚拟机的内存访问请求时, 緩存一致性处理 器进行緩存一致性处理, 访问内存访问请求中的内存地址信息对应的内存。 此处的内存地址信息对应的内存是指内存处理请求中的内存地址信息对应的 内存资源所在的主机上的内存。 具体的, 若需要访问的内存地址信息对应的 内存是本主机上的内存, 緩存一致性处理器进行緩存一致性处理, 对该主机 的内存进行访问: 如果内存访问请求是写内存指令, 緩存一致性处理器将内 容写入本主机的内存,可以由緩存一致性处理器通知 Hyperv i sor将内容写入 本机的内存, 或者由緩存一致性处理器直接将内容写入本机的内存, 并进一 步的,緩存一致性处理器会刷新本地的 CC 目录中对应进行了写操作的内存块 的 Cache状态信息; 如果内存访问请求是读内存指令, 緩存一致性处理器根 据緩存一致性目录中相应内存的内存块的 Cache状态信息通知主机的虚拟机 管理器进行内存读取, 并由主机的虚拟机管理器将读取的信息发送给发出内 存访问请求的虚拟机。 若需要访问的内存是其他主机上的内存, 则緩存一致 性处理器通过交换网络访问内存处理请求的内存地址信息对应的内存所在主 机上的内存。 为描述方便, 可以将内存地址信息对应的内存所在的其他主机 称作远端主机, 发出内存访问请求的主机称作本地主机。 此处的交换网络可 以为 PCI E交换机、 Inf iniband交换机或者以太网交换机, 本地主机对应的緩 存一致性处理器通过交换网络与远端主机对应的緩存一致性处理器进行通 信,从而实现对远端主机上的内存的访问。如果内存访问请求是写内存指令, 緩存一致性处理器需要刷新本地的 CC 目录中对应进行了写操作的内存的内 存块的 Cache状态信息, 并通知远端主机对应的 CC处理器, 由其将需要写入 的内容写入远端主机的内存; 如果内存访问请求是读内存指令, 发出内存访 问请求的 CC处理器通知远端主机对应的 CC处理器进行内存访问, 从远端主 机对应的緩存一致性处理器接收内存访问结果, 并发送给发出内存访问请求 的本地主机的虚拟机管理器, 由虚拟机管理器将读取的信息送给发出内存访 问请求的虚拟机, 其中, 内存访问结果是远端主机相连的对应緩存一致性处 理器根据内存访问请求和其本地的 CC 目录从内存中读取的。 CC处理器进行 CC处理的进一步技术细节遵循业界通用的 CC处理协议, 本处不再贅述。 If the memory processing command is a memory access request of the virtual machine on the host, the cache coherency processor performs cache coherency processing, and accesses the memory corresponding to the memory address information in the memory access request. The memory corresponding to the memory address information herein refers to the memory on the host where the memory resource corresponding to the memory address information in the memory processing request is located. Specifically, if the memory corresponding to the memory address information to be accessed is the memory on the host, the cache consistency processor performs cache coherency processing, and accesses the memory of the host: if the memory access request is a write memory instruction, the cache is consistent The processor writes the content to the memory of the host, and the cache coherency processor notifies the Hyperv i sor to write the content into the local memory, or the cache coherency processor directly writes the content into the local memory, and Further, the cache coherency processor refreshes the Cache state information of the memory block corresponding to the write operation in the local CC directory; if the memory access request is a read memory instruction, the cache coherency processor according to the corresponding memory in the cache coherency directory The Cache Status information of the memory block notifies the host's virtual machine manager to perform a memory read, and the host's virtual machine manager sends the read information to the virtual machine that issued the memory access request. If the memory to be accessed is the memory on the other host, the cache coherency processor accesses the memory on the host where the memory corresponding to the memory address information of the memory processing request is accessed through the exchange network. For convenience of description, other hosts in which the memory corresponding to the memory address information is located may be referred to as a remote host, and a host that issues a memory access request is referred to as a local host. The switching network here may be a PCI E switch, an Inf iniband switch or an Ethernet switch, and the cache coherency processor corresponding to the local host communicates with the cache coherency processor corresponding to the remote host through the switching network, thereby realizing the remote end Access to memory on the host. If the memory access request is a write memory instruction, the cache coherency processor needs to refresh the Cache status information of the memory block corresponding to the memory in the local CC directory, and notify the remote host of the corresponding CC processor, and Need to write The content is written to the memory of the remote host; if the memory access request is a read memory instruction, the CC processor that issues the memory access request notifies the remote host of the corresponding CC processor to perform memory access, and the cache consistency processing corresponding to the remote host Receives the memory access result and sends it to the virtual machine manager of the local host that issued the memory access request, and the virtual machine manager sends the read information to the virtual machine that issues the memory access request, where the memory access result is the remote end. The corresponding cache coherency processor connected to the host reads from memory based on the memory access request and its local CC directory. Further technical details of the CC processing performed by the CC processor follow the general CC processing protocol of the industry, and will not be described herein.
本发明实施例提供的聚合虚拟化中内存共享的方法, 通过緩存一致性处 理器接收主机的 Hyperv i sor发送的内存处理命令, 由緩存一致性处理器根据 内存处理命令进行緩存一致性处理, 避免了在主机上通过软件实现聚合虚拟 化中的 CC处理而导致的占用较多处理器资源, 引起系统性能下降的问题,从 而能够提升系统处理性能, 缩短内存访问时间。  The method for sharing memory in the aggregation virtualization provided by the embodiment of the present invention receives the memory processing command sent by the Hyperv i sor of the host by the cache consistency processor, and the cache consistency processing is performed by the cache consistency processor according to the memory processing command, thereby avoiding The problem of occupying more processor resources caused by CC processing in the aggregation virtualization by the software on the host, causing system performance degradation, thereby improving system processing performance and shortening memory access time.
图 3为本发明实施例 2的一种聚合虚拟化中内存共享的方法流程图。 如 图所示, 本方法为:  FIG. 3 is a flowchart of a method for memory sharing in aggregate virtualization according to Embodiment 2 of the present invention. As shown in the figure, this method is:
步骤 201 , 主机的虚拟机管理器获得虚拟机的内存访问请求。  Step 201: The virtual machine manager of the host obtains a memory access request of the virtual machine.
当主机上的虚拟机进行内存访问时,主机上的 Hyperv i sor会截获到虚拟 机的内存访问事件, 即获得虚拟机的内存访问请求。  When a virtual machine on the host performs a memory access, the Hyperv i sor on the host intercepts the memory access event of the virtual machine, that is, obtains the memory access request of the virtual machine.
步骤 202 , 主机的虚拟机管理器向緩存一致性处理器发送内存处理命令, 以便緩存一致性处理器根据接收到的内存处理命令进行緩存一致性处理。  Step 202: The virtual machine manager of the host sends a memory processing command to the cache coherency processor, so that the cache coherency processor performs cache coherency processing according to the received memory processing command.
具体的, 主机的虚拟机管理器获得虚拟机的内存访问请求, 可以先根据 内存访问请求中的内存地址信息判断该内存访问请求需要访问的内存是否为 本主机上的本地内存: 如果是, 则 艮据内存访问请求对本机上的本地内存进 行访问, 当为内存写指令时, 将需要写入的内容写到相应的内存地址, 并将 緩存状态更新信息发送给緩存一致性处理器, 以便所述緩存一致性处理器根 据接收到的緩存状态更新信息对本地的緩存一致性目录进行更新, 其中, 緩 存状态更新信息中包括内存块地址信息和 Cache状态信息; 当为内存读指令 时,虚拟机管理器查询緩存一致性处理器中的緩存一致性目录,根据 CC目录 中相应内存的内存块的 Cache状态信息从緩存中读取要访问的内容。 如果需 要访问的内存不是本主机上的内存, 则将虚拟机的内存访问请求发送给緩存 一致性处理器, 以便緩存一致性处理器进行緩存一致性处理并访问内存访问 请求中的内存地址信息对应的内存。 也可以如下处理, 主机的虚拟机管理器 获得虚拟机的内存访问请求, 不进行内存地址信息的判断, 直接将虚拟机的 内存访问请求发送给緩存一致性处理器, 以便緩存一致性处理器进行緩存一 致性处理并访问内存访问请求中的内存地址信息对应的内存, 具体的, 緩存 一致性处理器进行緩存一致性处理并访问内存访问请求中的内存地址信息对 应的内存的方法与实施例 1中类似, 本处不再贅述。 根据前面的描述, 主机 的虚拟机管理器发送给緩存一致性处理器的内存处理命令, 可能为虚拟机的 内存访问请求, 也可能是主机的虚拟机管理器进行内存访问后的緩存状态信 息。 Specifically, the virtual machine manager of the host obtains the memory access request of the virtual machine, and may first determine, according to the memory address information in the memory access request, whether the memory that the memory access request needs to access is the local memory on the host: If yes, Accessing the local memory on the local device according to the memory access request, when writing the instruction for the memory, writing the content to be written to the corresponding memory address, and sending the cache status update information to the cache coherency processor, so as to The cache coherency processor updates the local cache coherency directory according to the received cache state update information, where the cache state update information includes the memory block address information and the Cache state information; when the memory read command, the virtual machine management Query the cache coherency directory in the cache coherency processor, and read the content to be accessed from the cache according to the Cache state information of the corresponding memory block in the CC directory. If the memory that needs to be accessed is not the memory on the host, send the virtual machine's memory access request to the cache. The consistency processor, in order to cache the consistency processor for cache coherency processing and access the memory corresponding to the memory address information in the memory access request. The virtual machine manager of the host obtains the memory access request of the virtual machine, does not perform the judgment of the memory address information, and directly sends the memory access request of the virtual machine to the cache consistency processor, so that the cache consistency processor performs the same. Cache coherency processing and accessing the memory corresponding to the memory address information in the memory access request, specifically, the cache coherency processor performs the cache coherency processing and accesses the memory corresponding to the memory address information in the memory access request and the embodiment 1 Similar in the matter, we will not repeat them here. According to the foregoing description, the memory processing command sent by the host's virtual machine manager to the cache coherency processor may be a virtual machine's memory access request, or may be a cache state information after the host's virtual machine manager performs a memory access.
优选的, 主机的虚拟机管理器中的 DSM接口调用 Doma inO中的 PCI E to MEM的驱动,根据获得的内存访问请求通过 PCI E端口向緩存一致性处理器发 送内存处理命令。主机的虚拟机管理器通过 PCI E端口与緩存一致性处理器进 行通信, 采用 PC IE端口可以避免采用私有协议带来的不兼容升级风险和成 本, 当然也可以采用其他通信协议端口。  Preferably, the DSM interface in the host's virtual machine manager invokes the PCI E to MEM driver in the Doma inO, and sends a memory processing command to the cache coherency processor through the PCI E port according to the obtained memory access request. The host's virtual machine manager communicates with the cache coherency processor through the PCI E port. The PC IE port can avoid the risk and cost of incompatible upgrades caused by the proprietary protocol. Of course, other communication protocol ports can also be used.
进一步的, 如果内存访问请求是读内存指令, 主机的虚拟机管理器接收 緩存一致性处理器返回的内存访问结果,发送给发出内存访问请求的虚拟机。  Further, if the memory access request is a read memory instruction, the host virtual machine manager receives the memory access result returned by the cache coherency processor and sends the result to the virtual machine that issues the memory access request.
本发明实施例提供的聚合虚拟化中内存共享的方法, 通过主机的 Hyperv i sor 将内存处理命令发送给緩存一致性处理器, 以便由緩存一致性处 理器进行 CC处理, 避免了聚合虚拟化中在主机上通过软件实现 CC处理而导 致的占用较多处理器资源, 引起系统性能下降的问题, 从而能够提升系统处 理性能, 缩短内存访问时间。  The method for sharing memory in the aggregation virtualization provided by the embodiment of the present invention sends a memory processing command to the cache coherency processor through the Hyperv i sor of the host, so that the CPU is processed by the cache coherency processor, thereby avoiding aggregation virtualization. The CPU processing on the host implements CPU processing, which causes more processor resources and causes system performance degradation. This improves system processing performance and shortens memory access time.
图 4为本发明实施例 3的一种聚合虚拟化中内存共享的方法流程图。 如 图所示, 该方法具体为:  4 is a flowchart of a method for memory sharing in an aggregated virtualization according to Embodiment 3 of the present invention. As shown in the figure, the method is specifically as follows:
步骤 301 , 主机上的虚拟机发起内存访问事件。 聚合虚拟化将各主机上 的独立的内存对虚拟机呈现为一片连续的内存地址, 主机上的虚拟机需要进 行内存访问时, 发起内存访问事件。  Step 301: A virtual machine on the host initiates a memory access event. Aggregation virtualization presents the virtual machine as a contiguous memory address for the independent memory on each host. When the virtual machine on the host needs to access the memory, it initiates a memory access event.
步骤 302 , 主机上的虚拟机管理器截获内存访问事件。 在聚合虚拟化中, 为了保证内存数据的正确性, 内存访问敏感指令必须能被捕获。 Hyperv i sor 截获虚拟机的内存访问事件, 即获得虚拟机的内存访问请求。 Step 302: The virtual machine manager on the host intercepts the memory access event. In aggregate virtualization, in order to ensure the correctness of memory data, memory access sensitive instructions must be captured. Hyperv i sor Intercept the memory access event of the virtual machine, that is, obtain the memory access request of the virtual machine.
步骤 303 , Hyper V i s or判断内存访问请求是否是访问本主机上的内存。 Hyperv i sor根据内存访问请求中的内存地址信息判断该内存访问请求需要 访问的内存是否为本主机上的内存。 具体为, Hyperv i sor中的 DSM接口处理 获取的内存访问请求, 根据内存访问请求中的内存地址信息判断是否是访问 本主机上的内存。  Step 303: Hyper V i s or determine whether the memory access request is accessing the memory on the host. The Hyperv i sor determines whether the memory that the memory access request needs to access is the memory on the host according to the memory address information in the memory access request. Specifically, the DSM interface in the Hyperv i sor processes the obtained memory access request, and determines whether to access the memory on the host according to the memory address information in the memory access request.
步骤 304 , 若是访问本主机上的内存, 主机的 Hyperv i sor根据内存访问 请求中的内存地址信息对本主机上的内存进行访问。  Step 304: If the memory on the host is accessed, the Hyperv i sor of the host accesses the memory on the host according to the memory address information in the memory access request.
步骤 305 , 当为内存写指令时, 主机的 Hyperv i sor将緩存状态更新信息 发送给本地的緩存一致性处理器, 緩存状态更新信息中包括内存块地址信息 和 Cache状态信息, Cache状态信息的值表明写入数据后, Cache是什么状态, 可以为: 独占、 共享、 无效等 Cache状态中的一种。 本步骤具体为, 当为内 存写指令时, 主机的虚拟机管理器对内存进行写入操作, 虚拟机管理器中的 DSM接口调用 Doma inO中的 PC IE to MEM的驱动, 通过 PC IE端口向本地的緩 存一致性处理器发送緩存状态更新信息, 本地的緩存一致性处理器中负责与 主机侧接口的输入输出 ( Input Out put , 简称 10 )接口单元接收緩存状态更 新信息。 本实施例中为便于区分, 将发出内存请求命令的主机所对应的緩存 一致性处理器称为本地的緩存一致性处理器, 将要访问的内存所在的远端主 机所对应的緩存一致性处理器称为远端的緩存一致性处理器  Step 305: When writing an instruction for the memory, the host's Hyperv i sor sends the cache status update information to the local cache coherency processor, where the cache status update information includes the memory block address information and the Cache status information, and the value of the Cache status information. Indicates the state of the Cache after the data is written. It can be: one of the Cache states such as exclusive, shared, and invalid. This step is specifically: when the memory is written, the host virtual machine manager writes the memory, and the DSM interface in the virtual machine manager calls the PC IE to MEM driver in the Doma inO, through the PC IE port. The local cache coherency processor sends the cache status update information, and the input and output (Input Out put, 10 for short) interface unit in the local cache coherency processor receives the cache status update information. In this embodiment, for convenience of distinction, the cache coherency processor corresponding to the host that issues the memory request command is referred to as a local cache coherency processor, and the cache coherency processor corresponding to the remote host where the memory to be accessed is located. Cache-consistent processor
步骤 306 , 本地的緩存一致性处理器根据接收的 Cache状态更新信息更 新自身的緩存一致性目录。 具体为, 本地的緩存一致性处理器中的本地代理 ( Loca l Proxy, 简称 LP ) 子模块负责根据接收的主机的 Cache状态更新信 息中携带的内存块地址信息和 Cache状态信息更新本地的 CC 目录, 即, 更新 本地的緩存一致性目录中记录的进行了写操作的内存的内存块的 Cache状态 信息, 并进一步根据緩存一致性目录中该内存的内存块的当前拷贝信息通知 緩存了该内存的内存块的拷贝的其他主机对应的 CC处理器也进行各自本地 的緩存一致性目录的刷新。 具体的, 首先, 緩存一致性处理器根据緩存状态 更新信息中的内存块地址信息, 确定本地的緩存一致性目录中该内存块地址 信息对应的内存块的记录, 然后根据緩存状态更新信息中的緩存状态信息更 新该内存块的记录中的緩存状态信息, 并进一步的, 根据所该存块的记录中 的当前拷贝信息, 确定保存有该内存块的拷贝的其他主机, 通知其他主机对 应的緩存一致性处理器更新各自本地的緩存一致性目录。 执行步骤 315。 Step 306: The local cache coherency processor updates its own cache coherency directory according to the received Cache status update information. Specifically, the local proxy (Loca Proxy, LP) sub-module in the local cache coherency processor is responsible for updating the local CC directory according to the memory block address information and the Cache state information carried in the Cache status update information of the received host. , that is, updating the Cache state information of the memory block of the memory that is written in the local cache coherency directory, and further notifying the cached memory according to the current copy information of the memory block of the memory in the cache coherency directory The CC processor corresponding to the other host of the copy of the memory block also refreshes the respective local cache coherency directory. Specifically, first, the cache coherency processor determines, according to the memory block address information in the cache status update information, a record of the memory block corresponding to the memory block address information in the local cache coherency directory, and then updates the information according to the cache status. Cache status information is more The cache state information in the record of the memory block is newly added, and further, according to the current copy information in the record of the block, another host that saves the copy of the memory block is determined, and the cache consistency processing corresponding to the other host is notified. Updates their respective local cache coherency directories. Go to step 315.
步骤 307 , 若不是访问本主机上的内存, 主机的虚拟机管理器中的 DSM 接口调用 Doma inO中的 PC I E to MEM的驱动, 通过 PC I E端口向本地的緩存一 致性处理器发送内存访问请求。緩存一致性处理器中负责与主机侧接口的 10 接口单元接收内存访问请求。  Step 307: If the memory on the host is not accessed, the DSM interface in the host virtual machine manager calls the PC IE to MEM driver in the Doma inO, and sends a memory access request to the local cache coherency processor through the PC IE port. . The 10 interface unit responsible for the interface with the host side in the cache coherency processor receives the memory access request.
步骤 308 , 本地的緩存一致性处理器通过交换网络访问远端的緩存一致 性处理器。 本地的緩存一致性处理器接收内存访问请求后, 将需要访问其他 主机上内存的内存访问请求交给緩存一致性处理器中的远端代理 ( Remo te Proxy , 简称 RP ) 子模块负责处理, RP子模块通过网络接口单元经过交换网 络访问远端的緩存一致性处理器。 这里的远端的緩存一致性处理器是指负责 管理远端主机的 CC处理器, 该远端主机就是所要访问的内存所在的主机。  Step 308: The local cache coherency processor accesses the remote cache coherency processor through the switched network. After receiving the memory access request, the local cache coherency processor hands over the memory access request that needs to access the memory on the other host to the remote proxy (Remo te Proxy, RP for short) sub-module in the cache coherency processor. The submodule accesses the remote cache coherency processor through the switching network through the network interface unit. The remote cache coherency processor here refers to the CC processor responsible for managing the remote host, which is the host where the memory to be accessed is located.
步骤 309 , 远端的緩存一致性处理器接收到内存访问请求后, 将内存访 问请求交给其中的本地代理子模块进行处理。  Step 309: After receiving the memory access request, the remote cache coherency processor hands the memory access request to the local proxy sub-module for processing.
步骤 31 0 , 远端的緩存一致性处理器的本地代理子模块判断其本地的 CC 目录是否命中。 远端的緩存一致性处理器的本地代理子模块根据内存访问请 求的内存地址查询其本地的 CC 目录, 判断需要访问的内存的内存块的 Cache 状态是否为可读状态, 若为可读状态, 即表明本地 Cache目录命中, Cache 可用, 否则为未命中, Cache不可用。  Step 31 0: The local proxy submodule of the remote cache coherency processor determines whether its local CC directory hits. The local proxy submodule of the remote cache coherency processor queries its local CC directory according to the memory address of the memory access request, and determines whether the Cache state of the memory block of the memory to be accessed is readable, and if it is in a readable state, That is, the local Cache directory hits, the Cache is available, otherwise it is a miss, and the Cache is unavailable.
步骤 31 1 , 若 CC 目录没有命中, 则远端的緩存一致性处理器中的本地代 理子模块通过与主机进行接口的 10接口模块请求远端主机进行内存访问。远 端的緩存一致性处理器向远端主机发送请求, 访问内存访问请求中内存地址 的内存: 对于读指令, 获取内存访问请求中内存地址的内容, 对于写指令, 将要写入的内容写入主机内存地址。  Step 31: If the CC directory does not hit, the local proxy submodule in the remote cache coherency processor requests the remote host to perform memory access through the 10 interface module that interfaces with the host. The remote cache coherency processor sends a request to the remote host to access the memory of the memory address in the memory access request: for the read instruction, obtain the content of the memory address in the memory access request, and write the content to be written for the write instruction Host memory address.
步骤 312 , 远端的緩存一致性处理器对其本地的 CC 目录进行更新。 远端 的緩存一致性处理器对其本地的 CC目录中对应进行了内存读操作或写操作 的内存的内存块的 Cache状态信息进行更新, 即将本次内存读写的内容写入 Cache , 并更新 CC目录, 以便后续进行内存访问。 步骤 313 , 若 CC 目录命中, 则对于读指令, 远端的緩存一致性处理器直 接从 Cache中读取相应的内存值, 获取内存访问结果。 如果是写指令, 远端 的緩存一致性处理器将要写入的值写入到远端主机的内存中, 更新本地 Cache。 Step 312: The remote cache coherency processor updates its local CC directory. The remote cache coherency processor updates the Cache status information of the memory block corresponding to the memory in the local CC directory corresponding to the memory read operation or the write operation, and writes the content of the current memory read and write to the cache, and updates CC directory for subsequent memory access. Step 313: If the CC directory hits, for the read command, the remote cache coherency processor directly reads the corresponding memory value from the Cache to obtain a memory access result. If it is a write instruction, the remote cache coherency processor writes the value to be written to the memory of the remote host, updating the local cache.
步骤 314 , 对于读指令, 远端的緩存一致性处理器将获取的内存访问结 果返回给本地的緩存一致性处理器。 远端的緩存一致性处理器将读取到的内 存的内容通过网络接口单元经过交换网络返回给本地的緩存一致性处理器, 本地的緩存一致性处理器进行 CC目录中 Cache状态的更新。  Step 314: For the read instruction, the remote cache coherency processor returns the obtained memory access result to the local cache coherency processor. The remote cache coherency processor returns the content of the read memory to the local cache coherency processor through the network interface unit through the switching network, and the local cache coherency processor updates the Cache state in the CC directory.
步骤 315 , 对于读指令, 本地的緩存一致性处理器将内存访问结果返回 给发起内存访问事件的虚拟机。 本地的緩存一致性处理器接收远端的緩存一 致性处理器返回的内存访问结果,通过负责与主机接口的 10接口单元将内存 访问结果反馈给主机的 Doma i n 0 , 由 Doma i n 0处理后反馈给主机的  Step 315: For the read instruction, the local cache coherency processor returns the memory access result to the virtual machine that initiated the memory access event. The local cache coherency processor receives the memory access result returned by the remote cache coherency processor, and feeds the memory access result to the host's Doma in 0 through the 10-interface unit responsible for the interface with the host, and the feedback is processed by Doma in 0. Give the host
Hyperv i sor , 并最终返回给发起内存访问事件的 VM。 Hyperv i sor , and ultimately returned to the VM that initiated the memory access event.
本发明实施例提供的聚合虚拟化中内存共享的方法, 通过主机的 Hyperv i sor 将内存处理命令发送给緩存一致性处理器, 并由緩存一致性处理 器进行 CC处理, 避免了聚合虚拟化中在主机上通过软件实现 CC处理而导致 的占用较多处理器资源, 引起系统性能下降的问题, 从而能够提升系统处理 性能, 缩短内存访问时间。  The method for sharing memory in the aggregation virtualization provided by the embodiment of the present invention sends the memory processing command to the cache coherency processor through the Hyperv i sor of the host, and performs CC processing by the cache coherency processor, thereby avoiding aggregation virtualization. The CPU processing on the host implements CPU processing, which causes more processor resources and causes system performance degradation. This improves system processing performance and shortens memory access time.
图 5为本发明实施例 4的一种聚合虚拟化中内存共享的方法流程图。 如 图所示, 该方法具体为:  FIG. 5 is a flowchart of a method for memory sharing in an aggregated virtualization according to Embodiment 4 of the present invention. As shown in the figure, the method is specifically as follows:
步骤 401 ~ 402 ,具体的实施技术方案与本发明实施例 3的步骤 301 ~ 302 对应相同, 此处不再贅述。  The steps 401-402 are the same as the steps 301-302 of the embodiment 3 of the present invention, and are not described here.
步骤 403 , 主机的虚拟机管理器中的 DSM接口调用 Doma inO中的 PC IE to MEM的驱动, 通过 PCI E端口向本地的緩存一致性处理器发送内存访问请求。 緩存一致性处理器中负责与主机接口的 10接口单元接收内存访问请求。  Step 403: The DSM interface in the host virtual machine manager invokes the PC IE to MEM driver in the Doma inO, and sends a memory access request to the local cache coherency processor through the PCI E port. The 10 interface unit responsible for interfacing with the host in the cache coherency processor receives the memory access request.
步骤 404 , 本地的緩存一致性处理器判断内存访问请求是否是访问本主 机上的内存。 本地的緩存一致性处理器接收到内存访问请求, 根据内存访问 请求中的内存地址信息判断是否是访问本主机上的内存。  Step 404: The local cache coherency processor determines whether the memory access request is accessing the memory on the host. The local cache coherency processor receives the memory access request and determines whether to access the memory on the host according to the memory address information in the memory access request.
步骤 405 , 若是访问本主机上的内存, 本地的緩存一致性处理器将内存 访问请求交给其中的本地代理子模块进行处理。 Step 405, if the memory on the host is accessed, the local cache coherency processor will store the memory. The local proxy submodule to which the access request is handed over is processed.
步骤 406, 本地的緩存一致性处理器的本地代理子模块判断其本地的 CC 目录是否命中。本地代理子模块查询其本地的 CC目录,根据内存访问请求的 内存地址查询本地的 CC目录,判断需要访问的内存的内存块的 Cache状态是 否为可读状态, 若为可读状态, 即表明本地 Cache目录命中, Cache可用, 否则为未命中。  Step 406: The local proxy sub-module of the local cache coherency processor determines whether the local CC directory is hit. The local proxy sub-module queries its local CC directory, queries the local CC directory according to the memory address of the memory access request, and determines whether the Cache state of the memory block of the memory to be accessed is readable. If it is in a readable state, it indicates local. The Cache directory hits, the Cache is available, otherwise it is a miss.
步骤 407, 若 CC 目录没有命中, 则本地的緩存一致性处理器请求本主机 进行内存访问。 緩存一致性处理器向主机发送请求, 访问内存访问请求中内 存地址的内存, 获取内存访问结果。  Step 407: If the CC directory does not hit, the local cache coherency processor requests the host to perform memory access. The cache coherency processor sends a request to the host to access the memory of the memory address in the memory access request to obtain the memory access result.
步骤 408, 本地的緩存一致性处理器根据内存访问结果对其本地的 CC 目 录进行更新。 本地的緩存一致性处理器将内容写入到主机的内存中, 并且刷 新本地的 CC目录中对应的内存块的 Cache状态信息。  Step 408: The local cache coherency processor updates its local CC directory according to the memory access result. The local cache coherency processor writes the content to the host's memory and flushes the Cache status information of the corresponding memory block in the local CC directory.
步骤 409, 若 CC 目录命中, 则本地的緩存一致性处理器直接进行緩存访 问, 对于读指令, 获取内存访问结果, 对于写指令, 将内容写入到主机的内 存中, 更新原 Cache中的内容。  Step 409: If the CC directory hits, the local cache coherency processor directly performs cache access, obtains a memory access result for the read command, writes the content to the host memory for the write command, and updates the content in the original cache. .
步骤 410, 若不是访问本主机上的内存, 本地的緩存一致性处理器通过 交换网络访问远端的緩存一致性处理器。 本地的緩存一致性处理器将需要访 问其他主机上内存的内存访问请求交给其中的远端代理子模块负责处理, RP 子模块通过网络接口单元经过交换网络访问远端的緩存一致性处理器。 这里 的远端的緩存一致性处理器是指负责管理远端主机的 CC处理器,该远端主机 就是内存访问请求要访问的内存所在的主机。 本实施例中为便于区分, 将发 出内存请求命令的主机所对应的緩存一致性处理器称为本地的緩存一致性处 理器, 将需要访问的内存所在的远端主机所对应的緩存一致性处理器称为远 端的緩存一致性处理器。  Step 410: If the memory on the host is not accessed, the local cache coherency processor accesses the remote cache coherency processor through the switched network. The local cache coherency processor handles the remote proxy sub-module to which the memory access request for accessing the memory on other hosts is handled. The RP sub-module accesses the remote cache coherency processor through the switching network through the network interface unit. The remote cache coherency processor here refers to the CC processor responsible for managing the remote host, which is the host where the memory access request is to be accessed. In this embodiment, for convenience of distinction, the cache coherency processor corresponding to the host that issues the memory request command is referred to as a local cache coherency processor, and the cache coherency corresponding to the remote host where the memory to be accessed is located is processed. This is called the remote cache coherency processor.
411 ~ 417,具体的实施技术方案与本发明实施例 3的步骤 309 ~ 315
Figure imgf000019_0001
411 ~ 417, specific implementation technical solutions and steps 309 ~ 315 of Embodiment 3 of the present invention
Figure imgf000019_0001
本发明实施例提供的聚合虚拟化中内存共享的方法, 通过主机的 Hypervisor 将内存处理命令发送给緩存一致性处理器, 并由緩存一致性处理 器进行 CC处理, 避免了聚合虚拟化中在主机上通过软件实现 CC处理而导致 的占用较多处理器资源, 引起系统性能下降的问题, 从而能够提升系统处理 性能, 缩短内存访问时间。 The method for sharing memory in the aggregation virtualization provided by the embodiment of the present invention sends a memory processing command to the cache coherency processor through the host hypervisor, and performs CC processing by the cache coherency processor, thereby avoiding the host in the aggregation virtualization process. Caused by CC processing through software It takes up more processor resources and causes system performance degradation, which can improve system processing performance and shorten memory access time.
图 6为本发明实施例 5提供的緩存一致性处理器的结构图,如图 6所示: 緩存一致性处理器 50 , 包括输入输出单元 (简称 10单元) 51和目录管理单 元 52 , 緩存一致性处理单元 53。 其中,  FIG. 6 is a structural diagram of a cache coherency processor according to Embodiment 5 of the present invention, as shown in FIG. 6. The cache coherency processor 50 includes an input/output unit (referred to as 10 units) 51 and a directory management unit 52, and the cache is consistent. Sex processing unit 53. among them,
10单元 51 , 用于接收主机的虚拟机管理器发送的内存处理命令。 10单 元提供了緩存一致性处理单元和主机交互的接口, 其主要的功能就是完成緩 存一致性处理单元和主机(具体可以是主机中的中央处理器)之间的通信。 当主机上的虚拟机进行内存访问时,主机上的 Hyperv i sor会截获到虚拟机的 内存访问事件,即获得虚拟机的内存访问请求,内存访问请求中包含要访问的 内存地址信息, 可以为内存读指令或内存写指令。 优选的, 虚拟机管理器根 据获得的内存访问请求通过 PCI E端口向緩存一致性处理器中的 10单元发送 内存处理命令, 10单元接收到该内存处理命令。这里的 PC IE端口指采用 PCIE 协议进行通信的端口, 当然,虚拟机管理器也可能采用 PC IE端口以外的其他 通信协议端口向 10单元发送内存处理命令, PCI E协议作为一种较为通用的 国际标准, 10单元采用 PC IE端口可以避免采用私有协议带来的不兼容升级 风险和成本, 为便于描述, 本发明实施例中采用 PC IE端口进行描述, 并不对 本发明的保护范围造成限制。  10 unit 51, used to receive the memory processing command sent by the host's virtual machine manager. The 10 unit provides an interface for the cache coherency processing unit to interact with the host. Its main function is to complete communication between the cache coherency processing unit and the host (specifically, the central processor in the host). When the virtual machine on the host performs memory access, the Hyperv i sor on the host intercepts the memory access event of the virtual machine, that is, obtains the memory access request of the virtual machine, and the memory access request includes the memory address information to be accessed, which may be Memory read instruction or memory write instruction. Preferably, the virtual machine manager sends a memory processing command to the 10 units in the cache coherency processor through the PCI E port according to the obtained memory access request, and the 10 unit receives the memory processing command. The PC IE port here refers to the port that uses the PCIE protocol for communication. Of course, the virtual machine manager may also send memory processing commands to 10 units using other communication protocol ports other than the PC IE port. The PCI E protocol is a more general international. In the standard, the use of the PC IE port in the 10th unit can avoid the risk of the incompatible upgrade caused by the proprietary protocol. For the convenience of description, the description is made by using the PC IE port in the embodiment of the present invention, which does not limit the protection scope of the present invention.
緩存一致性处理单元 53 , 用于根据 10单元 51接收到的内存处理命令进 行緩存一致性处理, 若接收到的内存处理命令为主机的虚拟机管理器发送的 Cache状态更新信息, 则緩存一致性处理单元用于根据 Cache状态更新信息, 发送緩存一致性目录更新指令给目录管理单元 52对本地的緩存一致性目录 进行更新; 若接收到的内存处理命令为主机上的虚拟机的内存访问请求时, 緩存一致性处理单元 53用于进行緩存一致性处理,访问内存访问请求中的内 存地址信息对应的内存, 此处的内存地址信息对应的内存是指内存处理请求 中的内存地址信息对应的内存资源所在的主机上的内存。  The cache consistency processing unit 53 is configured to perform cache consistency processing according to the memory processing command received by the 10 unit 51, and if the received memory processing command is the Cache status update information sent by the host virtual machine manager, the cache consistency is performed. The processing unit is configured to send a cache consistent directory update command to the directory management unit 52 to update the local cache consistent directory according to the Cache status update information; if the received memory processing command is a memory access request of the virtual machine on the host The cache coherency processing unit 53 is configured to perform cache coherency processing, and access the memory corresponding to the memory address information in the memory access request, where the memory corresponding to the memory address information refers to the memory corresponding to the memory address information in the memory processing request. The memory on the host where the resource is located.
目录管理单元 52 , 用于根据緩存一致性处理单元 53的緩存一致性目录 更新指令对本地的緩存一致性目录进行更新。 緩存一致性目录中记录了整个 系统中共享内存的 Cache状态, 记录着内存的内存块的 Cache状态信息和当 前拷贝信息, 其中, Cache状态信息表示本地的 Cache的状态, 例如独占、 共享、 无效等状态。 当前拷贝信息指明哪些主机保存有该内存块的拷贝, 这 些主机对应的緩存一致性处理器的本地的緩存一致性目录中会有该内存块的 信息。 每个緩存一致性处理器的目录管理单元, 用于维护着自己本地的緩存 一致性目录, 当内存状态发生改变时, 緩存一致性目录的 Cache状态信息也 需要进行刷新, 例如, 在对应的主机执行了内存写操作以后, 目录管理单元 用于更新其本地的緩存一致性目录中进行了写操作的内存的内存块的 Cache 状态信息。 这里, 目录管理单元用于根据緩存一致性目录更新指令中的内存 块地址信息和 Cache状态信息, 更新緩存一致性目录中进行了该内存块的 Cache状态信息。 具体的, 目录管理单元, 用于根据内存块地址信息, 确定 本地的緩存一致性目录中内存块地址信息对应的内存块的记录, 根据緩存状 态更新信息中的緩存状态信息更新该内存块的记录中的緩存状态信息, 并根 据该内存块的记录中的当前拷贝信息, 确定保存有该内存块的拷贝的其他主 机,通知其他主机对应的緩存一致性处理器更新各自本地的緩存一致性目录。 The directory management unit 52 is configured to update the local cache coherency directory according to the cache coherency directory update instruction of the cache coherency processing unit 53. The cache consistency directory records the Cache status of the shared memory in the entire system, and records the Cache status information of the memory block of the memory and when Pre-copy information, where the Cache status information indicates the status of the local Cache, such as exclusive, shared, invalid, and so on. The current copy information indicates which hosts have a copy of the memory block, and the cache coherency processor corresponding to the host has the information of the memory block in the local cache coherency directory. The directory management unit of each cache coherency processor is used to maintain its own local cache coherency directory. When the memory state changes, the Cache state information of the cache coherency directory also needs to be refreshed, for example, in the corresponding host. After the memory write operation is performed, the directory management unit is used to update the Cache status information of the memory block of the memory in the local cache coherency directory that has been written. Here, the directory management unit is configured to update the cache state information of the memory block in the cache consistency directory according to the memory block address information and the Cache state information in the cache consistency directory update instruction. Specifically, the directory management unit is configured to determine, according to the memory block address information, a record of the memory block corresponding to the memory block address information in the local cache coherency directory, and update the record of the memory block according to the cache status information in the cache status update information. The cache state information in the cache, and according to the current copy information in the record of the memory block, determine other hosts that hold the copy of the memory block, and notify the cache coherency processors corresponding to other hosts to update their respective local cache coherency directories.
优选的, 当内存处理命令为虚拟机的内存访问请求时, 緩存一致性处理 单元 53用于进行緩存一致性处理,访问内存访问请求中的内存地址信息对应 的内存,具体为: 若需要访问的内存地址信息对应的内存是本主机上的内存, 用于进行緩存一致性处理, 对本主机的内存进行访问: 如果内存访问请求是 写内存指令, 緩存一致性处理单元, 用于将内容写入本主机上的对应内存, 可以由緩存一致性处理单元通过 10单元通知 Hyper v i sor ^夺内容写人本机的 内存, 或者由緩存一致性处理单元通过 10单元直接将内容写入本主机的内 存, 并进一步的, 緩存一致性处理单元, 还用于发送緩存一致性目录更新指 令通知目录管理单元刷新本地的 CC目录中对应进行了写操作的内存的内存 块的 Cache状态信息。 目录管理单元, 用于根据接收的緩存一致性目录更新 指令通知刷新本地的 CC 目录中对应进行了写操作的内存的内存块的 Cache 状态信息; 如果内存访问请求是读内存指令, 緩存一致性处理单元用于根据 緩存一致性目录中相应内存的内存块的 Cache状态信息通过 10单元通知主机 的虚拟机管理器进行内存读取, 并由主机的虚拟机管理器将读取的信息发送 给发出内存访问请求的虚拟机。 若需要访问的内存是其他主机上的内存, 则 緩存一致性处理单元用于进行緩存一致性处理,通过网络接口单元 54经交换 网络访问内存处理请求的内存地址信息对应的内存所在主机上的内存。此时, 緩存一致性处理器 50中, 还包含网络接口单元 54 , 用于提供緩存一致性处 理单元与其他緩存一致性处理器间的通信, 将緩存一致性处理单元的信息通 过交换网络发送给其他緩存一致性处理器, 将从交换网络接收的其他緩存一 致性处理器的信息传递给緩存一致性处理单元。此处的交换网络可以为 PCI E 交换机、 Inf iniband交换机或者以太网交换机, 緩存一致性处理器 50是通过 交换网络与内存地址信息对应的内存所在主机连接的緩存一致性处理器进行 通信, 实现对内存地址信息对应的内存所在主机上的内存的访问, 具体为, 緩存一致性处理单元, 用于进行緩存一致性处理, 通过所述网络接口单元经 所述交换网络与所述内存地址信息对应的所述其他主机连接的緩存一致性处 理器进行通信, 访问所述内存地址信息对应的所述其他主机上的内存。 为了 描述方便, 可以将内存地址信息对应的内存所在的其他主机称作远端主机, 发出内存访问请求的主机称作本地主机。 如果内存访问请求是写内存指令, 緩存一致性处理单元需要通知目录管理单元刷新本地的 CC 目录中对应进行 了写操作的内存的内存块的 Cache状态信息,并通过 10单元通知远端主机对 应的 CC处理器将需要写入的内容写入远端主机的内存,如果内存访问请求是 读内存指令, 发出内存访问请求的緩存一致性处理单元还用于通知远端主机 对应的 CC处理器进行内存访问,并从与远端主机相连的緩存一致性处理器接 收内存访问结果, 并发送给发出内存访问请求的主机的虚拟机管理器, 由虚 拟机管理器将读取的信息送给发出内存访问请求的虚拟机, 其中, 内存访问 结果是远端主机相连的緩存一致性处理根据内存访问请求和其本地的 CC目 录从内存中读取的。 CC处理的进一步技术细节遵循业界通用的 CC处理协议, 本处不再赘述。 Preferably, when the memory processing command is a memory access request of the virtual machine, the cache coherency processing unit 53 is configured to perform cache coherency processing, and access the memory corresponding to the memory address information in the memory access request, specifically: if access is required The memory corresponding to the memory address information is the memory on the host, used for cache coherency processing, and accesses the memory of the host: If the memory access request is a write memory instruction, the cache coherency processing unit is used to write the content into the host. The corresponding memory on the host can be notified by the cache coherency processing unit through 10 units to capture the memory of the local writer, or the cache coherency processing unit directly writes the content into the memory of the host through 10 units. Further, the cache consistency processing unit is further configured to send a cache consistency directory update instruction to notify the directory management unit to refresh the Cache state information of the memory block corresponding to the memory in the local CC directory corresponding to the write operation. a directory management unit, configured to notify, according to the received cache consistency directory update instruction, the Cache status information of the memory block corresponding to the memory in the local CC directory corresponding to the write operation; if the memory access request is a read memory instruction, the cache consistency processing The unit is configured to notify the host's virtual machine manager of the memory reading according to the Cache status information of the corresponding memory block in the cache coherency directory, and the host virtual machine manager sends the read information to the issuing memory. Access the requested virtual machine. If the memory that needs to be accessed is memory on another host, then The cache coherency processing unit is configured to perform cache coherency processing, and access the memory on the host where the memory corresponding to the memory address information of the memory processing request is accessed by the network interface unit 54 via the switching network. At this time, the cache coherency processor 50 further includes a network interface unit 54 for providing communication between the cache coherency processing unit and other cache coherency processors, and transmitting the information of the cache coherency processing unit to the exchange network. Other cache coherency processors pass information from other cache coherency processors received from the switched network to the cache coherency processing unit. The switching network here may be a PCI E switch, an Inf iniband switch, or an Ethernet switch. The cache coherency processor 50 communicates by using a cache coherency processor connected to the host where the memory corresponding to the memory address information is exchanged. The access of the memory on the host where the memory corresponding to the memory address information is located, specifically, the cache consistency processing unit is configured to perform cache consistency processing, and the network interface unit corresponds to the memory address information through the switching network. The cache coherency processor connected to the other host communicates to access the memory on the other host corresponding to the memory address information. For convenience of description, other hosts in which the memory corresponding to the memory address information is located may be referred to as a remote host, and a host that issues a memory access request is referred to as a local host. If the memory access request is a write memory instruction, the cache coherency processing unit needs to notify the directory management unit to refresh the Cache state information of the memory block corresponding to the memory in the local CC directory corresponding to the write operation, and notify the remote host correspondingly through the 10 unit. The CC processor writes the content to be written to the memory of the remote host. If the memory access request is a read memory instruction, the cache coherency processing unit that issues the memory access request is further used to notify the remote host of the corresponding CC processor to perform memory. Accessing, and receiving a memory access result from a cache coherency processor connected to the remote host, and sending the result to the virtual machine manager of the host that issued the memory access request, and the virtual machine manager sends the read information to the memory access The requested virtual machine, wherein the memory access result is that the cache coherency processing of the remote host is read from the memory according to the memory access request and its local CC directory. Further technical details of CC processing follow the industry-wide CC processing protocol, and will not be repeated here.
进一步的, 目录管理单元用于根据接收到的所述緩存一致性目录更新指 令更新其本地的緩存一致性目录中进行了写操作的内存的内存块的 Cache状 态信息, 并根据緩存一致性目录中该内存的内存块的当前拷贝信息通知緩存 了该内存的内存块的拷贝的其他主机对应的 CC处理器也进行各自本地的緩 存一致性目录的刷新, 具体可以发送消息给緩存一致性处理单元, 经网络接 口单元发送相关消息给其他 CC处理器。 Further, the directory management unit is configured to update the Cache state information of the memory block of the memory in the local cache coherency directory according to the received cache coherency directory update instruction, and according to the cache coherency directory The current copy information of the memory block of the memory notifies that the CC processor corresponding to the other host that caches the copy of the memory block of the memory also refreshes the local cache coherency directory, and may send a message to the cache coherency processing unit. Connected via the network The port unit sends relevant messages to other CC processors.
优选的, 主机的虚拟机管理器获得虚拟机的内存访问请求, 可以先根据 内存访问请求中的内存地址信息判断该内存访问请求需要访问的内存是否为 本主机上的内存, 如果是, 则根据内存访问请求对本机上的内存进行访问: 当为内存写指令时, 虚拟机管理器将需要写入的内容写到相应的内存地址, 并将緩存状态更新信息通过 PC I E端口发送给緩存一致性处理器中的 10单元, 其中, 緩存状态更新信息中包括内存块地址信息和 Cache状态信息, Cache 状态信息的值表明写入数据后, Cache是什么状态, 可以为: 独占、 共享、 无效等 Cache状态中的一种;当为内存读指令时,虚拟机管理器通过 10单元、 緩存一致性处理单元查询緩存一致性处理器中的目录管理单元中的緩存一致 性目录,根据 CC目录中相应内存的内存块的 Cache状态信息从内存中读取要 访问的内容。 如果需要访问的内存不是本主机上的内存, 则将虚拟机的内存 访问请求通过 10单元发送给緩存一致性处理单元。也可以如下处理,主机的 虚拟机管理器获得虚拟机的内存访问请求后, 不进行判断, 直接通过 PC I E 端口将虚拟机的内存访问请求通过 10单元发送给緩存一致性处理器。 可见, 緩存一致性处理器的 10单元接收到的主机上的虚拟机管理器发送的内存处 理命令, 可能为虚拟机的内存访问请求, 也可能是主机的虚拟机管理器进行 内存访问后的 Cache状态更新信息。  Preferably, the virtual machine manager of the host obtains a memory access request of the virtual machine, and first determines, according to the memory address information in the memory access request, whether the memory that the memory access request needs to access is the memory on the host, and if so, according to The memory access request accesses the memory on the local device: When writing the instruction for the memory, the virtual machine manager writes the content to be written to the corresponding memory address, and sends the cache status update information to the cache consistency processing through the PC IE port. 10 units in the device, wherein the cache status update information includes memory block address information and Cache status information, and the value of the Cache status information indicates what state the Cache is after writing the data, which may be: exclusive, shared, invalid, etc. One of the following; when reading instructions for memory, the virtual machine manager queries the cache coherency directory in the directory management unit in the cache coherency processor through the 10-unit, cache coherency processing unit, according to the corresponding memory in the CC directory. Cache status information of the memory block is read from the memory to be accessed. Content. If the memory to be accessed is not the memory on the host, the virtual machine's memory access request is sent to the cache coherency processing unit through 10 units. It can also be processed as follows. After the virtual machine manager of the host obtains the memory access request of the virtual machine, the memory access request of the virtual machine is directly sent to the cache coherency processor through the PC I E port through the PC I E port. It can be seen that the memory processing command sent by the virtual machine manager on the host received by the cache unit of the cache coherency processor may be a memory access request of the virtual machine, or may be a cache after the memory access of the host virtual machine manager. Status update information.
本发明实施例提供的緩存一致性处理器, 接收主机的 Hyperv i sor发送的 内存处理命令, 根据内存处理命令进行緩存一致性处理, 避免了在主机上通 过软件实现聚合虚拟化中的 C C处理而导致的占用较多处理器资源,引起系统 性能下降的问题, 从而能够提升系统处理性能, 缩短内存访问时间。  The cache coherency processor provided by the embodiment of the present invention receives the memory processing command sent by the host's Hyperv i sor, performs cache coherency processing according to the memory processing command, and avoids implementing CC processing in the aggregate virtualization by software on the host. As a result, it takes up more processor resources and causes system performance degradation, which can improve system processing performance and shorten memory access time.
图 7为本发明实施例 6的緩存一致性处理器的结构图。 在图 6所示的实 施例 5的 CC处理器的基础上, 本发明实施例的緩存一致性处理单元 53中包 括:  FIG. 7 is a structural diagram of a cache coherency processor according to Embodiment 6 of the present invention. On the basis of the CC processor of the embodiment 5 shown in FIG. 6, the cache coherency processing unit 53 of the embodiment of the present invention includes:
预处理子模块 530 , 用于与 10单元、 本地代理子模块 531、 远端代理子 模块 532连接, 负责 10单元与本地代理子模块、远端代理子模块之间的报文 传递, 接收 10单元发送的信息并转发给本地代理子模块或远端代理子模块, 以及接收本地代理子模块或远端代理子模块发送的信息并转发给 10单元。 本地代理子模块 5 31 , 用于处理对本主机的内存访问请求。 具体为, 用 于根据预处理子模块接收到的 10单元发送的内存处理命令进行緩存一致性 处理, 若接收到的内存处理命令为主机的虚拟机管理器发送的 Cache状态更 新信息, 则根据 Cache状态更新信息, 发送緩存一致性目录更新指令给目录 管理单元 52对本地的緩存一致性目录进行更新;若接收到的内存处理命令为 主机上的虚拟机的内存访问请求, 且此处内存访问请求中的内存地址信息对 应的内存是本主机上的内存, 则本地代理子模块用于进行緩存一致性处理, 对本主机的内存进行访问: 如果内存访问请求是写内存指令, 本地代理子模 块用于将内容写入本主机上的对应内存,可以通过预处理子模块经 10单元通 知 Hyperv i sor将内容写入本机的内存,或者由本地代理子模块通过预处理子 模块经 10单元直接将内容写入本主机的内存,并进一步的 ,本地代理子模块, 还用于发送緩存一致性目录更新指令通知目录管理单元刷新本地的 CC目录 中对应进行了写操作的内存的内存块的 Cache状态信息。 如果内存访问请求 是读内存指令, 本地代理子模块用于根据緩存一致性目录中相应内存的内存 块的 Cache状态信息通过预处理子模块经 10单元通知主机的虚拟机管理器进 行内存读取, 并由主机的虚拟机管理器将读取的信息发送给发出内存访问请 求的虚拟机。 当然,本地代理子模块也可以接收网络接口单元 54传递的其他 主机的内存访问请求, 而且内存访问请求中的内存地址信息对应的内存是本 主机上的内存, 则本地代理子模块用于根据其他主机的内存访问请求进行緩 存一致性处理, 对本主机的内存进行访问。 The pre-processing sub-module 530 is configured to be connected to the 10-unit, the local proxy sub-module 531, and the remote proxy sub-module 532, and is responsible for packet transmission between the 10-unit and the local proxy sub-module and the remote proxy sub-module, and receives 10 units. The sent information is forwarded to the local proxy submodule or the remote proxy submodule, and the information sent by the local proxy submodule or the remote proxy submodule is received and forwarded to the 10 unit. The local proxy submodule 5 31 is configured to process a memory access request to the host. Specifically, the method is configured to perform cache consistency processing according to the memory processing command sent by the 10 units received by the preprocessing submodule, and if the received memory processing command is the Cache status update information sent by the virtual machine manager of the host, according to the Cache Status update information, the send cache coherency directory update command to the directory management unit 52 to update the local cache coherency directory; if the received memory processing command is a memory access request of the virtual machine on the host, and the memory access request here The memory corresponding to the memory address information is the memory on the host, and the local proxy sub-module is used for cache coherency processing to access the memory of the host: If the memory access request is a write memory instruction, the local proxy sub-module is used The content is written into the corresponding memory on the host, and the content of the Hyperv i sor can be written to the local memory through the pre-processing sub-module via the 10-unit unit, or the content can be directly directly processed by the local proxy sub-module through the pre-processing sub-module through 10 units. Write to the host's memory, and further, the local proxy submodule, For transmitting a directory update instruction cache coherency directory managing unit notifies the refresh local directory corresponding CC were Cache memory state information of memory block write operation. If the memory access request is a read memory instruction, the local proxy sub-module is configured to notify the host's virtual machine manager of the memory read by the pre-processing sub-module according to the Cache state information of the corresponding memory block in the cache coherency directory. The read information is sent by the host's virtual machine manager to the virtual machine that issued the memory access request. Of course, the local proxy sub-module can also receive the memory access request of other hosts transmitted by the network interface unit 54, and the memory corresponding to the memory address information in the memory access request is the memory on the host, and the local proxy sub-module is used according to other The host's memory access request is cache-consistent and accesses the host's memory.
远端代理子模块 5 32 , 用于处理对其他主机的内存访问请求。 若接收到 的预处理模块转发的 10单元发送的内存处理命令为主机上的虚拟机的内存 访问请求, 且此处内存访问请求中的内存地址信息对应的内存是其他主机上 的内存, 则远端代理子模块进行緩存一致性处理,通过网络接口单元 54经交 换网络访问内存处理请求的内存地址信息对应的内存所在主机上的内存, 并 将从交换网络接收的其他主机的信息传递给预处理子模块。 CC处理的进一步 技术细节遵循业界通用的 CC处理协议,本处不再贅述。緩存一致性处理器的 各部分的功能的实现细节与前面实施例 1至实施例 5相同的部分, 可以参看 前面实施例的描述, 本处也不再贅述。 本发明实施例提供的緩存一致性处理器, 接收主机的 Hypervi sor发送的 内存处理命令, 根据内存处理命令进行緩存一致性处理, 避免了在主机上通 过软件实现聚合虚拟化中的 C C处理而导致的占用较多处理器资源,引起系统 性能下降的问题, 从而能够提升系统处理性能, 缩短内存访问时间, 并通过 本地代理子模块和远端代理子模块分别处理本地内存访问和远端内存访问, 进 一步提升了处理器的处理性能。 The remote proxy submodule 5 32 is configured to process a memory access request to other hosts. If the received memory processing command sent by the 10 units sent by the preprocessing module is a memory access request of the virtual machine on the host, and the memory corresponding to the memory address information in the memory access request is the memory on the other host, then the far The end proxy sub-module performs cache coherency processing, accesses the memory on the host where the memory corresponding to the memory address information of the memory processing request is accessed through the network interface unit 54, and transfers the information of other hosts received from the switching network to the pre-processing Submodule. Further technical details of CC processing follow the industry-wide CC processing protocol, and will not be repeated here. The implementation details of the functions of the parts of the cache coherency processor are the same as those of the previous embodiment 1 to 5. The description of the previous embodiments can be referred to, and details are not described herein again. The cache coherency processor provided by the embodiment of the present invention receives the memory processing command sent by the Hypervi sor of the host, and performs cache coherency processing according to the memory processing command, thereby avoiding the CC processing in the aggregate virtualization by the software on the host. Occupy more processor resources, causing system performance degradation, which can improve system processing performance, shorten memory access time, and handle local memory access and remote memory access through local proxy sub-modules and remote proxy sub-modules, respectively. Further improve the processing performance of the processor.
图 8为本发明实施例 7的计算机系统图, 如图所示, 所述计算机系统包 括: 至少两个主机, 至少两个緩存一致性处理器和一个交换网络, 其中, 该 至少两个主机中的每个主机分别与该至少两个緩存一致性处理器中的一个緩 存一致性处理器相连,该至少两个緩存一致性处理器通过交换网络通信连接。  8 is a computer system diagram of Embodiment 7 of the present invention. As shown, the computer system includes: at least two hosts, at least two cache coherency processors, and a switching network, wherein the at least two hosts are Each host is connected to a cache coherency processor of the at least two cache coherency processors, respectively, and the at least two cache coherency processors are connected by a switched network communication.
所述至少两个主机中的第一主机, 用于发送内存处理命令给相连的所述 至少两个 CC处理器中的第一 CC处理器。 优选的, 当第一主机上的虚拟机进 行内存访问时, 第一主机上的 Hyperv i sor会截获到虚拟机的内存访问事件, 即获得虚拟机的内存访问请求,内存访问请求中包含要访问的内存地址信息, 可以为内存读指令或内存写指令,第一主机通过 PCI E端口向与其相连的第一 緩存一致性处理器发送内存处理命令。 当然, 第一主机也可能采用 PCI E端口 以外的其他通信协议端口向第一緩存一致性处理器发送内存处理命令, PC IE 协议作为一种较为通用的国际标准,采用 PC I E端口可以避免采用私有协议带 来的不兼容升级风险和成本, 为便于描述, 本发明实施例中采用 PCI E端口进 行描述, 并不对本发明的保护范围造成限制。 需要说明的是, 在本发明实施 例的描述的 "第一主机" 和 "第一緩存一致性处理器" , 仅为了描述上的方 便, 表示多个主机或多个緩存一致性处理器中的一个非特指的主机或緩存一 致性处理器, 并非特殊的主机或 CC处理器。  The first host of the at least two hosts is configured to send a memory processing command to the first one of the at least two CC processors that are connected. Preferably, when the virtual machine on the first host performs a memory access, the Hyperv i sor on the first host intercepts a memory access event of the virtual machine, that is, obtains a memory access request of the virtual machine, and the memory access request includes accessing The memory address information may be a memory read command or a memory write command, and the first host sends a memory processing command to the first cache coherency processor connected thereto through the PCI E port. Of course, the first host may also send a memory processing command to the first cache coherency processor by using a communication protocol port other than the PCI E port. The PC IE protocol is a relatively common international standard, and the PC IE port can be used to avoid private use. The incompatibility upgrade risk and cost brought by the protocol are described in the embodiment of the present invention by using the PCI E port for convenience of description, and do not limit the protection scope of the present invention. It should be noted that the "first host" and the "first cache coherency processor" described in the embodiments of the present invention are only for convenience of description, and represent multiple hosts or multiple cache coherency processors. An unspecified host or cache coherency processor, not a special host or CC processor.
所述第一緩存一致性处理器, 用于根据接收到的内存处理命令进行緩存 一致性处理, 具体为: 若内存处理命令为第一主机的虚拟机管理器发送的 Cache状态更新信息, 则第一緩存一致性处理器用于根据 Cache状态更新信 息对本地的緩存一致性目录进行更新。 緩存一致性目录中记录了整个系统中 共享内存的 Cache状态, 记录着内存的内存块的 Cache状态信息和当前拷贝 信息, 其中, Cache状态信息表示本地的 Cache的状态, 例如独占、 共享、 无效等状态。 当前拷贝信息指明哪些主机保存有该内存块的拷贝。 第一緩存 一致性处理器用于根据接收到的 Cache状态更新信息对本地的緩存一致性目 录进行更新, 具体可以为根据 Cache状态更新信息中携带的内存块地址信息 (即进行了写操作的内存块) 和 Cache状态信息, 更新緩存一致性目录中内 存块的 Cache状态信息。 进一步的, 第一緩存一致性处理器还用于根据緩存 一致性目录中该内存的内存块的当前拷贝信息通知所述至少一个主机中緩存 了该内存的内存块的拷贝的其他主机的 CC处理器也进行各自本地的緩存一 致性目录的刷新。 具体的, 第一緩存一致性处理器, 用于根据内存块地址信 息, 确定本地的緩存一致性目录中该内存块地址信息对应的内存块的记录, 根据该緩存状态更新信息中的緩存状态信息更新该内存块的记录中的緩存状 态信息, 并根据该内存块的记录中的当前拷贝信息, 确定保存有该内存块的 拷贝的该至少两个主机中第一主机以外的其他主机, 通知其他主机对应的緩 存一致性处理器更新各自本地的緩存一致性目录。 The first cache coherency processor is configured to perform cache coherency processing according to the received memory processing command, where: if the memory processing command is the Cache status update information sent by the virtual machine manager of the first host, A cache coherency processor is used to update the local cache coherency directory according to the Cache status update information. The Cache Consistency Directory records the Cache status of the shared memory in the entire system, and records the Cache status information and current copy information of the memory block. The Cache status information indicates the status of the local Cache, such as exclusive, shared, Invalid state. The current copy information indicates which hosts have a copy of the memory block. The first cache coherency processor is configured to update the local cache coherency directory according to the received Cache status update information, and specifically may be the memory block address information carried in the update information according to the Cache status (ie, the memory block that has been written) And Cache status information, updating the Cache status information of the memory block in the cache coherency directory. Further, the first cache coherency processor is further configured to notify, according to current copy information of the memory block of the memory in the cache coherency directory, CC processing of other hosts in the at least one host that have a copy of the memory block in which the memory is cached. The device also refreshes its local cache coherency directory. Specifically, the first cache consistency processor is configured to determine, according to the memory block address information, a record of the memory block corresponding to the memory block address information in the local cache coherency directory, and update the cache status information in the information according to the cache status. Updating the cache state information in the record of the memory block, and determining, according to the current copy information in the record of the memory block, another host other than the first host of the at least two hosts storing the copy of the memory block, notifying other The cache coherency processor corresponding to the host updates its own local cache coherency directory.
优选的, 第一主机的虚拟机管理器获得虚拟机的内存访问请求, 可以先 根据内存访问请求中的内存地址信息判断该内存访问请求需要访问的内存是 否为本主机上的内存, 如果是, 则根据内存访问请求对本机上的内存进行访 问: 当为内存写指令时, 第一主机的虚拟机管理器用于将需要写入的内容写 到相应的内存地址, 并将緩存 (Cache ) 状态更新信息通过 PC I E端口发送给 第一緩存一致性处理器, 其中, 緩存状态更新信息中包括内存块地址信息和 Cache状态信息, Cache状态信息的值表明写入数据后, Cache是什么状态, 可以为: 独占、 共享、 无效等 Cache状态中的一种; 当为内存读指令时, 第 一主机的虚拟机管理器查询第一緩存一致性处理器中的緩存一致性目录, 根 据 CC 目录中相应内存的内存块的 Ca che状态信息从内存中读取要访问的内 容。 如果需要访问的内存不是本主机上的内存, 则第一主机用于将虚拟机的 内存访问请求发送给第一緩存一致性处理器。 也可以如下处理, 第一主机的 虚拟机管理器获得虚拟机的内存访问请求后, 不进行判断, 直接通过 PC I E 端口将虚拟机的内存访问请求发送给第一緩存一致性处理器。  Preferably, the virtual machine manager of the first host obtains a memory access request of the virtual machine, and may first determine, according to the memory address information in the memory access request, whether the memory that the memory access request needs to access is the memory on the host, and if so, Accessing the memory on the local device according to the memory access request: When writing the instruction for the memory, the virtual machine manager of the first host is used to write the content to be written to the corresponding memory address, and the cache status update information is cached. The Cache status update information includes the memory block address information and the Cache status information, where the value of the Cache status information indicates the status of the Cache after the data is written, which may be: One of Cache states: exclusive, shared, invalid, etc.; when reading instructions in memory, the virtual machine manager of the first host queries the cache coherency directory in the first cache coherency processor, according to the corresponding memory in the CC directory The Cache status information of the memory block reads the content to be accessed from the memory. If the memory to be accessed is not the memory on the host, the first host is used to send the virtual machine's memory access request to the first cache coherency processor. Alternatively, after the virtual machine manager of the first host obtains the memory access request of the virtual machine, the virtual machine manager sends the memory access request of the virtual machine to the first cache coherency processor directly through the PC I E port.
若第一緩存一致性处理器接收的内存处理命令为主机上的虚拟机的内存 访问请求时, 第一緩存一致性处理器用于进行緩存一致性处理, 访问内存访 问请求中的内存地址信息对应的内存。 此处的内存地址信息对应的内存是指 内存处理请求中的内存地址信息对应的内存资源所在的主机上的内存。 具体 的, 若需要访问的内存地址信息对应的内存是第一主机上的内存, 第一緩存 一致性处理器进行緩存一致性处理, 对第一主机上的内存进行访问: 如果内 存访问请求是写内存指令, 第一緩存一致性处理器将内容写入第一主机的内 存,可以由第一緩存一致性处理器通知第一主机的 Hyperv i sor将内容写入本 机的内存, 或者由第一緩存一致性处理器直接将内容写入第一主机的内存, 并进一步的,第一緩存一致性处理器会刷新本地的 CC目录中对应进行了写操 作的内存的内存块的 Cache状态信息。 如果内存访问请求是读内存指令, 第 一緩存一致性处理器根据緩存一致性目录中相应内存的内存块的 Cache状态 信息通知第一主机的虚拟机管理器进行内存读取, 并由第一主机的虚拟机管 理器将读取的信息发送给发出内存访问请求的虚拟机。 若需要访问的内存是 第一主机以外的其他主机上的内存, 则第一緩存一致性处理器通过交换网络 访问内存处理请求的内存地址信息对应的内存所在的其他主机上的内存。 此 处的交换网络可以为 PCI E交换机、 Inf iniband交换机或者以太网交换机, 第 一緩存一致性处理器通过交换网络与内存地址信息对应的内存所在的其他主 机连接的緩存一致性处理器进行通信, 实现对内存地址信息对应的内存所在 的其他主机上的内存的访问。 如果内存访问请求是写内存指令, 第一緩存一 致性处理器用于刷新本地的 CC 目录中对应进行了写操作的内存的内存块的 Cache状态信息, 并通知内存地址信息对应的内存所在的其他主机对应的 CC 处理器, 由其将需要写入的内容写入该其他主机的緩存, 如果内存访问请求 是读内存指令, 发出内存访问请求的第一緩存一致性处理器通知内存地址信 息对应的内存所在的其他主机对应的 CC处理器进行内存访问,从与该其他主 机相连的緩存一致性处理器接收内存访问结果, 并发送给发出内存访问请求 的第一主机的虚拟机管理器, 由虚拟机管理器将读取的信息送给发出内存访 问请求的虚拟机, 其中, 内存访问结果是其他主机相连的緩存一致性处理器 根据内存访问请求和其本地的 CC目录从内存中读取的。本发明实施例中, CC 处理器进行 CC处理的进一步技术细节遵循业界通用的 CC处理协议, 本处不 再贅述。 本实施例中的緩存一致性处理器, 其具体的技术实现可以如本发明 实施例 5、 实施例 6中描述的緩存一致性处理器, 本处不再贅述。 本发明实施例提供的计算机系统, 通过主机的 Hyperv i sor将内存处理命 令发送给緩存一致性处理器, 由緩存一致性处理器根据内存处理命令进行緩 存一致性处理,避免了在主机上通过软件实现聚合虚拟化中的 CC处理而导致 的占用较多处理器资源, 引起系统性能下降的问题, 从而能够提升系统处理 性能, 缩短内存访问时间。 If the memory processing command received by the first cache coherency processor is a memory access request of the virtual machine on the host, the first cache coherency processor is configured to perform cache coherency processing, and access the memory access Ask the memory corresponding to the memory address information in the request. The memory corresponding to the memory address information herein refers to the memory on the host where the memory resource corresponding to the memory address information in the memory processing request is located. Specifically, if the memory corresponding to the memory address information to be accessed is the memory on the first host, the first cache coherency processor performs cache coherency processing to access the memory on the first host: if the memory access request is a write a memory instruction, the first cache coherency processor writes the content to the memory of the first host, and the first cache coherency processor notifies the first host of the Hyperv i sor to write the content into the local memory, or by the first The cache coherency processor directly writes the content to the memory of the first host, and further, the first cache coherency processor refreshes the Cache state information of the memory block corresponding to the memory in the local CC directory corresponding to the write operation. If the memory access request is a read memory instruction, the first cache coherency processor notifies the first host's virtual machine manager to perform memory read according to the Cache state information of the corresponding memory block in the cache coherency directory, and is configured by the first host The virtual machine manager sends the read information to the virtual machine that issued the memory access request. If the memory to be accessed is the memory on the host other than the first host, the first cache coherency processor accesses the memory on the other host where the memory corresponding to the memory address information of the memory processing request is accessed through the exchange network. The switching network here may be a PCI E switch, an Inf iniband switch or an Ethernet switch, and the first cache coherency processor communicates by using a cache coherency processor connected to another host where the memory corresponding to the memory address information is exchanged, Access to memory on other hosts where the memory corresponding to the memory address information is located. If the memory access request is a write memory instruction, the first cache coherency processor is configured to refresh the Cache state information of the memory block corresponding to the memory in the local CC directory, and notify the other host where the memory corresponding to the memory address information is located. The corresponding CC processor writes the content to be written to the cache of the other host. If the memory access request is a read memory instruction, the first cache coherency processor that issues the memory access request notifies the memory corresponding to the memory address information. The CC processor corresponding to the other host performs memory access, receives the memory access result from the cache coherency processor connected to the other host, and sends the result to the virtual machine manager of the first host that issues the memory access request, by the virtual machine The manager sends the read information to the virtual machine that issued the memory access request, wherein the memory access result is that the cache coherency processor connected to the other host reads from the memory according to the memory access request and its local CC directory. In the embodiment of the present invention, further technical details of the CC processing performed by the CC processor follow the CC processing protocol generally used in the industry, and details are not described herein again. The cache coherency processor in this embodiment may be implemented in accordance with the present invention. The cache coherency processor described in Embodiment 5 and Embodiment 6 is not described herein again. The computer system provided by the embodiment of the present invention sends a memory processing command to a cache coherency processor through a Hyperv i sor of the host, and the cache coherency processor performs cache coherency processing according to the memory processing command, thereby avoiding passing the software on the host. The CPU processing in the aggregation virtualization process occupies more processor resources and causes system performance degradation, thereby improving system processing performance and shortening memory access time.
通过以上的实施方式的描述, 所属领域的技术人员可以清楚地了解到本 发明可以用硬件实现, 或固件实现, 或它们的组合方式来实现。 当使用软件 实现时, 可以将上述功能存储在计算机可读介质中或作为计算机可读介质上 的一个或多个指令或代码进行传输。 计算机可读介质包括计算机存储介质和 通信介质, 其中通信介质包括便于从一个地方向另一个地方传送计算机程序 的任何介质。 存储介质可以是计算机能够存取的任何可用介质。 以此为例但 不限于: 计算机可读介质可以包括 RAM、 ROM, EEPR0M、 CD-ROM或其他光盘存 储、 磁盘存储介质或者其他磁存储设备、 或者能够用于携带或存储具有指令 或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质。 此 夕卜。 任何连接可以适当的成为计算机可读介质。 例如, 如果软件是使用同轴 电缆、 光纤光缆、 双绞线、 数字用户线(DSL )或者诸如红外线、 无线电和微 波之类的无线技术从网站、 服务器或者其他远程源传输的, 那么同轴电缆、 光纤光缆、 双绞线、 DSL或者诸如红外线、 无线和微波之类的无线技术包括 在所属介质的定影中。 如本发明所使用的, 盘 (D i sk ) 和碟(d i s c ) 包括压 缩光碟(CD ) 、 激光碟、 光碟、 数字通用光碟(DVD ) 、 软盘和蓝光光碟, 其 中盘通常磁性的复制数据, 而碟则用激光来光学的复制数据。 上面的组合也 应当包括在计算机可读介质的保护范围之内。  From the description of the above embodiments, it will be apparent to those skilled in the art that the present invention can be implemented in hardware, or firmware implementation, or a combination thereof. When implemented in software, the functions described above may be stored in or transmitted as one or more instructions or code on a computer readable medium. Computer readable media includes both computer storage media and communication media including any medium that facilitates transfer of a computer program from one location to another. A storage medium may be any available media that can be accessed by a computer. By way of example and not limitation, the computer readable medium can comprise RAM, ROM, EEPROM, CD-ROM or other optical disk storage, disk storage media or other magnetic storage device, or can be used to carry or store an instruction or data structure. The desired program code and any other medium that can be accessed by the computer. This evening. Any connection may suitably be a computer readable medium. For example, if the software is transmitted from a website, server, or other remote source using coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL), or wireless technologies such as infrared, radio, and microwave, then the coaxial cable , fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, wireless, and microwaves are included in the fixing of the associated media. As used in the present invention, a disc (D i sk ) and a disc (CD) include a compact disc (CD), a laser disc, a compact disc, a digital versatile disc (DVD), a floppy disc, and a Blu-ray disc, wherein the disc is usually magnetically replicated, The disc uses a laser to optically replicate the data. Combinations of the above should also be included within the scope of the computer readable media.
总之, 以上所述仅为本发明技术方案的较佳实施例而已, 并非用于限定 本发明的保护范围。 凡在本发明的精神和原则之内, 所作的任何修改、 等同 替换、 改进等, 均应包含在本发明的保护范围之内。  In summary, the above description is only a preferred embodiment of the technical solution of the present invention, and is not intended to limit the scope of the present invention. Any modifications, equivalents, improvements, etc. made within the spirit and scope of the present invention are intended to be included within the scope of the present invention.

Claims

权 利 要 求 Rights request
1、 一种聚合虚拟化中内存共享的方法,包括: 1. A method for memory sharing in aggregate virtualization, including:
緩存一致性处理器接收主机的虚拟机管理器发送的内存处理命令; 若所述内存处理命令为緩存状态更新信息,所述緩存一致性处理器根据 所述緩存状态更新信息对本地的緩存一致性目录进行更新,所述緩存状态更 新信息中包括内存块地址信息和緩存状态信息; The cache consistency processor receives a memory processing command sent by the virtual machine manager of the host; if the memory processing command is cache status update information, the cache consistency processor performs local cache consistency processing based on the cache status update information. The directory is updated, and the cache status update information includes memory block address information and cache status information;
或者, 若所述内存处理命令为所述主机上的虚拟机的内存访问请求, 所 述緩存一致性处理器进行緩存一致性处理,访问所述内存访问请求中的内存 地址信息对应的内存。 Alternatively, if the memory processing command is a memory access request of a virtual machine on the host, the cache consistency processor performs cache consistency processing and accesses the memory corresponding to the memory address information in the memory access request.
2、 根据权利要求 1所述的方法, 其特征在于, 所述緩存一致性处理器 根据所述緩存状态更新信息对本地的緩存一致性目录进行更新, 具体为: 所述緩存一致性处理器根据所述内存块地址信息,确定所述本地的緩存 一致性目录中所述内存块地址信息对应的内存块的记录; 2. The method according to claim 1, characterized in that, the cache consistency processor updates the local cache consistency directory according to the cache status update information, specifically: the cache consistency processor updates the local cache consistency directory according to the cache status update information. The memory block address information determines the memory block record corresponding to the memory block address information in the local cache consistency directory;
根据所述緩存状态更新信息中的緩存状态信息更新所述内存块的记录 中的緩存状态信息; Update the cache status information in the record of the memory block according to the cache status information in the cache status update information;
根据所述内存块的记录中的当前拷贝信息,确定保存有所述内存块的拷 贝的其他主机,通知所述其他主机对应的緩存一致性处理器更新各自本地的 緩存一致性目录。 According to the current copy information in the record of the memory block, other hosts that store copies of the memory block are determined, and the corresponding cache consistency processors of the other hosts are notified to update their respective local cache consistency directories.
3、 根据权利要求 1或 2所述的方法, 其特征在于, 所述緩存一致性处 理器进行緩存一致性处理,访问所述内存访问请求中的内存地址信息对应的 内存, 具体为: 3. The method according to claim 1 or 2, characterized in that the cache consistency processor performs cache consistency processing and accesses the memory corresponding to the memory address information in the memory access request, specifically:
若所述内存地址信息对应的内存是所述主机上的内存,所述緩存一致性 处理器进行緩存一致性处理, 对所述主机的内存进行访问; If the memory corresponding to the memory address information is the memory on the host, the cache consistency processor performs cache consistency processing and accesses the memory of the host;
或者,若所述内存地址信息对应的内存是所述主机以外的其他主机上的 内存, 则所述緩存一致性处理器进行緩存一致性处理, 通过交换网络访问所 述内存地址信息对应的所述其他主机上的内存。 Alternatively, if the memory corresponding to the memory address information is a memory on a host other than the host, the cache consistency processor performs cache consistency processing and accesses the memory address corresponding to the memory address information through a switching network. memory on other hosts.
4、 根据权利要求 3所述的方法, 其特征在于, 所述緩存一致性处理器 通过交换网络访问所述内存地址信息对应的所述其他主机上的内存, 具体 为: 所述緩存一致性处理器通过所述交换网络与所述其他主机连接的緩存 一致性处理器进行通信,通过所述其他主机连接的緩存一致性处理器访问所 述内存地址信息对应的所述其他主机上的内存。 4. The method according to claim 3, wherein the cache consistency processor accesses the memory on the other host corresponding to the memory address information through a switching network, specifically: The cache consistency processor communicates with the cache consistency processor connected to the other host through the switching network, and accesses the other memory address corresponding to the memory address information through the cache consistency processor connected to the other host. memory on the host.
5、 根据权利要求 3或 4所述的方法, 其特征在于, 还包括: 5. The method according to claim 3 or 4, further comprising:
若所述内存访问请求为读内存指令,所述緩存一致性处理器将内存访问 结果发送给所述主机的虚拟机管理器。 If the memory access request is a read memory instruction, the cache consistency processor sends the memory access result to the virtual machine manager of the host.
6、 根据权利要求 1至 5任一所述的方法, 其特征在于, 所述緩存一致 性处理器接收主机的虚拟机管理器发送的内存处理命令之前, 还包括: 所述主机的虚拟机管理器获得所述虚拟机的所述内存访问请求; 所述主机的虚拟机管理器根据所述内存访问请求中的内存地址信息判 断所述内存访问请求需要访问的内存是否是所述主机上的内存,如果是所述 主机上的内存, 则根据所述内存访问请求访问所述主机上的内存, 并将所述 緩存状态更新信息发送给所述緩存一致性处理器;如果不是所述主机上的内 存, 则将所述内存访问请求发送给所述緩存一致性处理器。 6. The method according to any one of claims 1 to 5, characterized in that, before the cache coherence processor receives the memory processing command sent by the virtual machine manager of the host, it further includes: virtual machine management of the host The virtual machine manager of the host obtains the memory access request of the virtual machine; and the virtual machine manager of the host determines whether the memory that needs to be accessed by the memory access request is the memory on the host based on the memory address information in the memory access request. , if it is the memory on the host, access the memory on the host according to the memory access request, and send the cache status update information to the cache consistency processor; if it is not on the host memory, the memory access request is sent to the cache coherence processor.
7、 一种聚合虚拟化中内存共享的方法,包括: 7. A method for memory sharing in aggregate virtualization, including:
主机的虚拟机管理器获得虚拟机的内存访问请求; The host's virtual machine manager obtains the virtual machine's memory access request;
所述主机的虚拟机管理器根据所述内存访问请求中的内存地址信息判 断所述内存访问请求需要访问的内存是否是所述主机上的内存,如果是所述 主机上的内存, 则根据所述内存访问请求访问所述主机上的内存, 并在所述 内存访问请求为内存写指令时,发送緩存状态更新信息给緩存一致性处理器 以便所述緩存一致性处理器更新所述緩存一致性处理器本地的緩存一致性 目录中进行了写操作的内存块对应的緩存状态信息;如果所述内存访问请求 为读指令, 则将所述内存访问请求发送给所述緩存一致性处理器, 以便所述 緩存一致性处理器进行緩存一致性处理并访问所述内存访问请求中的内存 地址信息对应的内存; The virtual machine manager of the host determines whether the memory that needs to be accessed by the memory access request is the memory on the host based on the memory address information in the memory access request. If it is the memory on the host, then based on the The memory access request accesses the memory on the host, and when the memory access request is a memory write instruction, cache status update information is sent to the cache consistency processor so that the cache consistency processor updates the cache consistency The cache status information corresponding to the memory block that has been written in the local cache consistency directory of the processor; if the memory access request is a read instruction, the memory access request is sent to the cache consistency processor, so that The cache consistency processor performs cache consistency processing and accesses the memory corresponding to the memory address information in the memory access request;
或者, 所述主机的虚拟机管理器将所述内存访问请求发送给所述緩存 一致性处理器,以便所述緩存一致性处理器进行緩存一致性处理并访问所述 内存访问请求中的内存地址信息对应的内存。 Alternatively, the virtual machine manager of the host sends the memory access request to the cache consistency processor, so that the cache consistency processor performs cache consistency processing and accesses the memory address in the memory access request. The memory corresponding to the information.
8、 根据权利要求 7所述的方法, 其特征在于, 如果所述内存访问请求 为读指令,所述主机的虚拟机管理器将所述内存访问请求发送给所述緩存一 致性处理器之后, 还包括: 8. The method according to claim 7, characterized in that, if the memory access request is a read instruction, the virtual machine manager of the host sends the memory access request to the cache. After the consistency processor, it also includes:
所述主机的虚拟机管理器接收所述緩存一致性处理器返回的内存访问 结果。 The virtual machine manager of the host receives the memory access results returned by the cache coherence processor.
9、 一种緩存一致性处理器, 其特征在于, 包括: 9. A cache coherence processor, characterized by including:
输入输出单元, 用于接收主机的虚拟机管理器发送的内存处理命令; 緩存一致性处理单元, 若所述内存处理命令为緩存状态更新信息, 用于 根据所述緩存状态更新信息, 发送緩存一致性目录更新指令给目录管理单 元, 其中, 所述緩存状态更新信息中包括内存块地址信息和緩存状态信息, 或者, 所述内存处理命令为所述主机上的虚拟机的内存访问请求, 用于进行 緩存一致性处理, 访问所述内存访问请求中的内存地址信息对应的内存; 所述目录管理单元,用于根据所述緩存一致性目录更新指令更新本地的 緩存一致性目录。 The input and output unit is used to receive the memory processing command sent by the virtual machine manager of the host; the cache consistency processing unit, if the memory processing command is cache status update information, is used to send cache consistency according to the cache status update information. A directory update instruction is given to the directory management unit, where the cache status update information includes memory block address information and cache status information, or the memory processing command is a memory access request of a virtual machine on the host, for Perform cache consistency processing and access the memory corresponding to the memory address information in the memory access request; The directory management unit is used to update the local cache consistency directory according to the cache consistency directory update instruction.
1 0、 根据权利要求 9所述的緩存一致性处理器, 其特征在于: 所述目录 管理单元,用于根据所述緩存一致性目录更新指令更新本地的緩存一致性目 录, 具体为: 10. The cache consistency processor according to claim 9, characterized in that: the directory management unit is used to update the local cache consistency directory according to the cache consistency directory update instruction, specifically:
所述目录管理单元, 用于根据所述内存块地址信息, 确定所述本地的緩 存一致性目录中所述内存块地址信息对应的内存块的记录,根据所述緩存状 态更新信息中的緩存状态信息更新所述内存块的记录中的緩存状态信息,并 根据所述内存块的记录中的当前拷贝信息,确定保存有所述内存块的拷贝的 其他主机,通知所述其他主机对应的緩存一致性处理器更新各自本地的緩存 一致性目录。 The directory management unit is configured to determine the memory block record corresponding to the memory block address information in the local cache consistency directory according to the memory block address information, and update the cache status in the information according to the cache status. The information updates the cache status information in the record of the memory block, and determines other hosts that store copies of the memory block based on the current copy information in the record of the memory block, and notifies the other hosts that the corresponding caches are consistent The processors update their local cache coherency directories.
1 1、 根据权利要求 9或 1 0所述的緩存一致性处理器, 其特征在于, 所 述緩存一致性处理单元, 用于进行緩存一致性处理, 访问所述内存访问请求 中的内存地址信息对应的内存, 具体为: 11. The cache consistency processor according to claim 9 or 10, characterized in that the cache consistency processing unit is used to perform cache consistency processing and access the memory address information in the memory access request. The corresponding memory is specifically:
所述緩存一致性处理单元,若所述内存地址信息对应的内存是所述主机 上的内存, 用于进行緩存一致性处理, 对所述主机的内存进行访问, 若所述 内存地址信息对应的内存是所述主机以外的其他主机上的内存,则所述緩存 一致性处理单元用于进行緩存一致性处理,通过网络接口单元经交换网络访 问所述内存地址信息对应的所述其他主机上的内存; The cache consistency processing unit, if the memory corresponding to the memory address information is the memory on the host, is used to perform cache consistency processing and access the memory of the host. If the memory address information corresponds to If the memory is a memory on a host other than the host, the cache consistency processing unit is used to perform cache consistency processing, and accesses the memory on the other host corresponding to the memory address information through the network interface unit through the switching network. Memory;
则, 所述緩存一致性处理器, 还包括: 所述网络接口单元,用于提供所述緩存一致性处理单元与其他緩存一致 性处理器间的通信,将所述緩存一致性处理单元的信息通过所述交换网络发 送给所述其他緩存一致性处理器,将从所述交换网络接收的所述其他緩存一 致性处理器的信息传递给所述緩存一致性处理单元。 Then, the cache consistency processor also includes: The network interface unit is used to provide communication between the cache consistency processing unit and other cache consistency processors, and send the information of the cache consistency processing unit to the other cache consistency processors through the switching network. The processor is configured to pass information about the other cache coherence processors received from the switching network to the cache coherence processing unit.
12、 根据权利要求 11所述的緩存一致性处理器, 其特征在于, 所述緩 存一致性处理单元用于进行緩存一致性处理,通过网络接口单元经交换网络 访问所述内存地址信息对应的所述其他主机上的内存, 具体为: 12. The cache coherence processor according to claim 11, characterized in that, the cache coherence processing unit is used to perform cache coherence processing, and accesses all locations corresponding to the memory address information through a switching network through a network interface unit. Describe the memory on other hosts, specifically:
所述緩存一致性处理单元, 用于进行緩存一致性处理, 通过所述网络接 口单元经所述交换网络与所述内存地址信息对应的所述其他主机连接的緩 存一致性处理器进行通信,通过所述其他主机连接的緩存一致性处理器访问 所述内存地址信息对应的所述其他主机上的内存。 The cache consistency processing unit is used to perform cache consistency processing, and communicates with the cache consistency processor connected to the other host corresponding to the memory address information through the network interface unit through the switching network. The cache consistency processor connected to the other host accesses the memory on the other host corresponding to the memory address information.
1 3、 根据权利要求 11或 12所述的緩存一致性处理器, 其特征在于: 所述緩存一致性处理单元,还用于,若所述内存访问请求为读内存指令, 将内存访问结果通过所述输入输出单元发送给所述主机的虚拟机管理器。 13. The cache consistency processor according to claim 11 or 12, characterized in that: the cache consistency processing unit is further configured to, if the memory access request is a read memory instruction, pass the memory access result through The input and output unit sends the information to the virtual machine manager of the host.
14、根据权利要求 11至 13任一所述的緩存一致性处理器,其特征在于, 所述緩存一致性处理单元包括: 14. The cache consistency processor according to any one of claims 11 to 13, characterized in that, the cache consistency processing unit includes:
预处理子模块, 用于与所述输入输出单元、 本地代理子模块、 远端代理 子模块连接, 用于负责所述输入输出单元与所述本地代理子模块、 所述远端 代理子模块之间的报文传递; Preprocessing submodule, used to connect with the input and output unit, the local agent submodule, and the remote agent submodule, and used to be responsible for the interaction between the input and output unit, the local agent submodule, and the remote agent submodule. message transmission between;
所述本地代理子模块, 用于处理对所述主机的内存访问请求, 进行緩存 一致性处理, 以及发送所述緩存一致性目录更新指令给所述目录管理单元; 所述远端代理子模块,用于处理对所述主机以外的其他主机的内存访问 请求, 进行緩存一致性处理, 通过所述网络接口单元经所述交换网络访问所 述其他主机的内存。 The local agent sub-module is used to process memory access requests to the host, perform cache consistency processing, and send the cache consistency directory update instructions to the directory management unit; the remote agent sub-module, Used to process memory access requests to other hosts other than the host, perform cache consistency processing, and access the memory of the other hosts through the switching network through the network interface unit.
15、 一种计算机系统, 包括: 至少两个主机, 至少两个緩存一致性处理 器和一个交换网络, 其中, 所述至少两个主机中的每个主机分别与所述至少 两个緩存一致性处理器中的一个緩存一致性处理器相连,所述至少两个緩存 一致性处理器通过所述交换网络通信相连; 15. A computer system, including: at least two hosts, at least two cache coherence processors and a switching network, wherein each of the at least two hosts is respectively consistent with the at least two caches. One cache coherence processor in the processor is connected, and the at least two cache coherence processors are communicatively connected through the switching network;
所述至少两个主机中的第一主机,用于发送内存处理命令给相连的所述 至少两个緩存一致性处理器中的第一緩存一致性处理器; The first host among the at least two hosts is used to send memory processing commands to the connected a first cache coherence processor of at least two cache coherence processors;
所述第一緩存一致性处理器, 若所述内存处理命令为緩存状态更新信 息, 用于根据所述緩存状态更新信息更新本地的緩存一致性目录, 所述緩存 状态更新信息中包括内存块地址信息和緩存状态信息, 或者, 所述内存处理 命令为所述第一主机上的虚拟机的内存访问请求, 用于进行緩存一致性处 理, 访问所述内存访问请求中的内存地址信息对应的内存。 The first cache consistency processor, if the memory processing command is cache status update information, is used to update the local cache consistency directory according to the cache status update information, where the cache status update information includes a memory block address. information and cache status information, or, the memory processing command is a memory access request of the virtual machine on the first host, used to perform cache consistency processing, and access the memory corresponding to the memory address information in the memory access request. .
1 6、 根据权利要求 1 5所述的系统, 其特征在于, 所述第一緩存一致性 处理器, 用于根据所述緩存状态更新信息更新本地的緩存一致性目录, 具体 为: 16. The system according to claim 15, characterized in that the first cache consistency processor is used to update the local cache consistency directory according to the cache status update information, specifically:
所述第一緩存一致性处理器, 用于根据所述内存块地址信息, 确定所述 本地的緩存一致性目录中所述内存块地址信息对应的内存块的记录,根据所 述緩存状态更新信息中的緩存状态信息更新所述内存块的记录中的緩存状 态信息, 并根据所述内存块的记录中的当前拷贝信息, 确定保存有所述内存 块的拷贝的所述至少两个主机中所述第一主机以外的其他主机,通知所述其 他主机对应的緩存一致性处理器更新各自本地的緩存一致性目录。 The first cache consistency processor is configured to determine, according to the memory block address information, a record of the memory block corresponding to the memory block address information in the local cache consistency directory, and update the information according to the cache status Update the cache status information in the record of the memory block with the cache status information in the record of the memory block, and determine all of the at least two hosts that store copies of the memory block based on the current copy information in the record of the memory block. Hosts other than the first host notify the corresponding cache consistency processors of the other hosts to update their respective local cache consistency directories.
1 7、 根据权利要求 1 5或 1 6所述的系统, 其特征在于, 所述第一緩存一 致性处理器, 用于进行緩存一致性处理, 访问所述内存访问请求中的内存地 址信息对应的内存, 具体为: 17. The system according to claim 15 or 16, characterized in that the first cache consistency processor is used to perform cache consistency processing and access the memory address information corresponding to the memory access request. memory, specifically:
所述第一緩存一致性处理器,若所述内存地址信息对应的内存是所述第 一主机上的内存, 用于进行緩存一致性处理, 对所述第一主机的内存进行访 问, 或者, 若所述内存地址信息对应的内存是所述至少两个主机中所述第一 主机以外的其他主机上的内存, 用于进行緩存一致性处理, 通过所述交换网 络访问所述内存地址信息对应的所述其他主机上的内存。 The first cache consistency processor, if the memory corresponding to the memory address information is the memory on the first host, is used to perform cache consistency processing and access the memory of the first host, or, If the memory corresponding to the memory address information is a memory on a host other than the first host among the at least two hosts, it is used for cache consistency processing, and the memory address information corresponding to the memory address information is accessed through the switching network. of memory on said other hosts.
1 8、 根据权利要求 1 7所述的系统, 其特征在于, 所述第一緩存一致性 处理器, 用于进行緩存一致性处理, 通过所述交换网络访问所述内存地址信 息对应的所述其他主机上的内存, 具体为: 18. The system according to claim 17, characterized in that the first cache consistency processor is used to perform cache consistency processing and access the memory address corresponding to the memory address information through the switching network. Memory on other hosts, specifically:
所述第一緩存一致性处理器, 用于进行緩存一致性处理, 通过所述交换 网络与所述内存地址信息对应的所述其他主机连接的緩存一致性处理器进 行通信,通过所述其他主机连接的緩存一致性处理器访问所述内存地址信息 对应的所述其他主机上的内存。 The first cache consistency processor is used to perform cache consistency processing and communicate with the cache consistency processor connected to the other host corresponding to the memory address information through the switching network. The connected cache coherence processor accesses the memory on the other host corresponding to the memory address information.
1 9、 根据权利要求 1 7或 1 8所述的系统, 其特征在于: 19. The system according to claim 17 or 18, characterized in that:
所述第一緩存一致性处理器, 若所述内存访问请求为读内存指令, 还用 于将内存访问结果发送给所述第一主机的虚拟机管理器。 The first cache consistency processor, if the memory access request is a read memory instruction, is also used to send the memory access result to the virtual machine manager of the first host.
20、 根据权利要求 1 5至 1 9任一所述的系统, 其特征在于, 20. The system according to any one of claims 15 to 19, characterized in that,
所述第一主机的虚拟机管理器,还用于获得所述虚拟机的所述内存访问 请求,根据所述内存访问请求中的内存地址信息判断所述内存访问请求需要 访问的内存是否是所述第一主机上的内存, 如果是所述第一主机上的内存, 则根据所述内存访问请求对所述第一主机上的内存进行访问,并发送所述緩 存状态更新信息给所述第一緩存一致性处理器;如果不是所述第一主机上的 内存, 则将所述内存访问请求发送给所述第一緩存一致性处理器。 The virtual machine manager of the first host is also used to obtain the memory access request of the virtual machine, and determine whether the memory that needs to be accessed by the memory access request is the memory address information in the memory access request. The memory on the first host, if it is the memory on the first host, accesses the memory on the first host according to the memory access request, and sends the cache status update information to the third host. A cache coherence processor; if it is not the memory on the first host, then send the memory access request to the first cache coherence processor.
PCT/CN2013/084821 2013-10-08 2013-10-08 Memory sharing method, device and system in aggregation virtualization WO2015051488A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201380001624.9A CN103858111B (en) 2013-10-08 2013-10-08 A kind of realization is polymerized the shared method, apparatus and system of virtual middle internal memory
PCT/CN2013/084821 WO2015051488A1 (en) 2013-10-08 2013-10-08 Memory sharing method, device and system in aggregation virtualization

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2013/084821 WO2015051488A1 (en) 2013-10-08 2013-10-08 Memory sharing method, device and system in aggregation virtualization

Publications (1)

Publication Number Publication Date
WO2015051488A1 true WO2015051488A1 (en) 2015-04-16

Family

ID=50864334

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2013/084821 WO2015051488A1 (en) 2013-10-08 2013-10-08 Memory sharing method, device and system in aggregation virtualization

Country Status (2)

Country Link
CN (1) CN103858111B (en)
WO (1) WO2015051488A1 (en)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104794099A (en) * 2015-04-28 2015-07-22 浪潮电子信息产业股份有限公司 Resource fusion method and system and far-end agent
GB2539382B (en) * 2015-06-01 2017-05-24 Advanced Risc Mach Ltd Cache coherency
CN107894914A (en) * 2016-09-30 2018-04-10 华为技术有限公司 Buffer consistency treating method and apparatus
CN108268384A (en) * 2016-12-30 2018-07-10 华为技术有限公司 Read the method and device of data
CN106843772A (en) * 2017-02-14 2017-06-13 郑州云海信息技术有限公司 A kind of system and method based on uniformity bus extension nonvolatile memory
CN107168810A (en) * 2017-05-10 2017-09-15 郑州云海信息技术有限公司 A kind of calculate node internal memory sharing system and reading and writing operation internal memory sharing method
CN112988370B (en) * 2019-12-13 2024-05-17 南京品尼科自动化有限公司 Intelligent communication manager
CN112783667B (en) * 2020-12-10 2023-08-15 中国科学院深圳先进技术研究院 Memory sharing system and method based on virtual environment
CN115587051B (en) * 2022-10-28 2023-06-16 海光信息技术股份有限公司 Cache directory updating method, data processing method, related device and equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101510144A (en) * 2009-03-24 2009-08-19 中国科学院计算技术研究所 Distributed cache system based on distributed virtual machine manager and working method thereof
CN101802790A (en) * 2007-09-21 2010-08-11 美普思科技公司 Support to a plurality of coherence domains
CN101207515B (en) * 2007-12-12 2011-11-30 中兴通讯股份有限公司 Processing method, implementation method and synchronization method of multi-machine sharing internal memory
CN102521330A (en) * 2011-12-07 2012-06-27 华中科技大学 Mirror distributed storage method under desktop virtual environment
US20130111474A1 (en) * 2011-10-31 2013-05-02 Stec, Inc. System and method to cache hypervisor data

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101802790A (en) * 2007-09-21 2010-08-11 美普思科技公司 Support to a plurality of coherence domains
CN101207515B (en) * 2007-12-12 2011-11-30 中兴通讯股份有限公司 Processing method, implementation method and synchronization method of multi-machine sharing internal memory
CN101510144A (en) * 2009-03-24 2009-08-19 中国科学院计算技术研究所 Distributed cache system based on distributed virtual machine manager and working method thereof
US20130111474A1 (en) * 2011-10-31 2013-05-02 Stec, Inc. System and method to cache hypervisor data
CN102521330A (en) * 2011-12-07 2012-06-27 华中科技大学 Mirror distributed storage method under desktop virtual environment

Also Published As

Publication number Publication date
CN103858111A (en) 2014-06-11
CN103858111B (en) 2016-03-09

Similar Documents

Publication Publication Date Title
WO2015051488A1 (en) Memory sharing method, device and system in aggregation virtualization
TWI621023B (en) Systems and methods for supporting hot plugging of remote storage devices accessed over a network via nvme controller
US9760386B2 (en) Accelerator functionality management in a coherent computing system
US9342448B2 (en) Local direct storage class memory access
US7596654B1 (en) Virtual machine spanning multiple computers
US7756943B1 (en) Efficient data transfer between computers in a virtual NUMA system using RDMA
US10423332B2 (en) Fibre channel storage array having standby controller with ALUA standby mode for forwarding SCSI commands
US7234006B2 (en) Generalized addressing scheme for remote direct memory access enabled devices
CA3070006C (en) Method for reading data stored in a non-volatile cache using rdma
TWI793654B (en) Cloud gaming system and method for operating cloud gaming system
WO2014106321A1 (en) Pcie network-based virtual machine communication method, server and system
US10599356B2 (en) Aggregating memory to create a network addressable storage volume for storing virtual machine files
US10430305B2 (en) Determine whether to rebuild track metadata to determine whether a track format table has a track format code for the track format metadata
CN114371811A (en) Method, electronic device and computer program product for storage management
CN102917055A (en) Method and device of online migration of virtual machine, and terminal device
WO2024082944A1 (en) Method and apparatus for data exchange between multiple processors, device, and storage medium
CN115129625A (en) Enhanced storage protocol emulation in a peripheral device
US10366024B2 (en) Synchronous input/output computer system including hardware invalidation of synchronous input/output context
US10095620B2 (en) Computer system including synchronous input/output and hardware assisted purge of address translation cache entries of synchronous input/output transactions
US20230169093A1 (en) Fast database scaling utilizing a decoupled storage and compute architecture
US11281483B2 (en) Preserving transient address translation information across a firmware assisted dump procedure
US10642788B1 (en) Sand timer algorithm for tracking in-flight data storage requests for data replication
CN115811509A (en) Bus communication method and related equipment
JP2000163221A (en) Data processing system

Legal Events

Date Code Title Description
WWE Wipo information: entry into national phase

Ref document number: 201380001624.9

Country of ref document: CN

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

Ref document number: 13895162

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

Country of ref document: EP

Kind code of ref document: A1