CN112948149A - Remote memory sharing method and device, electronic equipment and storage medium - Google Patents

Remote memory sharing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN112948149A
CN112948149A CN202110336499.3A CN202110336499A CN112948149A CN 112948149 A CN112948149 A CN 112948149A CN 202110336499 A CN202110336499 A CN 202110336499A CN 112948149 A CN112948149 A CN 112948149A
Authority
CN
China
Prior art keywords
memory
interval
physical page
remote
cache
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110336499.3A
Other languages
Chinese (zh)
Inventor
李知隆
刘运渠
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jiangsu Weishi Technology Co ltd
Original Assignee
Jiangsu Weishi Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Jiangsu Weishi Technology Co ltd filed Critical Jiangsu Weishi Technology Co ltd
Priority to CN202110336499.3A priority Critical patent/CN112948149A/en
Publication of CN112948149A publication Critical patent/CN112948149A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/544Buffers; Shared memory; Pipes
    • 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

Abstract

The invention discloses a remote memory sharing method, a remote memory sharing device, electronic equipment and a storage medium, wherein the method is executed by the electronic equipment and comprises the following steps: determining a remote memory for a local electronic device and mapping the remote memory to a local virtual memory address under the condition that a physical memory of the local electronic device cannot meet the requirement of a local application program; establishing an association relation between a physical page and a memory interval in a cache in the process of using the remote memory based on the virtual memory address, and exchanging data between the associated physical page and the memory interval; the cache belongs to a physical memory. By implementing the technical scheme of the invention, the remote memory sharing can be realized, the requirement on the access performance of the remote memory is met, the comprehensive performance of the remote memory is improved, and the flexibility is high and the compatibility to upper-layer application is high.

Description

