WO2014183417A1 - 管理内存的方法、装置和系统 - Google Patents

管理内存的方法、装置和系统 Download PDF

Info

Publication number
WO2014183417A1
WO2014183417A1 PCT/CN2013/088073 CN2013088073W WO2014183417A1 WO 2014183417 A1 WO2014183417 A1 WO 2014183417A1 CN 2013088073 W CN2013088073 W CN 2013088073W WO 2014183417 A1 WO2014183417 A1 WO 2014183417A1
Authority
WO
WIPO (PCT)
Prior art keywords
node
indication information
remote memory
memory
data
Prior art date
Application number
PCT/CN2013/088073
Other languages
English (en)
French (fr)
Inventor
张立新
侯锐
张科
江涛
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to EP21183969.1A priority Critical patent/EP3958122A1/en
Priority to EP13884645.6A priority patent/EP2998862A4/en
Publication of WO2014183417A1 publication Critical patent/WO2014183417A1/zh
Priority to US14/942,719 priority patent/US9940020B2/en
Priority to US15/911,633 priority patent/US10235047B2/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0604Improving or facilitating administration, e.g. storage management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5016Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0629Configuration or reconfiguration of storage systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/067Distributed or networked storage systems, e.g. storage area networks [SAN], network attached storage [NAS]