Remote memory sharing method and device, electronic equipment and storage medium
Technical Field
Embodiments of the present invention relate to a memory sharing technology, and in particular, to a remote memory sharing method and apparatus, an electronic device, and a storage medium.
Background
With the continuous development of network technology, the speed of the network is continuously improved, and good conditions are created for the application of the cluster system.
The cluster system can provide a large amount of CPU and memory resources for users, but because each node in the cluster is still an autonomous individual, the memory resources cannot be effectively utilized, so that the memory resources of the cluster are seriously wasted. In the traditional memory sharing based on a Transmission Control Protocol (TCP), a shared memory interface is constructed on the TCP, however, the TCP as a traditional transport layer Protocol has the problems of large delay and insufficient performance, especially for an ethernet of over 100G, the traditional TCP is difficult to drive a high bandwidth, and causes the problem of too high CPU occupancy rate of the Protocol itself in a high bandwidth scene, and occupies computing resources required by the service logic itself. A new remote memory sharing protocol represented by cxl (computer Express link) can solve the problem of insufficient TCP performance. However, CXL itself is used as a hardware interface, and all memories of a remote node are directly accessed to a local node, which is not flexible enough. Therefore, there is a need for an improved memory sharing method.
Disclosure of Invention
The invention provides a remote memory sharing method and device, electronic equipment and a storage medium, which are used for meeting the requirement of remote memory access performance and improving the comprehensive performance of a remote memory.
In a first aspect, an embodiment of the present invention provides a remote memory sharing method, executed by an electronic device, where the method includes:
determining a remote memory for a local electronic device and mapping the remote memory to a local virtual memory address under the condition that a physical memory of the local electronic device cannot meet the requirement of a local application program;
establishing an association relation between a physical page and a memory interval in a cache in the process of using the remote memory based on the virtual memory address, and exchanging data between the associated physical page and the memory interval; the cache belongs to a physical memory.
In a second aspect, an embodiment of the present invention further provides a remote memory sharing apparatus, where the apparatus includes:
the memory determining module is used for determining a far-end memory for the local electronic equipment under the condition that the physical memory of the local electronic equipment cannot meet the requirement of a local application program, and mapping the far-end memory to a local virtual memory address;
the data exchange module is used for establishing an association relation between a physical page and a memory interval in a cache in the process of using the remote memory based on the virtual memory address and exchanging data between the associated physical page and the memory interval; the cache belongs to a physical memory.
In a third aspect, an embodiment of the present invention further provides an electronic device, where the electronic device includes:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement a remote memory sharing method according to any embodiment of the invention.
In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the remote memory sharing method according to any embodiment of the present invention.
According to the remote memory sharing method, the remote memory sharing device, the electronic equipment and the storage medium provided by the embodiment of the invention, under the condition that the physical memory of the local electronic equipment cannot meet the requirement of a local application program, the remote memory is determined for the local electronic equipment, and the remote memory is mapped to the local virtual memory address; and in the process of using the remote memory based on the virtual memory address, establishing an association relation between the physical page and the memory interval in the cache, and exchanging data between the associated physical page and the memory interval. The invention realizes a set of remote memory sharing interfaces compatible with upper-layer application by using a memory mapping mechanism, can allow the upper-layer application to apply and use a remote node memory according to the requirement under the condition that the upper-layer application is unknown to a bottom distributed memory architecture, has higher performance by exchanging a cache mechanism and cache data, can meet the requirement of remote memory access performance, improves the comprehensive performance of the remote memory, and provides a new idea for remote memory sharing.
Drawings
Fig. 1a is a flowchart of a remote memory sharing method according to an embodiment of the present invention;
fig. 1b is a schematic diagram of a mapping relationship provided in the first embodiment of the present invention;
FIG. 1c is a schematic diagram of data exchange according to an embodiment of the present invention;
fig. 2 is a flowchart of a remote memory sharing method according to a second embodiment of the present invention;
fig. 3 is a flowchart of a remote memory sharing method according to a third embodiment of the present invention;
fig. 4 is a structural diagram of a remote memory sharing device according to a fourth embodiment of the present invention;
fig. 5 is a schematic structural diagram of an electronic device according to a fifth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Example one
Fig. 1a is a flowchart of a remote memory sharing method according to an embodiment of the present invention, which is applicable to a remote memory sharing situation, for example, a data center cluster memory sharing situation. The method can be executed by the remote memory sharing device provided by the embodiment of the invention, and the device can be realized in a software and/or hardware manner and can be integrated on an electronic device.
Specifically, as shown in fig. 1a, the remote memory sharing method provided in the embodiment of the present invention may include the following steps:
s110, under the condition that the physical memory of the local electronic equipment cannot meet the requirement of the local application program, determining a remote memory for the local electronic equipment, and mapping the remote memory to a local virtual memory address.
The physical memory refers to a memory space obtained by a physical memory bank, and common physical memory specifications include 256M, 512M, 1G, 2G, and the like, and nowadays, with the development of computer hardware, memory specifications of 4G, 8G, and even higher capacity have appeared. Clearly, physical memory is a limited and objectively existing memory space. As a limited memory space, the situation that the physical memory is insufficient and cannot meet the requirement of the local application program inevitably occurs.
Virtual memory is a technique for memory management in computer systems. It allows an application to think that it has continuous available memory (a continuous complete address space), whereas in practice it is usually partitioned into multiple physical memory fragments, and some are temporarily stored on external disk storage, where data exchange takes place when needed. Currently, most operating systems use virtual memories, such as "virtual memory" of the Windows family, and "swap space" of Linux.
The remote memory may be understood as a physical memory of other electronic devices in the same data center cluster as the current electronic device. In this embodiment, under the condition that the physical memory of the local electronic device cannot meet the requirement of the local application program, the local electronic device may initiate a remote memory application request to the memory manager in the data center cluster. After receiving the locally transmitted remote memory application request, the memory manager may determine a remote memory for the local electronic device, and map the remote memory to a local virtual memory address.
Specifically, the remote memory requested by the application program may be mapped to a local memory file by using a remote memory interface and using an existing memory mapping mechanism in the operating system. The mechanism can fully ensure the flexibility of upper-layer application, dynamically apply for the memory according to the requirements of application programs and release the memory after the use is finished. Meanwhile, the memory mapping interface is a default interface realized in the operating system, so that the consistency among different application programs is ensured by using the interface. The mapping relationship of the interface implementation is shown in fig. 1 b.
S120, in the process of using the remote memory based on the virtual memory address, establishing an association relation between a physical page and a memory interval in a cache, and exchanging data between the associated physical page and the memory interval; the cache belongs to a physical memory.
The cache is a part of the local physical memory and is used for caching the part of the remote memory which is currently accessed or frequently accessed by the application program.
The remote memory maps the applied memory to the virtual memory address of the local memory in a memory mapping mode, a memory device file is generated locally, and the application program opens the local memory device file through the mmap interface to obtain the control right of the virtual memory address. At this time, there is a corresponding relationship between the applied remote memory and the memory address field of the application program at the local virtual memory address. With this control, remote memory can be used based on the virtual address.
Obviously, a mapping relationship exists between the virtual address and the cache. Based on the mapping relation between the virtual address and the remote memory and the mapping relation between the cache, the relation between the cache and the remote memory can be established, so that the association relation between the physical page in the cache and the memory interval in the remote memory is established, and data exchange is carried out on the associated physical page and the memory interval.
In an optional implementation manner of this embodiment, the mmap mechanism does not actively allocate a corresponding physical memory page, which is referred to as a physical page for short, to the virtual memory address. When the memory access interval of the application program exceeds the cache range, page fault exception is triggered, and the logic of data exchange between the local cache and the remote memory is realized during exception handling.
In order to improve the caching efficiency and the cache hit rate, and to make the caching time in the optimal caching state, in another optional implementation manner of this embodiment, the logical relationship between the access data of different memory intervals is determined according to the existing memory interval access behavior, so that the optimal caching strategy is automatically calculated; and based on the optimal cache strategy, realizing the logic of page exchange between the local cache page and the remote memory.
And in the initial stage, a simple caching strategy is adopted. The simple cache policy is that when a certain memory address is accessed, the next accessed data page is considered to have a high probability of falling within a section of interval before and after the address. The specific interval size can be dynamically adjusted according to the memory and the cache ratio.
As shown in fig. 1c, in the process of exchanging the cache data between the nodes a and B, the initial state is that the physical page 2 maps to the memory interval 2, the physical page 3 maps to the memory interval 3, and the physical page 4 maps to the memory interval 4. When the memory access falls in the allocated memory interval 3, according to the initial cache policy of the system, the system should perform physical page swap according to the upper and lower sections of the memory access interval 3, so that the physical page 1 points to the memory interval 5 again.
It is understood that, during operation, due to the limitation of the internal organization structure of the data, there is a specific rule for the data access of the memory intervals, that is, there is a logical relationship between the data accessed in different memory intervals. After a period of stable operation, the application program applies for a remote memory access behavior through the interface, which can be used to build a model to further determine a logical relationship between access data in different memory intervals. At this time, assuming that a memory access is performed for an address on the memory interval 1, the system automatically selects k memory intervals with the highest association degree with the interval 1 from other memory intervals for caching, and the value of k depends on the number of physical cache pages pre-allocated in the node a.
According to the technical scheme of the embodiment, under the condition that the physical memory of the local electronic equipment cannot meet the requirement of the local application program, the remote memory is determined for the local electronic equipment, and the remote memory is mapped to the local virtual memory address; and in the process of using the remote memory based on the virtual memory address, establishing an association relation between the physical page and the memory interval in the cache, and exchanging data between the associated physical page and the memory interval. The invention realizes a set of remote memory sharing interfaces compatible with upper-layer application by using a memory mapping mechanism, can allow the upper-layer application to apply and use a remote node memory according to requirements under the condition that the upper-layer application is unknown to a bottom distributed memory architecture, improves the performance by the cache mechanism and the cache data exchange, can meet the requirement of remote memory access performance by matching the unique cache mechanism and the cache page exchange system of the intelligent network card, improves the comprehensive performance of the remote memory, and provides a new idea for remote memory sharing.
In the current data center application environment, many challenges exist, such as single-node large memory capacity, cross-node memory sharing, processor and memory decoupling, and the like. Specifically, the method comprises the following steps: the memory resources are limited in a single node, so that the memory utilization rate is difficult to improve; in a distributed architecture, in order to reduce the memory overhead of nodes, copies can be saved in different nodes, and memory resources are consumed; in a memory database, the cost is higher if the single-node high-capacity requirements such as graph calculation and the like depend on multi-path CPU stacking; the ratio of the number of the CPU cores to the memory capacity is fixed, and memory fragments can be generated when cloud computing resources are sold; the Ethernet bandwidth evolves from 100G to 400G and is higher than the memory bandwidth, which objectively causes the problem that the network performance is not matched with the memory performance. To solve the above problems, a cross-point memory allocation and sharing mechanism based on high performance ethernet or similar interconnection protocol is made necessary.
Based on the above technical solution, data exchange can be performed between the associated physical page and the Memory interval based on a Remote Direct Memory Access (RDMA) protocol. The RDMA has the advantages of high performance and high Ethernet compatibility, and can meet the requirement of remote memory access performance and have high compatibility with the existing data center exchange architecture.
The standard RDMA protocol has messages as the basic unit of communication. When receiving the message sent by the sending end, the receiving end replies an acknowledgement packet (ACK) to inform the sending end of the state of receiving the message. However, when the protocol performs data exchange with the technical solution of this embodiment, there is an additional overhead, for example, in a scenario where the node a requests the remote memory node B to exchange the page m, the standard RDMA protocol operates such that after receiving the request message of the node a, the node B first replies with an ACK, and then resends the content of the page m as a new message to the node a, and after receiving the message, the node a replies with an ACK to the node B.
Based on the above embodiment, in order to improve RDMA data exchange efficiency, the node may directly insert the requested page content in the ACK message to reduce the message passing times. Illustratively, a node a requests a page m from a node B, after a message is sent to B, B replies to a by directly inserting the page m in an ACK packet, and after receiving the ACK with the content of the page m, a sends an ACK to B to inform receipt. Under the mechanism, the frequency of data exchange RDMA message transmission is reduced from 4 times of standard RDMA to 3 times, and the theoretical efficiency can be improved by more than 25%.
Example two
Fig. 2 is a flowchart of a remote memory sharing method according to a second embodiment of the present invention, which is further optimized based on the second embodiment, and provides a specific description of how to establish an association relationship between a physical page in a cache and a memory interval in a remote memory.
Specifically, as shown in fig. 2, the method includes:
s210, under the condition that the physical memory of the local electronic equipment cannot meet the requirement of the local application program, determining a remote memory for the local electronic equipment, and mapping the remote memory to a local virtual memory address.
S220, in the process of using the remote memory based on the virtual memory address, for each memory interval, obtaining a frequency that the local application program continuously uses other memory intervals after using the memory interval.
The memory interval is an access unit of the remote memory.
In the initial stage of accessing the remote memory interval, a simple cache strategy can be adopted. In the access process, due to the limitation of the internal organization structure of the data, the access of the memory interval has a specific rule, that is, a logical relationship exists between the access data of different memory intervals. With the increase of the number of access times of the memory interval, the frequency of the local application program continuously using other memory intervals after using the memory interval can be obtained. The strength of association between the memory interval and other memory intervals can be determined according to the frequency of using other different memory intervals after using the memory interval. It is understood that the higher the frequency, the higher the correlation strength.
For example, in the history access record, 100 accesses are performed to the memory section 1, the frequency of continuously accessing the memory section 2 after accessing the memory section 1 is 10, the frequency of continuously accessing the memory section 3 after accessing the memory section 1 is 5, the frequency of continuously accessing the memory section 4 after accessing the memory section 1 is 5, and the frequency of continuously accessing the memory section 5 after accessing the memory section 1 is 80. Obviously, the strength of the association between the memory interval 1 and the memory interval 5 is the highest.
And S230, selecting the next memory interval to be continuously used with the memory interval from other memory intervals according to the frequency associated with other memory intervals.
In order to improve the caching efficiency, in an optional embodiment of the present application, when a next memory interval to be continuously used with the memory interval is selected from other memory intervals according to the frequency of association between the other memory intervals, a memory space with the highest association strength may be selected as a next memory interval to be continuously used with the memory interval.
S240, according to the next memory interval of the memory interval, establishing an incidence relation between the physical page in the cache and the memory interval.
After selecting the next memory interval to be used continuously with the memory interval, the association relationship between the physical page and the memory interval in the cache can be established according to the next memory interval of the memory interval, so that the subsequent data exchange between the associated physical page and the memory interval is facilitated.
Further, establishing an association relationship between a physical page in the cache and the memory interval according to a next memory interval of the memory interval may specifically include: acquiring a physical page associated with the memory interval and a next physical page behind the physical page; determining whether an original memory interval associated with a next physical page is a next memory interval of the memory interval; if not, establishing the association relationship between the next physical page and the next memory interval.
In this embodiment, since the logic portion of the network card is associated with the remote memory sharing protocol, the remote memory information and the local cache information may be transmitted to the network card in the process of using the remote memory based on the virtual memory address. The network card polls the correlation frequency and the cache page state of the remote memory interval through a timer, when the cache physical page is in a non-optimal cache state, page exchange logic is triggered actively, and the correlation relation between the next physical page and the next memory interval is adjusted, so that the cache page achieves optimal cache. The optimal cache state may be understood as that a physical page in the cache stores content of a memory interval with the highest continuous access frequency, that is, the association frequency is optimal.
And S250, exchanging data between the associated physical page and the memory interval.
According to the technical scheme of the embodiment, a specific situation introduction for establishing the incidence relation between the physical page in the cache and the memory interval in the remote memory is given, the logical relation between the access data of different memory intervals is judged according to the existing memory interval access behaviors, and the incidence relation between the physical page in the cache and the memory interval is established, so that an optimal cache strategy is determined, the effect of improving the comprehensive performance of the remote memory is achieved, and a new idea is provided for remote memory sharing.
EXAMPLE III
Fig. 3 is a flowchart of a remote memory sharing method according to a third embodiment of the present invention, which is further optimized based on the foregoing embodiments, and provides a specific description of remote memory sharing.
Specifically, as shown in fig. 3, the method includes:
s301, under the condition that the physical memory of the local electronic equipment cannot meet the requirement of the local application program, determining a remote memory for the local electronic equipment, and mapping the remote memory to a local virtual memory address.
S302, generating a memory device file, and enabling the application program to open the local memory device file through the mmap interface to obtain the control right of the virtual memory address.
S303, using the remote memory based on the virtual memory address through the control right.
S304, in the process of using the remote memory based on the virtual memory address, aiming at each memory interval, obtaining the frequency of continuously using other memory intervals after the local application program uses the memory interval.
S305, selecting the next memory interval to be continuously used with the memory interval from other memory intervals according to the frequency associated with other memory intervals.
S306, acquiring the physical page associated with the memory interval and the next physical page behind the physical page.
S307, obtaining the original memory interval associated with the next physical page from the association relationship between each physical page and the original memory interval recorded in the cache.
S308, determining whether the original memory interval associated with the next physical page is the next memory interval of the memory interval.
S309, if not, establishing an association relationship between the next physical page and the next memory interval.
And S310, exchanging data between the associated physical page and the memory interval based on a remote direct data access protocol.
S311, inserting the data to be exchanged into the confirmation packet, and sending the confirmation packet to the data sending party.
According to the technical scheme of the embodiment, under the condition that the physical memory of the local electronic equipment cannot meet the requirement of the local application program, the remote memory is determined for the local electronic equipment, and the remote memory is mapped to the local virtual memory address; and in the process of using the remote memory based on the virtual memory address, establishing an association relation between the physical page and the memory interval in the cache, and exchanging data between the associated physical page and the memory interval. The invention realizes a set of remote memory sharing interfaces compatible with upper-layer application by using a memory mapping mechanism, can allow the upper-layer application to apply and use a remote node memory according to requirements under the condition that the upper-layer application is unknown to a bottom distributed memory architecture, has higher performance by a cache mechanism and cache data exchange, can meet the requirement of remote memory access performance by matching the unique cache mechanism and the cache page exchange system of the intelligent network card, improves the comprehensive performance of the remote memory, and provides a new idea for remote memory sharing.
Example four
Fig. 4 is a schematic structural diagram of a remote memory sharing device according to a fourth embodiment of the present invention, where the device is adapted to execute the remote memory sharing method according to the fourth embodiment of the present invention, so as to meet a requirement for remote memory access performance and improve comprehensive performance of a remote memory. As shown in fig. 4, the apparatus includes a memory determination module 410 and a data exchange module 420. Wherein the content of the first and second substances,
a memory determining module 410, configured to determine a remote memory for the local electronic device and map the remote memory to a local virtual memory address when a physical memory of the local electronic device cannot meet a local application program requirement;
a data exchange module 420, configured to establish an association relationship between a physical page in a cache and a memory interval in a process of using a remote memory based on a virtual memory address, and perform data exchange on the associated physical page and the memory interval; the cache belongs to a physical memory.
According to the technical scheme of the embodiment, under the condition that the physical memory of the local electronic equipment cannot meet the requirement of the local application program, the remote memory is determined for the local electronic equipment, and the remote memory is mapped to the local virtual memory address; and in the process of using the remote memory based on the virtual memory address, establishing an association relation between the physical page and the memory interval in the cache, and exchanging data between the associated physical page and the memory interval. The invention realizes a set of remote memory sharing interfaces compatible with upper-layer application by using a memory mapping mechanism, can allow the upper-layer application to apply and use a remote node memory according to requirements under the condition that the upper-layer application is unknown to a bottom distributed memory architecture, has higher performance by a cache mechanism and cache data exchange, can meet the requirement of remote memory access performance by matching the unique cache mechanism and the cache page exchange system of the intelligent network card, improves the comprehensive performance of the remote memory, and provides a new idea for remote memory sharing.
Preferably, the data exchange module 420 specifically includes: the device comprises a frequency acquisition unit, an interval selection unit and a relation establishment unit. Wherein the content of the first and second substances,
the frequency acquisition unit is used for acquiring the frequency of continuously using other memory intervals after the local application program uses the memory interval aiming at each memory interval;
the interval selection unit is used for selecting the next memory interval to be continuously used with the memory interval from other memory intervals according to the frequency associated with other memory intervals;
and the relationship establishing unit is used for establishing the association relationship between the physical page in the cache and the memory interval according to the next memory interval of the memory interval.
Preferably, the relationship establishing unit specifically includes: the physical page acquisition subunit, the interval determination subunit and the relationship establishment subunit. Wherein the content of the first and second substances,
a physical page obtaining subunit, configured to obtain a physical page associated with the memory interval and a next physical page located after the physical page;
an interval determining subunit, configured to determine whether an original memory interval associated with a next physical page is a next memory interval of the memory interval;
and the relationship establishing subunit is used for establishing an association relationship between the next physical page and the next memory interval if the physical page is not the next physical page.
Preferably, the relationship establishing unit further includes: and the interval acquisition subunit is used for acquiring the original memory interval associated with the next physical page from the association relationship between each physical page and the original memory interval recorded by the cache.
Preferably, the apparatus further comprises: and the confirmation packet sending module is used for inserting the data to be exchanged into the confirmation packet and sending the confirmation packet to the data sending party.
Preferably, the data exchange module 420 includes a data exchange unit, configured to exchange data between the associated physical page and the memory partition based on a remote direct data access protocol.
Accordingly, the data exchange module 420 includes: the device comprises a file generating unit and a memory using unit. The file generation unit is used for generating a memory device file, so that an application program opens a local memory device file through a mmap interface to obtain the control right of a virtual memory address; and the memory using unit is used for using the remote memory based on the virtual memory address through the control right.
The remote memory sharing device provided by the embodiment of the invention can execute the remote memory sharing method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
EXAMPLE five
Fig. 5 is a schematic structural diagram of an electronic device according to a fifth embodiment of the present invention. FIG. 5 illustrates a block diagram of an exemplary electronic device 12 suitable for use in implementing embodiments of the present invention. The electronic device 12 shown in fig. 5 is only an example and should not bring any limitation to the function and the scope of use of the embodiment of the present invention.
As shown in FIG. 5, electronic device 12 is embodied in the form of a general purpose computing device. The components of electronic device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 that couples various system components including the system memory 28 and the processing unit 16.
Bus 18 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, micro-channel architecture (MAC) bus, enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Electronic device 12 typically includes a variety of computer system readable media. Such media may be any available media that is accessible by electronic device 12 and includes both volatile and nonvolatile media, removable and non-removable media.
The system memory 28 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM)30 and/or cache memory 32. The electronic device 12 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 34 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 5, and commonly referred to as a "hard drive"). Although not shown in FIG. 5, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 18 by one or more data media interfaces. System memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.
A program/utility 40 having a set (at least one) of program modules 42 may be stored, for example, in system memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination thereof may comprise an implementation of a network environment. Program modules 42 generally carry out the functions and/or methodologies of the described embodiments of the invention.
The electronic device 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), with one or more devices that enable a user to interact with the electronic device/terminal/server 12, and/or with any devices (e.g., network card, modem, etc.) that enable the electronic device 12 to communicate with one or more other computing devices. Such communication may be through an input/output (I/O) interface 22. Also, the electronic device 12 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the Internet) via the network adapter 20. As shown, the network adapter 20 communicates with other modules of the electronic device 12 via the bus 18. It should be understood that although not shown in the figures, other hardware and/or software modules may be used in conjunction with electronic device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
The processing unit 16 executes programs stored in the system memory 28 to execute various functional applications and data processing, such as implementing the remote memory sharing method provided by the embodiments of the present invention.
EXAMPLE six
A sixth embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the remote memory sharing method provided in any embodiment of the present invention.
Computer storage media for embodiments of the invention may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (10)

1. A remote memory sharing method, performed by an electronic device, the method comprising:
determining a remote memory for a local electronic device and mapping the remote memory to a local virtual memory address under the condition that a physical memory of the local electronic device cannot meet the requirement of a local application program;
establishing an association relation between a physical page and a memory interval in a cache in the process of using the remote memory based on the virtual memory address, and exchanging data between the associated physical page and the memory interval; the cache belongs to a physical memory.
2. The method of claim 1, wherein establishing the association between the physical page and the memory space in the cache comprises:
aiming at each memory interval, acquiring the frequency of continuously using other memory intervals after the local application program uses the memory interval;
selecting a next memory interval to be continuously used with the memory interval from other memory intervals according to the frequency associated with other memory intervals;
and establishing an association relation between the physical page in the cache and the memory interval according to the next memory interval of the memory interval.
3. The method of claim 2, wherein establishing the association between the physical page in the cache and the memory window according to a memory window next to the memory window comprises:
acquiring a physical page associated with the memory interval and a next physical page behind the physical page;
determining whether the original memory interval associated with the next physical page is the next memory interval of the memory interval;
if not, establishing the association relationship between the next physical page and the next memory interval.
4. The method of claim 3, wherein determining whether the original memory interval associated with the next physical page is prior to the next memory interval of the memory interval further comprises:
and obtaining the original memory interval associated with the next physical page from the association relation between each physical page and the original memory interval recorded by the cache.
5. The method of claim 1, wherein after performing the data exchange between the associated physical page and memory partition, further comprising:
and inserting the data to be exchanged into the acknowledgement packet, and sending the acknowledgement packet to the data sender.
6. The method of claim 1, wherein exchanging data between the associated physical page and memory partition comprises:
and exchanging data between the associated physical page and the memory interval based on a remote direct data access protocol.
7. The method of claim 1, wherein using the remote memory based on the virtual memory address comprises:
generating a memory device file, and enabling an application program to open a local memory device file through a mmap interface to obtain the control right of a virtual memory address;
using, by the control authority, the remote memory based on the virtual memory address.
8. A remote memory sharing apparatus, the apparatus comprising:
the memory determining module is used for determining a far-end memory for the local electronic equipment under the condition that the physical memory of the local electronic equipment cannot meet the requirement of a local application program, and mapping the far-end memory to a local virtual memory address;
the data exchange module is used for establishing an association relation between a physical page and a memory interval in a cache in the process of using the remote memory based on the virtual memory address and exchanging data between the associated physical page and the memory interval; the cache belongs to a physical memory.
9. An electronic device, characterized in that the device comprises:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the remote memory sharing method of any one of claims 1-7.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the remote memory sharing method according to any one of claims 1 to 7.
CN202110336499.3A 2021-03-29 2021-03-29 Remote memory sharing method and device, electronic equipment and storage medium Pending CN112948149A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110336499.3A CN112948149A (en) 2021-03-29 2021-03-29 Remote memory sharing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110336499.3A CN112948149A (en) 2021-03-29 2021-03-29 Remote memory sharing method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN112948149A true CN112948149A (en) 2021-06-11