Definitions

  • the present invention relates to the field of computers, and more particularly to a method, apparatus, and system for managing memory.
  • the server system for managing resources is usually composed of dozens, hundreds, or even tens of thousands of computer server nodes depending on the scale. Most of these server nodes use commercial standard servers on the market, and they have hardware devices such as separate memory.
  • Embodiments of the present invention provide a method, an apparatus, and a system for managing memory, which can easily implement sharing of memory resources.
  • a method for managing memory includes: sending, by a requesting node in a memory management system, first indication information, where the first indication information is used to indicate a length of memory required by the requesting node; Instructing information, the second indication information is used to indicate a first remote memory that is provided by the target contribution node of the at least one contributing node of the remote memory to the requesting node, wherein the first remote memory is based on the first indication information Determining that the length of the first remote memory is greater than or equal to the length of memory required by the requesting node; determining from the available virtual addresses a first virtual address corresponding to the first remote memory; when the first data of the pointer in the first virtual address range is required to be read and written, sending a first data read/write instruction for the first data, the first The data read/write instruction includes third indication information, where the third indication information is used to indicate a storage space in the first remote memory for storing the first data, so that the target contribution node accesses according
  • the requesting node in the memory management system sends the first indication information, where: the requesting node in the memory management system acquires the contributing node information used to indicate the target contributing node; according to the contributing node information, Sending the first indication information to the target contribution node; and receiving the second indication information comprises: receiving the second indication information sent by the target contribution node.
  • the sending, according to the contributing node information, the first indication information to the target contributing node including: according to the contributing node information, The target contribution node sends a second data write instruction for the second data, the second data write instruction includes the first indication information; and the receiving the second indication information sent by the target contribution node comprises: receiving the target contribution node to send And a second data write response for indicating completion of the second data storage, the second data write response including the second indication information.
  • the sending, by the requesting node in the memory management system, the first indication information includes: The requesting node sends the first indication information to the control center, so that the control center determines the target contributing node and the first remote from the contributing node according to the first indication information and the length of the remote memory that the contributing node can provide.
  • a memory wherein the length of the remote memory that the contributing node can provide is determined by the control center according to the fourth indication information sent by the contributing node to indicate the length of the remote memory that the contributing node can provide; and the receiving second The indication information includes: receiving the second indication information sent by the control center.
  • the method further includes: receiving, by the control center, a contribution node information indicating the target contribution node, and the transmission is for the
  • the first data read/write instruction of the first data includes: transmitting, according to the contribution node information, a first data read/write instruction for the first data to the target contribution node.
  • the sending is directed to
  • the first data read/write instruction of the first data includes: broadcasting a first data read/write instruction for the first data, so that the contribution node determines that the storage space is within a range of remote memory that the contribution node can provide After that, the first data is accessed.
  • the memory management system includes at least two contributing nodes, and the physical addresses of the remote memory that the at least two contributing nodes can provide are different.
  • determining the first virtual address according to the first remote memory including: determining, corresponding to the first remote memory, from a local memory in the requesting node A local memory, based on the first local memory, determining the first virtual address.
  • the length of the first remote memory is the same as the length of memory required by the requesting node, and the second indication information is used to indicate the first a starting physical address of a remote memory; the length of the first remote memory is the same as the length of the first data, and the third indication information is used to indicate a starting physical address of the storage space.
  • the second indication information is used to indicate a starting physical address and a length of the first remote memory, and the first remote memory indicated by the length of the first data and the second indication information
  • the third indication information is used to indicate a starting physical address of the first remote memory; when the length of the first data is less than the length of the first remote memory indicated by the second indication information, the first The three indication information is used to indicate the starting physical address and length of the storage space.
  • a method for managing memory comprising: determining, by a contributing node in a memory management system, a first remote memory, the first remote memory being determined according to first indication information from a requesting node, the first An indication information is used to indicate a length of memory required by the requesting node, where the length of the first remote memory is greater than or equal to a length of memory required by the requesting node; and receiving, by the requesting node, the first data read and written for the first data
  • the first data read/write instruction is used to indicate that the contributing node accesses the first data
  • the first data read/write instruction includes third indication information, where the third indication information is used to indicate that the first remote memory is used. And storing the storage space of the first data; accessing the first data according to the first data read/write instruction and the third indication information.
  • the contributing node in the memory management system determines that the first remote memory includes: the contributing node in the memory management system receives the first indication information sent by the requesting node; according to the first indication information, Determining the first remote memory; and the method further comprising: transmitting, to the requesting node, second indication information indicating the first remote memory.
  • the receiving, by the contributing node in the memory management system, the first indication information sent by the requesting node includes: a contribution in a memory management system
  • Receiving, by the requesting node, a second data write command for the second data and the second data, where the second data write command includes the first indication information, and determining, according to the first indication information, the first remote memory, And storing the first data in the first remote memory; and sending the second indication information for indicating the first remote memory to the requesting node comprises: sending the second data to the requesting node And storing a completed second data write response, the second data write response including second indication information for indicating the first remote memory.
  • the contributing node in the memory management system determines that the first remote memory includes: the contributing node in the memory management system sends fourth indication information to the control center, where the fourth indication information is used to indicate the contributing node The first physical information and the length of the remote memory that can be provided; receiving the second indication information sent by the control center, the second indication information is determined by the control center according to the first indication information and the fourth indication information; The second indication information determines the first remote memory.
  • the first possible implementation manner, the second possible implementation manner, and the third possible implementation manner in a fourth possible implementation manner, includes: determining that the storage space is within a range of the first remote memory; and accessing the first data in the storage space according to the first data read/write instruction.
  • the requesting node The length of the required memory is the same as the length of the first data, the length of the remote memory that the target contribution node can provide is the same as the length of the memory required by the requesting node, and the second indication information and the third indication information are used for Indicates the starting physical address of the first remote memory.
  • the second indication information is used to indicate a starting physical address and a length of the first remote memory; and when the length of the first data is different from the length of the first remote memory indicated by the second indication information
  • the third indication information is used to indicate a starting physical address of the first remote memory. When the length of the first data is less than the length of the first remote memory indicated by the second indication information, the third indication information Used to indicate the starting physical address and length of the storage space.
  • the method further includes: acquiring request node information for indicating the requesting node; determining the requesting node according to the requesting node information; It is prohibited to use the first remote memory by a node other than the requesting node.
  • a third aspect provides a method for managing memory, the method comprising: a control center in a memory management system determining a starting physical address and a length of a remote memory that at least one contributing node can provide, and receiving a first indication sent by the requesting node Information, the first indication information is used to indicate a length of memory required by the requesting node, and determining a target from the contributing node according to the first indication information and a starting physical address and length of the remote memory that the at least one contributing node can provide a contribution node and a first remote memory provided by the target contribution node to the requesting node, the length of the first remote memory being greater than or equal to a length of memory required by the requesting node; sending the indication to the requesting node and the target contributing node The second indication information of the first remote memory, so that the requesting node and the target contributing node determine the first remote memory according to the second indication information, and perform the first data access in the first remote memory, Wherein the pointer of the first data is at the request no
  • the method further includes: sending, to the requesting node, contribution node information indicating the target contributing node, so that the requesting node sends, according to the contributing node information, the target contributing node to the target The first data read and write instruction of the first data.
  • the method further includes: sending, to the contributing node, request node information for indicating the requesting node, to facilitate the target contributing node Based on the request node information, the requesting node is determined, and the node other than the requesting node is prohibited from using the first remote memory.
  • the memory management system includes at least two contributing nodes, and the first indication information according to the first indication And determining, by the fourth indication information, the target contribution node and the first remote memory provided by the target contribution node to the requesting node, according to the first indication information and the fourth indication information, from the contributing node Determining a target contribution node and a first remote memory provided by the target contribution node to the request node, so that physical addresses of remote memory provided by each contribution node including the first remote memory are different.
  • the required memory length of the requesting node is different from the first
  • the length of the data is the same
  • the length of the remote memory that the target contribution node can provide is the same as the length of the memory required by the requesting node
  • the second indication information and the third indication information are used to indicate the start of the first remote memory. The starting physical address.
  • the second The indication information is used to indicate a starting physical address and a length of the first remote memory; and when the length of the first data is the same as the length of the first remote memory indicated by the second indication information, the third indication information is used by the third indication information. Instructing the starting physical address of the first remote memory; when the length of the first data is less than the length of the first remote memory indicated by the second indication information, the third indication information is used to indicate that the first The starting physical address and length of a data storage space.
  • the fourth aspect provides an apparatus for managing a memory, where the apparatus includes: a sending unit, configured to enable a requesting node in a memory management system to send first indication information, where the first indication information is used to indicate a memory required by the requesting node. a receiving unit, configured to indicate the first remote memory provided by the target contributing node in the at least one contributing node of the remote memory to the requesting node, wherein the first remote memory is based on The first indication information determines that the length of the first remote memory is greater than or equal to the length of memory required by the requesting node, and the processing unit is configured to determine, from the virtual address that can be used, the first remote memory.
  • a first virtual address configured to: when the first data of the first virtual address range needs to be read and written, control the sending unit to send a first data read/write instruction for the first data, the first data read and write
  • the instruction includes third indication information, where the third indication information is used to indicate that the first remote memory is used to store the first Data storage space, so that the contribution of the target node based on the third indication information, accesses the first data.
  • the processing unit is specifically configured to acquire the contribution node information used to indicate the target contribution node, where the sending unit is configured to send the first indication information to the target contribution node according to the contribution node information.
  • the receiving unit is specifically configured to receive the target contribution node The second indication message sent.
  • the sending unit is specifically configured to send, according to the contributing node information, a second data write for the second data to the target contributing node
  • the second data write command includes the first indication information
  • the receiving unit is configured to receive a second data write response sent by the target contribution node to indicate completion of the second data storage, the second data write The response includes the second indication information.
  • the sending unit is specifically configured to send the first indication information to the control center, so as to facilitate the control. Determining, by the center, the target contribution node and the first remote memory from the contribution node according to the first indication information and the length of the remote memory that the contribution node can provide, wherein the length of the remote memory that the contribution node can provide is
  • the control center determines, according to the fourth indication information that is sent by the contributing node to indicate the length of the remote memory that the contributing node can provide; and the receiving unit is specifically configured to receive the second indication information sent by the control center.
  • the receiving unit is further configured to receive the control center to send The contribution node information for indicating the target contribution node
  • the sending unit is specifically configured to send, according to the contribution node information, a first data read/write instruction for the first data to the target contribution node.
  • the sending unit Specifically, the first data read/write instruction for the first data is broadcasted, so that the contribution node accesses the first data after determining that the storage space is within a range of remote memory that the contribution node can provide.
  • the memory management system includes at least two contributing nodes, the at least two The physical addresses of the remote memory that the contributing nodes can provide are different.
  • the processing unit is specifically configured to: determine, from a local memory in the requesting node, a first local memory corresponding to the first remote memory; Local memory, determine the first virtual address.
  • the length of the first remote memory is the same as the length of memory required by the requesting node, and the second indication information is used to indicate the first a starting physical address of a remote memory; the length of the first remote memory is the same as the length of the first data, and the third indication information is used to indicate a starting physical address of the storage space.
  • the second indication information is used to indicate a starting physical address and a length of the first remote memory; And when the length of the first data is the same as the length of the first remote memory indicated by the second indication information, the third indication information is used to indicate a starting physical address of the first remote memory; When the length of the first remote memory is smaller than the length of the first remote memory indicated by the second indication information, the third indication information is used to indicate a starting physical address and a length of the storage space.
  • a fifth aspect provides an apparatus for managing memory, the apparatus comprising: a processing unit, configured to enable a contributing node in a memory management system to determine a first remote memory, the first remote memory being based on a first indication from a requesting node Determining, the first indication information is used to indicate the length of the memory required by the requesting node, the length of the first remote memory is greater than or equal to the length of the memory required by the requesting node, and the receiving unit is configured to receive the requesting node to send First data read/write finger for the first data
  • the first data read/write instruction is used to indicate that the contributing node accesses the first data
  • the first data read/write instruction includes third indication information, where the third indication information is used to indicate that the first remote memory is used.
  • the storage unit is configured to store the first data.
  • the processing unit is further configured to access the first data according to the first data read/write instruction and the third indication information.
  • the receiving unit is configured to receive the first indication information sent by the requesting node, where the processing unit is configured to determine the first remote memory according to the first indication information, and the device The method further includes: a sending unit, configured to send, to the requesting node, second indication information for indicating the first remote memory.
  • the receiving unit is specifically configured to receive a second data write instruction for the second data and the second data that is sent by the requesting node
  • the second data write command includes the first indication information.
  • the processing unit is configured to determine the first remote memory according to the first indication information, and store the first data in the first remote memory.
  • the sending unit is specifically configured to send, to the requesting node, a second data write response for indicating completion of the second data storage, where the second data write response includes second indication information for indicating the first remote memory.
  • the apparatus further includes: a sending unit, configured to send the fourth indication information to the control center,
  • the fourth indication information is used to indicate a starting physical address and a length of the remote memory that the contributing node can provide;
  • the receiving unit is specifically configured to receive second indication information sent by the control center, where the second indication information is the control center Determining, according to the first indication information and the fourth indication information;
  • the processing unit is specifically configured to determine the first remote memory according to the second indication information.
  • the processing unit is specifically configured to determine that the storage space is Within the range of the first remote memory; for accessing the first data in the storage space according to the first data read/write instruction.
  • the length of memory required by the requesting node is the same as the length of the first data
  • the target contributing node can provide remote memory.
  • the length of the request is the same as the length of the memory required by the requesting node
  • the second indication information and the third indication information are used to indicate the starting physical address of the first remote memory.
  • the second indication information is used to indicate a starting physical address and a length of the first remote memory; and when the length of the first data is different from the length of the first remote memory indicated by the second indication information
  • the third indication information is used to indicate a starting physical address of the first remote memory. When the length of the first data is less than the length of the first remote memory indicated by the second indication information, the third indication information Used to indicate the starting physical address and length of the storage space.
  • the processing unit is further configured to acquire request node information for indicating the requesting node, configured to determine the requesting node according to the requesting node information, and to prohibit the requesting The node other than the node uses the first remote memory.
  • a sixth aspect provides an apparatus for managing memory, the apparatus comprising: a processing unit, configured to enable a control center in a memory management system to determine a starting physical address and a length of a remote memory that at least one contributing node can provide; And receiving, by the requesting node, first indication information, where the first indication information is used to indicate a length of memory required by the requesting node, where the processing unit is further configured to be configured according to the first indication information and the at least one contributing node a starting physical address and a length of the remote memory, determining, from the contributing node, a target contributing node and a first remote memory provided by the target contributing node to the requesting node, where the length of the first remote memory is greater than or equal to that required by the requesting node a sending unit, configured to send second indication information for indicating the first remote memory to the requesting node and the target contributing node, so that the requesting node and the target contributing node are configured according to the second indication information, Determining the first remote memory, and performing the
  • the sending unit is further configured to send, to the requesting node, the contributing node information used to indicate the target contributing node, so that the requesting node sends, according to the contributing node information, the target contributing node to the target contributing node.
  • the first data read and write instruction of the first data.
  • the sending unit is further configured to send, to the contributing node, request node information for indicating the requesting node, to facilitate the target contribution.
  • the node determines the requesting node according to the requesting node information, and prohibits nodes other than the requesting node from using the first remote memory.
  • the memory management system includes at least two contributing nodes, and the first indication information according to the first indication And determining, by the fourth indication information, the target contribution node and the first remote memory provided by the target contribution node to the requesting node, according to the first indication information and the fourth indication information, from the contributing node Determining a target contribution node and a first remote memory provided by the target contribution node to the request node, so that physical addresses of remote memory provided by each contribution node including the first remote memory are different.
  • the required memory length of the requesting node is different from the first
  • the length of the data is the same
  • the length of the remote memory that the target contribution node can provide is the same as the length of the memory required by the requesting node
  • the second indication information and the third indication information are used to indicate the start of the first remote memory. The starting physical address.
  • the second The indication information is used to indicate a starting physical address and a length of the first remote memory; and when the length of the first data is the same as the length of the first remote memory indicated by the second indication information, the third indication information is used by the third indication information. Instructing the starting physical address of the first remote memory; when the first data is long When the degree is less than the length of the first remote memory indicated by the second indication information, the third indication information is used to indicate a starting physical address and a length of a storage space for storing the first data.
  • a system for managing a memory includes: at least one requesting node, configured to send first indication information, where the first indication information is used to indicate a length of memory required by the requesting node, and receive a second Instructing information, the second indication information is used to indicate a first remote memory that is provided by the target contribution node of the at least one contributing node of the remote memory to the requesting node, wherein the first remote memory is based on the first indication information Determining that the length of the first remote memory is greater than or equal to the length of memory required by the requesting node, and determining, from a virtual address that can be used, a first virtual address corresponding to the first remote memory, when a read/write pointer is needed And sending, by the first data in the first virtual address range, a first data read/write instruction for the first data, where the first data read/write instruction includes third indication information, where the third indication information is used to indicate the a storage space for storing the first data in the first remote memory
  • the system further includes: a control center, configured to determine a starting physical address and a length of the remote memory that the at least one contributing node can provide; receiving the first indication information sent by the requesting node, the first indication The information is used to indicate the length of the memory required by the requesting node; determining the target contributing node and the target from the contributing node according to the first indication information and the starting physical address and length of the remote memory that the at least one contributing node can provide Contributing a first remote memory provided by the node to the requesting node, the length of the first remote memory being greater than or equal to that required by the requesting node a length of the memory; sending, to the requesting node and the target contributing node, second indication information for indicating the first remote memory, so that the requesting node and the target contributing node determine the first remote according to the second indication information And performing, in the first remote memory, a first data access, wherein the pointer of the first data is within a first virtual address range allocated by the requesting node
  • a method, apparatus, and system for managing memory determines a remote memory for use by a requesting node from a contributing node according to a memory required by the requesting node and a memory that the contributing node can provide, in the requesting node,
  • the remote memory allocates a virtual address, and when the requesting node needs to store the data of the pointer within the virtual address range, it may determine that the data needs to be accessed on the contributing node according to the correspondence between the virtual address and the remote memory, thereby A data read/write instruction is sent to the contribution node to implement access to the data in the remote memory, so that memory sharing can be easily realized.
  • FIG. 1 is a schematic flow chart of a method for managing memory according to an embodiment of the invention.
  • FIG. 2 is a schematic flow chart of a method of managing memory according to another embodiment of the present invention.
  • FIG. 3 is a schematic flowchart of a method for managing memory according to still another embodiment of the present invention.
  • FIG. 4 is a schematic block diagram of an apparatus for managing memory in accordance with an embodiment of the present invention.
  • FIG. 5 is a schematic block diagram of an apparatus for managing a memory according to another embodiment of the present invention.
  • FIG. 6 is a schematic block diagram of an apparatus for managing a memory according to still another embodiment of the present invention.
  • FIG. 7 is a schematic block diagram of a system for managing memory in accordance with an embodiment of the present invention.
  • FIG. 8 is a schematic structural diagram of a system for managing memory according to an embodiment of the present invention. detailed description
  • the technical solution of the present invention can be applied to a server system having two or more server nodes, and each server node can have an independent hardware structure to be able to independently implement the same or different services, and each server node is mutually Ability to communicate.
  • each server node has a certain memory space, but the memory sizes of the server nodes may be the same or different, and the present invention is not particularly limited.
  • one of the two or more server nodes that requests another server node due to insufficient memory or the like is referred to as a request node, and is capable of providing memory to other server nodes (hereinafter, referred to as The side of the remote memory is called the contribution node.
  • a request node is capable of providing memory to other server nodes
  • the side of the remote memory is called the contribution node.
  • one server node may serve as a requesting node in a certain period of time, and serve as a contributing node in another time period, or one server node may serve as both a requesting node and another server node. Contribution node.
  • Figure 1 shows a schematic flow diagram of a method 100 of managing memory as described from the perspective of a requesting node. As shown in Figure 1, the method 100 includes:
  • the requesting node in the memory management system sends first indication information, where the first indication information is used to indicate a length of memory required by the requesting node;
  • the length of the memory represents the size of the memory; the length of memory required by the requesting node is the amount of memory required by the requesting node.
  • the requesting node receives the second indication information, where the second indication information is used to indicate the first remote memory that is provided by the target contributing node of the at least one contributing node that can provide the remote memory to the requesting node, where the first The remote memory is determined according to the first indication information, the first far The length of the program memory is greater than or equal to the length of memory required by the requesting node;
  • the requesting node determines, from a virtual address that can be used, a first virtual address corresponding to the first remote memory;
  • the requesting node when it is required to read and write the first data of the pointer in the first virtual address range, the requesting node sends a first data read/write instruction for the first data, where the first data read/write instruction includes a third indication
  • the third indication information is used to indicate a storage space in the first remote memory for storing the first data, so that the target contribution node accesses the first data according to the third indication information.
  • the requesting node may send a request message to the outside, and the request message may be Carrying the information indicating the memory required by the requesting node (an example of the first indication information), it should be understood that, in the embodiment of the present invention, the memory capacity indicated by the first indication information may be greater than the memory capacity required by the requesting node. It may also be equal to the memory capacity required by the requesting node, and the present invention is not particularly limited.
  • the requesting node may obtain routing information of each contributing node in the system (an example of the contributing node information described later), so that the request message may be directly sent to the contributing node (ie, case 1).
  • a control center described later may be configured in the system to uniformly perform allocation of remote memory provided by each contributing node in the system, so that the requesting node may send the request message to the control center in the system (ie, case 2).
  • Case 1 and Case 2 will be described separately.
  • the sending, by the requesting node in the memory management system, the first indication information includes:
  • the requesting node in the memory management system acquires the contributing node information for indicating the target contributing node
  • the receiving the second indication information includes:
  • the contribution node information includes an identifier of the contributing node in the memory management system or a location of the contributing node in the memory management system.
  • each service node (including a contributing node and a requesting node) in the system can learn routing information between each other (an example of contributing node information), and the routing information can be the service.
  • the node ID of the node may also be the location of the service node.
  • the contributing node may broadcast information in the system indicating the remote memory it can provide (for example, the information may indicate the size of the remote memory and the Contributing the routing information of the node, the requesting node may determine, according to the information, that the contributing node and the contributing node can provide remote memory, and thus, in S110, the requesting node may, according to the routing information of each serving node, to the contributing node in the system, Sending a request message, the request message may carry information indicating an amount of memory required by the requesting node (an example of the first indication information).
  • the first indication information is sent to the target contribution node according to the contribution node information, including:
  • each service node (including a contributing node and a requesting node) in the system can learn routing information between each other, so that when the local memory of the requesting node is insufficient or needs to be used
  • the requesting node can refer to the routing information of each service node to the system.
  • the other service node (including the contributing node) sends a data write instruction (an example of the second data write command) for the second data
  • the second data write instruction may carry information indicating the memory required by the request node (first An example of the indication information). It should be understood that the length of the memory required by the requesting node indicated by the first indication information may be greater than or equal to the length of the second data, and the present invention is not particularly limited.
  • the service node may determine whether the required memory can be provided for the requesting node according to the first indication information that the request message can carry and the memory capacity that the service node can provide.
  • the service node can provide externally with a memory capacity greater than or equal to the memory required by the requesting node, it can be used as a contributing node. And, the contributing node may return a response message to the requesting node, where the response message may carry information (second indication information) indicating the memory (first remote memory) that the service node can provide.
  • the requesting node may receive the second indication information sent by the contributing node. Therefore, both the requesting node and the contributing node can learn that the requesting node obtains the right to use the first remote memory in the contributing node. In the embodiment of the present invention, the requesting node can use the first remote memory exclusively, thereby enabling Improve the security of your business.
  • the receiving the second indication information sent by the target contribution node includes:
  • the length of the memory required by the request node indicated by the first indication information is greater than or equal to the length of the second data, and therefore, the contribution
  • the node may store the second data in part or all of the storage space of the first remote memory according to the second data write instruction, so that the contribution node may send to the requesting node to indicate that the second data storage is completed.
  • the second data write response carries the second indication information.
  • first data and the second data listed above may be the same data or different data, and the present invention is not particularly limited.
  • the length of the first remote memory is the same as the length of memory required by the requesting node, and the second indication information is used to indicate a starting physical address of the first remote memory.
  • the contributing node may return only the starting physical address of the first remote memory (in the contributing node) to the requesting node. (An example of the second indication information).
  • the requesting node may determine by default that the memory capacity provided by the contributing node is the same as the memory capacity required by the requesting node.
  • the length of the first remote memory is greater than the length of memory required by the requesting node, and the second indication information is used to indicate a starting physical address and length of the first remote memory.
  • the contributing node may return the starting physical address and length of the first remote memory (in the contributing node) to the requesting node. (Another example of the second indication information). Therefore, the requesting node may determine the starting physical address and length of the first remote memory according to the second indication information, and use any storage space in the first remote memory as needed.
  • the first indication information sent by the requesting node in the memory management system includes:
  • the requesting node in the memory management system sends the first indication information to the control center, so that the control center determines the target contributing node from the contributing node according to the first indication information and the length of the remote memory that the contributing node can provide, and The first remote memory, wherein the length of the remote memory that the contributing node can provide is determined by the control center according to the fourth indication information sent by the contributing node to indicate the length of the remote memory that the contributing node can provide;
  • the receiving the second indication information includes:
  • a control center may be set in the system for acquiring information of remote memory that the server node can provide, and uniformly scheduling the remote memory resource.
  • the control center may be independent of each server node, that is, the control center may have an independent hardware structure (for example, a processor, a memory, an I/O device, etc.), thereby being connected to each server. Communication may be performed by means of signaling or messages, or a client may be set in the system of each server node, thereby sharing hardware devices such as processors and processors with each server node (for example, a processor, a memory, an I/O device, etc.) ).
  • the node when the server node (contributing node) is idle or has unused In memory, the node can provide memory (remote memory) to other server nodes, and, for example, after cleaning the data in the remote memory and deleting the page table mapping relationship of the remote memory inside the node, the contributing node can The control center reports information (fourth indication information) indicating the remote memory that it can provide.
  • the fourth indication information may indicate the physical address and length of the remote memory in the contributing node.
  • control center or the client configured in the requesting node
  • the control center can learn the information of the contributing node (for example, the routing information of the contributing node within the system) and the information of the remote memory provided by the contributing node (for example, The physical address and length of the remote memory).
  • the requesting node may send request information to the control center, the request message may carry information indicating the memory required by the requesting node (an example of the first indication information).
  • the control center may determine, according to the first indication information and the fourth indication information, a memory that can contribute to the node and the contribution node provides to the requesting node (first remote memory). For example, if the service node is able to provide externally with a memory capacity greater than or equal to the requested node providing its required memory, it can act as a contributing node.
  • the first remote memory may be greater than or equal to the memory length indicated by the first indication information.
  • the first remote memory may be less than or equal to the memory length indicated by the fourth indication.
  • control center may send information indicating the first remote memory (second indication information) to the requesting node and the contributing node, so that both the requesting node and the contributing node can know that the requesting node obtains the first of the contributing nodes.
  • the requesting node can exclusively use the first remote memory, thereby improving the security of the service.
  • the requesting node receives the second indication information sent by the control center.
  • the length of the first remote memory is the same as the length of memory required by the requesting node, and the second indication information is used to indicate a starting physical address of the first remote memory.
  • the contributing node may return only the starting physical address of the first remote memory (in the contributing node) to the requesting node. (An example of the second indication information). Therefore, in the case that the second indication information only indicates the starting physical address, the requesting node may determine by default that the contributing node mentions The amount of memory provided is the same as the amount of memory required by the requesting node.
  • the length of the first remote memory is greater than the length of memory required by the requesting node, and the second indication information is used to indicate a starting physical address and length of the first remote memory.
  • the contributing node may return the starting physical address and length of the first remote memory (in the contributing node) to the requesting node. (Another example of the second indication information). Therefore, the requesting node may determine the starting physical address and length of the first remote memory according to the second indication information, and use any storage space in the first remote memory as needed.
  • the requesting node can allocate a virtual address (first virtual address) for the first remote memory.
  • determining the first virtual address according to the first remote memory including:
  • the processor can reach 32 bits or even 64 bits, so that the range of virtual addresses that can be used can reach 2 32 or even 264, and the memory capacity in a typical computer system is much smaller than this value. Therefore, a sufficient virtual address may be allocated to the first remote memory, and the requesting node may regard the first remote memory as its local memory space, so that the same or similar method as the prior art may be used. Memory space (first remote memory) Assign a virtual address (first virtual address). Also, to avoid confusion, it may be provided that the first virtual address assigned to the first remote memory is different from the second virtual address assigned to the local memory in the requesting node.
  • the first data storage may be determined according to the pointer or needs to be stored in the first remote memory (specifically, the first remote memory) All or part of the storage space) to access the first data in the first remote memory (described in detail later).
  • the method for managing memory according to the embodiment of the present invention can reduce the complexity of the data storage process without affecting the use of the local memory by the requesting node.
  • determining the first virtual address according to the first remote memory including:
  • the first virtual address is determined according to the first local memory.
  • the requesting node may determine, according to the length of the first remote memory, a piece of memory space (first local memory) from the local memory of the requesting node, and according to a preset algorithm or mapping relationship, for example, according to a pre- The ratio (for example, 1 byte (Byte) of local memory corresponds to 1 kilobyte (Kbyt e) of remote memory, it should be understood that the above enumerated ratios are merely illustrative, and the present invention is not limited thereto) Generating a correspondence page table of the first local memory and the first remote memory. Since the first local memory is the local memory of the requesting node, a virtual address can be assigned to the first local memory using the same or similar method as in the prior art.
  • the first local memory (specifically, all or part of the first local memory) may be determined according to the pointer, and according to Determining the first remote memory (specifically, the first remote memory all or part of the storage space) in the first remote memory, as described above, the first local memory and the first remote memory correspondence page table are generated. Access the first data (described in detail later).
  • the first local memory may be determined according to the pointer using the same or similar method as the prior art.
  • the method of managing memory according to an embodiment of the present invention can reduce changes to existing data storage processes and methods, and improve practicability.
  • the requesting node may determine the pointer according to the first data.
  • the first data store (corresponding to a read command) or the need to store (corresponding to a write command) in remote memory. Thereafter, the requesting node may determine, according to the length of the first data, the first remote memory for storing The storage space of the first data is stored. And carrying information indicating the storage space (third indication information) in the first data read/write command
  • the length of the first remote memory is the same as the length of the first data
  • the third indication information is used to indicate a starting physical address of the storage space.
  • the pointer length of the first data is the same as the length of the first remote memory, the entire storage space of the first remote memory needs to be used, and at this time, the data read and write instruction sent by the requesting node to the contributing node (the first)
  • information indicating the starting physical address of the first remote memory (an example of the third indication information) may be carried. Therefore, in a case where the third indication information indicates only the starting physical address of the storage space, and the indicated starting physical address of the storage space is the same as the starting physical address of the first remote memory, the contributing node may default to It is determined that the length of the first data is the same as the length of the first remote memory, so that access to the first data can be achieved.
  • the third indication information is used to indicate a starting physical address of the storage space.
  • the data read and write instruction sent by the requesting node to the contributing node may carry information indicating the starting physical address and length of the partial storage space of the first remote memory (another example of the third indication information). Therefore, the contributing node can access the first data in the first remote memory according to the third indication information.
  • the requesting node in the memory management system is capable of acquiring the contributing node information for indicating the target contributing node
  • Sending the first indication information to the target contribution node according to the contribution node information including: sending, according to the contribution node information, a second data write command for the second data and the second data to the target contribution node, where the second data
  • the two data write instructions include the first indication information
  • the receiving the second indication information sent by the target contribution node includes: Receiving, by the target contribution node, a second data write response for indicating completion of the second data storage, the second data write response including the second indication information.
  • the contribution node information includes an identifier of the contributing node in the memory management system or a location of the contributing node in the memory management system;
  • the request information includes an identifier of the requesting node in the memory management system or a location of the requesting node in the memory management system.
  • each service node (including a contributing node and a requesting node) in the system may learn routing information between each other, and the routing information may be a node identifier of the serving node (Node ID) ), may also be the location of the service node, for example, the server node may broadcast information indicating the location of the Node ID or the service node in the system, and thus, at S140, the requesting node may according to the routing information of the contributing node, a contribution node in the system, sending a data read/write instruction (first data read/write instruction) for the first data, the first data read/write instruction may carry a memory space indicating the first data storage or need to be stored (first Information about a part or all of the storage space of a remote memory (third indication information).
  • the contributing node may receive the first data read/write instruction, and determine, according to the third indication information, the first data storage or the memory space that needs to be stored in the first remote memory (some or all of the first
  • the sending, by the first data read/write instruction for the first data includes:
  • the first data read and write instruction for the first data is broadcasted, so that the contributing node accesses the first data after determining that the storage space is within a range of remote memory that the contributing node can provide.
  • the requesting node may broadcast a data read/write instruction for the first data in the system (the first data read Write command), the first data read/write instruction may carry information (third indication information) indicating the first data storage or a storage space (partial or full storage space of the first remote memory) to be stored.
  • the contributing node Since in the case 1 the contributing node is able to autonomously determine the first remote The length of the deposit and the starting physical address. In case 2, the contributing node can learn the length of the first remote memory and the starting physical address from the control center. Therefore, when the first data storage indicated by the third indication information or the storage space that needs to be stored is within the range of the first remote memory, it may be determined that the storage for the first data can be performed in the first remote memory. take.
  • the memory management system includes at least two contributing nodes, and the physical addresses of the remote memory that the at least two contributing nodes can provide are different.
  • the control center may make the physical address of the remote memory a provided by the contributing node a of the at least two contributing nodes and the physical of the remote memory b provided by the contributing node b The address is different, so that when the requesting node sends the first data read/write instruction by broadcast, for example, if the requesting node needs to use the remote memory a provided by the contributing node a, the first data read/write instruction carries the indicating remote memory.
  • the third indication information Information of the physical address of the storage space in a (an example of the third indication information)
  • the contribution node b receives the first data read/write instruction
  • the physical address indicated by the third indication information is not in the physical address of the remote memory b
  • the first data read and write instructions are not read or written.
  • the contributing node a receives the first data read/write command
  • the first data read/write instruction is performed according to the first data read/write command. Read and write.
  • the contributing node b is determined not to be based on the first data when receiving the first data read/write instruction and because the physical address indicated by the third indication information is not within the range of the physical address of the remote memory b
  • the first data read/write instruction can be forwarded by the adjacent node in the system, thereby accelerating the first data read/write instruction to reach the contribution node a.
  • the contributing node b forwards the first data read and write command only once.
  • the remote memory used by the requesting node is determined from the contributing node according to the memory required by the requesting node and the memory that the contributing node can provide, and the remote memory is allocated virtual in the requesting node.
  • the request node needs to store the pointer in the virtual
  • the access to the data in memory makes it easy to share the memory.
  • Figure 2 shows a schematic flow diagram of a method 200 of managing memory as described from the perspective of a contributing node. As shown in FIG. 2, the method 200 includes:
  • the contributing node in the memory management system determines a first remote memory, where the first remote memory is determined according to the first indication information from the requesting node, where the first indication information is used to indicate a length of memory required by the requesting node, The length of the first remote memory is greater than or equal to the length of memory required by the requesting node;
  • the length of the memory represents the size of the memory.
  • the contributing node receives a first data read/write instruction for the first data sent by the requesting node, where the first data read/write instruction is used to indicate that the contributing node accesses the first data, the first data read/write instruction
  • the third indication information is used to indicate a storage space in the first remote memory for storing the first data.
  • the contributing node accesses the first data according to the first data read/write instruction and the third indication information.
  • the requesting node may send a request message to the outside, and the request message may carry the indication requesting node
  • the information of the required memory (an example of the first indication information)
  • the memory capacity indicated by the first indication information may be greater than the memory capacity required by the requesting node, or may be equal to the request.
  • the memory capacity required by the node is not particularly limited in the present invention.
  • the requesting node may obtain routing information of each contributing node in the system (an example of the contributing node information described later), and directly send the request message to the contributing node, so that the contributing node can receive the requesting node.
  • the first indication sent ie, case 3
  • the control center described later can be configured in the system to uniformly perform the allocation of the remote memory provided by each contributing node in the system (ie, Case 4). Next, Case 3 and Case 4 will be described separately.
  • the contributing node in the memory management system determines that the first remote memory includes:
  • the contributing node in the memory management system receives the first indication information sent by the requesting node; determining the first remote memory according to the first indication information;
  • the method also includes:
  • each service node (including a contributing node and a requesting node) in the system can learn routing information between each other (an example of contributing node information), and the routing information can be the service.
  • the node ID of the node may also be the location of the service node.
  • the contributing node may broadcast information in the system indicating the remote memory it can provide (for example, the information may indicate the size of the remote memory and the The routing information of the contributing node, the requesting node may determine, according to the information, that the contributing node and the contributing node can provide remote memory, so that the requesting node may send a request to the contributing node in the system according to the routing information of each serving node;
  • the request and the message may carry information indicating an amount of memory required by the requesting node (an example of the first indication information), so that, at S21 0, the contributing node may, according to the request, receive the request message.
  • the first indication information that the message can carry, and the service External nodes can provide for the memory, determining whether the requesting node that it needs to provide memory.
  • the contributing node may determine from the local memory that the capacity is greater than or equal to the remote memory provided by the requesting node to provide the required memory (first Remote memory).
  • the contributing node may return a response message to the requesting node, where the response message may carry information (second indication information) indicating the memory (first remote memory) that the service node can provide.
  • the requesting node can receive the second indication information sent by the contributing node.
  • the two parties of the contributing node can learn that the requesting node obtains the right to use the first remote memory in the contributing node.
  • the requesting node can exclusively use the first remote memory, thereby improving service security. Sex.
  • the receiving, by the contributing node in the memory management system, the first indication information sent by the requesting node includes:
  • the sending, by the requesting node, the second indication information for indicating the first remote memory includes: sending, to the requesting node, a second data write response for indicating completion of the second data storage, where the second data write response includes Second indication information for indicating the first remote memory.
  • each service node (including a contributing node and a requesting node) in the system can learn routing information between each other, so that when the local memory of the requesting node is insufficient or needs to be used
  • the requesting node can refer to the routing information of each service node to the system.
  • the other service node (including the contributing node) sends a data write instruction (an example of the second data write command) for the second data
  • the second data write instruction may carry information indicating the memory required by the request node (first An example of the indication information). It should be understood that the length of the memory required by the requesting node indicated by the first indication information may be greater than or equal to the length of the second data, and the present invention is not particularly limited.
  • the length of the memory required by the request node indicated by the first indication information is greater than or equal to the length of the second data, so the contributing node may a second data write instruction storing the second data in part or all of the storage space of the first remote memory, such that the contribution node can send a second data write response to the requesting node indicating that the second data storage is completed
  • the second indication information is carried in the middle. It should be understood that the first data and the second data enumerated above may be the same data or different data, and the present invention is not particularly limited.
  • the length of the first remote memory is the same as the length of memory required by the requesting node, and the second indication information is used to indicate a starting physical address of the first remote memory.
  • the contributing node may return only the starting physical address of the first remote memory (in the contributing node) to the requesting node. (An example of the second indication information).
  • the requesting node may determine by default that the memory capacity provided by the contributing node is the same as the memory capacity required by the requesting node.
  • the length of the first remote memory is greater than the length of memory required by the requesting node, and the second indication information is used to indicate a starting physical address and length of the first remote memory.
  • the contributing node may return the starting physical address and length of the first remote memory (in the contributing node) to the requesting node. (Another example of the second indication information). Therefore, the requesting node may determine the starting physical address and length of the first remote memory according to the second indication information, and use any storage space in the first remote memory as needed.
  • the contributing node in the memory management system determines that the first remote memory includes:
  • the contributing node in the memory management system sends a fourth indication information to the control center, where the fourth indication information is used to indicate a starting physical address and a length of the remote memory that the contributing node can provide;
  • the control center Receiving, by the control center, the second indication information for indicating the first remote memory, where the first remote memory is determined by the control center according to the first indication information and the fourth indication information;
  • a control center may be set in the system for acquiring information about remote memory that the server node can provide, and uniformly scheduling the remote memory resource.
  • the control center may be independent of each server node, that is, the control center may have an independent hardware structure (for example, a processor, a memory, an I/O device, etc.), thereby signaling or The communication may be performed by means of a message or the like, or the client may be provided in the system of each server node, thereby sharing a hardware device such as a processor (for example, a processor, a memory, an I/O device, etc.) with each server node.
  • a hardware device such as a processor (for example, a processor, a memory, an I/O device, etc.) with each server node.
  • the node when a server node (contributing node) is idle or has unused memory, the node can provide memory (remote memory) to other server nodes, and, for example, clean up data in the remote memory, After deleting the page table mapping relationship of the remote memory in the local node, the contributing node may report information (fourth indication information) indicating the remote memory that can be provided to the control center. For example, the fourth indication information may indicate the remote location. The physical address and length of the memory in the contributing node.
  • control center or the client configured in the requesting node
  • the control center can learn the information of the contributing node (for example, the routing information of the contributing node within the system) and the information of the remote memory provided by the contributing node (for example, The physical address and length of the remote memory).
  • the requesting node may send a request message to the control center, the request message may carry information indicating an amount of memory required by the requesting node (an example of the first indication information).
  • the control center may determine, according to the first indication information and the fourth indication information, a memory that can contribute to the node and the contribution node provides to the requesting node (first remote memory). For example, if the service node is able to provide externally with a memory capacity greater than or equal to the requested node providing its required memory, it can act as a contributing node.
  • the first remote memory may be greater than or equal to the memory length indicated by the first indication information.
  • the first remote memory may be less than or equal to the memory length indicated by the fourth indication.
  • control center may send the information indicating the first remote memory (the second indication information) to the requesting node and the contributing node, so that, in S210, the contributing node may learn that the requesting node obtains the first remote memory in the contributing node.
  • the requesting node can also know that the requesting node has obtained the right to use the first remote memory in the contributing node.
  • the method further includes: Obtaining request node information for indicating the requesting node;
  • the requesting node can use the first remote memory exclusively, thereby improving the security of the service.
  • the length of the first remote memory is the same as the length of memory required by the requesting node, and the second indication information is used to indicate a starting physical address of the first remote memory.
  • the contributing node may return only the starting physical address of the first remote memory (in the contributing node) to the requesting node. (An example of the second indication information).
  • the requesting node may determine by default that the memory capacity provided by the contributing node is the same as the memory capacity required by the requesting node.
  • the length of the first remote memory is greater than the length of memory required by the requesting node, and the second indication information is used to indicate a starting physical address and length of the first remote memory.
  • the contributing node may return the starting physical address and length of the first remote memory (in the contributing node) to the requesting node. (Another example of the second indication information). Therefore, the requesting node may determine the starting physical address and length of the first remote memory according to the second indication information, and use any storage space in the first remote memory as needed.
  • the requesting node may allocate a virtual address (first virtual address) for the first remote memory.
  • the processor can reach 32 bits or even 64 bits, so that the range of virtual addresses that can be used can reach 232 or 264, and the memory capacity in a typical computer system is much smaller than this value, and thus, there may be A sufficient virtual address is allocated to the first remote memory, and the requesting node can regard the first remote memory as its local memory space, so that the same or similar method as the prior art can be used for the memory space (first Remote memory) assign virtual address (first virtual address). Also, to avoid indication confusion, it may be provided that the first virtual address assigned to the first remote memory is different from the second virtual address assigned to the local memory in the requesting node.
  • the first data storage may be determined according to the pointer or needs to be stored in the first remote memory (specifically, the first remote memory) All or part of the storage space) to access the first data in the first remote memory (described in detail later).
  • the method for managing memory according to an embodiment of the present invention can reduce the complexity of the data storage process without affecting the use of local memory by the requesting node.
  • the requesting node may determine a memory space (first local memory) from the local memory of the requesting node according to the length of the first remote memory, and according to a preset algorithm or mapping relationship, for example, according to a preset
  • the ratio for example, 1 byte (Byt e ) of local memory corresponds to 1 kilobyte (Kbyt e) of remote memory, it should be understood that the above enumerated ratios are merely illustrative, and the present invention is not limited thereto
  • Generating a correspondence page table of the first local memory and the first remote memory Generating a correspondence page table of the first local memory and the first remote memory. Since the first local memory is the local memory of the requesting node, the virtual memory can be assigned to the first local memory using the same or similar method as in the prior art.
  • the first local memory (specifically, all or part of the first local memory) may be determined according to the pointer, and according to Determining the first remote memory (specifically, the first remote memory all or part of the storage space) in the first remote memory, as described above, the first local memory and the first remote memory correspondence page table are generated. Access the first data (described in detail later).
  • the first local memory may be determined according to the pointer using the same or similar method as the prior art.
  • the method of managing memory according to an embodiment of the present invention can reduce changes to existing data storage processes and methods, and improve practicability.
  • the requesting node When the requesting node receives the read/write instruction (the first data read/write instruction) for the data (the first data) in the range of the first virtual address, the requesting node may determine the pointer according to the first data.
  • the first data store (corresponding to a read command) or the need to store (corresponding to a write command) in remote memory. Thereafter, the requesting node may determine, according to the length of the first data, a storage space in the first remote memory for storing the first data. And carrying information indicating the storage space (third indication information) in the first data read/write command
  • the length of the first remote memory is the same as the length of the first data
  • the third indication information is used to indicate a starting physical address of the storage space.
  • the pointer length of the first data is the same as the length of the first remote memory, the entire storage space of the first remote memory needs to be used, and at this time, the data read and write instruction sent by the requesting node to the contributing node (the first)
  • information indicating the starting physical address of the first remote memory (an example of the third indication information) may be carried. Therefore, in a case where the third indication information indicates only the starting physical address of the storage space, and the indicated starting physical address of the storage space is the same as the starting physical address of the first remote memory, the contributing node may default to It is determined that the length of the first data is the same as the length of the first remote memory, so that access to the first data can be achieved.
  • the third indication information is used to indicate a starting physical address of the storage space.
  • the data read and write instruction sent by the requesting node to the contributing node may carry information indicating the starting physical address and length of the partial storage space of the first remote memory (another example of the third indication information). Therefore, the contributing node can access the first data in the first remote memory according to the third indication information.
  • each service node (including a contributing node and a requesting node) in the system may learn routing information between each other, and the routing information may be a node identifier (Node ID) of the serving node, or Is the location of the service node, for example, the server node may broadcast information indicating the Node ID or the location of the service node in the system, so that the requesting node may Sending, according to the routing information of the contributing node, a data read/write instruction (first data read/write instruction) for the first data to the contributing node in the system, where the first data read/write instruction may carry the indication of the first data storage or Information (third indication information) of the memory space (partial or total storage space of the first remote memory) to be stored.
  • Node ID node identifier
  • the server node may broadcast information indicating the Node ID or the location of the service node in the system, so that the requesting node may Sending, according to the routing information of the contributing node, a data read/write instruction
  • the contributing node may receive the first data read/write instruction, and determine, according to the third indication information, the first data storage or the memory space that needs to be stored in the first remote memory according to the third indication information (first remote) Some or all of the memory is stored, and the first data is accessed.
  • the requesting node may broadcast a data read/write instruction (first data read/write instruction) for the first data in the system
  • the first data read/write instruction may carry information (third indication information) indicating the storage space (partial or full storage space of the first remote memory) in which the first data is stored or stored.
  • the contributing node can receive the first data read/write instruction. Since the contributing node can autonomously determine the length of the first remote memory and the starting physical address in case 3, in case 4 the contributing node can learn the length and starting physical address of the first remote memory from the control center. Therefore, when the first data storage indicated by the third indication information or the storage space that needs to be stored is within the range of the first remote memory, at S230, the contributing node may determine that the first remote memory can be performed in the first remote memory. Access to the first data.
  • the remote memory used by the requesting node is determined from the contributing node according to the memory required by the requesting node and the memory that the contributing node can provide, and the remote memory is allocated virtual in the requesting node.
  • An address when the requesting node needs to store data with a pointer in the virtual address range, according to the correspondence between the virtual address and the remote memory, determining that the data needs to be accessed on the contributing node, so that the contributing node can
  • the data read and write instructions are sent to access the data in the remote memory, thereby facilitating the sharing of the memory.
  • FIG. 3 shows a schematic flow of a method 300 of managing memory as described from the perspective of a control center.
  • the method 300 includes:
  • control center in the memory management system determines a starting physical address and a length of the remote memory that the at least one contributing node can provide;
  • the control center receives first indication information sent by the requesting node, where the first indication information is used to indicate a length of memory required by the requesting node;
  • the length of the memory represents the size of the memory.
  • the control center determines, according to the first indication information and a starting physical address and a length of the remote memory that the at least one contributing node can provide, the target contributing node from the contributing node, and the target contributing node provides the requesting node to the requesting node.
  • the first remote memory, the length of the first remote memory is greater than or equal to the length of memory required by the requesting node;
  • the control center sends second indication information for indicating the first remote memory to the requesting node and the target contributing node, so that the requesting node and the target contributing node determine the first according to the second indication information.
  • a remote memory and for the first data access in the first remote memory, wherein the pointer of the first data is within a first virtual address range allocated by the requesting node for the first remote memory.
  • a control center may be set in the system for acquiring information about remote memory that the server node can provide, and uniformly scheduling the remote memory resource.
  • the control center may be independent of each server node, that is, the control center may have an independent hardware structure (for example, a processor, a memory, an I/O device, etc.), thereby being connected to each server. Communication may be performed by means of signaling or messages, or the client may be set in the system of each server node, thereby sharing hardware devices such as processors and processors with each server node (for example, a processor, a memory, an I/O device, etc.) ).
  • control center can maintain a remote memory set such that the starting physical address and length of the remote memory that at least one of the contributing nodes can provide can be determined.
  • the processing center in the memory management system determines a starting physical address and a length of the remote memory that the at least one contributing node can provide:
  • the processing center in the memory management system receives the fourth indication information sent by the at least one contributing node, where the fourth indication information is used to indicate a starting physical address and a length of the remote memory that the contributing node can provide;
  • the node when a server node (contributing node) is idle or has unused memory, the node can provide memory (remote memory) to other server nodes, and, for example, clean up data in the remote memory, After deleting the page table mapping relationship of the remote memory in the local node, the contributing node may report information (fourth indication information) indicating the remote memory that can be provided to the control center. For example, the fourth indication information may indicate the remote location. The physical address and length of the memory in the contributing node.
  • the control center (or the client configured in the requesting node) can learn the information of the contributing node (for example, the routing information of the contributing node in the system) and the remote memory provided by the contributing node.
  • Information for example, the physical address and length of the remote memory.
  • the requesting node may send request information to the control center, and the request message may carry information indicating an amount of memory required by the requesting node (an example of the first indication information).
  • the control center can learn the first indication information.
  • the control center may determine, according to the first indication information and the fourth indication information, a memory that can be contributed to the node and provided by the contributing node to the requesting node (first remote memory). For example, if the service node is able to provide a memory capacity greater than or equal to the memory required by the requesting node, it can act as a contributing node. Moreover, in the embodiment of the present invention, the control center determines that the first remote memory may be greater than or equal to the memory length indicated by the first indication information. The first remote memory may be less than or equal to the memory length indicated by the fourth indication.
  • the control center may send information indicating the first remote memory (second indication information) to the requesting node and the contributing node, so that both the requesting node and the contributing node can know that the requesting node obtains the contributing node.
  • the right to use the first remote memory in the embodiment of the present invention, The requesting node can exclusively use the first remote memory, thereby improving the security of the service.
  • the length of the first remote memory is the same as the length of memory required by the requesting node, and the second indication information is used to indicate a starting physical address of the first remote memory.
  • the contributing node may return only the starting physical address of the first remote memory (in the contributing node) to the requesting node. (An example of the second indication information).
  • the requesting node may determine by default that the memory capacity provided by the contributing node is the same as the memory capacity required by the requesting node.
  • the length of the first remote memory is greater than the length of memory required by the requesting node, and the second indication information is used to indicate a starting physical address and length of the first remote memory.
  • the contributing node may return the starting physical address and length of the first remote memory (in the contributing node) to the requesting node. (Another example of the second indication information). Therefore, the requesting node may determine the starting physical address and length of the first remote memory according to the second indication information, and use any storage space in the first remote memory as needed.
  • the requesting node may allocate a virtual address (first virtual address) for the first remote memory.
  • the processor can reach 32 bits or even 64 bits, so that the range of virtual addresses that can be used can reach 232 or 264, and the memory capacity in a typical computer system is much smaller than this value, and thus, there may be A sufficient virtual address is allocated to the first remote memory, and the requesting node can regard the first remote memory as its local memory space, so that the same or similar method as the prior art can be used for the memory space (first Remote memory) Assign a virtual address (first virtual address). Also, to avoid indication confusion, it may be provided that the first virtual address assigned to the first remote memory is different from the second virtual address assigned to the local memory in the requesting node.
  • the first data storage may be determined according to the pointer or needs to be stored in the first remote memory (specifically, Is the first remote memory all or part of the storage space) to access the first data in the first remote memory (described in detail later).
  • the method for managing memory according to an embodiment of the present invention can reduce the complexity of the data storage process without affecting the use of local memory by the requesting node.
  • the requesting node may determine a memory space (first local memory) from the local memory of the requesting node according to the length of the first remote memory, and according to a preset algorithm or mapping relationship, for example, according to a preset
  • the ratio for example, 1 byte (Byt e ) of local memory corresponds to 1 kilobyte (Kbyt e) of remote memory, it should be understood that the above enumerated ratios are merely illustrative, and the present invention is not limited thereto
  • Generating a correspondence page table of the first local memory and the first remote memory Generating a correspondence page table of the first local memory and the first remote memory. Since the first local memory is the local memory of the requesting node, the virtual memory can be assigned to the first local memory using the same or similar method as in the prior art.
  • the first local memory (specifically, all or part of the first local memory) may be determined according to the pointer, and according to Determining the first remote memory (specifically, the first remote memory all or part of the storage space) in the first remote memory, as described above, the first local memory and the first remote memory correspondence page table are generated. Access the first data (described in detail later).
  • the first local memory may be determined according to the pointer using the same or similar method as the prior art.
  • the method of managing memory according to an embodiment of the present invention can reduce changes to existing data storage processes and methods, and improve practicability.
  • the requesting node may determine the first data storage according to the pointer of the first data when receiving the read/write instruction (first data read/write instruction) for the data (first data) of the pointer in the first virtual address range. (corresponding to read command) or need to store (corresponding to write command) in remote memory. Thereafter, the requesting node may determine, according to the length of the first data, a storage space in the first remote memory for storing the first data. And carrying information indicating the storage space (third indication information) in the first data read/write command For example, in the embodiment of the present invention, the length of the first remote memory is the same as the length of the first data, and the third indication information is used to indicate a starting physical address of the storage space.
  • the pointer length of the first data is the same as the length of the first remote memory, the entire storage space of the first remote memory needs to be used, and at this time, the data read and write instruction sent by the requesting node to the contributing node (the first)
  • information indicating the starting physical address of the first remote memory (an example of the third indication information) may be carried. Therefore, in a case where the third indication information indicates only the starting physical address of the storage space, and the indicated starting physical address of the storage space is the same as the starting physical address of the first remote memory, the contributing node may default to It is determined that the length of the first data is the same as the length of the first remote memory, so that access to the first data can be achieved.
  • the third indication information is used to indicate a starting physical address of the storage space.
  • the data read and write instruction sent by the requesting node to the contributing node may carry information indicating the starting physical address and length of the partial storage space of the first remote memory (another example of the third indication information). Therefore, the contributing node can access the first data in the first remote memory according to the third indication information.
  • the method further includes:
  • the contribution node information includes an identifier of the contributing node in the memory management system or a location of the contributing node in the memory management system;
  • the request information includes an identifier of the requesting node in the memory management system or a location of the requesting node in the memory management system.
  • the control center may notify the requesting node of the routing information of the contributing node, so that the requesting node may send the first data to the contributing node in the system according to the routing information of the contributing node.
  • Data read/write instruction first data read/write instruction
  • the first data read/write instruction may carry information indicating the first data storage or a memory space (partial or all storage space of the first remote memory) to be stored ( Third indication information).
  • the contributing node may receive the first data read/write instruction, and determine, according to the third indication information, the first data storage or the memory space that needs to be stored in the first remote memory (some or all of the first remote memory) ) and access the first data.
  • the method further includes:
  • the control center may notify the contributing node of the routing information of the requesting node, so that the contributing node may only allow the requesting node to use the first remote memory according to the routing information of the requesting node.
  • the other remote memory including the contributing node, uses the first remote memory, thereby improving network security.
  • the memory management system includes at least two contributing nodes, and
  • Determining, according to the first indication information and the fourth indication information, the target tribute node from the contributing node and the first remote memory provided by the target contributing node to the requesting node includes:
  • the control center may make the physical address of the remote memory a provided by the contributing node a of the at least two contributing nodes and the physical of the remote memory b provided by the contributing node b
  • the addresses are different, and thus, the requesting node is broadcasted
  • the first data read/write instruction carries information indicating the physical address of the storage space in the remote memory a (third An example of the indication information)
  • the contribution node b receives the first data read/write command, since the physical address indicated by the third indication information is not within the range of the physical address of the remote memory b, the first data is not Read and write instructions are read and written.
  • the contributing node a when the contributing node a receives the first data read/write command, since the physical address indicated by the third indication information is within the range of the physical address of the remote memory a, the first data read/write instruction is performed according to the first data read/write command. Read and write.
  • the contributing node b is determined not to be based on the first data when receiving the first data read/write instruction and because the physical address indicated by the third indication information is not within the range of the physical address of the remote memory b
  • the first data read/write instruction can be forwarded by the adjacent node in the system, thereby accelerating the first data read/write instruction to reach the contribution node a.
  • the contributing node b forwards the first data read and write command only once.
  • the remote memory used by the requesting node is determined from the contributing node according to the memory required by the requesting node and the memory that the contributing node can provide, and the remote memory is allocated virtual in the requesting node.
  • An address when the requesting node needs to store data with a pointer in the virtual address range, according to the correspondence between the virtual address and the remote memory, determining that the data needs to be accessed on the contributing node, so that the contributing node can
  • the data read and write instructions are sent to access the data in the remote memory, thereby facilitating the sharing of the memory.
  • FIGS. 1 to 3 a method of managing memory according to an embodiment of the present invention is described in detail with reference to FIGS. 1 to 3.
  • an apparatus for managing a memory according to an embodiment of the present invention will be described in detail with reference to FIGS. 4 to 6.
  • FIG. 4 shows a schematic block diagram of an apparatus 400 for managing memory in accordance with an embodiment of the present invention. As shown in Figure 7, the device 400 includes:
  • the apparatus 400 for managing memory may correspond to the method of the embodiment of the present invention.
  • the modules in the device 400 for managing the memory and the other operations and/or functions described above, respectively, in order to implement the corresponding processes of the method 100 in FIG. 1, for the sake of cleaning, no further description is provided herein. .
  • the apparatus for managing memory determines a remote memory for use by a requesting node from a contributing node according to a memory required by the requesting node and a memory that the contributing node can provide, and allocates a virtual space for the remote memory in the requesting node.
  • An address when the requesting node needs to store data with a pointer in the virtual address range, according to the correspondence between the virtual address and the remote memory, determining that the data needs to be accessed on the contributing node, so that the contributing node can
  • the data read and write instructions are sent to access the data in the remote memory, thereby facilitating the sharing of the memory.
  • FIG. 4 shows a schematic block diagram of an apparatus 400 for managing memory in accordance with an embodiment of the present invention. As shown in Figure 7, the device 400 includes:
  • the sending unit 41 0 is configured to enable the requesting node in the memory management system to send the first indication information, where the first indication information is used to indicate a length of memory required by the requesting node;
  • the receiving unit 42 0 is configured to receive second indication information, where the second indication information is used to indicate that the target remote node in the at least one contributing node that can provide the remote memory provides the first remote memory to the requesting node, where the first a remote memory is determined according to the first indication information, where the length of the first remote memory is greater than or equal to the length of memory required by the requesting node;
  • the processing unit 4 30 is configured to determine, from a virtual address that can be used, a first virtual address corresponding to the first remote memory;
  • the control sending unit 410 sends a first data read/write instruction for the first data, where the first data read/write instruction includes
  • the third indication information is used to indicate a storage space in the first remote memory for storing the first data, so that the target contribution node accesses the first data according to the third indication information.
  • the length of the memory represents the size of the memory.
  • the processing unit 430 is specifically configured to acquire, by using the contribution node information, the target contribution node;
  • the sending unit 410 is configured to send first indication information to the target contributing node according to the contributing node information
  • the receiving unit 420 is specifically configured to receive the second indication information sent by the target contribution node.
  • the sending unit 410 is specifically configured to send, according to the contribution node information, a second data write instruction for the second data to the target contribution node, where the second data write instruction includes the first indication information;
  • the receiving unit 420 is specifically configured to receive a second data write response sent by the target contribution node to indicate completion of the second data storage, where the second data write response includes the second indication information.
  • the sending unit 410 is specifically configured to send the first indication information to the control center, so that the control center determines, according to the first indication information and a length of the remote memory that the contributing node can provide, from the contributing node. a target contribution node and the first remote memory, wherein a length of the remote memory that the contribution node can provide is a fourth indication information sent by the control center according to the contribution node to indicate a length of the remote memory that the contribution node can provide Determining; and the receiving unit 420 is specifically configured to receive the second indication information sent by the control center.
  • the receiving unit 420 is further configured to receive, by the control center, information about the contributing node that is used to indicate the target contributing node, and
  • the sending unit 410 is specifically configured to send, according to the contribution node information, a first data read/write instruction for the first data to the target contribution node.
  • the sending unit 410 is specifically configured to broadcast a first data read/write instruction for the first data, so that the contributing node saves the storage space within a range of remote memory that the contributing node can provide. Take the first data.
  • the memory management system includes at least two contributing nodes, and the physical addresses of the remote memory that the at least two contributing nodes can provide are different.
  • the processing unit 430 is specifically configured to determine, from a local memory in the request node. a first local memory corresponding to the first remote memory;
  • the first virtual address is determined according to the first local memory.
  • the length of the first remote memory is the same as the length of the memory required by the requesting node, and the second indication information is used to indicate a starting physical address of the first remote memory;
  • the length of the first remote memory is the same as the length of the first data, and the third indication information is used to indicate a starting physical address of the storage space.
  • the second indication information is used to indicate a starting physical address and a length of the first remote memory
  • the third indication information is used to indicate a starting physical address of the first remote memory
  • the third indication information is used to indicate a starting physical address and a length of the storage space.
  • the device 400 for managing memory may correspond to a requesting node in the method of the embodiment of the present invention, and each unit in the device 400 for managing memory and the other operations and/or functions described above are respectively implemented.
  • the corresponding process of the method 100 in FIG. 1 is not described here.
  • the apparatus for managing memory determines a remote memory for use by a requesting node from a contributing node according to a memory required by the requesting node and a memory that the contributing node can provide, and allocates a virtual space for the remote memory in the requesting node.
  • An address when the requesting node needs to store data with a pointer in the virtual address range, according to the correspondence between the virtual address and the remote memory, determining that the data needs to be accessed on the contributing node, so that the contributing node can
  • the data read and write instructions are sent to access the data in the remote memory, thereby facilitating the sharing of the memory.
  • FIG. 5 shows a schematic block diagram of an apparatus 500 for managing memory in accordance with an embodiment of the present invention.
  • the apparatus 500 includes:
  • the processing unit 510 is configured to enable the contributing node in the memory management system to determine the first remote memory,
  • the first remote memory is determined according to the first indication information from the requesting node, where the first indication information is used to indicate a length of memory required by the requesting node, where the length of the first remote memory is greater than or equal to that required by the requesting node.
  • the length of the memory is configured to enable the contributing node in the memory management system to determine the first remote memory,
  • the first remote memory is determined according to the first indication information from the requesting node, where the first indication information is used to indicate a length of memory required by the requesting node, where the length of the first remote memory is greater than or equal to that required by the requesting node.
  • the receiving unit 520 is configured to receive, by the requesting node, a first data read/write instruction for the first data, where the first data read/write instruction is used to indicate that the contributing node accesses the first data, and the first data is read and written.
  • the instruction includes third indication information, where the third indication information is used to indicate a storage space in the first remote memory for storing the first data;
  • the processing unit 510 is further configured to access the first data according to the first data read/write instruction and the third indication information.
  • the length of the memory represents the size of the memory.
  • the receiving unit 520 is specifically configured to receive the first indication information sent by the requesting node;
  • the processing unit 510 is specifically configured to determine the first remote memory according to the first indication information
  • the device also includes:
  • the sending unit 530 is configured to send, to the requesting node, second indication information for indicating the first remote memory.
  • the receiving unit 520 is configured to receive a second data write command for the second data and the second data that is sent by the requesting node, where the second data write command includes the first indication information.
  • the first remote memory is determined according to the first indication information, and the first data is stored in the first remote memory;
  • the sending unit 530 is specifically configured to send, to the requesting node, a second data write response for indicating completion of the second data storage, where the second data write response includes second indication information for indicating the first remote memory.
  • the device further includes:
  • the sending unit 530 is configured to send fourth indication information to the control center, where the fourth indication information is used by Instructing the starting physical address and length of the remote memory that the contributing node can provide; the receiving unit 520 is specifically configured to receive second indication information that is sent by the control center and used to indicate the first remote memory, the first remote memory The control center determines, according to the first indication information and the fourth indication information;
  • the processing unit 510 is specifically configured to determine the first remote memory according to the second indication information.
  • the processing unit 510 is specifically configured to determine that the storage space is within a range of the first remote memory;
  • the length of the required memory of the requesting node is the same as the length of the first data
  • the length of the remote memory that the target contributing node can provide is the same as the length of the required memory of the requesting node
  • the second indication information and the third indication information are used to indicate a starting physical address of the first remote memory.
  • the second indication information is used to indicate a starting physical address and a length of the first remote memory
  • the third indication information is used to indicate a starting physical address of the first remote memory
  • the third indication information is used to indicate a starting physical address and a length of the storage space.
  • processing unit 510 is further configured to obtain request node information used to indicate the requesting node.
  • the device 500 for managing memory may correspond to a contributing node in the method of the embodiment of the present invention, and each unit in the device 500 for managing memory and the other operations and/or functions described above are respectively implemented.
  • the apparatus for managing memory determines a remote memory for use by a requesting node from a contributing node according to a memory required by the requesting node and a memory that the contributing node can provide, and allocates a virtual space for the remote memory in the requesting node.
  • An address when the requesting node needs to store data with a pointer in the virtual address range, according to the correspondence between the virtual address and the remote memory, determining that the data needs to be accessed on the contributing node, so that the contributing node can
  • the data read and write instructions are sent to access the data in the remote memory, thereby facilitating the sharing of the memory.
  • FIG. 6 shows a schematic block diagram of an apparatus 600 for managing memory in accordance with an embodiment of the present invention.
  • the device 600 includes:
  • the receiving unit 61 0 is configured to enable a control center in the memory management system to determine a starting physical address and a length of the remote memory that the at least one contributing node can provide;
  • the requesting node And configured to receive first indication information sent by the requesting node, where the first indication information is used to indicate a length of memory required by the requesting node;
  • the processing unit 62 0 is configured to determine, according to the first indication information and a starting physical address and a length of the remote memory that the at least one contributing node can provide, the target contributing node and the target contributing node to the requesting node Providing a first remote memory, the length of the first remote memory being greater than or equal to a length of memory required by the requesting node;
  • the sending unit 6 30 is configured to send second indication information for indicating the first remote memory to the requesting node and the target contributing node, so that the requesting node and the target contributing node determine the second indication information according to the second indication information.
  • a first remote memory and performing a first data access in the first remote memory, wherein the pointer of the first data is within a first virtual address range allocated by the requesting node for the first remote memory.
  • the length of the memory represents the size of the memory.
  • the sending unit 630 is further configured to send, to the requesting node, the contributing node information used to indicate the target contributing node, so that the requesting node tributes to the target according to the contributing node information.
  • the contribution node sends a first data read and write instruction for the first data.
  • the sending unit 630 is further configured to send, to the contributing node, request node information for indicating the requesting node, so that the target contributing node determines the requesting node according to the requesting node information, and prohibits the request from being removed.
  • the node other than the node uses the first remote memory.
  • the memory management system includes at least two contributing nodes, and
  • the processing unit is configured to determine, according to the first indication information and the fourth indication information, a target contribution node and a first remote memory that the target contribution node provides to the request node, so as to include the first
  • the physical addresses of the remote memory provided by each contributing node, such as remote memory, are different.
  • the length of the required memory of the requesting node is the same as the length of the first data
  • the length of the remote memory that the target contributing node can provide is the same as the length of the required memory of the requesting node
  • the second indication information and the third indication information are used to indicate a starting physical address of the first remote memory.
  • the second indication information is used to indicate a starting physical address and a length of the first remote memory
  • the third indication information is used to indicate a starting physical address of the first remote memory
  • the third indication information is used to indicate a starting physical address and a length of a storage space for storing the first data.
  • the receiving unit 610 is further configured to receive fourth indication information that is sent by the at least one contributing node, where the fourth indication information is used to indicate a starting physical address and a length of the remote memory that the contributing node can provide;
  • the processing unit 62 is specifically configured to determine, according to the fourth indication information, a starting physical address and a length of the remote memory that the at least one contributing node can provide.
  • the device 600 for managing memory according to an embodiment of the present invention may correspond to a control center in the method of the embodiment of the present invention, and each unit in the device 600 for managing memory and the other operations and/or functions described above are respectively implemented. The corresponding process of the method 300 in FIG. 3 is not described here.
  • the apparatus for managing memory determines a remote memory for use by a requesting node from a contributing node according to a memory required by the requesting node and a memory that the contributing node can provide, and allocates a virtual space for the remote memory in the requesting node.
  • An address when the requesting node needs to store data with a pointer in the virtual address range, according to the correspondence between the virtual address and the remote memory, determining that the data needs to be accessed on the contributing node, so that the contributing node can
  • the data read and write instructions are sent to access the data in the remote memory, thereby facilitating the sharing of the memory.
  • FIGS. 1 through 6 a method and apparatus for managing memory according to an embodiment of the present invention are described in detail with reference to FIGS. 1 through 6, and a system for managing memory according to an embodiment of the present invention will be described in detail below with reference to FIG.
  • FIG. 7 shows a schematic block diagram of a system 700 for managing memory in accordance with an embodiment of the present invention. As shown in Figure 7, the system 700 includes:
  • At least one requesting node 710 configured to send first indication information, where the first indication information is used to indicate a length of memory required by the requesting node, and receive second indication information, where the second indication information is used to indicate that remote memory is available
  • the first remote memory provided by the target contribution node of the at least one contributing node to the requesting node, wherein the first remote memory is determined according to the first indication information, where the length of the first remote memory is greater than or equal to the requesting node
  • the length of the required memory from the virtual address that can be used, determining the first virtual address corresponding to the first remote memory, when the first data of the pointer in the first virtual address range needs to be read and written, sending
  • the first data read/write instruction of the first data, the first data read/write instruction includes third indication information, where the third indication information is used to indicate a storage space for storing the first data in the first remote memory, So that the target contribution node accesses the first data according to the third indication information;
  • At least one contribution node 720
  • the length of the memory represents the size of the memory.
  • system further includes:
  • the control center 730 is configured to determine a starting physical address and a length of the remote memory that the at least one contributing node can provide, and receive the first indication information sent by the requesting node, where the first indication information is used to indicate the length of the required memory of the requesting node, Determining, according to the first indication information and a starting physical address and length of the remote memory that the at least one contributing node can provide, from the contributing node, the target contributing node and the first remote memory provided by the target contributing node to the requesting node, The length of the first remote memory is greater than or equal to the length of memory required by the requesting node, and sending, to the requesting node and the target contributing node, second indication information for indicating the first remote memory, to facilitate the requesting node and the
  • the target contribution node determines the first remote memory according to the second indication information, and performs a first data access in the first remote memory, where the pointer of the first data is the first remote memory at the request node
  • the first virtual address range is allocated
  • the requesting node 710 may correspond to the requesting node in the method of the embodiment of the present invention, and the modules and the other operations and/or functions in the requesting node 710 are respectively implemented in FIG. The corresponding process of the method 100 is not described here.
  • the contribution node 720 may correspond to a contribution node in the method of the embodiment of the present invention, and each of the units in the contribution node 720, and the other operations and/or functions described above, respectively, are implemented in FIG.
  • the corresponding process of the method 200 is not described here.
  • the control center 730 according to an embodiment of the present invention may correspond to a control center in the method of the embodiment of the present invention, and each unit in the control center 730, that is, the module and the other operations and/or functions described above are respectively implemented in FIG.
  • the corresponding process of the method 300 is not described here.
  • FIG. 8 shows a schematic structure of a system for managing memory according to an embodiment of the present invention.
  • a node of a system including a request node and a contributing node
  • a local memory including a request node and a contributing node
  • a processor memory controller including a processor memory controller
  • the remote memory control chip wherein the remote memory control chip of the requesting node can implement the function of the device 400 or 710 for managing the memory (ie, the flow of the method 100 in FIG. 1) in the embodiment of the present invention, either separately or together with the processor.
  • information transmission with the contributing node or the control center may be implemented, and the correspondence between the remote memory provided by the contributing node and the virtual address provided by the processor may be determined.
  • the remote memory control chip of the contributing node can implement the function of the device 500 or 720 for managing the memory (ie, the flow of the method 200 in FIG. 1) of the embodiment of the present invention, either alone or in conjunction with the processor, specifically,
  • the information transmission of the requesting node or the control center can access the data from the requesting node in the remote memory provided by the contributing node.
  • the configurations of the requesting node and the contributing node listed above are merely exemplary, and the present invention is not limited thereto.
  • the remote memory control chip may be integrated in the processor.
  • a system for managing memory determines a remote memory for use by a requesting node from a contributing node according to a memory required by the requesting node and a memory that the contributing node can provide, and allocates a virtual memory for the remote memory in the requesting node.
  • An address when the requesting node needs to store data with a pointer in the virtual address range, according to the correspondence between the virtual address and the remote memory, determining that the data needs to be accessed on the contributing node, so that the contributing node can The data read and write instructions are sent to access the data in the remote memory, thereby facilitating the sharing of the memory.
  • the disclosed systems, devices, and methods may be implemented in other ways.
  • the device embodiments described above are merely illustrative.
  • the division of the unit is only a logical function division.
  • there may be another division manner for example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored, or not executed.
  • the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be electrical, mechanical or otherwise.
  • the components displayed for the unit may or may not be physical units, ie may be located in one place, or may be distributed over multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solution of the embodiment.
  • each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the function is implemented in the form of a software functional unit and sold or used as a standalone product It can be stored on a computer readable storage medium.
  • the technical solution of the present invention may be embodied in the form of a software product in essence or in the form of a shared part of the prior art, and the computer software product is stored in a storage medium, including
  • the instructions are used to cause a computer device (which may be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention.
  • the foregoing storage medium includes: a USB flash drive, a removable hard disk, a Read-Only Memory (ROM), a random access memory (RAM, Random Acce ss Memory), a magnetic disk, or an optical disk, and the like, which can store program codes. Medium.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Human Computer Interaction (AREA)
  • Mobile Radio Communication Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

提供一种管理内存的方法、装置和系统,能够容易地实现内存资源的共享。该方法包括:请求节点发送第一指示信息,该第一指示信息用于指示该请求节点所需内存的长度;该请求节点接收第二指示信息,该第二指示信息用于指示能够提供远程内存的至少一个贡献节点中的目标贡献节点向该请求节点提供的第一远程内存;该请求节点从能够使用的虚拟地址中,确定与该第一远程内存相对应的第一虚拟地址;及当需要读写指针在该第一虚拟地址范围内的第一数据时,该请求节点发送针对该第一数据的第一数据读写指令,该第一数据读写指令包括第三指示信息,该第三指示信息用于指示该第一远程内存中用于存储该第一数据的存储空间。

Description

管理内存的方法、 装置和系统
技术领域 本发明涉及计算机领域, 并且更具体地, 涉及管理内存的方法、 装置和 系统 背景技术
目前, 管理资源的服务器系统根据规模不同, 通常由几十台、 几百台、 甚至上万台计算机服务器节点组成。 这些服务器节点大部分都是采用市场上 的商用标准服务器, 它们拥有各自独立内存等硬件设备。
随着云计算模式的不断普及和广为接受,服务器节点需要为云计算服务, 因此, 应用负载变得越来越多样化, 与事务处理和网络服务这样的传统负载 相比, 新出现的工作负载均是以数据为中心的。 这些新的输入输出 ( 10 , Input /Out put )密集型的负载运行在大规模集群上(几百或几千台服务器), 处理着多种多样的数据 (有结构化的、 无结构的、 多媒体的) 。
因此, 需要一种能够使各服务器节点之间容易地共享内存资源的方法。
发明内容
本发明实施例提供一种管理内存的方法、 装置和系统, 能够容易地实现 内存资源的共享。
第一方面, 提供了一种管理内存的方法, 该方法包括: 内存管理系统中 的请求节点发送第一指示信息, 该第一指示信息用于指示该请求节点所需内 存的长度; 接收第二指示信息, 该第二指示信息用于指示能够提供远程内存 的至少一个贡献节点中的目标贡献节点向该请求节点提供的第一远程内存, 其中, 该第一远程内存是根据该第一指示信息确定的, 该第一远程内存的长 度大于或等于该请求节点所需内存的长度; 从能够使用的虚拟地址中, 确定 与该第一远程内存相对应的第一虚拟地址; 当需要读写指针在该第一虚拟地 址范围内的第一数据时, 发送针对该第一数据的第一数据读写指令, 该第一 数据读写指令包括第三指示信息, 该第三指示信息用于指示该第一远程内存 中用于存储该第一数据的存储空间, 以便于该目标贡献节点根据该第三指示 信息, 存取该第一数据。
在一种可能的实施方式中, 该内存管理系统中的请求节点发送第一指示 信息包括: 内存管理系统中的请求节点获取用于指示该目标贡献节点的贡献 节点信息; 根据该贡献节点信息, 向该目标贡献节点发送第一指示信息; 以 及该接收第二指示信息包括: 接收该目标贡献节点发送的第二指示信息。
结合第一方面和第一种可能的实施方式, 在第二种可能的实施方式中, 该根据该贡献节点信息, 向该目标贡献节点发送第一指示信息, 包括: 根据 该贡献节点信息, 向该目标贡献节点发送针对第二数据的第二数据写指令, 该第二数据写指令包括该第一指示信息; 以及该接收该目标贡献节点发送的 第二指示信息包括: 接收该目标贡献节点发送的用于指示该第二数据存储完 成的第二数据写应答, 该第二数据写应答包括该第二指示信息。
结合第一方面、 第一种可能的实施方式和第二种可能的实施方式, 在第 三种可能的实施方式中, 该内存管理系统中的请求节点发送第一指示信息包 括: 内存管理系统中的请求节点向控制中心发送第一指示信息, 以便于该控 制中心根据该第一指示信息和该贡献节点能够提供的远程内存的长度, 从该 贡献节点中确定该目标贡献节点以及该第一远程内存, 其中, 该贡献节点能 够提供的远程内存的长度是该控制中心根据该贡献节点发送的用于指示该贡 献节点能够提供的远程内存的长度的第四指示信息确定的; 以及该接收第二 指示信息包括: 接收该控制中心发送的第二指示信息。
结合第一方面、 第一种可能的实施方式、 第二种可能的实施方式和第三 种可能的实施方式, 在第四种可能的实施方式中, 该方法还包括: 接收该控 制中心发送的用于指示该目标贡献节点的贡献节点信息, 以及该发送针对该 第一数据的第一数据读写指令, 包括: 根据该贡献节点信息, 向该目标贡献 节点发送针对该第一数据的第一数据读写指令。
结合第一方面、 第一种可能的实施方式、 第二种可能的实施方式、 第三 种可能的实施方式和第四种可能的实施方式, 在第五种可能的实施方式中, 该发送针对该第一数据的第一数据读写指令, 包括: 广播针对该第一数据的 第一数据读写指令, 以便于该贡献节点在确定该存储空间在该贡献节点能够 提供的远程内存的范围内后, 存取该第一数据。
结合第一方面、 第一种可能的实施方式、 第二种可能的实施方式、 第三 种可能的实施方式、 第四种可能的实施方式和第五种可能的实施方式, 在第 六种可能的实施方式中, 内存管理系统包括至少两个贡献节点, 该至少两个 贡献节点能够提供的远程内存的物理地址相异。
结合第一方面、 第一种可能的实施方式、 第二种可能的实施方式、 第三 种可能的实施方式、 第四种可能的实施方式、 第五种可能的实施方式和第六 种可能的实施方式, 在第七种可能的实施方式中, 该根据该第一远程内存, 确定第一虚拟地址, 包括: 从该请求节点内的本地内存中, 确定与该第一远 程内存相对应的第一本地内存, 根据该第一本地内存, 确定第一虚拟地址。
结合第一方面、 第一种可能的实施方式、 第二种可能的实施方式、 第三 种可能的实施方式、 第四种可能的实施方式、 第五种可能的实施方式、 第六 种可能的实施方式和第七种可能的实施方式, 在第八种可能的实施方式中, 该第一远程内存的长度与该请求节点所需内存的长度相同, 以及该第二指示 信息用于指示该第一远程内存的起始物理地址; 该第一远程内存的长度与该 第一数据的长度相同, 以及该第三指示信息用于指示该存储空间的起始物理 地址。 九种可能的实施方式中, 该第二指示信息用于指示该第一远程内存的起始物 理地址和长度; 以及当该第一数据的长度与该第二指示信息指示的该第一远 程内存的长度相同时, 该第三指示信息用于指示该第一远程内存的起始物理 地址; 当该第一数据的长度小于该第二指示信息指示的该第一远程内存的长 度时, 该第三指示信息用于指示该存储空间的起始物理地址和长度。
第二方面, 提供了一种管理内存的方法, 该方法包括: 内存管理系统中 的贡献节点确定第一远程内存, 该第一远程内存是根据来自请求节点的第一 指示信息确定的, 该第一指示信息用于指示该请求节点所需内存的长度, 该 第一远程内存的长度大于或等于该请求节点所需内存的长度; 接收该请求节 点发送的针对第一数据的第一数据读写指令, 该第一数据读写指令用于指示 该贡献节点存取该第一数据, 该第一数据读写指令包括第三指示信息, 该第 三指示信息用于指示该第一远程内存中用于存储该第一数据的存储空间; 根 据第一数据读写指令和该第三指示信息, 存取该第一数据。
在一种可能的实施方式中, 该内存管理系统中的贡献节点确定第一远程 内存包括: 内存管理系统中的贡献节点接收该请求节点发送的该第一指示信 息; 根据该第一指示信息, 确定该第一远程内存; 以及该方法还包括: 向该 请求节点发送用于指示该第一远程内存的第二指示信息。
结合第二方面和第一种可能的实施方式, 在第二种可能的实施方式中, 该内存管理系统中的贡献节点接收该请求节点发送的该第一指示信息包括: 内存管理系统中的贡献节点接收该请求节点发送的针对第二数据的第二数据 写指令以及该第二数据, 该第二数据写指令包括该第一指示信息; 根据该第 一指示信息, 确定该第一远程内存, 并将该第一数据存储在该第一远程内存 中;以及该向该请求节点发送用于指示该第一远程内存的第二指示信息包括: 向该请求节点发送的用于指示该第二数据存储完成的第二数据写应答, 该第 二数据写应答包括用于指示该第一远程内存的第二指示信息。
结合第二方面、 第一种可能的实施方式和第二种可能的实施方式, 在第 三种可能的实施方式中, 该内存管理系统中的贡献节点确定第一远程内存包 括: 内存管理系统中的贡献节点向控制中心发送第四指示信息, 该第四指示 信息用于指示该贡献节点能够提供的远程内存的起始物理地址和长度; 接收 该控制中心发送的第二指示信息, 该第二指示信息是该控制中心根据该第一 指示信息和该第四指示信息确定的; 根据该第二指示信息, 确定该第一远程 内存。
结合第二方面、 第一种可能的实施方式、 第二种可能的实施方式和第三 种可能的实施方式, 在第四种可能的实施方式中, 该根据第一数据读写指令 和该第三指示信息, 存取该第一数据, 包括: 确定该存储空间在该第一远程 内存的范围内; 根据第一数据读写指令, 在该存储空间内存取该第一数据。
结合第二方面、 第一种可能的实施方式、 第二种可能的实施方式、 第三 种可能的实施方式和第四种可能的实施方式, 在第五种可能的实施方式中, 该请求节点所需内存的长度与该第一数据的长度相同, 该目标贡献节点能够 提供的远程内存的长度与该请求节点所需内存的长度相同, 以及该第二指示 信息和该第三指示信息用于指示该第一远程内存的起始物理地址。
结合第二方面、 第一种可能的实施方式、 第二种可能的实施方式、 第三 种可能的实施方式、 第四种可能的实施方式和第五种可能的实施方式, 在第 六种可能的实施方式中, 该第二指示信息用于指示该第一远程内存的起始物 理地址和长度; 以及当该第一数据的长度与该第二指示信息指示的该第一远 程内存的长度相同时, 该第三指示信息用于指示该第一远程内存的起始物理 地址; 当该第一数据的长度小于该第二指示信息指示的该第一远程内存的长 度时, 该第三指示信息用于指示该存储空间的起始物理地址和长度。
结合第二方面、 第一种可能的实施方式、 第二种可能的实施方式、 第三 种可能的实施方式、 第四种可能的实施方式、 第五种可能的实施方式和第六 种可能的实施方式, 在第七种可能的实施方式中, 该方法还包括: 获取用于 指示该请求节点的请求节点信息; 根据该请求节点信息, 确定该请求节点; 禁止除该请求节点以外的节点使用该第一远程内存。
第三方面, 提供了一种管理内存的方法, 该方法包括: 内存管理系统中 的控制中心确定至少一个贡献节点能够提供的远程内存的起始物理地址和长 度, 接收请求节点发送的第一指示信息, 第一指示信息用于指示该请求节点 所需内存的长度, 根据该第一指示信息和该至少一个贡献节点能够提供的远 程内存的起始物理地址和长度, 从该贡献节点中确定目标贡献节点以及该目 标贡献节点向该请求节点提供的第一远程内存, 该第一远程内存的长度大于 或等于该请求节点所需内存的长度; 向该请求节点和该目标贡献节点发送用 于指示该第一远程内存的第二指示信息, 以便于该请求节点和该目标贡献节 点根据该第二指示信息, 确定该第一远程内存, 并在该第一远程内存进行针 对第一数据存取, 其中, 该第一数据的指针在该请求节点为该第一远程内存 分配的第一虚拟地址范围内。
在一种可能的实施方式中, 该方法还包括: 向该请求节点发送用于指示 该目标贡献节点的贡献节点信息, 以便于该请求节点根据该贡献节点信息, 向该目标贡献节点发送针对该第一数据的第一数据读写指令。
结合第三方面和第一种可能的实施方式, 在第二种可能的实施方式中, 该方法还包括: 向该贡献节点发送用于指示该请求节点的请求节点信息, 以 便于该目标贡献节点根据该请求节点信息, 确定该请求节点, 并禁止除该请 求节点以外的节点使用该第一远程内存。
结合第三方面、 第一种可能的实施方式和第二种可能的实施方式, 在第 三种可能的实施方式中, 该内存管理系统包括至少两个贡献节点, 以及该根 据该第一指示信息和该第四指示信息, 从该贡献节点中确定目标贡献节点以 及该目标贡献节点向该请求节点提供的第一远程内存包括: 根据该第一指示 信息和该第四指示信息, 从该贡献节点中确定目标贡献节点以及该目标贡献 节点向该请求节点提供的第一远程内存, 以使包括该第一远程内存在内的各 贡献节点提供的远程内存的物理地址相异。 结合第三方面、 第一种可能的实施方式、 第二种可能的实施方式和第三 种可能的实施方式, 在第四种可能的实施方式中, 该请求节点所需内存的长 度与该第一数据的长度相同, 该目标贡献节点能够提供的远程内存的长度与 该请求节点所需内存的长度相同, 以及该第二指示信息和该第三指示信息用 于指示该第一远程内存的起始物理地址。
结合第三方面、 第一种可能的实施方式、 第二种可能的实施方式、 第三 种可能的实施方式和第四种可能的实施方式, 在第五种可能的实施方式中, 该第二指示信息用于指示该第一远程内存的起始物理地址和长度; 以及当该 第一数据的长度与该第二指示信息指示的该第一远程内存的长度相同时, 该 第三指示信息用于指示该第一远程内存的起始物理地址; 当该第一数据的长 度小于该第二指示信息指示的该第一远程内存的长度时, 该第三指示信息用 于指示用于存储该第一数据的存储空间的起始物理地址和长度。
第四方面, 提供了一种管理内存的装置, 该装置包括: 发送单元, 用于 使内存管理系统中的请求节点发送第一指示信息, 该第一指示信息用于指示 该请求节点所需内存的长度; 接收单元, 用于该第二指示信息用于指示能够 提供远程内存的至少一个贡献节点中的目标贡献节点向该请求节点提供的第 一远程内存, 其中, 该第一远程内存是根据该第一指示信息确定的, 该第一 远程内存的长度大于或等于该请求节点所需内存的长度; 处理单元, 用于从 能够使用的虚拟地址中, 确定与该第一远程内存相对应的第一虚拟地址; 用 于当需要读写指针在该第一虚拟地址范围内的第一数据时, 控制该发送单元 发送针对该第一数据的第一数据读写指令, 该第一数据读写指令包括第三指 示信息, 该第三指示信息用于指示该第一远程内存中用于存储该第一数据的 存储空间, 以便于该目标贡献节点根据该第三指示信息, 存取该第一数据。
在一种可能的实施方式中, 该处理单元具体用于获取用于指示该目标贡 献节点的贡献节点信息; 该发送单元具体用于根据该贡献节点信息, 向该目 标贡献节点发送第一指示信息; 该接收单元具体用于接收该目标贡献节点发 送的第二指示信息。
结合第四方面和第一种可能的实施方式, 在第二种可能的实施方式中, 该发送单元具体用于根据该贡献节点信息, 向该目标贡献节点发送针对第二 数据的第二数据写指令, 该第二数据写指令包括该第一指示信息; 以及该接 收单元具体用于接收该目标贡献节点发送的用于指示该第二数据存储完成的 第二数据写应答, 该第二数据写应答包括该第二指示信息。
结合第四方面、 第一种可能的实施方式和第二种可能的实施方式, 在第 三种可能的实施方式中,该发送单元具体用于向控制中心发送第一指示信息, 以便于该控制中心根据该第一指示信息和该贡献节点能够提供的远程内存的 长度, 从该贡献节点中确定该目标贡献节点以及该第一远程内存, 其中, 该 贡献节点能够提供的远程内存的长度是该控制中心根据该贡献节点发送的用 于指示该贡献节点能够提供的远程内存的长度的第四指示信息确定的; 以及 该接收单元具体用于接收该控制中心发送的第二指示信息。
结合第四方面、 第一种可能的实施方式、 第二种可能的实施方式和第三 种可能的实施方式, 在第四种可能的实施方式中, 该接收单元还用于接收该 控制中心发送的用于指示该目标贡献节点的贡献节点信息, 以及该发送单元 具体用于根据该贡献节点信息, 向该目标贡献节点发送针对该第一数据的第 一数据读写指令。
结合第四方面、 第一种可能的实施方式、 第二种可能的实施方式、 第三 种可能的实施方式和第四种可能的实施方式, 在第五种可能的实施方式中, 该发送单元具体用于广播针对该第一数据的第一数据读写指令, 以便于该贡 献节点在确定该存储空间在该贡献节点能够提供的远程内存的范围内后, 存 取该第一数据。
结合第四方面、 第一种可能的实施方式、 第二种可能的实施方式、 第三 种可能的实施方式、 第四种可能的实施方式和第五种可能的实施方式, 在第 六种可能的实施方式中, 该内存管理系统包括至少两个贡献节点, 该至少两 个贡献节点能够提供的远程内存的物理地址相异。
结合第四方面、 第一种可能的实施方式、 第二种可能的实施方式、 第三 种可能的实施方式、 第四种可能的实施方式、 第五种可能的实施方式和第六 种可能的实施方式, 在第七种可能的实施方式中, 该处理单元具体用于从该 请求节点内的本地内存中, 确定与该第一远程内存相对应的第一本地内存; 用于根据该第一本地内存, 确定第一虚拟地址。
结合第四方面、 第一种可能的实施方式、 第二种可能的实施方式、 第三 种可能的实施方式、 第四种可能的实施方式、 第五种可能的实施方式、 第六 种可能的实施方式和第七种可能的实施方式, 在第八种可能的实施方式中, 该第一远程内存的长度与该请求节点所需内存的长度相同, 以及该第二指示 信息用于指示该第一远程内存的起始物理地址; 该第一远程内存的长度与该 第一数据的长度相同, 以及该第三指示信息用于指示该存储空间的起始物理 地址。
结合第四方面、 第一种可能的实施方式、 第二种可能的实施方式、 第三 种可能的实施方式、 第四种可能的实施方式、 第五种可能的实施方式、 第六 种可能的实施方式、 第七种可能的实施方式和第八种可能的实施方式, 在第 九种可能的实施方式中, 该第二指示信息用于指示该第一远程内存的起始物 理地址和长度; 以及当该第一数据的长度与该第二指示信息指示的该第一远 程内存的长度相同时, 该第三指示信息用于指示该第一远程内存的起始物理 地址; 当该第一数据的长度小于该第二指示信息指示的该第一远程内存的长 度时, 该第三指示信息用于指示该存储空间的起始物理地址和长度。
第五方面, 提供了一种管理内存的装置, 该装置包括: 处理单元, 用于 使内存管理系统中的贡献节点确定第一远程内存, 该第一远程内存是根据来 自请求节点的第一指示信息确定的, 该第一指示信息用于指示该请求节点所 需内存的长度, 该第一远程内存的长度大于或等于该请求节点所需内存的长 度; 接收单元, 用于接收该请求节点发送的针对第一数据的第一数据读写指 令, 该第一数据读写指令用于指示该贡献节点存取该第一数据, 该第一数据 读写指令包括第三指示信息, 该第三指示信息用于指示该第一远程内存中用 于存储该第一数据的存储空间; 该处理单元还用于根据第一数据读写指令和 该第三指示信息, 存取该第一数据。
在一种可能的实施方式中, 该接收单元具体用于接收该请求节点发送的 该第一指示信息; 该处理单元具体用于根据该第一指示信息, 确定该第一远 程内存; 以及该装置还包括: 发送单元, 用于向该请求节点发送用于指示该 第一远程内存的第二指示信息。
结合第五方面和第一种可能的实施方式, 在第二种可能的实施方式中, 该接收单元具体用于接收该请求节点发送的针对第二数据的第二数据写指令 以及该第二数据, 该第二数据写指令包括该第一指示信息; 该处理单元具体 用于根据该第一指示信息, 确定该第一远程内存, 并将该第一数据存储在该 第一远程内存中; 该发送单元具体用于向该请求节点发送的用于指示该第二 数据存储完成的第二数据写应答, 该第二数据写应答包括用于指示该第一远 程内存的第二指示信息。
结合第五方面、 第一种可能的实施方式和第二种可能的实施方式, 在第 三种可能的实施方式中, 该装置还包括: 发送单元, 用于向控制中心发送第 四指示信息, 该第四指示信息用于指示该贡献节点能够提供的远程内存的起 始物理地址和长度; 该接收单元具体用于接收该控制中心发送的第二指示信 息, 该第二指示信息是该控制中心根据该第一指示信息和该第四指示信息确 定的; 该处理单元具体用于根据该第二指示信息, 确定该第一远程内存。
结合第五方面、 第一种可能的实施方式、 第二种可能的实施方式和第三 种可能的实施方式, 在第四种可能的实施方式中, 该处理单元具体用于确定 该存储空间在该第一远程内存的范围内; 用于根据第一数据读写指令, 在该 存储空间内存取该第一数据。
结合第五方面、 第一种可能的实施方式、 第二种可能的实施方式、 第三 种可能的实施方式和第四种可能的实施方式, 在第五种可能的实施方式中, 该请求节点所需内存的长度与该第一数据的长度相同, 该目标贡献节点能够 提供的远程内存的长度与该请求节点所需内存的长度相同, 以及该第二指示 信息和该第三指示信息用于指示该第一远程内存的起始物理地址。
结合第五方面、 第一种可能的实施方式、 第二种可能的实施方式、 第三 种可能的实施方式、 第四种可能的实施方式和第五种可能的实施方式, 在第 六种可能的实施方式中, 该第二指示信息用于指示该第一远程内存的起始物 理地址和长度; 以及当该第一数据的长度与该第二指示信息指示的该第一远 程内存的长度相同时, 该第三指示信息用于指示该第一远程内存的起始物理 地址; 当该第一数据的长度小于该第二指示信息指示的该第一远程内存的长 度时, 该第三指示信息用于指示该存储空间的起始物理地址和长度。
结合第五方面、 第一种可能的实施方式、 第二种可能的实施方式、 第三 种可能的实施方式、 第四种可能的实施方式、 第五种可能的实施方式和第六 种可能的实施方式, 在第七种可能的实施方式中, 该处理单元还用于获取用 于指示该请求节点的请求节点信息; 用于根据该请求节点信息, 确定该请求 节点; 用于禁止除该请求节点以外的节点使用该第一远程内存。
第六方面, 提供了一种管理内存的装置, 该装置包括: 处理单元, 用于 使内存管理系统中的控制中心确定至少一个贡献节点能够提供的远程内存的 起始物理地址和长度; 接收单元, 用于接收请求节点发送的第一指示信息, 第一指示信息用于指示该请求节点所需内存的长度; 该处理单元还用于根据 该第一指示信息和该至少一个贡献节点能够提供的远程内存的起始物理地址 和长度, 从该贡献节点中确定目标贡献节点以及该目标贡献节点向该请求节 点提供的第一远程内存, 该第一远程内存的长度大于或等于该请求节点所需 内存的长度; 发送单元, 用于向该请求节点和该目标贡献节点发送用于指示 该第一远程内存的第二指示信息, 以便于该请求节点和该目标贡献节点根据 该第二指示信息, 确定该第一远程内存, 并在该第一远程内存进行针对第一 数据存取, 其中, 该第一数据的指针在该请求节点为该第一远程内存分配的 第一虚拟地址范围内。
在一种可能的实施方式中, 该发送单元还用于向该请求节点发送用于指 示该目标贡献节点的贡献节点信息,以便于该请求节点根据该贡献节点信息, 向该目标贡献节点发送针对该第一数据的第一数据读写指令。
结合第六方面和第一种可能的实施方式, 在第二种可能的实施方式中, 该发送单元还用于向该贡献节点发送用于指示该请求节点的请求节点信息, 以便于该目标贡献节点根据该请求节点信息, 确定该请求节点, 并禁止除该 请求节点以外的节点使用该第一远程内存。
结合第六方面、 第一种可能的实施方式和第二种可能的实施方式, 在第 三种可能的实施方式中, 该内存管理系统包括至少两个贡献节点, 以及该根 据该第一指示信息和该第四指示信息, 从该贡献节点中确定目标贡献节点以 及该目标贡献节点向该请求节点提供的第一远程内存包括: 根据该第一指示 信息和该第四指示信息, 从该贡献节点中确定目标贡献节点以及该目标贡献 节点向该请求节点提供的第一远程内存, 以使包括该第一远程内存在内的各 贡献节点提供的远程内存的物理地址相异。
结合第六方面、 第一种可能的实施方式、 第二种可能的实施方式和第三 种可能的实施方式, 在第四种可能的实施方式中, 该请求节点所需内存的长 度与该第一数据的长度相同, 该目标贡献节点能够提供的远程内存的长度与 该请求节点所需内存的长度相同, 以及该第二指示信息和该第三指示信息用 于指示该第一远程内存的起始物理地址。
结合第六方面、 第一种可能的实施方式、 第二种可能的实施方式、 第三 种可能的实施方式和第四种可能的实施方式, 在第五种可能的实施方式中, 该第二指示信息用于指示该第一远程内存的起始物理地址和长度; 以及当该 第一数据的长度与该第二指示信息指示的该第一远程内存的长度相同时, 该 第三指示信息用于指示该第一远程内存的起始物理地址; 当该第一数据的长 度小于该第二指示信息指示的该第一远程内存的长度时, 该第三指示信息用 于指示用于存储该第一数据的存储空间的起始物理地址和长度。
第七方面, 提供了一种管理内存的系统, 该系统包括: 至少一个请求节 点, 用于发送第一指示信息, 该第一指示信息用于指示该请求节点所需内存 的长度, 接收第二指示信息, 该第二指示信息用于指示能够提供远程内存的 至少一个贡献节点中的目标贡献节点向该请求节点提供的第一远程内存, 其 中, 该第一远程内存是根据该第一指示信息确定的, 该第一远程内存的长度 大于或等于该请求节点所需内存的长度, 从能够使用的虚拟地址中, 确定与 该第一远程内存相对应的第一虚拟地址, 当需要读写指针在该第一虚拟地址 范围内的第一数据时, 发送针对该第一数据的第一数据读写指令, 该第一数 据读写指令包括第三指示信息, 该第三指示信息用于指示该第一远程内存中 用于存储该第一数据的存储空间, 以便于该目标贡献节点根据该第三指示信 息, 存取该第一数据; 至少一个贡献节点, 用于确定第一远程内存, 该第一 远程内存是根据来自请求节点的第一指示信息确定的, 该第一指示信息用于 指示该请求节点所需内存的长度, 该第一远程内存的长度大于或等于该请求 节点所需内存的长度, 接收该请求节点发送的针对第一数据的第一数据读写 指令, 该第一数据读写指令用于指示该贡献节点存取该第一数据, 该第一数 据读写指令包括第三指示信息, 该第三指示信息用于指示该第一远程内存中 用于存储该第一数据的存储空间,根据第一数据读写指令和该第三指示信息, 存取该第一数据。
在一种可能的实施方式中, 该系统还包括: 控制中心, 用于确定至少一 个贡献节点能够提供的远程内存的起始物理地址和长度; 接收请求节点发送 的第一指示信息, 第一指示信息用于指示该请求节点所需内存的长度; 根据 该第一指示信息和该至少一个贡献节点能够提供的远程内存的起始物理地址 和长度, 从该贡献节点中确定目标贡献节点以及该目标贡献节点向该请求节 点提供的第一远程内存, 该第一远程内存的长度大于或等于该请求节点所需 内存的长度; 向该请求节点和该目标贡献节点发送用于指示该第一远程内存 的第二指示信息,以便于该请求节点和该目标贡献节点根据该第二指示信息, 确定该第一远程内存, 并在该第一远程内存进行针对第一数据存取, 其中, 该第一数据的指针在该请求节点为该第一远程内存分配的第一虚拟地址范围 内。
根据本发明实施例的管理内存的方法、 装置和系统, 通过根据请求节点 所需要的内存和贡献节点能够提供的内存, 从贡献节点中确定供请求节点使 用的远程内存, 在请求节点中为该远程内存分配虚拟地址, 在请求节点需要 存储指针在该虚拟地址范围内的数据时, 可以根据该虚拟地址与该远程内存 的对应关系, 确定需要在贡献节点上对该数据进行存取, 从而可以向该贡献 节点发送数据读写指令, 以实现在远程内存上对该数据的存取, 从而, 能够 容易地实现内存的共享。 附图说明
为了更清楚地说明本发明实施例的技术方案, 下面将对本发明实施例中 所需要使用的附图作筒单地介绍, 显而易见地, 下面所描述的附图仅仅是本 发明的一些实施例, 对于本领域普通技术人员来讲, 在不付出创造性劳动的 前提下, 还可以根据这些附图获得其他的附图。
图 1是根据本发明一实施例的管理内存的方法的示意性流程图。
图 2是根据本发明另一实施例的管理内存的方法的示意性流程图。
图 3是根据本发明再一实施例的管理内存的方法的示意性流程图。
图 4是根据本发明一实施例的管理内存的装置的示意性框图。
图 5是根据本发明另一实施例的管理内存的装置的示意性框图。
图 6是根据本发明再一实施例的管理内存的装置的示意性框图。
图 7是根据本发明一实施例的管理内存的系统的示意性框图。
图 8是根据本发明一实施例的管理内存的系统的示意性结构图 具体实施方式
下面将结合本发明实施例中的附图, 对本发明实施例中的技术方案进行 清楚、 完整地描述, 显然, 所描述的实施例是本发明一部分实施例, 而不是 全部的实施例。 基于本发明中的实施例, 本领域普通技术人员在没有作出创 造性劳动前提下所获得的所有其他实施例, 都属于本发明保护的范围。
本发明的技术方案, 可以应用于具有两个以上的服务器节点的服务器系 统, 各服务器节点可以具有独立的硬件结构, 以能够独立的实现相同或相异 的业务, 并且, 各服务器节点彼此之间能够进行通信。
需要说明的是, 在本发明实施例中, 各服务器节点均具有的一定的内存 空间, 但各服务器节点的内存大小可以相同或相异, 本发明并未特别限定。
为了便于理解, 在以下说明中, 将该两个以上的服务器节点中因其自身 内存不足等而请求使用其他服务器节点的一方称为请求节点, 将能够向其他 服务器节点提供内存 (以下, 称为远程内存) 的一方称为贡献节点。 需要说 明的是, 在本发明实施例中, 一个服务器节点可以在某一时段内作为请求节 点, 并在另一时段内作为贡献节点, 或者一个服务器节点可以同时作为请求 节点以及对于另一服务器节点的贡献节点。
图 1示出了从请求节点的角度描述的管理内存的方法 1 00的示意性流程 图。 如图 1所示, 该方法 1 00包括:
S 1 1 0 , 内存管理系统中的请求节点发送第一指示信息, 该第一指示信息 用于指示该请求节点所需内存的长度;
该实施例中, 内存的长度代表内存的容量大小; 该请求节点所需内存的 长度即该请求节点所需的内存的容量。
S 120 , 该请求节点接收第二指示信息, 该第二指示信息用于指示能够提 供远程内存的至少一个贡献节点中的目标贡献节点向该请求节点提供的第一 远程内存, 其中, 该第一远程内存是根据该第一指示信息确定的, 该第一远 程内存的长度大于或等于该请求节点所需内存的长度;
S 1 30 , 该请求节点从能够使用的虚拟地址中, 确定与该第一远程内存相 对应的第一虚拟地址;
S 140 , 当需要读写指针在该第一虚拟地址范围内的第一数据时, 该请求 节点发送针对该第一数据的第一数据读写指令, 该第一数据读写指令包括第 三指示信息, 该第三指示信息用于指示该第一远程内存中用于存储该第一数 据的存储空间, 以便于该目标贡献节点根据该第三指示信息, 存取该第一数 据。
具体地说, 在 S 1 1 0 , 例如, 当请求节点的本地内存不足或者需要使用贡 献节点提供的大容量内存以执行应用或处理业务时, 请求节点可以向外部发 送请求消息, 该请求消息可以携带指示该请求节点所需要的内存的信息 (第 一指示信息的一例) , 应理解, 在本发明实施例中, 该第一指示信息所指示 的内存容量可以大于该请求节点所需要的内存容量, 也可以等于该请求节点 所需要的内存容量, 本发明并未特别限定。
在本发明实施例中, 请求节点可以获知该系统内的各贡献节点的路由信 息 (后述贡献节点信息的一例) , 从而, 可以直接向该贡献节点发送上述请 求消息 (即, 情况 1 ) , 或者, 可以在系统内配置后述控制中心, 以统一执 行对系统内各贡献节点提供的远程内存的分配, 从而, 请求节点可以向该系 统内的控制中心发送上述请求消息 (即, 情况 2 ) , 下面, 分别对情况 1和 情况 2进行说明。
情况 1
可选地, 在本发明实施例中, 该内存管理系统中的请求节点发送第一指 示信息包括:
内存管理系统中的请求节点获取用于指示该目标贡献节点的贡献节点信 息;
根据该贡献节点信息, 向该目标贡献节点发送第一指示信息; 以及 该接收第二指示信息包括:
接收该目标贡献节点发送的第二指示信息。
并且, 可选地, 该贡献节点信息包括该贡献节点在该内存管理系统中的 标识或该贡献节点在该内存管理系统中的位置。
具体地说, 在本发明实施例中, 系统内的各服务节点 (包括贡献节点以 及请求节点)可以获知彼此之间的路由信息(贡献节点信息的一例), 并且, 该路由信息可以是该服务节点的节点标识(Node ID ) , 也可以是该服务节点 的位置, 例如, 贡献节点可以在系统中广播指示其能够提供的远程内存的信 息(例如, 该信息可以指示该远程内存的大小以及该贡献节点的路由信息), 请求节点可以根据该信息, 确定该贡献节点以及该贡献节点能够提供远程内 存, 从而, 在 S110 , 请求节点可以根据各服务节点的路由信息, 向系统中的 贡献节点, 发送请求消息, 该请求消息可以携带指示该请求节点所需要的内 存的信息 (第一指示信息的一例) 。
可选地, 在本发明实施例中, 该根据该贡献节点信息, 向该目标贡献节 点发送第一指示信息, 包括:
根据该贡献节点信息, 向该目标贡献节点发送针对第二数据的第二数据 写指令, 该第二数据写指令包括该第一指示信息。
具体地说, 在本发明实施例中, 如上所述, 系统内的各服务节点 (包括 贡献节点以及请求节点) 可以获知彼此之间的路由信息, 从而, 当请求节点 的本地内存不足或者需要使用贡献节点提供的大容量内存以执行应用或处理 业务时, 例如, 需要写入该应用或业务的数据 (第二数据的一例) 时, 请求 节点可以根据各服务节点的路由信息, 向系统中的其他服务节点 (包括贡献 节点) , 发送针对该第二数据的数据写指令(第二数据写指令的一例) , 该 第二数据写指令可以携带指示该请求节点所需要的内存的信息 (第一指示信 息的一例) 。 应理解, 第一指示信息所指示的该请求节点所需要的内存的长 度可以大于或等于该第二数据的长度, 本发明并未特别限定。 该服务节点在接收到该请求消息后, 可以根据该请求消息可以携带的第 一指示信息, 以及该服务节点能够对外提供的内存容量, 确定是否能够为该 请求节点提供其所需要的内存。
例如, 如果该服务节点能够对外提供的内存容量大于或等于该请求节点 提供其所需要的内存, 则可以作为贡献节点。 并且, 该贡献节点可以向该请 求节点返回响应消息, 该响应消息可以携带指示该服务节点能够提供的内存 (第一远程内存) 的信息 (第二指示信息) 。 在 S 120 , 请求节点可以接收该 贡献节点发送的第二指示信息。从而,请求节点以及贡献节点双方可以获知, 请求节点获得了该贡献节点中的第一远程内存的使用权,在本发明实施例中, 该请求节点可以独占地使用该第一远程内存, 从而能够提高业务的安全性。
可选地, 该接收该目标贡献节点发送的第二指示信息包括:
接收该目标贡献节点发送的用于指示该第二数据存储完成的第二数据写 应答, 该第二数据写应答包括该第二指示信息。
具体地说, 如果上述第一指示信息携带于第二数据写指令中, 则由于第 一指示信息所指示的该请求节点所需要的内存的长度大于或等于该第二数据 的长度, 因此, 贡献节点可以根据该第二数据写指令, 将该第二数据存储在 第一远程内存的部分或全部存储空间, 从而, 贡献节点可以在发送给请求节 点的用于指示该第二数据存储完成的第二数据写应答中携带该第二指示信 息。
应理解, 以上列举的第一数据和第二数据可以是相同的数据也可以是相 异的数据, 本发明并未特别限定。
可选地, 该第一远程内存的长度与该请求节点所需内存的长度相同, 以 及该第二指示信息用于指示该第一远程内存的起始物理地址。
具体地说, 如果该贡献节点提供的内存容量与该请求节点所需要的内存 容量相同, 则该贡献节点可以仅向请求节点返回该第一远程内存 (在该贡献 节点中) 的起始物理地址 (第二指示信息的一例) 。 从而, 在该第二指示信 息仅指示该起始物理地址的情况下, 请求节点可以默认地确定该贡献节点提 供的内存容量与该请求节点所需要的内存容量相同。
可选地, 该第一远程内存的长度大于该请求节点所需内存的长度, 以及 该第二指示信息用于指示该第一远程内存的起始物理地址及长度。
具体地说, 如果该贡献节点提供的内存容量大于该请求节点所需要的内 存容量, 则该贡献节点可以向请求节点返回该第一远程内存 (在该贡献节点 中) 的起始物理地址及长度(第二指示信息的另一例) 。 从而, 请求节点可 以根据该第二指示信息, 确定该第一远程内存的起始物理地址及长度, 根据 需要来使用该第一远程内存中的任意存储空间。
情况 2
该内存管理系统中的请求节点发送第一指示信息包括:
内存管理系统中的请求节点向控制中心发送第一指示信息, 以便于该控 制中心根据该第一指示信息和该贡献节点能够提供的远程内存的长度, 从该 贡献节点中确定该目标贡献节点以及该第一远程内存, 其中, 该贡献节点能 够提供的远程内存的长度是该控制中心根据该贡献节点发送的用于指示该贡 献节点能够提供的远程内存的长度的第四指示信息确定的; 以及
该接收第二指示信息包括:
接收该控制中心发送的第二指示信息。
在本发明实施例中, 在系统内可以设置控制中心, 用于获取服务器节点 能够提供的远程内存的信息, 并统一调度该远程内存资源。 并且, 在本发明 实施例中, 该控制中心可以与各服务器节点相独立, 即, 控制中心可以具有 独立的硬件结构 (例如, 处理器、 存储器及 I /O设备等) , 从而与各服务器 之间通过信令或消息等方式进行通信, 或者, 也可以在各服务器节点的系统 内设置客户端, 从而与各服务器节点共用处理器等硬件设备(例如, 处理器、 存储器及 I /O设备等) 。
具体地说, 例如, 当服务器节点 (贡献节点) 处于空闲或者有未使用的 内存时, 该节点能够向其他服务器节点提供内存(远程内存) , 并且, 例如, 在清理该远程内存内的数据、 删除该远程内存在本节点内部的页表映射关系 后, 该贡献节点可以向控制中心上报指示其能够提供的远程内存的信息 (第 四指示信息) , 例如, 该第四指示信息可以指示该远程内存在贡献节点中的 物理地址及长度。 从而, 控制中心 (或者说, 配置在请求节点内的客户端) 能够获知贡献节点的信息 (例如, 该贡献节点在系统内的路由信息) 以及该 贡献节点提供的远程内存的信息 (例如, 该远程内存的物理地址及长度) 。
在 S 1 1 0 , 请求节点可以向控制中心发送请求信息, 该请求消息可以携带 指示该请求节点所需要的内存的信息 (第一指示信息的一例) 。
控制中心可以根据该第一指示信息以及该第四指示信息, 确定能够贡献 节点以及该贡献节点提供给请求节点的内存 (第一远程内存) 。 例如, 如果 服务节点能够对外提供的内存容量大于或等于该请求节点提供其所需要的内 存, 则可以作为贡献节点。 并且, 在本发明实施例中, 该控制中心确定的, 第一远程内存可以大于或等于该第一指示信息指示的内存长度。 该第一远程 内存可以小于或等于该第四指示信息指示的内存长度。
并且, 控制中心可以将指示该第一远程内存的信息 (第二指示信息)发 送给请求节点以及贡献节点, 从而, 请求节点以及贡献节点双方可以获知, 请求节点获得了该贡献节点中的第一远程内存的使用权,在本发明实施例中, 该请求节点可以独占地使用该第一远程内存, 从而能够提高业务的安全性。
在 S 120 , 请求节点接收该控制中心发送的该第二指示信息。
可选地, 该第一远程内存的长度与该请求节点所需内存的长度相同, 以 及该第二指示信息用于指示该第一远程内存的起始物理地址。
具体地说, 如果该贡献节点提供的内存容量与该请求节点所需要的内存 容量相同, 则该贡献节点可以仅向请求节点返回该第一远程内存 (在该贡献 节点中) 的起始物理地址 (第二指示信息的一例) 。 从而, 在该第二指示信 息仅指示该起始物理地址的情况下, 请求节点可以默认地确定该贡献节点提 供的内存容量与该请求节点所需要的内存容量相同。
可选地, 该第一远程内存的长度大于该请求节点所需内存的长度, 以及 该第二指示信息用于指示该第一远程内存的起始物理地址及长度。
具体地说, 如果该贡献节点提供的内存容量大于该请求节点所需要的内 存容量, 则该贡献节点可以向请求节点返回该第一远程内存 (在该贡献节点 中) 的起始物理地址及长度(第二指示信息的另一例) 。 从而, 请求节点可 以根据该第二指示信息, 确定该第一远程内存的起始物理地址及长度, 根据 需要来使用该第一远程内存中的任意存储空间。
如上所述, 在请求节点获得该第一远程内存的使用权后, 在 S 1 30 , 请求 节点可以为该第一远程内存分配虚拟地址 (第一虚拟地址 ) 。
可选地, 该根据该第一远程内存, 确定第一虚拟地址, 包括:
根据所述第一远程内存, 确定第一虚拟地址, 其中, 该第一虚拟地址与 为该请求节点的本地内存分配的第二虚拟地址相异, 该请求节点能够分配的 虚拟地址的范围大于等于该第一远程内存与本地内存之和的范围。
具体地说, 目前,通常的计算机系统中处理器能够达到 32位乃至 64位, 从而, 能够使用的虚拟地址的范围可以达到 2 32乃至 264 , 而通常的计算机 系统中的内存容量远小于该值, 从而, 可以有足够的虚拟地址分配给该第一 远程内存, 请求节点可以将该第一远程内存视为其本地的内存空间, 从而, 可以使用与现有技术相同或类似的方法, 为该内存空间 (第一远程内存) 分 配虚拟地址 (第一虚拟地址) 。 并且, 为了避免指示混乱, 可以规定分配给 该第一远程内存的第一虚拟地址与分配给该请求节点中本地内存的第二虚拟 地址相异。
从而, 需要存取指针在第一虚拟地址范围内的数据 (第一数据) 时, 可 以根据该指针确定该第一数据存储或需要存储在第一远程内存 (具体地说, 是第一远程内存全部或部分存储空间) , 以在第一远程内存中存取该第一数 据 (随后详细说明) 。 根据本发明实施例的管理内存的方法, 能够不影响请求节点对本地内存 的使用, 降低数据存储流程的复杂度。
可选地, 该根据该第一远程内存, 确定第一虚拟地址, 包括:
从该请求节点内的本地内存中, 确定与该第一远程内存相对应的第一本 地内存,
根据该第一本地内存, 确定第一虚拟地址。
具体地说, 请求节点可以根据该第一远程内存的长度, 从将该请求节点 的本地内存中确定一段内存空间 (第一本地内存) , 并根据预设的算法或映 射关系, 例如, 根据预设的比例 (例如, 1字节 (Byte ) 的本地内存对应 1 千字节( Kbyt e )的远程内存, 应理解, 以上列举的比例仅为示例性说明, 本 发明并不限定于此) , 生成该第一本地内存与该第一远程内存的对应关系页 表。 由于第一本地内存是请求节点的本地内存, 因此, 可以使用与现有技术 相同或类似的方法, 为该第一本地内存分配虚拟地址。
从而, 需要存取指针在第一虚拟地址范围内的数据 (第一数据) 时, 可 以根据该指针确定第一本地内存 (具体地说, 是第一本地内存全部或部分存 储空间) , 并根据如上述生成的该第一本地内存与该第一远程内存的对应关 系页表, 确定第一远程内存 (具体地说, 是第一远程内存全部或部分存储空 间) , 以在第一远程内存中存取该第一数据 (随后详细说明) 。 这里, 需要 说明的是, 在本发明实施例中, 可以使用与现有技术相同或类似的方法, 根 据该指针确定第一本地内存。
根据本发明实施例的管理内存的方法, 能够减少对现有数据存储流程及 方法的改变, 提高了实用性。
在 S 140 , 请求节点在接收到针对指针在第一虚拟地址范围内的数据(第 一数据)的读写指令(第一数据读写指令)时, 可以根据该第一数据的指针, 确定该第一数据存储(对应读指令) 或需要存储(对应写指令) 在远程内存 中。 其后, 请求节点可以根据该第一数据的长度确定第一远程内存中用于存 储该第一数据的存储空间。 并且, 在第一数据读写指令中携带指示该存储空 间的信息 (第三指示信息)
例如, 在本发明实施例中, 该第一远程内存的长度与该第一数据的长度 相同, 以及该第三指示信息用于指示该存储空间的起始物理地址。
具体的, 如果该第一数据的指针长度与第一远程内存的长度相同, 则需 要使用该第一远程内存的全部存储空间, 此时, 在请求节点向贡献节点发送 的数据读写指令(第一数据读写指令) 中, 可以携带指示该第一远程内存的 起始物理地址的信息 (第三指示信息的一例) 。 从而, 在该第三指示信息仅 指示该存储空间的起始物理地址, 且指示的该存储空间的起始物理地址与第 一远程内存的起始物理地址相同的情况下, 贡献节点可以默认地确定该第一 数据的长度与第一远程内存的长度相同, 从而, 可以实现对该第一数据的存 取。
再例如, 在本发明实施例中, 该第一数据的长度小于该第二指示信息指 示的该第一远程内存的长度时, 该第三指示信息用于指示该存储空间的起始 物理地址和长度
具体的, 如果该第一数据的指针长度小于第一远程内存的长度, 则需要 使用该第一远程内存的部分存储空间, 此时, 在请求节点向贡献节点发送的 数据读写指令(第一数据读写指令) 中, 可以携带指示该第一远程内存的部 分存储空间的起始物理地址及长度的信息(第三指示信息的另一例)。 从而, 贡献节点可以根据该第三指示信息, 在该第一远程内存中存取该第一数据。
可选地, 在本发明实施例中, 内存管理系统中的请求节点能够获取用于 指示该目标贡献节点的贡献节点信息; 以及
该根据该贡献节点信息, 向该目标贡献节点发送第一指示信息, 包括: 根据该贡献节点信息, 向该目标贡献节点发送针对第二数据的第二数据 写指令以及该第二数据, 该第二数据写指令包括该第一指示信息; 以及
该接收该目标贡献节点发送的第二指示信息包括: 接收该目标贡献节点发送的用于指示该第二数据存储完成的第二数据写 应答, 该第二数据写应答包括该第二指示信息。
并且, 在本发明实施例中, 该贡献节点信息包括该贡献节点在该内存管 理系统中的标识或该贡献节点在该内存管理系统中的位置;
该请求信息包括该请求节点在该内存管理系统中的标识或该请求节点在 该内存管理系统中的位置。
具体地说, 在本发明实施例中, 系统内的各服务节点 (包括贡献节点以 及请求节点) 可以获知彼此之间的路由信息, 并且, 该路由信息可以是该服 务节点的节点标识(Node ID ) , 也可以是该服务节点的位置, 例如, 服务器 节点可以在系统中广播指示该 Node ID或该服务节点的位置的信息, 从而, 在 S 140 , 请求节点可以根据贡献节点的路由信息, 向系统中的贡献节点, 发 送针对上述第一数据的数据读写指令(第一数据读写指令) , 该第一数据读 写指令可以携带指示该第一数据存储或需要存储在的内存空间 (第一远程内 存的部分或全部存储空间) 的信息 (第三指示信息) 。 贡献节点可以接收带 第一数据读写指令, 并根据该第三指示信息, 从第一远程内存中确定该第一 数据存储或需要存储在的内存空间(第一远程内存的部分或全部存储空间), 并对该第一数据进行存取。
可选地, 在本发明实施例中, 该发送针对该第一数据的第一数据读写指 令, 包括:
广播针对该第一数据的第一数据读写指令, 以便于该贡献节点在确定该 存储空间在该贡献节点能够提供的远程内存的范围内后, 存取该第一数据。
具体地说, 在本发明实施例中, 请求节点在确定了该第一数据存储或需 要存储在的存储空间后, 可以在系统内广播针对上述第一数据的数据读写指 令(第一数据读写指令) , 该第一数据读写指令可以携带指示该第一数据存 储或需要存储在的存储空间 (第一远程内存的部分或全部存储空间) 的信息 (第三指示信息) 。 由于在情况 1中该贡献节点能够自主确定该第一远程内 存的长度及起始物理地址, 在情况 2中该贡献节点能够从控制中心获知该第 一远程内存的长度及起始物理地址。 因此, 当上述第三指示信息指示的该第 一数据存储或需要存储在的存储空间在该第一远程内存的范围内时, 可以确 定能够在第一远程内存中进行针对该第一数据的存取。
由此, 实现了在贡献节点中对来自请求节点的数据的存取。
在本发明实施例中, 该内存管理系统包括至少两个贡献节点, 该至少两 个贡献节点能够提供的远程内存的物理地址相异。
具体地说, 在系统内包括至少两个贡献节点的情况下, 控制中心可以使 至少两个贡献节点中的贡献节点 a提供的远程内存 a的物理地址与贡献节点 b提供的远程内存 b的物理地址相异, 从而, 在请求节点采用广播方式发送 上述第一数据读写指令时, 例如, 如果请求节点需要使用贡献节点 a提供的 远程内存 a , 则第一数据读写指令中携带指示远程内存 a中的存储空间的物 理地址的信息 (第三指示信息的一例) , 当贡献节点 b接收到该第一数据读 写指令时, 由于第三指示信息指示的物理地址不在远程内存 b的物理地址的 范围内, 因此, 不会根据该第一数据读写指令进行读写。 与此相对, 当贡献 节点 a接收到该第一数据读写指令时, 由于第三指示信息指示的物理地址在 远程内存 a的物理地址的范围内, 因此,根据该第一数据读写指令进行读写。
在本发明实施例中, 贡献节点 b在接收到该第一数据读写指令, 并由于 第三指示信息指示的物理地址不在远程内存 b的物理地址的范围内而确定不 会根据该第一数据读写指令进行读写后, 可以相系统内的相邻节点转发该第 一数据读写指令, 从而, 能够加速该第一数据读写指令到达贡献节点 a。 并 且, 为了避免系统内出现信令风暴, 贡献节点 b对该第一数据读写指令仅转 发一次。
根据本发明实施例的管理内存的方法, 通过根据请求节点所需要的内存 和贡献节点能够提供的内存,从贡献节点中确定供请求节点使用的远程内存, 在请求节点中为该远程内存分配虚拟地址, 在请求节点需要存储指针在该虚 拟地址范围内的数据时, 可以根据该虚拟地址与该远程内存的对应关系, 确 定需要在贡献节点上对该数据进行存取, 从而可以向该贡献节点发送数据读 写指令, 以实现在远程内存上对该数据的存取, 从而, 容易地能够实现内存 的共享。
图 2示出了从贡献节点的角度描述的管理内存的方法 200的示意性流程 图。 如图 2所示, 该方法 200包括:
S210 , 内存管理系统中的贡献节点确定第一远程内存, 该第一远程内存 是根据来自请求节点的第一指示信息确定的, 该第一指示信息用于指示该请 求节点所需内存的长度, 该第一远程内存的长度大于或等于该请求节点所需 内存的长度;
该实施例中, 内存的长度代表内存的容量大小。
S220 , 该贡献节点接收该请求节点发送的针对第一数据的第一数据读写 指令, 该第一数据读写指令用于指示该贡献节点存取该第一数据, 该第一数 据读写指令包括第三指示信息, 该第三指示信息用于指示该第一远程内存中 用于存储该第一数据的存储空间;
S230 , 该贡献节点根据第一数据读写指令和该第三指示信息, 存取该第 一数据。
具体地说, 例如, 当请求节点的本地内存不足或者需要使用贡献节点提 供的大容量内存以执行应用或处理业务时, 请求节点可以向外部发送请求消 息, 该请求消息可以携带指示该请求节点所需要的内存的信息 (第一指示信 息的一例) , 应理解, 在本发明实施例中, 该第一指示信息所指示的内存容 量可以大于该请求节点所需要的内存容量, 也可以等于该请求节点所需要的 内存容量, 本发明并未特别限定。
在本发明实施例中, 请求节点可以获知该系统内的各贡献节点的路由信 息 (后述贡献节点信息的一例) , 并直接向该贡献节点发送上述请求消息, 从而贡献节点可以接收该请求节点发送的第一指示信息 (即, 情况 3 ) , 或 者, 可以在系统内配置后述控制中心, 以统一执行对系统内各贡献节点提供 的远程内存的分配(即, 情况 4 ) , 下面, 分别对情况 3和情况 4进行说明。
情况 3
可选地, 在本发明实施例中, 该内存管理系统中的贡献节点确定第一远 程内存包括:
内存管理系统中的贡献节点接收该请求节点发送的该第一指示信息; 根据该第一指示信息, 确定该第一远程内存; 以及
该方法还包括:
向该请求节点发送用于指示该第一远程内存的第二指示信息。
具体地说, 在本发明实施例中, 系统内的各服务节点 (包括贡献节点以 及请求节点)可以获知彼此之间的路由信息(贡献节点信息的一例), 并且, 该路由信息可以是该服务节点的节点标识(Node I D ) , 也可以是该服务节点 的位置, 例如, 贡献节点可以在系统中广播指示其能够提供的远程内存的信 息(例如, 该信息可以指示该远程内存的大小以及该贡献节点的路由信息), 请求节点可以根据该信息, 确定该贡献节点以及该贡献节点能够提供远程内 存, 从而, 请求节点可以根据各服务节点的路由信息, 向系统中的贡献节点, 发送请求;肖息,该请求、肖息可以携带指示该请求节点所需要的内存的信息(第 一指示信息的一例) , 从而, 在 S21 0 , 该贡献节点在接收到该请求消息后, 可以根据该请求消息可以携带的第一指示信息, 以及该服务节点能够对外提 供的内存容量, 确定是否能够为该请求节点提供其所需要的内存。
例如, 如果贡献节点能够对外提供的内存容量大于或等于该请求节点提 供其所需要的内存, 则可以从本地内存中确定容量大于或等于该请求节点提 供其所需要的内存的远程内存 (第一远程内存) 。
并且, 该贡献节点可以向该请求节点返回响应消息, 该响应消息可以携 带指示该服务节点能够提供的内存(第一远程内存)的信息(第二指示信息)。 从而, 请求节点可以接收该贡献节点发送的第二指示信息。 从而, 请求节点 以及贡献节点双方可以获知, 请求节点获得了该贡献节点中的第一远程内存 的使用权,在本发明实施例中, 该请求节点可以独占地使用该第一远程内存, 从而能够提高业务的安全性。
可选地, 在本发明实施例中, 该内存管理系统中的贡献节点接收该请求 节点发送的该第一指示信息包括:
内存管理系统中的贡献节,、接收该请求节点发送的针对第二数据的第二 数据写指令以及该第二数据, 该第二数据写指令包括该第一指示信息;
根据该第一指示信息, 确定该第一远程内存, 并将该第一数据存储在该 第一远程内存中; 以及
该向该请求节点发送用于指示该第一远程内存的第二指示信息包括: 向该请求节点发送的用于指示该第二数据存储完成的第二数据写应答, 该第二数据写应答包括用于指示该第一远程内存的第二指示信息。
具体地说, 在本发明实施例中, 如上所述, 系统内的各服务节点 (包括 贡献节点以及请求节点) 可以获知彼此之间的路由信息, 从而, 当请求节点 的本地内存不足或者需要使用贡献节点提供的大容量内存以执行应用或处理 业务时, 例如, 需要写入该应用或业务的数据 (第二数据的一例) 时, 请求 节点可以根据各服务节点的路由信息, 向系统中的其他服务节点 (包括贡献 节点) , 发送针对该第二数据的数据写指令(第二数据写指令的一例) , 该 第二数据写指令可以携带指示该请求节点所需要的内存的信息 (第一指示信 息的一例) 。 应理解, 第一指示信息所指示的该请求节点所需要的内存的长 度可以大于或等于该第二数据的长度, 本发明并未特别限定。
如果上述第一指示信息携带于第二数据写指令中, 则由于第一指示信息 所指示的该请求节点所需要的内存的长度大于或等于该第二数据的长度, 因 此, 贡献节点可以根据该第二数据写指令, 将该第二数据存储在第一远程内 存的部分或全部存储空间, 从而, 贡献节点可以在发送给请求节点的用于指 示该第二数据存储完成的第二数据写应答中携带该第二指示信息。 应理解, 以上列举的第一数据和第二数据可以是相同的数据也可以是相 异的数据, 本发明并未特别限定。
可选地, 该第一远程内存的长度与该请求节点所需内存的长度相同, 以 及该第二指示信息用于指示该第一远程内存的起始物理地址。
具体地说, 如果该贡献节点提供的内存容量与该请求节点所需要的内存 容量相同, 则该贡献节点可以仅向请求节点返回该第一远程内存 (在该贡献 节点中) 的起始物理地址 (第二指示信息的一例) 。 从而, 在该第二指示信 息仅指示该起始物理地址的情况下, 请求节点可以默认地确定该贡献节点提 供的内存容量与该请求节点所需要的内存容量相同。
可选地, 该第一远程内存的长度大于该请求节点所需内存的长度, 以及 该第二指示信息用于指示该第一远程内存的起始物理地址及长度。
具体地说, 如果该贡献节点提供的内存容量大于该请求节点所需要的内 存容量, 则该贡献节点可以向请求节点返回该第一远程内存 (在该贡献节点 中) 的起始物理地址及长度(第二指示信息的另一例) 。 从而, 请求节点可 以根据该第二指示信息, 确定该第一远程内存的起始物理地址及长度, 根据 需要来使用该第一远程内存中的任意存储空间。
情况 4
该内存管理系统中的贡献节点确定第一远程内存包括:
内存管理系统中的贡献节点向控制中心发送第四指示信息, 该第四指示 信息用于指示该贡献节点能够提供的远程内存的起始物理地址和长度;
接收该控制中心发送的用于指示所述第一远程内存的第二指示信息, 所 述第一远程内存是该控制中心根据该第一指示信息和该第四指示信息确定 的;
根据该第二指示信息, 确定该第一远程内存。
在本发明实施例中, 在系统内可以设置控制中心, 用于获取服务器节点 能够提供的远程内存的信息, 并统一调度该远程内存资源。 并且, 在本发明 实施例中, 该控制中心可以与各服务器节点相独立, 即, 控制中心可以具有 独立的硬件结构 (例如, 处理器、 存储器及 I /O设备等) , 从而与各服务器 之间通过信令或消息等方式进行通信, 或者, 也可以在各服务器节点的系统 内设置客户端, 从而与各服务器节点共用处理器等硬件设备(例如, 处理器、 存储器及 I /O设备等) 。
具体地说, 例如, 当服务器节点 (贡献节点) 处于空闲或者有未使用的 内存时, 该节点能够向其他服务器节点提供内存(远程内存) , 并且, 例如, 在清理该远程内存内的数据、 删除该远程内存在本节点内部的页表映射关系 后, 该贡献节点可以向控制中心上报指示其能够提供的远程内存的信息 (第 四指示信息) , 例如, 该第四指示信息可以指示该远程内存在贡献节点中的 物理地址及长度。 从而, 控制中心 (或者说, 配置在请求节点内的客户端) 能够获知贡献节点的信息 (例如, 该贡献节点在系统内的路由信息) 以及该 贡献节点提供的远程内存的信息 (例如, 该远程内存的物理地址及长度) 。
请求节点可以向控制中心发送请求消息, 该请求消息可以携带指示该请 求节点所需要的内存的信息 (第一指示信息的一例) 。
控制中心可以根据该第一指示信息以及该第四指示信息, 确定能够贡献 节点以及该贡献节点提供给请求节点的内存 (第一远程内存) 。 例如, 如果 服务节点能够对外提供的内存容量大于或等于该请求节点提供其所需要的内 存, 则可以作为贡献节点。 并且, 在本发明实施例中, 该控制中心确定的, 第一远程内存可以大于或等于该第一指示信息指示的内存长度。 该第一远程 内存可以小于或等于该第四指示信息指示的内存长度。
并且, 控制中心可以将指示该第一远程内存的信息 (第二指示信息)发 送给请求节点以及贡献节点, 从而, 在 S210 , 贡献节点可以获知请求节点获 得了该贡献节点中的第一远程内存的使用权, 同样, 请求节点也可以获知请 求节点获得了该贡献节点中的第一远程内存的使用权。
可选地, 该方法还包括: 获取用于指示该请求节点的请求节点信息;
根据该请求节点信息, 确定该请求节点;
禁止除该请求节点以外的节点使用该第一远程内存。
具体地说, 在本发明实施例中, 该请求节点可以独占地使用该第一远程 内存, 从而能够提高业务的安全性。
可选地, 该第一远程内存的长度与该请求节点所需内存的长度相同, 以 及该第二指示信息用于指示该第一远程内存的起始物理地址。
具体地说, 如果该贡献节点提供的内存容量与该请求节点所需要的内存 容量相同, 则该贡献节点可以仅向请求节点返回该第一远程内存 (在该贡献 节点中) 的起始物理地址 (第二指示信息的一例) 。 从而, 在该第二指示信 息仅指示该起始物理地址的情况下, 请求节点可以默认地确定该贡献节点提 供的内存容量与该请求节点所需要的内存容量相同。
可选地, 该第一远程内存的长度大于该请求节点所需内存的长度, 以及 该第二指示信息用于指示该第一远程内存的起始物理地址及长度。
具体地说, 如果该贡献节点提供的内存容量大于该请求节点所需要的内 存容量, 则该贡献节点可以向请求节点返回该第一远程内存 (在该贡献节点 中) 的起始物理地址及长度(第二指示信息的另一例) 。 从而, 请求节点可 以根据该第二指示信息, 确定该第一远程内存的起始物理地址及长度, 根据 需要来使用该第一远程内存中的任意存储空间。
如上所述, 在请求节点获得该第一远程内存的使用权后, 请求节点可以 为该第一远程内存分配虚拟地址 (第一虚拟地址) 。
例如, 通常的计算机系统中处理器能够达到 32位乃至 64位, 从而, 能 够使用的虚拟地址的范围可以达到 232乃至 264 , 而通常的计算机系统中的 内存容量远小于该值,从而, 可以有足够的虚拟地址分配给该第一远程内存, 请求节点可以将该第一远程内存视为其本地的内存空间, 从而, 可以使用与 现有技术相同或类似的方法, 为该内存空间 (第一远程内存) 分配虚拟地址 (第一虚拟地址) 。 并且, 为了避免指示混乱, 可以规定分配给该第一远程 内存的第一虚拟地址与分配给该请求节点中本地内存的第二虚拟地址相异。
从而, 需要存取指针在第一虚拟地址范围内的数据 (第一数据) 时, 可 以根据该指针确定该第一数据存储或需要存储在第一远程内存 (具体地说, 是第一远程内存全部或部分存储空间) , 以在第一远程内存中存取该第一数 据 (随后详细说明) 。
根据本发明实施例的管理内存的方法, 能够不影响请求节点对本地内存 的使用, 降低数据存储流程的复杂度。
再例如, 请求节点可以根据该第一远程内存的长度, 从将该请求节点的 本地内存中确定一段内存空间 (第一本地内存) , 并根据预设的算法或映射 关系, 例如, 根据预设的比例 (例如, 1字节 (Byt e ) 的本地内存对应 1千 字节(Kbyt e )的远程内存, 应理解, 以上列举的比例仅为示例性说明, 本发 明并不限定于此),生成该第一本地内存与该第一远程内存的对应关系页表。 由于第一本地内存是请求节点的本地内存, 因此, 可以使用与现有技术相同 或类似的方法, 为该第一本地内存分配虚拟地址。
从而, 需要存取指针在第一虚拟地址范围内的数据 (第一数据) 时, 可 以根据该指针确定第一本地内存 (具体地说, 是第一本地内存全部或部分存 储空间) , 并根据如上述生成的该第一本地内存与该第一远程内存的对应关 系页表, 确定第一远程内存 (具体地说, 是第一远程内存全部或部分存储空 间) , 以在第一远程内存中存取该第一数据 (随后详细说明) 。 这里, 需要 说明的是, 在本发明实施例中, 可以使用与现有技术相同或类似的方法, 根 据该指针确定第一本地内存。
根据本发明实施例的管理内存的方法, 能够减少对现有数据存储流程及 方法的改变, 提高了实用性。
请求节点在接收到针对指针在第一虚拟地址范围内的数据 (第一数据) 的读写指令(第一数据读写指令) 时, 可以根据该第一数据的指针, 确定该 第一数据存储(对应读指令)或需要存储(对应写指令) 在远程内存中。 其 后, 请求节点可以根据该第一数据的长度确定第一远程内存中用于存储该第 一数据的存储空间。 并且, 在第一数据读写指令中携带指示该存储空间的信 息 (第三指示信息)
例如, 在本发明实施例中, 该第一远程内存的长度与该第一数据的长度 相同, 以及该第三指示信息用于指示该存储空间的起始物理地址。
具体的, 如果该第一数据的指针长度与第一远程内存的长度相同, 则需 要使用该第一远程内存的全部存储空间, 此时, 在请求节点向贡献节点发送 的数据读写指令(第一数据读写指令) 中, 可以携带指示该第一远程内存的 起始物理地址的信息 (第三指示信息的一例) 。 从而, 在该第三指示信息仅 指示该存储空间的起始物理地址, 且指示的该存储空间的起始物理地址与第 一远程内存的起始物理地址相同的情况下, 贡献节点可以默认地确定该第一 数据的长度与第一远程内存的长度相同, 从而, 可以实现对该第一数据的存 取。
再例如, 在本发明实施例中, 该第一数据的长度小于该第二指示信息指 示的该第一远程内存的长度时, 该第三指示信息用于指示该存储空间的起始 物理地址和长度
具体的, 如果该第一数据的指针长度小于第一远程内存的长度, 则需要 使用该第一远程内存的部分存储空间, 此时, 在请求节点向贡献节点发送的 数据读写指令(第一数据读写指令) 中, 可以携带指示该第一远程内存的部 分存储空间的起始物理地址及长度的信息(第三指示信息的另一例)。 从而, 贡献节点可以根据该第三指示信息, 在该第一远程内存中存取该第一数据。
在本发明实施例中, 系统内的各服务节点(包括贡献节点以及请求节点) 可以获知彼此之间的路由信息, 并且, 该路由信息可以是该服务节点的节点 标识(Node ID ) , 也可以是该服务节点的位置, 例如, 服务器节点可以在系 统中广播指示该 Node ID或该服务节点的位置的信息, 从而, 请求节点可以 根据贡献节点的路由信息, 向系统中的贡献节点, 发送针对上述第一数据的 数据读写指令(第一数据读写指令) , 该第一数据读写指令可以携带指示该 第一数据存储或需要存储在的内存空间 (第一远程内存的部分或全部存储空 间) 的信息 (第三指示信息) 。 从而, 在 S220 , 贡献节点可以接收带第一数 据读写指令, 并在 S230根据该第三指示信息,从第一远程内存中确定该第一 数据存储或需要存储在的内存空间(第一远程内存的部分或全部存储空间), 并对该第一数据进行存取。
在本发明实施例中, 请求节点在确定了该第一数据存储或需要存储在的 存储空间后, 可以在系统内广播针对上述第一数据的数据读写指令(第一数 据读写指令) , 该第一数据读写指令可以携带指示该第一数据存储或需要存 储在的存储空间 (第一远程内存的部分或全部存储空间) 的信息 (第三指示 信息) 。 从而在 S220 , 贡献节点可以接收到该第一数据读写指令。 由于在情 况 3中该贡献节点能够自主确定该第一远程内存的长度及起始物理地址, 在 情况 4中该贡献节点能够从控制中心获知该第一远程内存的长度及起始物理 地址。 因此, 当上述第三指示信息指示的该第一数据存储或需要存储在的存 储空间在该第一远程内存的范围内时, 在 S230 , 贡献节点可以确定能够在第 一远程内存中进行针对该第一数据的存取。
由此, 实现了在贡献节点中对来自请求节点的数据的存取。
根据本发明实施例的管理内存的方法, 通过根据请求节点所需要的内存 和贡献节点能够提供的内存,从贡献节点中确定供请求节点使用的远程内存, 在请求节点中为该远程内存分配虚拟地址, 在请求节点需要存储指针在该虚 拟地址范围内的数据时, 可以根据该虚拟地址与该远程内存的对应关系, 确 定需要在贡献节点上对该数据进行存取, 从而可以向该贡献节点发送数据读 写指令, 以实现在远程内存上对该数据的存取, 从而, 容易地能够实现内存 的共享。
图 3示出了从控制中心的角度描述的管理内存的方法 300的示意性流程 图。 如图 3所示, 该方法 300包括:
S 31 0 , 内存管理系统中的控制中心确定至少一个贡献节点能够提供的远 程内存的起始物理地址和长度;
S 320 , 该控制中心接收请求节点发送的第一指示信息, 第一指示信息用 于指示该请求节点所需内存的长度;
该实施例中, 内存的长度代表内存的容量大小。
S 330 , 该控制中心根据该第一指示信息和该至少一个贡献节点能够提供 的远程内存的起始物理地址和长度, 从该贡献节点中确定目标贡献节点以及 该目标贡献节点向该请求节点提供的第一远程内存, 该第一远程内存的长度 大于或等于该请求节点所需内存的长度;
S 340 , 该控制中心向该请求节点和该目标贡献节点发送用于指示该第一 远程内存的第二指示信息, 以便于该请求节点和该目标贡献节点根据该第二 指示信息, 确定该第一远程内存, 并在该第一远程内存进行针对第一数据存 取, 其中, 该第一数据的指针在该请求节点为该第一远程内存分配的第一虚 拟地址范围内。
具体地说, 在本发明实施例中, 在系统内可以设置控制中心, 用于获取 服务器节点能够提供的远程内存的信息, 并统一调度该远程内存资源。并且, 在本发明实施例中, 该控制中心可以与各服务器节点相独立, 即, 控制中心 可以具有独立的硬件结构 (例如, 处理器、 存储器及 I /O设备等) , 从而与 各服务器之间通过信令或消息等方式进行通信, 或者, 也可以在各服务器节 点的系统内设置客户端,从而与各服务器节点共用处理器等硬件设备(例如, 处理器、 存储器及 I /O设备等) 。
在本发明实施例中, 控制中心可以维护一个远程内存集合, 从而可以确 定至少一个贡献节点能够提供的远程内存的起始物理地址和长度。
可选地, 该内存管理系统中的处理中心确定至少一个贡献节点能够提供 的远程内存的起始物理地址和长度包括: 内存管理系统中的处理中心接收至少一个贡献节点发送的第四指示信 息, 该第四指示信息用于指示该贡献节点能够提供的远程内存的起始物理地 址和长度;
根据该第四指示信息, 确定该至少一个贡献节点能够提供的远程内存的 起始物理地址和长度。
具体地说, 例如, 当服务器节点 (贡献节点) 处于空闲或者有未使用的 内存时, 该节点能够向其他服务器节点提供内存(远程内存) , 并且, 例如, 在清理该远程内存内的数据、 删除该远程内存在本节点内部的页表映射关系 后, 该贡献节点可以向控制中心上报指示其能够提供的远程内存的信息 (第 四指示信息) , 例如, 该第四指示信息可以指示该远程内存在贡献节点中的 物理地址及长度。
从而, 在 S 31 0 , 控制中心 (或者说, 配置在请求节点内的客户端) 能够 获知贡献节点的信息 (例如, 该贡献节点在系统内的路由信息) 以及该贡献 节点提供的远程内存的信息 (例如, 该远程内存的物理地址及长度) 。
请求节点可以向控制中心发送请求信息, 该请求消息可以携带指示该请 求节点所需要的内存的信息 (第一指示信息的一例) 。
从而, 在 S 320 , 控制中心能够获知该第一指示信息。
在 S 330 , 控制中心可以根据该第一指示信息以及该第四指示信息, 确定 能够贡献节点以及该贡献节点提供给请求节点的内存 (第一远程内存) 。 例 如, 如果服务节点能够对外提供的内存容量大于或等于该请求节点提供其所 需要的内存, 则可以作为贡献节点。 并且, 在本发明实施例中, 该控制中心 确定的, 第一远程内存可以大于或等于该第一指示信息指示的内存长度。 该 第一远程内存可以小于或等于该第四指示信息指示的内存长度。
在 S 34 0 , 控制中心可以将指示该第一远程内存的信息 (第二指示信息) 发送给请求节点以及贡献节点,从而,请求节点以及贡献节点双方可以获知, 请求节点获得了该贡献节点中的第一远程内存的使用权,在本发明实施例中, 该请求节点可以独占地使用该第一远程内存, 从而能够提高业务的安全性。 可选地, 该第一远程内存的长度与该请求节点所需内存的长度相同, 以 及该第二指示信息用于指示该第一远程内存的起始物理地址。
具体地说, 如果该贡献节点提供的内存容量与该请求节点所需要的内存 容量相同, 则该贡献节点可以仅向请求节点返回该第一远程内存 (在该贡献 节点中) 的起始物理地址 (第二指示信息的一例) 。 从而, 在该第二指示信 息仅指示该起始物理地址的情况下, 请求节点可以默认地确定该贡献节点提 供的内存容量与该请求节点所需要的内存容量相同。
可选地, 该第一远程内存的长度大于该请求节点所需内存的长度, 以及 该第二指示信息用于指示该第一远程内存的起始物理地址及长度。
具体地说, 如果该贡献节点提供的内存容量大于该请求节点所需要的内 存容量, 则该贡献节点可以向请求节点返回该第一远程内存 (在该贡献节点 中) 的起始物理地址及长度(第二指示信息的另一例) 。 从而, 请求节点可 以根据该第二指示信息, 确定该第一远程内存的起始物理地址及长度, 根据 需要来使用该第一远程内存中的任意存储空间。
如上所述, 在请求节点获得该第一远程内存的使用权后, 请求节点可以 为该第一远程内存分配虚拟地址 (第一虚拟地址) 。
例如, 通常的计算机系统中处理器能够达到 32位乃至 64位, 从而, 能 够使用的虚拟地址的范围可以达到 232乃至 264 , 而通常的计算机系统中的 内存容量远小于该值,从而, 可以有足够的虚拟地址分配给该第一远程内存, 请求节点可以将该第一远程内存视为其本地的内存空间, 从而, 可以使用与 现有技术相同或类似的方法, 为该内存空间 (第一远程内存) 分配虚拟地址 (第一虚拟地址) 。 并且, 为了避免指示混乱, 可以规定分配给该第一远程 内存的第一虚拟地址与分配给该请求节点中本地内存的第二虚拟地址相异。
从而, 需要存取指针在第一虚拟地址范围内的数据 (第一数据) 时, 可 以根据该指针确定该第一数据存储或需要存储在第一远程内存 (具体地说, 是第一远程内存全部或部分存储空间) , 以在第一远程内存中存取该第一数 据 (随后详细说明) 。
根据本发明实施例的管理内存的方法, 能够不影响请求节点对本地内存 的使用, 降低数据存储流程的复杂度。
再例如, 请求节点可以根据该第一远程内存的长度, 从将该请求节点的 本地内存中确定一段内存空间 (第一本地内存) , 并根据预设的算法或映射 关系, 例如, 根据预设的比例 (例如, 1字节 (Byt e ) 的本地内存对应 1千 字节(Kbyt e )的远程内存, 应理解, 以上列举的比例仅为示例性说明, 本发 明并不限定于此),生成该第一本地内存与该第一远程内存的对应关系页表。 由于第一本地内存是请求节点的本地内存, 因此, 可以使用与现有技术相同 或类似的方法, 为该第一本地内存分配虚拟地址。
从而, 需要存取指针在第一虚拟地址范围内的数据 (第一数据) 时, 可 以根据该指针确定第一本地内存 (具体地说, 是第一本地内存全部或部分存 储空间) , 并根据如上述生成的该第一本地内存与该第一远程内存的对应关 系页表, 确定第一远程内存 (具体地说, 是第一远程内存全部或部分存储空 间) , 以在第一远程内存中存取该第一数据 (随后详细说明) 。 这里, 需要 说明的是, 在本发明实施例中, 可以使用与现有技术相同或类似的方法, 根 据该指针确定第一本地内存。
根据本发明实施例的管理内存的方法, 能够减少对现有数据存储流程及 方法的改变, 提高了实用性。
请求节点在接收到针对指针在第一虚拟地址范围内的数据 (第一数据) 的读写指令(第一数据读写指令) 时, 可以根据该第一数据的指针, 确定该 第一数据存储(对应读指令)或需要存储(对应写指令) 在远程内存中。 其 后, 请求节点可以根据该第一数据的长度确定第一远程内存中用于存储该第 一数据的存储空间。 并且, 在第一数据读写指令中携带指示该存储空间的信 息 (第三指示信息) 例如, 在本发明实施例中, 该第一远程内存的长度与该第一数据的长度 相同, 以及该第三指示信息用于指示该存储空间的起始物理地址。
具体的, 如果该第一数据的指针长度与第一远程内存的长度相同, 则需 要使用该第一远程内存的全部存储空间, 此时, 在请求节点向贡献节点发送 的数据读写指令(第一数据读写指令) 中, 可以携带指示该第一远程内存的 起始物理地址的信息 (第三指示信息的一例) 。 从而, 在该第三指示信息仅 指示该存储空间的起始物理地址, 且指示的该存储空间的起始物理地址与第 一远程内存的起始物理地址相同的情况下, 贡献节点可以默认地确定该第一 数据的长度与第一远程内存的长度相同, 从而, 可以实现对该第一数据的存 取。
再例如, 在本发明实施例中, 该第一数据的长度小于该第二指示信息指 示的该第一远程内存的长度时, 该第三指示信息用于指示该存储空间的起始 物理地址和长度
具体的, 如果该第一数据的指针长度小于第一远程内存的长度, 则需要 使用该第一远程内存的部分存储空间, 此时, 在请求节点向贡献节点发送的 数据读写指令(第一数据读写指令) 中, 可以携带指示该第一远程内存的部 分存储空间的起始物理地址及长度的信息(第三指示信息的另一例)。 从而, 贡献节点可以根据该第三指示信息, 在该第一远程内存中存取该第一数据。
可选地, 在本发明实施例中, 该方法还包括:
向该请求节点发送用于指示该目标贡献节点的贡献节点信息, 以便于该 请求节点根据该贡献节点信息, 向该目标贡献节点发送针对该第一数据的第 一数据读写指令。
并且, 在本发明实施例中, 该贡献节点信息包括该贡献节点在该内存管 理系统中的标识或该贡献节点在该内存管理系统中的位置;
该请求信息包括该请求节点在该内存管理系统中的标识或该请求节点在 该内存管理系统中的位置。 具体地说, 在本发明实施例中, 控制中心可以通知请求节点该贡献节点 的路由信息, 从而, 请求节点可以根据贡献节点的路由信息, 向系统中的贡 献节点, 发送针对上述第一数据的数据读写指令(第一数据读写指令) , 该 第一数据读写指令可以携带指示该第一数据存储或需要存储在的内存空间 (第一远程内存的部分或全部存储空间) 的信息 (第三指示信息) 。 贡献节 点可以接收带第一数据读写指令, 并根据该第三指示信息, 从第一远程内存 中确定该第一数据存储或需要存储在的内存空间 (第一远程内存的部分或全 部存储空间) , 并对该第一数据进行存取。
可选地, 在本发明实施例横纵, 该方法还包括:
向该贡献节点发送用于指示该请求节点的请求节点信息, 以便于该目标 贡献节点根据该请求节点信息, 确定该请求节点, 并禁止除该请求节点以外 的节点使用该第一远程内存。
具体地说, 在本发明实施例中, 控制中心可以通知贡献节点该请求节点 的路由信息, 从而, 贡献节点可以根据请求节点的路由信息, 仅允许该请求 节点使用该第一远程内存, 而禁止其他节点 (包括该贡献节点在内)使用该 第一远程内存, 从而能够提高网络安全性。
可选地, 在本发明实施例中, 该内存管理系统包括至少两个贡献节点, 以及
该根据该第一指示信息和该第四指示信息, 从该贡献节点中确定目标贡 献节点以及该目标贡献节点向该请求节点提供的第一远程内存包括:
根据该第一指示信息和该第四指示信息, 从该贡献节点中确定目标贡献 节点以及该目标贡献节点向该请求节点提供的第一远程内存, 以使包括该第 一远程内存在内的各贡献节点提供的远程内存的物理地址相异。
具体地说, 在系统内包括至少两个贡献节点的情况下, 控制中心可以使 至少两个贡献节点中的贡献节点 a提供的远程内存 a的物理地址与贡献节点 b提供的远程内存 b的物理地址相异, 从而, 在请求节点采用广播方式发送 上述第一数据读写指令时, 例如, 如果请求节点需要使用贡献节点 a提供的 远程内存 a , 则第一数据读写指令中携带指示远程内存 a中的存储空间的物 理地址的信息 (第三指示信息的一例) , 当贡献节点 b接收到该第一数据读 写指令时, 由于第三指示信息指示的物理地址不在远程内存 b的物理地址的 范围内, 因此, 不会根据该第一数据读写指令进行读写。 与此相对, 当贡献 节点 a接收到该第一数据读写指令时, 由于第三指示信息指示的物理地址在 远程内存 a的物理地址的范围内, 因此,根据该第一数据读写指令进行读写。
在本发明实施例中, 贡献节点 b在接收到该第一数据读写指令, 并由于 第三指示信息指示的物理地址不在远程内存 b的物理地址的范围内而确定不 会根据该第一数据读写指令进行读写后, 可以相系统内的相邻节点转发该第 一数据读写指令, 从而, 能够加速该第一数据读写指令到达贡献节点 a。 并 且, 为了避免系统内出现信令风暴, 贡献节点 b对该第一数据读写指令仅转 发一次。
根据本发明实施例的管理内存的方法, 通过根据请求节点所需要的内存 和贡献节点能够提供的内存,从贡献节点中确定供请求节点使用的远程内存, 在请求节点中为该远程内存分配虚拟地址, 在请求节点需要存储指针在该虚 拟地址范围内的数据时, 可以根据该虚拟地址与该远程内存的对应关系, 确 定需要在贡献节点上对该数据进行存取, 从而可以向该贡献节点发送数据读 写指令, 以实现在远程内存上对该数据的存取, 从而, 容易地能够实现内存 的共享。
上文中, 结合图 1至图 3 , 详细描述了根据本发明实施例的管理内存的 方法, 下面, 将结合图 4至图 6 , 详细描述根据本发明实施例的管理内存的 装置。
图 4示出了根据本发明实施例的管理内存的装置 400的示意性框图。 如 图 7所示, 该装置 4 00包括:
根据本发明实施例的管理内存的装置 400可对应于本发明实施例的方法 中的请求节点, 并且, 该管理内存的装置 400中的各单元即模块和上述其他 操作和 /或功能分别为了实现图 1中的方法 1 00的相应流程, 为了筒洁,在此 不再赘述。
根据本发明实施例的管理内存的装置, 通过根据请求节点所需要的内存 和贡献节点能够提供的内存,从贡献节点中确定供请求节点使用的远程内存, 在请求节点中为该远程内存分配虚拟地址, 在请求节点需要存储指针在该虚 拟地址范围内的数据时, 可以根据该虚拟地址与该远程内存的对应关系, 确 定需要在贡献节点上对该数据进行存取, 从而可以向该贡献节点发送数据读 写指令, 以实现在远程内存上对该数据的存取, 从而, 容易地能够实现内存 的共享。
图 4示出了根据本发明实施例的管理内存的装置 400的示意性框图。 如 图 7所示, 该装置 4 00包括:
发送单元 41 0 , 用于使内存管理系统中的请求节点发送第一指示信息, 该第一指示信息用于指示该请求节点所需内存的长度;
接收单元 42 0 , 用于接收第二指示信息, 该第二指示信息用于指示能够 提供远程内存的至少一个贡献节点中的目标贡献节点向该请求节点提供的第 一远程内存, 其中, 该第一远程内存是根据该第一指示信息确定的, 该第一 远程内存的长度大于或等于该请求节点所需内存的长度;
处理单元 4 30 , 用于从能够使用的虚拟地址中, 确定与该第一远程内存 相对应的第一虚拟地址;
用于当需要读写指针在该第一虚拟地址范围内的第一数据时, 控制发送 单元 4 1 0发送针对该第一数据的第一数据读写指令, 该第一数据读写指令包 括第三指示信息, 该第三指示信息用于指示该第一远程内存中用于存储该第 一数据的存储空间, 以便于该目标贡献节点根据该第三指示信息, 存取该第 一数据。
该实施例中, 内存的长度代表内存的容量大小。 可选地, 该处理单元 430具体用于获取用于指示该目标贡献节点的贡献 节点信息;
该发送单元具体 410用于根据该贡献节点信息, 向该目标贡献节点发送 第一指示信息;
该接收单元 420具体用于接收该目标贡献节点发送的第二指示信息。 可选地, 该发送单元 410具体用于根据该贡献节点信息, 向该目标贡献 节点发送针对第二数据的第二数据写指令, 该第二数据写指令包括该第一指 示信息; 以及
该接收单元 420具体用于接收该目标贡献节点发送的用于指示该第二数 据存储完成的第二数据写应答, 该第二数据写应答包括该第二指示信息。
可选地, 该发送单元 410具体用于向控制中心发送第一指示信息, 以便 于该控制中心根据该第一指示信息和该贡献节点能够提供的远程内存的长 度, 从该贡献节点中确定该目标贡献节点以及该第一远程内存, 其中, 该贡 献节点能够提供的远程内存的长度是该控制中心根据该贡献节点发送的用于 指示该贡献节点能够提供的远程内存的长度的第四指示信息确定的; 以及 该接收单元 420具体用于接收该控制中心发送的第二指示信息。
可选地, 该接收单元 420还用于接收该控制中心发送的用于指示该目标 贡献节点的贡献节点信息, 以及
该发送单元 410具体用于根据该贡献节点信息, 向该目标贡献节点发送 针对该第一数据的第一数据读写指令。
可选地, 该发送单元 410具体用于广播针对该第一数据的第一数据读写 指令, 以便于该贡献节点在确定该存储空间在该贡献节点能够提供的远程内 存的范围内后, 存取该第一数据。
可选地, 该内存管理系统包括至少两个贡献节点, 该至少两个贡献节点 能够提供的远程内存的物理地址相异。
可选地, 该处理单元 430具体用于从该请求节点内的本地内存中, 确定 与该第一远程内存相对应的第一本地内存;
用于根据该第一本地内存, 确定第一虚拟地址。
可选地, 该第一远程内存的长度与该请求节点所需内存的长度相同, 以 及该第二指示信息用于指示该第一远程内存的起始物理地址;
该第一远程内存的长度与该第一数据的长度相同, 以及该第三指示信息 用于指示该存储空间的起始物理地址。
可选地, 该第二指示信息用于指示该第一远程内存的起始物理地址和长 度; 以及
当该第一数据的长度与该第二指示信息指示的该第一远程内存的长度相 同时, 该第三指示信息用于指示该第一远程内存的起始物理地址;
当该第一数据的长度小于该第二指示信息指示的该第一远程内存的长度 时, 该第三指示信息用于指示该存储空间的起始物理地址和长度。
根据本发明实施例的管理内存的装置 400可对应于本发明实施例的方法 中的请求节点, 并且, 该管理内存的装置 400中的各单元即模块和上述其他 操作和 /或功能分别为了实现图 1中的方法 100的相应流程, 为了筒洁,在此 不再赘述。
根据本发明实施例的管理内存的装置, 通过根据请求节点所需要的内存 和贡献节点能够提供的内存,从贡献节点中确定供请求节点使用的远程内存, 在请求节点中为该远程内存分配虚拟地址, 在请求节点需要存储指针在该虚 拟地址范围内的数据时, 可以根据该虚拟地址与该远程内存的对应关系, 确 定需要在贡献节点上对该数据进行存取, 从而可以向该贡献节点发送数据读 写指令, 以实现在远程内存上对该数据的存取, 从而, 容易地能够实现内存 的共享。
图 5示出了根据本发明实施例的管理内存的装置 500的示意性框图。 如 图 5所示, 该装置 500包括:
处理单元 510 , 用于使内存管理系统中的贡献节点确定第一远程内存, 该第一远程内存是根据来自请求节点的第一指示信息确定的, 该第一指示信 息用于指示该请求节点所需内存的长度, 该第一远程内存的长度大于或等于 该请求节点所需内存的长度;
接收单元 520 , 用于接收该请求节点发送的针对第一数据的第一数据读 写指令, 该第一数据读写指令用于指示该贡献节点存取该第一数据, 该第一 数据读写指令包括第三指示信息, 该第三指示信息用于指示该第一远程内存 中用于存储该第一数据的存储空间;
该处理单元 510还用于根据第一数据读写指令和该第三指示信息, 存取 该第一数据。
该实施例中, 内存的长度代表内存的容量大小。
可选地, 该接收单元 520具体用于接收该请求节点发送的该第一指示信 息;
该处理单元 510具体用于根据该第一指示信息, 确定该第一远程内存; 以及
该装置还包括:
发送单元 530 , 用于向该请求节点发送用于指示该第一远程内存的第二 指示信息。
可选地, 该接收单元 520具体用于接收该请求节点发送的针对第二数据 的第二数据写指令以及该第二数据,该第二数据写指令包括该第一指示信息; 该处理单元 510具体用于根据该第一指示信息, 确定该第一远程内存, 并将该第一数据存储在该第一远程内存中;
该发送单元 530具体用于向该请求节点发送的用于指示该第二数据存储 完成的第二数据写应答, 该第二数据写应答包括用于指示该第一远程内存的 第二指示信息。
可选地, 该装置还包括:
发送单元 530 , 用于向控制中心发送第四指示信息, 该第四指示信息用 于指示该贡献节点能够提供的远程内存的起始物理地址和长度; 该接收单元 520具体用于接收该控制中心发送的用于指示该第一远程内 存的第二指示信息, 该第一远程内存是该控制中心根据该第一指示信息和该 第四指示信息确定的;
该处理单元 510具体用于根据该第二指示信息, 确定该第一远程内存。 可选地, 该处理单元 510具体用于确定该存储空间在该第一远程内存的 范围内;
用于根据第一数据读写指令, 在该存储空间内存取该第一数据。
可选地, 该请求节点所需内存的长度与该第一数据的长度相同, 该目标 贡献节点能够提供的远程内存的长度与该请求节点所需内存的长度相同, 以 及
该第二指示信息和该第三指示信息用于指示该第一远程内存的起始物理 地址。
可选地, 该第二指示信息用于指示该第一远程内存的起始物理地址和长 度; 以及
当该第一数据的长度与该第二指示信息指示的该第一远程内存的长度相 同时, 该第三指示信息用于指示该第一远程内存的起始物理地址;
当该第一数据的长度小于该第二指示信息指示的该第一远程内存的长度 时, 该第三指示信息用于指示该存储空间的起始物理地址和长度。
可选地, 该处理单元 510还用于获取用于指示该请求节点的请求节点信 息;
用于根据该请求节点信息, 确定该请求节点;
用于禁止除该请求节点以外的节点使用该第一远程内存。
根据本发明实施例的管理内存的装置 500可对应于本发明实施例的方法 中的贡献节点, 并且, 该管理内存的装置 500中的各单元即模块和上述其他 操作和 /或功能分别为了实现图 2中的方法 200的相应流程, 为了筒洁,在此 不再赘述。
根据本发明实施例的管理内存的装置, 通过根据请求节点所需要的内存 和贡献节点能够提供的内存,从贡献节点中确定供请求节点使用的远程内存, 在请求节点中为该远程内存分配虚拟地址, 在请求节点需要存储指针在该虚 拟地址范围内的数据时, 可以根据该虚拟地址与该远程内存的对应关系, 确 定需要在贡献节点上对该数据进行存取, 从而可以向该贡献节点发送数据读 写指令, 以实现在远程内存上对该数据的存取, 从而, 容易地能够实现内存 的共享。
图 6示出了根据本发明实施例的管理内存的装置 600的示意性框图。 如 图 6所示, 该装置 6 00包括:
接收单元 61 0 , 用于使内存管理系统中的控制中心确定至少一个贡献节 点能够提供的远程内存的起始物理地址和长度;
用于接收请求节点发送的第一指示信息, 第一指示信息用于指示该请求 节点所需内存的长度;
处理单元 62 0 , 用于根据该第一指示信息和该至少一个贡献节点能够提 供的远程内存的起始物理地址和长度, 从该贡献节点中确定目标贡献节点以 及该目标贡献节点向该请求节点提供的第一远程内存, 该第一远程内存的长 度大于或等于该请求节点所需内存的长度;
发送单元 6 30 , 用于向该请求节点和该目标贡献节点发送用于指示该第 一远程内存的第二指示信息, 以便于该请求节点和该目标贡献节点根据该第 二指示信息, 确定该第一远程内存, 并在该第一远程内存进行针对第一数据 存取, 其中, 该第一数据的指针在该请求节点为该第一远程内存分配的第一 虚拟地址范围内。
该实施例中, 内存的长度代表内存的容量大小。
可选地, 该发送单元 6 30还用于向该请求节点发送用于指示该目标贡献 节点的贡献节点信息, 以便于该请求节点根据该贡献节点信息, 向该目标贡 献节点发送针对该第一数据的第一数据读写指令。
可选地, 该发送单元 6 30还用于向该贡献节点发送用于指示该请求节点 的请求节点信息, 以便于该目标贡献节点根据该请求节点信息, 确定该请求 节点, 并禁止除该请求节点以外的节点使用该第一远程内存。
可选地, 该内存管理系统包括至少两个贡献节点, 以及
该处理单元具体用于根据该第一指示信息和该第四指示信息, 从该贡献 节点中确定目标贡献节点以及该目标贡献节点向该请求节点提供的第一远程 内存, 以使包括该第一远程内存在内的各贡献节点提供的远程内存的物理地 址相异。
可选地, 该请求节点所需内存的长度与该第一数据的长度相同, 该目标 贡献节点能够提供的远程内存的长度与该请求节点所需内存的长度相同, 以 及
该第二指示信息和该第三指示信息用于指示该第一远程内存的起始物理 地址。
可选地, 该第二指示信息用于指示该第一远程内存的起始物理地址和长 度; 以及
当该第一数据的长度与该第二指示信息指示的该第一远程内存的长度相 同时, 该第三指示信息用于指示该第一远程内存的起始物理地址;
当该第一数据的长度小于该第二指示信息指示的该第一远程内存的长度 时, 该第三指示信息用于指示用于存储该第一数据的存储空间的起始物理地 址和长度。
可选地, 该接收单元 61 0还用于接收至少一个贡献节点发送的第四指示 信息, 该第四指示信息用于指示该贡献节点能够提供的远程内存的起始物理 地址和长度;
该处理单元 62 0具体用于根据该第四指示信息, 确定该至少一个贡献节 点能够提供的远程内存的起始物理地址和长度。 根据本发明实施例的管理内存的装置 600可对应于本发明实施例的方法 中的控制中心, 并且, 该管理内存的装置 600中的各单元即模块和上述其他 操作和 /或功能分别为了实现图 3中的方法 300的相应流程, 为了筒洁,在此 不再赘述。
根据本发明实施例的管理内存的装置, 通过根据请求节点所需要的内存 和贡献节点能够提供的内存,从贡献节点中确定供请求节点使用的远程内存, 在请求节点中为该远程内存分配虚拟地址, 在请求节点需要存储指针在该虚 拟地址范围内的数据时, 可以根据该虚拟地址与该远程内存的对应关系, 确 定需要在贡献节点上对该数据进行存取, 从而可以向该贡献节点发送数据读 写指令, 以实现在远程内存上对该数据的存取, 从而, 容易地能够实现内存 的共享。
上文中, 结合图 1至图 6 , 详细描述了根据本发明实施例的管理内存的 方法和装置, 下面, 将结合图 7 , 详细描述根据本发明实施例的管理内存的 系统。
图 7示出了根据本发明实施例的管理内存的系统 700的示意性框图。 如 图 7所示, 该系统 700包括:
至少一个请求节点 710 , 用于发送第一指示信息, 该第一指示信息用于 指示该请求节点所需内存的长度, 接收第二指示信息, 该第二指示信息用于 指示能够提供远程内存的至少一个贡献节点中的目标贡献节点向该请求节点 提供的第一远程内存, 其中, 该第一远程内存是根据该第一指示信息确定的, 该第一远程内存的长度大于或等于该请求节点所需内存的长度, 从能够使用 的虚拟地址中, 确定与该第一远程内存相对应的第一虚拟地址, 当需要读写 指针在该第一虚拟地址范围内的第一数据时, 发送针对该第一数据的第一数 据读写指令, 该第一数据读写指令包括第三指示信息, 该第三指示信息用于 指示该第一远程内存中用于存储该第一数据的存储空间, 以便于该目标贡献 节点根据该第三指示信息, 存取该第一数据; 至少一个贡献节点 720 , 用于确定第一远程内存, 该第一远程内存是根 据来自请求节点的第一指示信息确定的, 该第一指示信息用于指示该请求节 点所需内存的长度, 该第一远程内存的长度大于或等于该请求节点所需内存 的长度, 接收该请求节点发送的针对第一数据的第一数据读写指令, 该第一 数据读写指令用于指示该贡献节点存取该第一数据, 该第一数据读写指令包 括第三指示信息, 该第三指示信息用于指示该第一远程内存中用于存储该第 一数据的存储空间, 根据第一数据读写指令和该第三指示信息, 存取该第一 数据。
该实施例中, 内存的长度代表内存的容量大小。
可选地, 该系统还包括:
控制中心 730 , 用于确定至少一个贡献节点能够提供的远程内存的起始 物理地址和长度, 接收请求节点发送的第一指示信息, 第一指示信息用于指 示该请求节点所需内存的长度, 根据该第一指示信息和该至少一个贡献节点 能够提供的远程内存的起始物理地址和长度, 从该贡献节点中确定目标贡献 节点以及该目标贡献节点向该请求节点提供的第一远程内存, 该第一远程内 存的长度大于或等于该请求节点所需内存的长度, 向该请求节点和该目标贡 献节点发送用于指示该第一远程内存的第二指示信息, 以便于该请求节点和 该目标贡献节点根据该第二指示信息, 确定该第一远程内存, 并在该第一远 程内存进行针对第一数据存取, 其中, 该第一数据的指针在该请求节点为该 第一远程内存分配的第一虚拟地址范围内。
根据本发明实施例的请求节点 710可对应于本发明实施例的方法中的请 求节点, 并且, 该请求节点 710中的各单元即模块和上述其他操作和 /或功能 分别为了实现图 1中的方法 100的相应流程, 为了筒洁, 在此不再赘述。
根据本发明实施例的贡献节点 720可对应于本发明实施例的方法中的贡 献节点, 并且, 该贡献节点 720中的各单元即模块和上述其他操作和 /或功能 分别为了实现图 2中的方法 200的相应流程, 为了筒洁, 在此不再赘述。 根据本发明实施例的控制中心 730可对应于本发明实施例的方法中的控 制中心, 并且, 该控制中心 730中的各单元即模块和上述其他操作和 /或功能 分别为了实现图 3中的方法 300的相应流程, 为了筒洁, 在此不再赘述。
图 8示出了本发明一实施例的管理内存的系统的示意性结构, 如图 8所 示, 在系统的节点 (包括请求节点和贡献节点) 中, 包括本地内存、 处理器 内存控制器和远程内存控制芯片, 其中, 请求节点的远程内存控制芯片可以 单独地或与处理器共同实现本发明实施例的管理内存的装置 400或 710的功 能 (即, 图 1中方法 100的个流程) , 具体地说, 可以实现与贡献节点或控 制中心的信息传输, 可以确定贡献节点提供的远程内存与处理器提供的虚拟 地址的对应关系。 贡献节点的远程内存控制芯片可以单独地或与处理器共同 实现本发明实施例的管理内存的装置 500或 720的功能(即,图 1中方法 200 的个流程) , 具体地说, 可以实现与请求节点或控制中心的信息传输, 可以 在贡献节点提供的远程内存中存取来自请求节点的数据。
应理解, 以上列举的请求节点和贡献节点的结构仅为示例性说明, 本发 明并不限定于此, 例如, 也可以将远程内存控制芯片集成在处理器中。
根据本发明实施例的管理内存的系统, 通过根据请求节点所需要的内存 和贡献节点能够提供的内存,从贡献节点中确定供请求节点使用的远程内存, 在请求节点中为该远程内存分配虚拟地址, 在请求节点需要存储指针在该虚 拟地址范围内的数据时, 可以根据该虚拟地址与该远程内存的对应关系, 确 定需要在贡献节点上对该数据进行存取, 从而可以向该贡献节点发送数据读 写指令, 以实现在远程内存上对该数据的存取, 从而, 容易地能够实现内存 的共享。
应理解, 本文中术语 "和 /或" , 仅仅是一种描述关联对象的关联关系, 表示可以存在三种关系, 例如, A和 /或 B , 可以表示: 单独存在 A , 同时存 在 A和 B , 单独存在 B这三种情况。 另外, 本文中字符 "/" , 一般表示前后 关联对象是一种 "或" 的关系。 应理解, 在本发明的各种实施例中, 上述各过程的序号的长度并不意味 着执行顺序的先后, 各过程的执行顺序应以其功能和内在逻辑确定, 而不应 对本发明实施例的实施过程构成任何限定。
本领域普通技术人员可以意识到, 结合本文中所公开的实施例描述的各 示例的单元及算法步骤, 能够以电子硬件、 或者计算机软件和电子硬件的结 合来实现。 这些功能究竟以硬件还是软件方式来执行, 取决于技术方案的特 定应用和设计约束条件。 专业技术人员可以对每个特定的应用来使用不同方 法来实现所描述的功能, 但是这种实现不应认为超出本发明的范围。
所属领域的技术人员可以清楚地了解到, 为描述的方便和筒洁, 上述描 述的系统、 装置和单元的具体工作过程, 可以参考前述方法实施例中的对应 过程, 在此不再赘述。
在本申请所提供的几个实施例中, 应该理解到, 所揭露的系统、 装置和 方法, 可以通过其它的方式实现。 例如, 以上所描述的装置实施例仅仅是示 意性的, 例如, 所述单元的划分, 仅仅为一种逻辑功能划分, 实际实现时可 以有另外的划分方式, 例如多个单元或组件可以结合或者可以集成到另一个 系统, 或一些特征可以忽略, 或不执行。 另一点, 所显示或讨论的相互之间 的耦合或直接耦合或通信连接可以是通过一些接口, 装置或单元的间接耦合 或通信连接, 可以是电性, 机械或其它的形式。 为单元显示的部件可以是或者也可以不是物理单元, 即可以位于一个地方, 或者也可以分布到多个网络单元上。 可以根据实际的需要选择其中的部分或 者全部单元来实现本实施例方案的目的。
另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中, 也可以是各个单元单独物理存在, 也可以两个或两个以上单元集成在一个单 元中。
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用 时, 可以存储在一个计算机可读取存储介质中。 基于这样的理解, 本发明的 技术方案本质上或者说对现有技术做出共享的部分或者该技术方案的部分可 以以软件产品的形式体现出来, 该计算机软件产品存储在一个存储介质中, 包括若干指令用以使得一台计算机设备(可以是个人计算机, 服务器, 或者 网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。 而前述的 存储介质包括: U盘、 移动硬盘、 只读存储器 (ROM, Read-On ly Memory ) 、 随机存取存储器 ( RAM , Random Acce s s Memory ) 、 磁碟或者光盘等各种可以 存储程序代码的介质。
以上所述, 仅为本发明的具体实施方式, 但本发明的保护范围并不局限 于此, 任何熟悉本技术领域的技术人员在本发明揭露的技术范围内, 可轻易 想到变化或替换, 都应涵盖在本发明的保护范围之内。 因此, 本发明的保护 范围应以所述权利要求的保护范围为准。

Claims

权 利 要 求
1. 一种管理内存的方法, 其特征在于, 所述方法包括:
内存管理系统中的请求节点发送第一指示信息,所述第一指示信息用于 指示所述请求节点所需内存的长度;
所述请求节点接收第二指示信息,所述第二指示信息用于指示能够提供 远程内存的至少一个贡献节点中的目标贡献节点向所述请求节点提供的第 一远程内存, 其中, 所述第一远程内存是根据所述第一指示信息确定的, 所 述第一远程内存的长度大于或等于所述请求节点所需内存的长度;
所述请求节点从能够使用的虚拟地址中,确定与所述第一远程内存相对 应的第一虚拟地址; 及
当需要读写指针在所述第一虚拟地址范围内的第一数据时,所述请求节 点发送针对所述第一数据的第一数据读写指令,所述第一数据读写指令包括 第三指示信息,所述第三指示信息用于指示所述第一远程内存中用于存储所 述第一数据的存储空间, 以便于所述目标贡献节点根据所述第三指示信息, 存取所述第一数据。
2. 根据权利要求 1所述的方法, 其特征在于, 所述内存管理系统中的 请求节点发送第一指示信息包括:
内存管理系统中的请求节点获取用于指示所述目标贡献节点的贡献节 点信息;
所述请求节点根据所述贡献节点信息,向所述目标贡献节点发送第一指 示信息; 以及
所述请求节点接收第二指示信息包括:
所述请求节点接收所述目标贡献节点发送的第二指示信息。
3. 根据权利要求 2所述的方法, 其特征在于, 所述请求节点根据所述 贡献节点信息, 向所述目标贡献节点发送第一指示信息, 包括:
所述请求节点根据所述贡献节点信息,向所述目标贡献节点发送针对第 二数据的第二数据写指令, 所述第二数据写指令包括所述第一指示信息; 以 及
所述请求节点接收所述目标贡献节点发送的第二指示信息包括: 所述请求节点接收所述目标贡献节点发送的用于指示所述第二数据存 储完成的第二数据写应答, 所述第二数据写应答包括所述第二指示信息。
4. 根据权利要求 1所述的方法, 其特征在于, 所述内存管理系统中的 请求节点发送第一指示信息包括:
内存管理系统中的请求节点向控制中心发送第一指示信息,以便于所述 控制中心根据所述第一指示信息和所述贡献节点能够提供的远程内存的长 度,从所述贡献节点中确定所述目标贡献节点以及所述第一远程内存,其中, 所述贡献节点能够提供的远程内存的长度是所述控制中心根据所述贡献节 点发送的用于指示所述贡献节点能够提供的远程内存的长度的第四指示信 息确定的; 以及
所述请求节点接收第二指示信息包括:
所述请求节点接收所述控制中心发送的第二指示信息。
5. 根据权利要求 4所述的方法, 其特征在于, 所述方法还包括: 所述请求节点接收所述控制中心发送的用于指示所述目标贡献节点的 贡献节点信息, 以及
所述请求节点发送针对所述第一数据的第一数据读写指令, 包括: 所述请求节点根据所述贡献节点信息,向所述目标贡献节点发送针对所 述第一数据的第一数据读写指令。
6. 根据权利要求 4所述的方法, 其特征在于, 所述请求节点发送针对 所述第一数据的第一数据读写指令, 包括:
所述请求节点广播针对所述第一数据的第一数据读写指令,以便于所述 贡献节点在确定所述存储空间在所述贡献节点能够提供的远程内存的范围 内后, 存取所述第一数据。
7. 根据权利要求 6所述的方法, 其特征在于, 所述内存管理系统包括 至少两个贡献节点,所述至少两个贡献节点能够提供的远程内存的物理地址 相异。
8. 根据权利要求 1至 7中任一项所述的方法, 其特征在于, 所述请求 节点根据所述第一远程内存, 确定第一虚拟地址, 包括:
所述请求节点从所述请求节点内的本地内存中,确定与所述第一远程内 存相对应的第一本地内存;
所述请求节点根据所述第一本地内存, 确定第一虚拟地址。
9. 根据权利要求 1至 8 中任一项所述的方法, 其特征在于, 所述第一 远程内存的长度与所述请求节点所需内存的长度相同,以及所述第二指示信 息用于指示所述第一远程内存的起始物理地址;
所述第一远程内存的长度与所述第一数据的长度相同,以及所述第三指 示信息用于指示所述存储空间的起始物理地址。
1 0. 根据权利要求 1至 8中任一项所述的方法, 其特征在于, 所述第二 指示信息用于指示所述第一远程内存的起始物理地址和长度; 以及
当所述第一数据的长度与所述第二指示信息指示的所述第一远程内存 的长度相同时,所述第三指示信息用于指示所述第一远程内存的起始物理地 址;
当所述第一数据的长度小于所述第二指示信息指示的所述第一远程内 存的长度时,所述第三指示信息用于指示所述存储空间的起始物理地址和长 度。
1 1. 一种管理内存的方法, 其特征在于, 所述方法包括:
内存管理系统中的贡献节点确定第一远程内存,所述第一远程内存是根 据来自请求节点的第一指示信息确定的,所述第一指示信息用于指示所述请 求节点所需内存的长度,所述第一远程内存的长度大于或等于所述请求节点 所需内存的长度; 所述贡献节点接收所述请求节点发送的针对第一数据的第一数据读写 指令, 所述第一数据读写指令用于指示所述贡献节点存取所述第一数据, 所 述第一数据读写指令包括第三指示信息,所述第三指示信息用于指示所述第 一远程内存中用于存储所述第一数据的存储空间;
所述贡献节点根据第一数据读写指令和所述第三指示信息,存取所述第 一数据。
12. 根据权利要求 1 1所述的方法, 其特征在于, 所述内存管理系统中 的贡献节点确定第一远程内存包括:
内存管理系统中的贡献节点接收所述请求节点发送的所述第一指示信 息;
所述贡献节点根据所述第一指示信息, 确定所述第一远程内存; 以及 所述方法还包括:
所述贡献节点向所述请求节点发送用于指示所述第一远程内存的第二 指示信息。
1 3. 根据权利要求 12所述的方法, 其特征在于, 所述内存管理系统中 的贡献节点接收所述请求节点发送的所述第一指示信息包括:
内存管理系统中的贡献节,、接收所述请求节点发送的针对第二数据的 第二数据写指令以及所述第二数据,所述第二数据写指令包括所述第一指示 信息;
所述贡献节点根据所述第一指示信息, 确定所述第一远程内存, 并将所 述第一数据存储在所述第一远程内存中; 以及
所述贡献节点向所述请求节点发送用于指示所述第一远程内存的第二 指示信息包括:
所述贡献节点向所述请求节点发送的用于指示所述第二数据存储完成 的第二数据写应答,所述第二数据写应答包括用于指示所述第一远程内存的 第二指示信息。
14. 根据权利要求 1 1所述的方法, 其特征在于, 所述内存管理系统中 的贡献节点确定第一远程内存包括:
内存管理系统中的贡献节点向控制中心发送第四指示信息,所述第四指 示信息用于指示所述贡献节点能够提供的远程内存的起始物理地址和长度; 所述贡献节点接收所述控制中心发送的用于指示所述第一远程内存的 第二指示信息,所述第一远程内存是所述控制中心根据所述第一指示信息和 所述第四指示信息确定的;
所述贡献节点根据所述第二指示信息, 确定所述第一远程内存。
15. 根据权利要求 1 1至 14中任一项所述的方法, 其特征在于, 所述贡 献节点根据第一数据读写指令和所述第三指示信息, 存取所述第一数据, 包 括:
所述贡献节点确定所述存储空间在所述第一远程内存的范围内; 所述贡献节点根据第一数据读写指令,在所述存储空间内存取所述第一 数据。
16. 根据权利要求 1 1至 15中任一项所述的方法, 其特征在于, 所述请 求节点所需内存的长度与所述第一数据的长度相同,所述目标贡献节点能够 提供的远程内存的长度与所述请求节点所需内存的长度相同, 以及
所述第二指示信息和所述第三指示信息用于指示所述第一远程内存的 起始物理地址。
17. 根据权利要求 1 1至 15中任一项所述的方法, 其特征在于, 所述第 二指示信息用于指示所述第一远程内存的起始物理地址和长度; 以及
当所述第一数据的长度与所述第二指示信息指示的所述第一远程内存 的长度相同时,所述第三指示信息用于指示所述第一远程内存的起始物理地 址;
当所述第一数据的长度小于所述第二指示信息指示的所述第一远程内 存的长度时,所述第三指示信息用于指示所述存储空间的起始物理地址和长 度。
18. 根据权利要求 1 1至 17中任一项所述的方法, 其特征在于, 所述方 法还包括:
所述贡献节点获取用于指示所述请求节点的请求节点信息;
所述贡献节点根据所述请求节点信息, 确定所述请求节点;
所述贡献节点禁止除所述请求节点以外的节点使用所述第一远程内存。
19. 一种管理内存的方法, 其特征在于, 所述方法包括:
内存管理系统中的控制中心确定至少一个贡献节点能够提供的远程内 存的起始物理地址和长度;
所述控制中心接收请求节点发送的第一指示信息,第一指示信息用于指 示所述请求节点所需内存的长度;
所述控制中心根据所述第一指示信息和所述至少一个贡献节点能够提 供的远程内存的起始物理地址和长度,从所述贡献节点中确定目标贡献节点 以及所述目标贡献节点向所述请求节点提供的第一远程内存,所述第一远程 内存的长度大于或等于所述请求节点所需内存的长度;
所述控制中心向所述请求节点和所述目标贡献节点发送用于指示所述 第一远程内存的第二指示信息,以便于所述请求节点和所述目标贡献节点根 据所述第二指示信息, 确定所述第一远程内存, 并在所述第一远程内存进行 针对第一数据存取, 其中, 所述第一数据的指针在所述请求节点为所述第一 远程内存分配的第一虚拟地址范围内。
20. 根据权利要求 1 9所述的方法, 其特征在于, 所述方法还包括: 所述控制中心向所述请求节点发送用于指示所述目标贡献节点的贡献 节点信息, 以便于所述请求节点根据所述贡献节点信息, 向所述目标贡献节 点发送针对所述第一数据的第一数据读写指令。
21. 根据权利要求 19或 20所述的方法,其特征在于,所述方法还包括: 所述控制中心向所述贡献节点发送用于指示所述请求节点的请求节点 信息,以便于所述目标贡献节点根据所述请求节点信息,确定所述请求节点, 并禁止除所述请求节点以外的节点使用所述第一远程内存。
22. 根据权利要求 19至 21中任一项所述的方法, 其特征在于, 所述内 存管理系统包括至少两个贡献节点, 以及
所述控制中心根据所述第一指示信息和所述第四指示信息,从所述贡献 节点中确定目标贡献节点以及所述目标贡献节点向所述请求节点提供的第 一远程内存包括:
所述控制中心根据所述第一指示信息和所述第四指示信息,从所述贡献 节点中确定目标贡献节点以及所述目标贡献节点向所述请求节点提供的第 一远程内存,以使包括所述第一远程内存在内的各贡献节点提供的远程内存 的物理地址相异。
23. 根据权利要求 19至 22中任一项所述的方法, 其特征在于, 所述请 求节点所需内存的长度与所述第一数据的长度相同,所述目标贡献节点能够 提供的远程内存的长度与所述请求节点所需内存的长度相同, 以及
所述第二指示信息和所述第三指示信息用于指示所述第一远程内存的 起始物理地址。
24. 根据权利要求 19至 22中任一项所述的方法, 其特征在于, 所述第 二指示信息用于指示所述第一远程内存的起始物理地址和长度; 以及
当所述第一数据的长度与所述第二指示信息指示的所述第一远程内存 的长度相同时,所述第三指示信息用于指示所述第一远程内存的起始物理地 址;
当所述第一数据的长度小于所述第二指示信息指示的所述第一远程内 存的长度时,所述第三指示信息用于指示用于存储所述第一数据的存储空间 的起始物理地址和长度。
25. 根据权利要求 19至 24中任一项所述的方法, 其特征在于, 所述内 存管理系统中的控制中心确定至少一个贡献节点能够提供的远程内存的起 始物理地址和长度包括:
内存管理系统中的控制中心接收至少一个贡献节点发送的第四指示信 息,所述第四指示信息用于指示所述贡献节点能够提供的远程内存的起始物 理地址和长度;
所述控制中心根据所述第四指示信息,确定所述至少一个贡献节点能够 提供的远程内存的起始物理地址和长度。
26. 一种管理内存的装置, 其特征在于, 所述装置包括:
发送单元, 用于使内存管理系统中的请求节点发送第一指示信息, 所述 第一指示信息用于指示所述请求节点所需内存的长度;
接收单元, 用于接收第二指示信息, 所述第二指示信息用于指示能够提 供远程内存的至少一个贡献节点中的目标贡献节点向所述请求节点提供的 第一远程内存, 其中, 所述第一远程内存是根据所述第一指示信息确定的, 所述第一远程内存的长度大于或等于所述请求节点所需内存的长度;
处理单元, 用于从能够使用的虚拟地址中, 确定与所述第一远程内存相 对应的第一虚拟地址;
用于当需要读写指针在所述第一虚拟地址范围内的第一数据时,控制所 述发送单元发送针对所述第一数据的第一数据读写指令,所述第一数据读写 指令包括第三指示信息,所述第三指示信息用于指示所述第一远程内存中用 于存储所述第一数据的存储空间,以便于所述目标贡献节点根据所述第三指 示信息, 存取所述第一数据。
27. 根据权利要求 26所述的装置, 其特征在于, 所述处理单元具体用 于获取用于指示所述目标贡献节点的贡献节点信息;
所述发送单元具体用于根据所述贡献节点信息,向所述目标贡献节点发 送第一指示信息;
所述接收单元具体用于接收所述目标贡献节点发送的第二指示信息。
28. 根据权利要求 27所述的装置, 其特征在于, 所述发送单元具体用 于根据所述贡献节点信息,向所述目标贡献节点发送针对第二数据的第二数 据写指令, 所述第二数据写指令包括所述第一指示信息; 以及
所述接收单元具体用于接收所述目标贡献节点发送的用于指示所述第 二数据存储完成的第二数据写应答,所述第二数据写应答包括所述第二指示 信息。
29. 根据权利要求 26所述的装置, 其特征在于, 所述发送单元具体用 于向控制中心发送第一指示信息,以便于所述控制中心根据所述第一指示信 息和所述贡献节点能够提供的远程内存的长度,从所述贡献节点中确定所述 目标贡献节点以及所述第一远程内存, 其中, 所述贡献节点能够提供的远程 内存的长度是所述控制中心根据所述贡献节点发送的用于指示所述贡献节 点能够提供的远程内存的长度的第四指示信息确定的; 以及
所述接收单元具体用于接收所述控制中心发送的第二指示信息。
30. 根据权利要求 29所述的装置, 其特征在于, 所述接收单元还用于 接收所述控制中心发送的用于指示所述目标贡献节点的贡献节点信息,以及 所述发送单元具体用于根据所述贡献节点信息,向所述目标贡献节点发 送针对所述第一数据的第一数据读写指令。
31. 根据权利要求 29所述的装置, 其特征在于, 所述发送单元具体用 于广播针对所述第一数据的第一数据读写指令,以便于所述贡献节点在确定 所述存储空间在所述贡献节点能够提供的远程内存的范围内后,存取所述第 一数据。
32. 根据权利要求 31所述的装置, 其特征在于, 所述内存管理系统包 括至少两个贡献节点,所述至少两个贡献节点能够提供的远程内存的物理地 址相异。
33. 根据权利要求 26至 32中任一项所述的装置, 其特征在于, 所述处 理单元具体用于从所述请求节点内的本地内存中,确定与所述第一远程内存 相对应的第一本地内存; 用于根据所述第一本地内存, 确定第一虚拟地址。
34. 根据权利要求 26至 33中任一项所述的装置, 其特征在于, 所述第 一远程内存的长度与所述请求节点所需内存的长度相同,以及所述第二指示 信息用于指示所述第一远程内存的起始物理地址;
所述第一远程内存的长度与所述第一数据的长度相同,以及所述第三指 示信息用于指示所述存储空间的起始物理地址。
35. 根据权利要求 26至 33中任一项所述的装置, 其特征在于, 所述第 二指示信息用于指示所述第一远程内存的起始物理地址和长度; 以及
当所述第一数据的长度与所述第二指示信息指示的所述第一远程内存 的长度相同时,所述第三指示信息用于指示所述第一远程内存的起始物理地 址;
当所述第一数据的长度小于所述第二指示信息指示的所述第一远程内 存的长度时,所述第三指示信息用于指示所述存储空间的起始物理地址和长 度。
36. 一种管理内存的装置, 其特征在于, 所述装置包括:
处理单元, 用于使内存管理系统中的贡献节点确定第一远程内存, 所述 第一远程内存是根据来自请求节点的第一指示信息确定的,所述第一指示信 息用于指示所述请求节点所需内存的长度,所述第一远程内存的长度大于或 等于所述请求节点所需内存的长度;
接收单元,用于接收所述请求节点发送的针对第一数据的第一数据读写 指令, 所述第一数据读写指令用于指示所述贡献节点存取所述第一数据, 所 述第一数据读写指令包括第三指示信息,所述第三指示信息用于指示所述第 一远程内存中用于存储所述第一数据的存储空间;
所述处理单元还用于根据第一数据读写指令和所述第三指示信息,存取 所述第一数据。
37. 根据权利要求 36所述的装置, 其特征在于, 所述接收单元具体用 于接收所述请求节点发送的所述第一指示信息;
所述处理单元具体用于根据所述第一指示信息, 确定所述第一远程内 存; 以及
所述装置还包括:
发送单元,用于向所述请求节点发送用于指示所述第一远程内存的第二 指示信息。
38. 根据权利要求 37所述的装置, 其特征在于, 所述接收单元具体用 于接收所述请求节点发送的针对第二数据的第二数据写指令以及所述第二 数据, 所述第二数据写指令包括所述第一指示信息;
所述处理单元具体用于根据所述第一指示信息, 确定所述第一远程内 存, 并将所述第一数据存储在所述第一远程内存中;
所述发送单元具体用于向所述请求节点发送的用于指示所述第二数据 存储完成的第二数据写应答,所述第二数据写应答包括用于指示所述第一远 程内存的第二指示信息。
39. 根据权利要求 36所述的装置, 其特征在于, 所述装置还包括: 发送单元, 用于向控制中心发送第四指示信息, 所述第四指示信息用于 指示所述贡献节点能够提供的远程内存的起始物理地址和长度;
所述接收单元具体用于接收所述控制中心发送的用于指示所述第一远 程内存的第二指示信息,所述第一远程内存是所述控制中心根据所述第一指 示信息和所述第四指示信息确定的;
所述处理单元具体用于根据所述第二指示信息, 确定所述第一远程内 存。
40. 根据权利要求 36至 39中任一项所述的装置, 其特征在于, 所述处 理单元具体用于确定所述存储空间在所述第一远程内存的范围内;
用于根据第一数据读写指令, 在所述存储空间内存取所述第一数据。
41. 根据权利要求 36至 40中任一项所述的装置, 其特征在于, 所述请 求节点所需内存的长度与所述第一数据的长度相同,所述目标贡献节点能够 提供的远程内存的长度与所述请求节点所需内存的长度相同, 以及
所述第二指示信息和所述第三指示信息用于指示所述第一远程内存的 起始物理地址。
42. 根据权利要求 36至 40中任一项所述的装置, 其特征在于, 所述第 二指示信息用于指示所述第一远程内存的起始物理地址和长度; 以及
当所述第一数据的长度与所述第二指示信息指示的所述第一远程内存 的长度相同时,所述第三指示信息用于指示所述第一远程内存的起始物理地 址;
当所述第一数据的长度小于所述第二指示信息指示的所述第一远程内 存的长度时,所述第三指示信息用于指示所述存储空间的起始物理地址和长 度。
43. 根据权利要求 36至 42中任一项所述的装置, 其特征在于, 所述处 理单元还用于获取用于指示所述请求节点的请求节点信息;
用于根据所述请求节点信息, 确定所述请求节点;
用于禁止除所述请求节点以外的节点使用所述第一远程内存。
44. 一种管理内存的装置, 其特征在于, 所述装置包括:
处理单元,用于使内存管理系统中的控制中心确定至少一个贡献节点能 够提供的远程内存的起始物理地址和长度;
接收单元, 用于接收请求节点发送的第一指示信息, 第一指示信息用于 指示所述请求节点所需内存的长度;
所述处理单元还用于根据所述第一指示信息和所述至少一个贡献节点 能够提供的远程内存的起始物理地址和长度,从所述贡献节点中确定目标贡 献节点以及所述目标贡献节点向所述请求节点提供的第一远程内存,所述第 一远程内存的长度大于或等于所述请求节点所需内存的长度;
发送单元,用于向所述请求节点和所述目标贡献节点发送用于指示所述 第一远程内存的第二指示信息,以便于所述请求节点和所述目标贡献节点根 据所述第二指示信息, 确定所述第一远程内存, 并在所述第一远程内存进行 针对第一数据存取, 其中, 所述第一数据的指针在所述请求节点为所述第一 远程内存分配的第一虚拟地址范围内。
45. 根据权利要求 44所述的装置, 其特征在于, 所述发送单元还用于 向所述请求节点发送用于指示所述目标贡献节点的贡献节点信息,以便于所 述请求节点根据所述贡献节点信息,向所述目标贡献节点发送针对所述第一 数据的第一数据读写指令。
46. 根据权利要求 44或 45所述的装置, 其特征在于, 所述发送单元还 用于向所述贡献节点发送用于指示所述请求节点的请求节点信息,以便于所 述目标贡献节点根据所述请求节点信息, 确定所述请求节点, 并禁止除所述 请求节点以外的节点使用所述第一远程内存。
47. 根据权利要求 44至 46中任一项所述的装置, 其特征在于, 所述内 存管理系统包括至少两个贡献节点, 以及
该处理单元具体用于根据所述第一指示信息和所述第四指示信息,从所 述贡献节点中确定目标贡献节点以及所述目标贡献节点向所述请求节点提 供的第一远程内存,以使包括所述第一远程内存在内的各贡献节点提供的远 程内存的物理地址相异。
48. 根据权利要求 44至 47中任一项所述的装置, 其特征在于, 所述请 求节点所需内存的长度与所述第一数据的长度相同,所述目标贡献节点能够 提供的远程内存的长度与所述请求节点所需内存的长度相同, 以及
所述第二指示信息和所述第三指示信息用于指示所述第一远程内存的 起始物理地址。
49. 根据权利要求 44至 47中任一项所述的装置, 其特征在于, 所述第 二指示信息用于指示所述第一远程内存的起始物理地址和长度; 以及
当所述第一数据的长度与所述第二指示信息指示的所述第一远程内存 的长度相同时,所述第三指示信息用于指示所述第一远程内存的起始物理地 址;
当所述第一数据的长度小于所述第二指示信息指示的所述第一远程内 存的长度时,所述第三指示信息用于指示用于存储所述第一数据的存储空间 的起始物理地址和长度。
50. 根据权利要求 44至 49中任一项所述的装置, 其特征在于, 所述接收单元还用于接收至少一个贡献节点发送的第四指示信息,所述 第四指示信息用于指示所述贡献节点能够提供的远程内存的起始物理地址 和长度;
所述处理单元具体用于根据所述第四指示信息,确定所述至少一个贡献 节点能够提供的远程内存的起始物理地址和长度。
51. 一种管理内存的系统, 其特征在于, 所述系统包括:
至少一个请求节点, 用于发送第一指示信息, 该第一指示信息用于指示 该请求节点所需内存的长度, 接收第二指示信息, 所述第二指示信息用于指 示能够提供远程内存的至少一个贡献节点中的目标贡献节点向所述请求节 点提供的第一远程内存, 其中, 所述第一远程内存是根据所述第一指示信息 确定的, 所述第一远程内存的长度大于或等于所述请求节点所需内存的长 度, 从能够使用的虚拟地址中, 确定与所述第一远程内存相对应的第一虚拟 地址, 当需要读写指针在所述第一虚拟地址范围内的第一数据时, 发送针对 所述第一数据的第一数据读写指令,所述第一数据读写指令包括第三指示信 息,所述第三指示信息用于指示所述第一远程内存中用于存储所述第一数据 的存储空间, 以便于所述目标贡献节点根据所述第三指示信息, 存取所述第 一数据;
至少一个贡献节点, 用于确定第一远程内存, 所述第一远程内存是根据 来自请求节点的第一指示信息确定的,所述第一指示信息用于指示所述请求 节点所需内存的长度,所述第一远程内存的长度大于或等于所述请求节点所 需内存的长度, 接收所述请求节点发送的针对第一数据的第一数据读写指 令, 所述第一数据读写指令用于指示所述贡献节点存取所述第一数据, 所述 第一数据读写指令包括第三指示信息,所述第三指示信息用于指示所述第一 远程内存中用于存储所述第一数据的存储空间,根据第一数据读写指令和所 述第三指示信息, 存取所述第一数据。
52. 根据权利要求 5 1述的装置, 其特征在于, 所述系统还包括: 控制中心,用于确定至少一个贡献节点能够提供的远程内存的起始物理 地址和长度, 接收请求节点发送的第一指示信息, 第一指示信息用于指示所 述请求节点所需内存的长度,根据所述第一指示信息和所述至少一个贡献节 点能够提供的远程内存的起始物理地址和长度,从所述贡献节点中确定目标 贡献节点以及所述目标贡献节点向所述请求节点提供的第一远程内存,所述 第一远程内存的长度大于或等于所述请求节点所需内存的长度,向所述请求 节点和所述目标贡献节点发送用于指示所述第一远程内存的第二指示信息, 以便于所述请求节点和所述目标贡献节点根据所述第二指示信息,确定所述 第一远程内存, 并在所述第一远程内存进行针对第一数据存取, 其中, 所述 第一数据的指针在所述请求节点为所述第一远程内存分配的第一虚拟地址 范围内。
PCT/CN2013/088073 2013-05-17 2013-11-28 管理内存的方法、装置和系统 WO2014183417A1 (zh)

Priority Applications (4)

Application Number Priority Date Filing Date Title
EP21183969.1A EP3958122A1 (en) 2013-05-17 2013-11-28 Memory management method, apparatus, and system
EP13884645.6A EP2998862A4 (en) 2013-05-17 2013-11-28 METHOD, DEVICE AND SYSTEM FOR MEMORY MANAGEMENT
US14/942,719 US9940020B2 (en) 2013-05-17 2015-11-16 Memory management method, apparatus, and system
US15/911,633 US10235047B2 (en) 2013-05-17 2018-03-05 Memory management method, apparatus, and system

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201310183167.1A CN104166628B (zh) 2013-05-17 2013-05-17 管理内存的方法、装置和系统
CN201310183167.1 2013-05-17

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US14/942,719 Continuation US9940020B2 (en) 2013-05-17 2015-11-16 Memory management method, apparatus, and system

Publications (1)

Publication Number Publication Date
WO2014183417A1 true WO2014183417A1 (zh) 2014-11-20

Family

ID=51897637

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2013/088073 WO2014183417A1 (zh) 2013-05-17 2013-11-28 管理内存的方法、装置和系统

Country Status (4)

Country Link
US (2) US9940020B2 (zh)
EP (2) EP2998862A4 (zh)
CN (2) CN104166628B (zh)
WO (1) WO2014183417A1 (zh)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105808448A (zh) * 2014-12-30 2016-07-27 中兴通讯股份有限公司 内存管理方法及系统
US9619165B1 (en) * 2015-10-30 2017-04-11 Sandisk Technologies Llc Convertible leaf memory mapping
KR102352156B1 (ko) * 2017-10-26 2022-01-17 삼성전자주식회사 Arp를 수행하는 슬레이브 장치 및 이의 동작 방법
CN111694649B (zh) * 2020-06-12 2023-07-18 北京火山引擎科技有限公司 资源调度方法、装置、计算机设备和存储介质
WO2022118323A1 (en) * 2020-12-02 2022-06-09 Unifabrix Ltd. Adjustable-precision multidimensional memory entropy sampling for optimizing memory resource allocation
CN115269174A (zh) * 2021-04-30 2022-11-01 华为技术有限公司 一种数据传输方法、数据处理方法及相关产品
CN118103824A (zh) * 2021-06-09 2024-05-28 安法布里卡公司 通过网络协议的透明远程存储器访问
CN115934023A (zh) * 2021-08-31 2023-04-07 华为技术有限公司 数据处理方法、数据处理装置以及相关设备
CN115543862B (zh) * 2022-09-27 2023-09-01 超聚变数字技术有限公司 内存管理方法及相关装置

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101373445A (zh) * 2008-09-09 2009-02-25 创新科存储技术(深圳)有限公司 一种内存调度方法及装置
CN101470665A (zh) * 2007-12-27 2009-07-01 Tcl集团股份有限公司 一种无mmu平台的应用系统内存管理的方法及系统

Family Cites Families (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6055617A (en) * 1997-08-29 2000-04-25 Sequent Computer Systems, Inc. Virtual address window for accessing physical memory in a computer system
US6249802B1 (en) * 1997-09-19 2001-06-19 Silicon Graphics, Inc. Method, system, and computer program product for allocating physical memory in a distributed shared memory network
JP2002149495A (ja) * 2000-11-15 2002-05-24 Nec Corp メモリ管理方式とその方法及びこの方法を記録した記録媒体
US7380039B2 (en) * 2003-12-30 2008-05-27 3Tera, Inc. Apparatus, method and system for aggregrating computing resources
CN100349142C (zh) * 2004-05-25 2007-11-14 中国科学院计算技术研究所 一种用于虚拟共享存储系统的远程取页方法及网络接口卡
US20060075057A1 (en) * 2004-08-30 2006-04-06 International Business Machines Corporation Remote direct memory access system and method
US7428629B2 (en) * 2006-08-08 2008-09-23 International Business Machines Corporation Memory request / grant daemons in virtual nodes for moving subdivided local memory space from VN to VN in nodes of a massively parallel computer system
US7979645B2 (en) * 2007-09-14 2011-07-12 Ricoh Company, Limited Multiprocessor system for memory mapping of processing nodes
US20090089537A1 (en) * 2007-09-28 2009-04-02 Sun Microsystems, Inc. Apparatus and method for memory address translation across multiple nodes
CN101635669B (zh) * 2008-07-25 2011-11-09 中国科学院声学研究所 一种用于数据共享系统中获取数据片段的方法
US20110103391A1 (en) * 2009-10-30 2011-05-05 Smooth-Stone, Inc. C/O Barry Evans System and method for high-performance, low-power data center interconnect fabric
CN103959270B (zh) * 2011-10-07 2018-08-21 英特尔公司 用于在计算装置处采用和便于动态和远程存储器协作的机制
CN102521300B (zh) * 2011-11-30 2015-03-04 华中科技大学 基于嵌入式虚拟化平台的域间文件数据共享方法
WO2014120226A1 (en) * 2013-01-31 2014-08-07 Hewlett-Packard Development Company, L.P. Mapping mechanism for large shared address spaces
US20140280669A1 (en) * 2013-03-15 2014-09-18 Microsoft Corporation Memory Sharing Over A Network

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101470665A (zh) * 2007-12-27 2009-07-01 Tcl集团股份有限公司 一种无mmu平台的应用系统内存管理的方法及系统
CN101373445A (zh) * 2008-09-09 2009-02-25 创新科存储技术(深圳)有限公司 一种内存调度方法及装置

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
PAN, MINGLIAN ET AL., MICROCOMPUTER PRINCIPLE., 30 September 2003 (2003-09-30), pages 79 - 80, XP008179426 *
See also references of EP2998862A4 *

Also Published As

Publication number Publication date
EP3958122A1 (en) 2022-02-23
US20180196603A1 (en) 2018-07-12
CN108845877B (zh) 2021-09-17
EP2998862A1 (en) 2016-03-23
CN108845877A (zh) 2018-11-20
US9940020B2 (en) 2018-04-10
CN104166628B (zh) 2018-05-18
CN104166628A (zh) 2014-11-26
US20160070475A1 (en) 2016-03-10
US10235047B2 (en) 2019-03-19
EP2998862A4 (en) 2016-04-20

Similar Documents

Publication Publication Date Title
WO2014183417A1 (zh) 管理内存的方法、装置和系统
WO2018059222A1 (zh) 一种文件切片上传方法、装置及云存储系统
WO2018035856A1 (zh) 实现硬件加速处理的方法、设备和系统
US9998531B2 (en) Computer-based, balanced provisioning and optimization of data transfer resources for products and services
US9448901B1 (en) Remote direct memory access for high availability nodes using a coherent accelerator processor interface
WO2021057607A1 (zh) 一种节点限速的方法、装置、电子设备及存储介质
CN111585887B (zh) 基于多个网络的通信方法、装置、电子设备及存储介质
WO2015180648A1 (zh) 一种资源分配的方法及装置
CN109379448B (zh) 一种文件分布式部署方法、装置、电子设备及存储介质
WO2015165298A1 (zh) 计算机,控制设备和数据处理方法
JP2009251708A (ja) I/oノード制御方式及び方法
CN110225146B (zh) 内外网映射方法、装置、电子设备、介质及视频会议系统
US20100020818A1 (en) Sharing buffer space in link aggregation configurations
CN104461698A (zh) 虚拟磁盘动态挂载的方法、管理装置及分布式存储系统
CN115964319A (zh) 远程直接内存访问的数据处理方法及相关产品
WO2017054533A1 (zh) 云互通的外部资源管理方法、装置及系统
CN113361913A (zh) 一种通信业务编排方法、装置、计算机设备及存储介质
EP3051426B1 (en) Method, device, and system for accessing memory
JP2005208999A (ja) 仮想マシン管理プログラム
US9547590B2 (en) Managing memory
WO2020259208A1 (zh) 内存调度方法、装置、设备及存储介质
EP3076306A1 (en) Method and apparatus for achieving device sharing
CN110636149B (zh) 远程访问方法、装置、路由器及存储介质
CN107534678B (zh) 建立vnfm与vim之间的连接的方法、装置及系统
TW201440476A (zh) 畫面分享系統及方法

Legal Events

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

Ref document number: 13884645

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

WWE Wipo information: entry into national phase

Ref document number: 2013884645

Country of ref document: EP