Family

ID=76227377

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110336499.3A Pending CN112948149A (en) 2021-03-29 2021-03-29 Remote memory sharing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112948149A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113448897A (en) * 2021-07-12 2021-09-28 上海交通大学 Array structure and optimization method suitable for pure user mode remote direct memory access
CN113590364A (en) * 2021-09-29 2021-11-02 阿里云计算有限公司 Data processing method and device based on distributed shared memory system
CN113722110A (en) * 2021-11-02 2021-11-30 阿里云计算有限公司 Computer system, memory access method and device
WO2023005783A1 (en) * 2021-07-26 2023-02-02 华为技术有限公司 Data processing method and electronic device
CN115858160A (en) * 2022-12-07 2023-03-28 江苏为是科技有限公司 Remote direct memory access virtualization resource allocation method and device and storage medium
WO2023098032A1 (en) * 2021-11-30 2023-06-08 苏州浪潮智能科技有限公司 Memory space extension method and apparatus, electronic device, and storage medium
CN116466879A (en) * 2023-03-17 2023-07-21 北京超弦存储器研究院 CXL memory module, memory data replacement method and computer system

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7680987B1 (en) * 2006-03-29 2010-03-16 Emc Corporation Sub-page-granular cache coherency using shared virtual memory mechanism
US20110072234A1 (en) * 2009-09-18 2011-03-24 Chinya Gautham N Providing Hardware Support For Shared Virtual Memory Between Local And Remote Physical Memory
CN102308282A (en) * 2011-07-20 2012-01-04 华为技术有限公司 Simulation method of far-end memory access of multi-processor structure and simulator
CN103823638A (en) * 2014-02-08 2014-05-28 华为技术有限公司 Virtual equipment access method and device
CN104133780A (en) * 2013-05-02 2014-11-05 华为技术有限公司 Cross-page prefetching method, device and system
CN105988871A (en) * 2015-01-27 2016-10-05 华为技术有限公司 Remote memory allocation method, device and system
US20160378530A1 (en) * 2015-06-27 2016-12-29 Vmware, Inc. Remote-direct-memory-access-based virtual machine live migration
CN107203411A (en) * 2017-04-18 2017-09-26 中国科学院计算技术研究所 A kind of virutal machine memory extended method and system based on long-range SSD
CN111221758A (en) * 2019-09-30 2020-06-02 华为技术有限公司 Method and computer equipment for processing remote direct memory access request
CN111813584A (en) * 2020-08-05 2020-10-23 Oppo广东移动通信有限公司 Memory sharing method and device, electronic equipment and storage medium

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7680987B1 (en) * 2006-03-29 2010-03-16 Emc Corporation Sub-page-granular cache coherency using shared virtual memory mechanism
US20110072234A1 (en) * 2009-09-18 2011-03-24 Chinya Gautham N Providing Hardware Support For Shared Virtual Memory Between Local And Remote Physical Memory
CN102308282A (en) * 2011-07-20 2012-01-04 华为技术有限公司 Simulation method of far-end memory access of multi-processor structure and simulator
CN104133780A (en) * 2013-05-02 2014-11-05 华为技术有限公司 Cross-page prefetching method, device and system
CN103823638A (en) * 2014-02-08 2014-05-28 华为技术有限公司 Virtual equipment access method and device
CN105988871A (en) * 2015-01-27 2016-10-05 华为技术有限公司 Remote memory allocation method, device and system
US20160378530A1 (en) * 2015-06-27 2016-12-29 Vmware, Inc. Remote-direct-memory-access-based virtual machine live migration
CN107203411A (en) * 2017-04-18 2017-09-26 中国科学院计算技术研究所 A kind of virutal machine memory extended method and system based on long-range SSD
CN111221758A (en) * 2019-09-30 2020-06-02 华为技术有限公司 Method and computer equipment for processing remote direct memory access request
CN111813584A (en) * 2020-08-05 2020-10-23 Oppo广东移动通信有限公司 Memory sharing method and device, electronic equipment and storage medium

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113448897A (en) * 2021-07-12 2021-09-28 上海交通大学 Array structure and optimization method suitable for pure user mode remote direct memory access
WO2023005783A1 (en) * 2021-07-26 2023-02-02 华为技术有限公司 Data processing method and electronic device
CN113590364A (en) * 2021-09-29 2021-11-02 阿里云计算有限公司 Data processing method and device based on distributed shared memory system
CN113590364B (en) * 2021-09-29 2021-12-21 阿里云计算有限公司 Data processing method and device based on distributed shared memory system
CN113722110A (en) * 2021-11-02 2021-11-30 阿里云计算有限公司 Computer system, memory access method and device
WO2023098032A1 (en) * 2021-11-30 2023-06-08 苏州浪潮智能科技有限公司 Memory space extension method and apparatus, electronic device, and storage medium
CN115858160A (en) * 2022-12-07 2023-03-28 江苏为是科技有限公司 Remote direct memory access virtualization resource allocation method and device and storage medium
CN115858160B (en) * 2022-12-07 2023-12-05 江苏为是科技有限公司 Remote direct memory access virtualized resource allocation method and device and storage medium
CN116466879A (en) * 2023-03-17 2023-07-21 北京超弦存储器研究院 CXL memory module, memory data replacement method and computer system
CN116466879B (en) * 2023-03-17 2023-12-29 北京超弦存储器研究院 CXL memory module, memory data replacement method and computer system

Similar Documents

Publication Publication Date Title
CN112948149A (en) Remote memory sharing method and device, electronic equipment and storage medium
CN106874128B (en) Data transmission method and device
EP3748510A1 (en) Network interface for data transport in heterogeneous computing environments
US6049808A (en) System and method for efficient remote disk I/O
EP0889622A2 (en) System and method for remote buffer allocation and management for message passing between network nodes
US20050144402A1 (en) Method, system, and program for managing virtual memory
CN106598752B (en) Remote zero-copy method
US9584628B2 (en) Zero-copy data transmission system
US7002956B2 (en) Network addressing method and system for localizing access to network resources in a computer network
US11693809B2 (en) Asymmetric read / write architecture for enhanced throughput and reduced latency
CN115964319A (en) Data processing method for remote direct memory access and related product
US9311044B2 (en) System and method for supporting efficient buffer usage with a single external memory interface
CN112052100A (en) Virtual machine communication method and equipment based on shared memory
CN115374046B (en) Multiprocessor data interaction method, device, equipment and storage medium
US11675510B2 (en) Systems and methods for scalable shared memory among networked devices comprising IP addressable memory blocks
US6961837B2 (en) Method and apparatus for address translation pre-fetch
CN114691382A (en) RDMA-based communication method, node, system and medium
CN112422244B (en) RDMA buffer dynamic allocation method based on flow load prediction
CN113612837B (en) Data processing method, device, medium and computing equipment
CN114253733B (en) Memory management method, device, computer equipment and storage medium
CN109308247A (en) A kind of log processing method, device, equipment and a kind of network equipment
US20240069755A1 (en) Computer system, memory expansion device and method for use in computer system
CN117648280A (en) Sharing caching method and device for multi-port switching equipment
CN114911411A (en) Data storage method and device and network equipment
CN114827151A (en) Heterogeneous server cluster and data forwarding method, device and equipment

Legal Events

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