WO2022262623A1 - 一种数据交换方法及装置 - Google Patents

一种数据交换方法及装置 Download PDF

Info

Publication number
WO2022262623A1
WO2022262623A1 PCT/CN2022/097694 CN2022097694W WO2022262623A1 WO 2022262623 A1 WO2022262623 A1 WO 2022262623A1 CN 2022097694 W CN2022097694 W CN 2022097694W WO 2022262623 A1 WO2022262623 A1 WO 2022262623A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
swap
memory
request
exchange
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/CN2022/097694
Other languages
English (en)
French (fr)
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.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to EP22824103.0A priority Critical patent/EP4354305B1/en
Publication of WO2022262623A1 publication Critical patent/WO2022262623A1/zh
Priority to US18/541,176 priority patent/US12498878B2/en
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/10Address translation
    • G06F12/1009Address translation using page tables, e.g. page table structures
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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/0655Vertical data movement, i.e. input-output transfer; data movement between one or more hosts and one or more storage devices
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/0802Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
    • G06F12/0866Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches for peripheral storage systems, e.g. disk cache
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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 OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/0802Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
    • G06F12/0893Caches characterised by their organisation or structure
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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 OR CALCULATING; 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/0671In-line storage system
    • G06F3/0673Single storage device
    • G06F3/0679Non-volatile semiconductor memory device, e.g. flash memory, one time programmable memory [OTP]
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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 OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/0802Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
    • G06F12/0866Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches for peripheral storage systems, e.g. disk cache
    • G06F12/0868Data transfer between cache memory and other subsystems, e.g. storage devices or host systems
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/12Replacement control
    • G06F12/121Replacement control using replacement algorithms
    • G06F12/126Replacement control using replacement algorithms with special data handling, e.g. priority of data or instructions, handling errors or pinning
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/14Protection against unauthorised use of memory or access to memory
    • G06F12/1458Protection against unauthorised use of memory or access to memory by checking the subject access rights
    • G06F12/1483Protection against unauthorised use of memory or access to memory by checking the subject access rights using an access-table, e.g. matrix or list
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/14Protection against unauthorised use of memory or access to memory
    • G06F12/1458Protection against unauthorised use of memory or access to memory by checking the subject access rights
    • G06F12/1491Protection against unauthorised use of memory or access to memory by checking the subject access rights in a hierarchical protection system, e.g. privilege levels, memory rings
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/10Providing a specific technical effect
    • G06F2212/1004Compatibility, e.g. with legacy hardware
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/10Providing a specific technical effect
    • G06F2212/1016Performance improvement
    • G06F2212/1024Latency reduction
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/10Providing a specific technical effect
    • G06F2212/1032Reliability improvement, data loss prevention, degraded operation etc
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/50Control mechanisms for virtual memory, cache or TLB
    • G06F2212/502Control mechanisms for virtual memory, cache or TLB using adaptive policy

Definitions

  • the present application relates to the field of storage technologies, and in particular to a data exchange method and device.
  • the normal operation of the host is inseparable from the operating system, such as the Linux operating system.
  • the operating system kernel supports memory swapping, that is, swapping out data in the memory of the host to a storage device, or swapping data in the storage device into the memory.
  • various applications are installed on the host. With the diversified development of applications, the requirements of various applications for memory exchange show a trend of diversification. For example, different applications may want to use different storage devices when swapping memory.
  • the storage device used by the operating system kernel for memory exchange is usually a general-purpose fixed device, which cannot meet the diverse needs of various applications for the storage device.
  • the present application provides a data exchange method and device, which solves the problem that the memory exchange mechanism of the operating system kernel cannot meet the diverse requirements of different applications.
  • the present application provides a data exchange method, which is applied to a host computer.
  • the host computer is installed with an operating system and a target application. storage device.
  • the specific solution includes: the host obtains the exchange request of the target application, and calls the user mode interface to perform operations on the storage device according to the exchange request.
  • the swap request is a swap-in request or a swap-out request, and the swap-out request is used to request that the data of the target application be written into the storage device from the memory of the host.
  • the swap-in request is used to request to write the data in the storage device into the memory.
  • memory exchange in the user state is realized by setting the user state interface of the application in the user state space, and calling the user state interface to swap out or swap in the data of the application. Therefore, different user-mode interfaces can be set for different applications.
  • the different user-mode interfaces correspond to different storage devices, providing users with a customized user-mode memory exchange framework, and meeting the diverse needs of different applications for storage devices. , enabling users to design the memory swap mechanism they want.
  • the above-mentioned method of "calling the user mode interface to perform operations on the storage device according to the swap request" may include: the host responds to the swap-out request, Determine the first data of the target application in the memory, and release the mapping relationship between the first virtual address and the first physical address in the pre-stored page table, assign the second virtual address to the first data, and establish the relationship between the second virtual address and the first physical address.
  • the mapping relationship of physical addresses may include: the host responds to the swap-out request, Determine the first data of the target application in the memory, and release the mapping relationship between the first virtual address and the first physical address in the pre-stored page table, assign the second virtual address to the first data, and establish the relationship between the second virtual address and the first physical address.
  • the host calls the user mode interface, writes the first data indicated by the first physical address corresponding to the second virtual address from the memory into the storage device, and establishes a mapping relationship between the first virtual address and the first swap entry in the page table.
  • the first exchange entry is used to indicate the location of the first data in the storage device.
  • the first virtual address is the virtual address of the first data in the virtual memory
  • the first physical address is the address of the first data in the memory.
  • the data exchange method provided in the present application may further include: the host cancels the mapping relationship between the second virtual address and the first physical address, and deletes the first data in the memory.
  • the memory usage can be saved and the memory usage rate can be increased.
  • the data exchange method provided in the present application may further include: the host sets the state information of the first virtual address as first information, and the first information is used to indicate that the first virtual address corresponds to
  • the exchange type of the first data is a user state exchange type.
  • the above method of "obtaining the exchange request of the target application” may include: the host acquires the virtual address of the second data to be accessed, and When the state information of the virtual address of the second data is the first information, the second data is the data of the target application, and the memory does not include the second data, a swap-in request is generated.
  • the first information is used to indicate that the exchange type of the second data is a user mode exchange type.
  • the above-mentioned method of "calling the user mode interface to perform operations on the storage device according to the swap request" may include: the host obtains the second data according to the pre-stored page table in response to the swap-in request The second exchange entry corresponding to the virtual address of the second exchange entry, call the user mode interface, write the second data indicated by the second exchange entry from the storage device into the memory, and then establish the virtual address of the second data and the physical address of the second data in the page table Address mapping relationship.
  • the physical address of the second data is the address of the second data in the memory.
  • the data exchange method provided in the present application may further include: the host establishes a swap-out thread and a swap-in thread after the target application is started. Wherein, the swap-out thread is used to execute the swap-out operation of the first data, and the swap-in thread is used to execute the swap-in operation of the second data.
  • the above method of "establishing a swap-out thread and a swap-in thread” may include: the host establishes a swap-out thread and a swap-in thread when the target application is included in a pre-stored white list. thread.
  • Whitelist includes at least one app that supports memory swapping.
  • the present application provides a data exchange device.
  • the data exchange device includes various modules for performing the data exchange method of the above first aspect or any possible implementation manner of the above first aspect.
  • the present application provides a host, where the host includes a memory and a processor.
  • the memory and processor are coupled.
  • the memory is used to store computer program code, which includes computer instructions.
  • the processor executes the computer instruction, the host executes the data exchange method according to the first aspect and any possible implementation manner thereof.
  • the present application provides a chip system, which is applied to a host.
  • a system-on-a-chip includes one or more interface circuits, and one or more processors.
  • the interface circuit and the processor are interconnected by wires; the interface circuit is used to receive signals from the memory of the host computer and send signals to the processor, the signals include computer instructions stored in the memory.
  • the processor executes the computer instruction
  • the host executes the data exchange method according to the first aspect and any possible implementation manner thereof.
  • the present application provides a computer-readable storage medium, the computer-readable storage medium includes computer instructions, and when the computer instructions are run on a host, the host executes the first aspect and any possible implementation thereof. data exchange method.
  • the present application provides a computer program product, the computer program product includes computer instructions, and when the computer instructions are run on the host computer, the host computer executes the data exchange method according to the first aspect and any possible implementation thereof .
  • FIG. 1 is a schematic diagram of a data exchange system provided by an embodiment of the present application.
  • FIG. 2 is one of a schematic structural diagram of a host provided in an embodiment of the present application.
  • Fig. 3 is a second structural schematic diagram of a host computer provided by the embodiment of the present application.
  • FIG. 4a is a schematic diagram of data swapping out of the user state provided by the embodiment of the present application.
  • FIG. 4b is a schematic diagram of a scene where the first data is swapped out according to the embodiment of the present application.
  • FIG. 5 is a schematic diagram of data exchange in the user state provided by the embodiment of the present application.
  • FIG. 6 is a schematic flowchart of a data exchange method provided in an embodiment of the present application.
  • FIG. 7 is one of the structural schematic diagrams of the data exchange device provided by the embodiment of the present application.
  • FIG. 8 is the second schematic diagram of the structure of the data exchange device provided by the embodiment of the present application.
  • words such as “exemplary” or “for example” are used as examples, illustrations or illustrations. Any embodiment or design scheme described as “exemplary” or “for example” in the embodiments of the present application shall not be interpreted as being more preferred or more advantageous than other embodiments or design schemes. Rather, the use of words such as “exemplary” or “such as” is intended to present related concepts in a concrete manner.
  • first and second are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance or implicitly specifying the quantity of indicated technical features. Thus, a feature defined as “first” and “second” may explicitly or implicitly include one or more of these features. In the description of the embodiments of the present application, unless otherwise specified, "plurality” means two or more.
  • cold data refers to data that is accessed infrequently but still needs to be retained for a long time.
  • the cold data can be stored in the storage device through the memory exchange mechanism.
  • the operating system kernel executes the memory swap process as follows: when the memory of the host is insufficient, the operating system kernel writes data with low access frequency in the memory, that is, cold data, from the memory to the storage device, and deletes the cold data in the memory. data. When the data written to the storage device needs to be accessed in the memory, the operating system kernel can write the data from the storage device into the memory.
  • the storage device used by the operating system kernel for memory exchange is usually a general-purpose fixed device, it cannot meet the diverse needs of various applications for storage devices.
  • an embodiment of the present application provides a data exchange method, which is applied to a host.
  • the host is installed with an operating system and a target application.
  • the operating system includes a user state space.
  • the user state space is provided with a user state interface of the target application, and the user state interface corresponds to a storage device. After the host obtains the exchange request of the target application, it can call the user mode interface to perform operations on the storage device according to the exchange request.
  • the swap request When the swap request is a swap-out request, it is used to request that the data of the target application be written into the storage device from the memory of the host, and when the swap request is a swap-in request, it is used to request to write the data in the storage device into the memory.
  • memory exchange in the user state is realized by setting the user state interface of the application in the user state space, and calling the user state interface to swap out or swap in the data of the application. Therefore, different user mode interfaces can be set for different applications, and the different user mode interfaces correspond to different storage devices, which meets the diverse requirements of different applications for storage devices.
  • the operating system is an indispensable system software for a host, and it is the soul of the entire host.
  • Common operating systems may include Windows operating systems, Linux operating systems, and the like.
  • the operating system can include user mode space and kernel mode space.
  • the user state space is the active space of the application, and is used to store program codes and data of the application.
  • the kernel state space is the active space of the operating system, and is used to store program codes and data of the operating system or the operating system kernel.
  • the hardware resources of the host that can be accessed by the applications or processes in the user mode space are limited, and can only access part of the hardware resources.
  • the operating system or kernel in the kernel space has the authority to access all hardware resources of the host, and can access all hardware resources of the host.
  • applications in the user space cannot directly access the hardware resources of the host, but can access hardware resources through operating system calls, library functions, and scripts.
  • FIG. 1 shows a structure of the data exchange system.
  • the data exchange system may include: a host 11 and a storage device 12 .
  • the host 11 and the storage device 12 are connected by wired communication or wireless communication.
  • the host 11 is configured to obtain the exchange request of the target application installed on the host 11, and according to the exchange request, call the user mode interface of the target application set in the user mode space to perform operations on the storage device 12 corresponding to the user mode interface.
  • the operating system installed on the host 11 includes a user mode space.
  • the user mode interface of each target application can be set in the user mode space, that is, one target application corresponds to one user mode interface.
  • the user mode interfaces corresponding to different applications may be the same or different.
  • one user mode interface corresponds to one storage device.
  • the storage devices corresponding to the same user mode interface may be the same or different, and the storage devices corresponding to different user mode interfaces may be the same or different.
  • the user-mode interface corresponding to each application and the storage device corresponding to each user-mode interface can be pre-configured in the host, and are not limited here.
  • the host 11 may be a terminal device, a server, a cloud computing platform, and the like.
  • the terminal device may be a mobile phone, a tablet computer, a notebook computer, a palmtop computer, a computer, and the like.
  • the host is used as an example to illustrate the server.
  • the storage device 12 may be a memory of a host other than the host 11, or may be a storage medium.
  • the type of the storage medium may be non-volatile flash memory (not and flash, NAND flash), storage class memory (storage class memory, SCM), and the like.
  • the operating system installed on the host 11 may include not only the user mode space, but also the kernel mode space.
  • the kernel mode space can be provided with a kernel mode interface, and the kernel mode interface corresponds to a storage device, which is a device used by the operating system kernel for memory exchange.
  • the type of the storage device is usually NAND flash, SCM, etc.
  • the data exchange system shown in FIG. 1 is only used as an example, and is not used to limit the technical solutions of the embodiments of the present application. Those skilled in the art should understand that in a specific implementation process, the data exchange system may also include other nodes, and the number of nodes may also be determined according to specific needs, without limitation.
  • Fig. 2 shows a structure of the above-mentioned host.
  • the host may include a processor 201 and a memory 202 for implementing the data exchange method provided in the embodiment of the present application.
  • the processor 201 can be a general-purpose central processing unit (central processing unit, CPU), a microprocessor, a specific application integrated circuit (application-specific integrated circuit, ASIC), or one or more for controlling the execution of the program program of this application integrated circuit.
  • CPU central processing unit
  • ASIC application-specific integrated circuit
  • the processor 201 is configured to process requests from outside the host, such as other hosts, and is also configured to process requests generated inside the host.
  • the processor 201 may be configured to process a swap request acquired by the host, where the swap request is a swap-out request or a swap-in request.
  • the memory 202 refers to an internal memory directly exchanging data with the processor 201. It can read and write data at any time, and the speed is very fast. It is used as a temporary data storage for the operating system or other running programs.
  • the memory 202 includes at least two types of memory, for example, the memory can be a random access memory or a read only memory (read only memory, ROM).
  • the random access memory may be dynamic random access memory (dynamic random access memory, DRAM), or SCM.
  • DRAM is a kind of semiconductor memory, and like most random access memory (random access memory, RAM), it belongs to a kind of volatile memory (volatile memory).
  • SCM is a composite storage technology that combines the characteristics of traditional storage devices and memory at the same time.
  • Storage-class memory can provide faster read and write speeds than hard disks, but slower access speeds than DRAM, and cheaper than DRAM in terms of cost.
  • DRAM and the SCM are only exemplary in this embodiment of the application, and the memory 202 may also include other random access memories, such as static random access memory (static random access memory, SRAM).
  • SRAM static random access memory
  • the read-only memory for example, it may be programmable read-only memory (programmable read only memory, PROM), erasable programmable read-only memory (erasable programmable read only memory, EPROM), etc., but not limited thereto.
  • the memory 202 can also be a dual in-line memory module or a dual in-line memory module (DIMM), that is, a module composed of DRAM, or a solid state disk (SSD).
  • DIMM dual in-line memory module
  • the memory 202 may exist independently and be coupled with the processor 201 .
  • the memory 202 can also be integrated with the processor 201 .
  • multiple memories may be configured in the host, and the multiple memories may be of the same type or of different types.
  • the embodiment of the present application does not limit the quantity and type of memory of the host, and only one memory 202 is shown in FIG. 2 as an example.
  • the memory 202 can be configured to have a power saving function.
  • the power saving function means that the data stored in the memory 202 will not be lost when the system is powered off and then powered on again. Memory with power retention is called non-volatile memory.
  • the memory 202 stores program codes and data of applications installed on the host, and codes and data of operating systems installed on the host.
  • the application is a program running on the basis of the operating system.
  • the structure shown in FIG. 2 does not constitute a limitation to the host. Except for the components shown in FIG. 2, the host may include more or less components than those shown in the illustration, or combine certain components , or different component arrangements. For example, the host may also include input and output devices such as a sound card, an optical drive, a hard disk, a monitor, a keyboard, a mouse, a stereo, a tablet, a microphone, and a camera.
  • input and output devices such as a sound card, an optical drive, a hard disk, a monitor, a keyboard, a mouse, a stereo, a tablet, a microphone, and a camera.
  • FIG. 3 shows a structure of the host.
  • an operating system and at least one target application are installed on the host.
  • An operating system may include a user-mode space and a kernel-mode space.
  • the user mode space includes program code and data of each application in at least one application
  • the kernel mode space includes program code and data of the operating system kernel.
  • the user mode space is provided with a user mode interface of each application in at least one application.
  • the program code of each application may include the driver program or protocol stack corresponding to the user mode interface of the application, and the user mode interface of the application can be called by running the driver program or protocol stack .
  • the user space may include preloaded modules, swapped out modules, and swapped in modules.
  • the kernel state space may include a page table management module and a page fault exception reporting module. These modules can cooperate to complete the memory exchange mechanism in user mode.
  • a target application is used as an example to introduce the memory swap method in the user mode in detail. The memory swap methods of other target applications are similar and will not be repeated here.
  • the page table management module is used to manage the page table of the host.
  • the page table is a structure of data storage, which is used to store the mapping relationship between the virtual address (virtual address, VA) and the physical address (physical address, PA) of the data.
  • the virtual address is the logical address of the data in the virtual memory
  • the physical address is the real address of the data in the memory.
  • the data stored in the page table may be implemented through a hash table.
  • the preloading module is used to establish a swap-out thread and a swap-in thread after the target application is started, and initialize related resources.
  • the swap-out thread is used to execute the swap-out operation of the first data
  • the swap-in thread is used to execute the swap-in operation of the second data.
  • Relevant resources refer to various resources required for swapping out of the first data or swapping in of the second data.
  • related resources may include page tables.
  • the related resources may also include swap memory (swap cache).
  • the swap memory is a part of storage space divided from the memory of the host, and is used to temporarily store the first data when the first data is swapped out from the memory to the storage device. After the swap memory is full of data, the data in the swap memory is stored in the storage device.
  • the preloading module is specifically used to create a swap-out thread and a swap-in thread and initialize related resources by loading the program code of the target application in the user mode space after the target application is started.
  • the preload module can first determine whether the target application is included in the pre-stored whitelist before creating the swap-out thread and the swap-in thread.
  • the list includes at least one application that supports memory swapping.
  • the preloading module creates a swap-out thread and a swap-in thread; otherwise, the preloading module does not perform any operation.
  • the applications included in the white list may be applications that occupy a large amount of memory, for example, game applications, video applications, and the like. Applications that occupy less memory, such as calendars and calculators, are usually not included in the whitelist, because the data volume of such applications is small, and there is no need for memory swap. In this way, by setting the white list in advance, only some specific applications are supported to perform memory swap, which can save memory overhead and improve the performance of the host.
  • the swap-out module can wait to receive a swap-out request, and the swap-in module can wait to receive a swap-in request.
  • FIG. 4a shows a swapping out process of the first data.
  • the swapping out module is configured to acquire a swapping out request of a target application, and invoke a swapping out thread to swap out the first data.
  • the swap-out request is used to request to write the data of the target application from the memory of the host to the storage device corresponding to the user mode interface of the target application.
  • the swap-out module may generate a swap-out request for the target application in response to the user's swap-out operation on the target application.
  • the swap-out module may also generate a swap-out request for the target application when it is determined that the memory for running the target application is insufficient. This embodiment of the present application does not limit the triggering manner of the swap-out request.
  • the memory capacity of the host is 13G, and the host has currently run two applications, occupying 10G of memory. At this point the user launches another application. If the host needs to occupy 5G of memory to run the other application, the host generates a swap out request for the other application when it determines that the memory for running the other application is insufficient.
  • the swap-out module is further configured to determine in memory the first data to be swapped out of the target application in response to the swap-out request of the target application.
  • the first data may be cold data of the target application, that is, data that the target application has a low access frequency but requires long-term storage.
  • the first data may be historical record data of the game application.
  • the swap-out module is further configured to determine whether the first data of the target application is allowed to be swapped out after the first data of the target application is determined. If it is determined that the first data is not allowed to be swapped out, the swapping out module ends the swapping out process of the first data. If it is determined that the first data is allowed to be swapped out, the swap-out module may send a message to the page table management module by calling the customized interface. The message is used for the swap-out module to notify the page table management module that the first data is data to be swapped out.
  • the customized interface refers to the communication interface between the user mode space and the kernel mode space.
  • the page table management module after receiving the message sent by the swap out module, can release the mapping relationship between the first virtual address and the first physical address of the first data in the pre-stored page table, and assign the second virtual address to the first data. address, and establish a mapping relationship between the second virtual address and the first physical address. Finally, the page table management module is further configured to return the second virtual address of the first data to the swap-out module through a customized interface.
  • the first virtual address and the second virtual address are two different virtual addresses of the first data in the virtual memory
  • the first physical address is a real address of the first data in the memory.
  • the page table management module is further configured to set the state information of the first virtual address as the first information after receiving the message from the swap-out module in the user state space, the second The information is used to indicate that the exchange type of the first data corresponding to the first virtual address is a user state exchange type.
  • the page table management module is further configured to set the state information of the first virtual address as second information after receiving the message from the swap-out module in the kernel space, and the second information is used to indicate the first virtual address
  • the corresponding exchange type of the first data is a kernel state exchange type.
  • the swap-out module is also used to receive the second virtual address of the first data sent by the page table management module, call the user mode interface of the target application by running the driver program or protocol stack of the target application, and according to the second virtual address in the page table
  • the mapping relationship between the virtual address and the first physical address, the first data indicated by the first physical address corresponding to the second virtual address is written from the memory into the storage device corresponding to the user mode interface, and the data written into the storage device is third data. After the storage device successfully writes the third data, it can return the first swap entry (swap entry) to the swap-out module through the user mode interface.
  • the first exchange entry is used to indicate the location of the third data in the storage device.
  • the swap-out module may call the user-mode interface of the target application, first write the first data from the internal memory into the swap memory, and then write the first data into the swap memory. Data is exchanged data. After the storage space of the swap memory is full, the swap data may be written from the swap memory into the storage device corresponding to the user mode interface. At this time, the data written into the storage device is the third data.
  • the first data, the third data, and the swap data are the same data stored in the internal memory, the storage device, and the swap memory, respectively. Only the storage location of the data changes, and the content of the data remains the same. Moreover, after the first data is written into the storage device from the internal memory, when the first data needs to be accessed in the internal memory, the third data may be written from the storage device into the internal memory. In this case, the virtual address of the data written into the memory and the virtual address of the first data are the same virtual address.
  • the swap out module is further configured to send the first swap entry to the page table management module through the customized interface after receiving the first swap entry.
  • the page table management module is further configured to, after receiving the first swap entry, establish a mapping relationship between the first virtual address and the first swap entry in the page table.
  • the page table management module is further configured to release the mapping relationship between the second virtual address and the first physical address in the page table, and delete the first data in the memory. In this way, the swapping out of the first data is completed, and by releasing the storage space of the first data in the memory, the memory usage can be saved and the memory usage ratio can be increased.
  • the page table management module is further configured to set the state information of the first switch entry as the third information after establishing the mapping relationship between the first virtual address and the first switch entry.
  • the third information is used to indicate that the third data indicated by the first swap entry is data swapped out from the internal memory to the storage device.
  • Fig. 5 shows the swap-in process of the second data.
  • the swap-in module is configured to obtain a swap-in request of the target application, and call a swap-in thread to swap in the second data.
  • the swap-in request is used to request to write data in the storage device corresponding to the user mode interface of the target application into the memory.
  • the viewing operation can be performed on the host.
  • the processor of the host generates a data access request in response to the viewing operation of the user, and sends the data access request to the page table management module.
  • the data access request may include data access information, for example, the data access information may be a virtual address of the second data.
  • the page table management module can query the virtual address of the second data in the page table. If the data location information corresponding to the virtual address of the second data in the page table is a physical address, it indicates that the second data is stored in the memory, and at this time, the second data can be obtained in the memory according to the physical address.
  • the page table management module may send an indication message to the page fault reporting module to trigger the page fault reporting.
  • the page fault reporting module receives the indication message sent by the page table management module, it can determine whether the swap-in operation is a swap-in of the kernel mode or a swap-in of the user mode.
  • the page fault exception reporting module may determine whether the state information of the virtual address of the second data in the page table is the first information or the second information.
  • the page fault reporting module can generate a change-in request of the target application under the condition that the second data is determined to be the data of the target application, and then send a request to the user state through the user exception handling function (userfaultfd) or signal processing function (signal).
  • the swap-in module in the space sends a swap-in request of the target application, and the swap-in request may include the virtual address of the second data. In this way, the swap-in module in the user state space can obtain the swap-in request of the target application.
  • the page fault exception reporting module may send a swap-in request to the swap-in module in the kernel space, so that the swap-in module performs the swap-in of the second data.
  • the above-mentioned second data is data swapped out from the internal memory to the storage device, and the above-mentioned userfaultfd or signal may be registered during the swap-out process of the second data. Specifically, it may be registered after the swap-out module determines that the second data is allowed to be swapped out.
  • the process of swapping out the second data is the same as the process of swapping out the first data in the above embodiment, and will not be repeated here.
  • the swap-in module is also used to call the customized interface in response to the swap-in request of the target application, obtain the second swap entry corresponding to the virtual address of the second data in the page table through the page table management module, and call the target application's
  • the user mode interface writes the second data indicated by the second exchange entry into the memory from the storage device corresponding to the user mode interface.
  • the swap-in module may first apply for a third virtual address and a third physical address. After applying for the address, the swap-in module may copy the second data from the storage device to a location corresponding to the third physical address, and establish a mapping relationship between the third virtual address and the third physical address. At this time, the data stored in the third physical address is the fourth data.
  • the swap-in module may instruct the page table management module to apply for a new physical address for the second data, and copy the fourth data indicated by the third physical address corresponding to the third virtual address to the position corresponding to the new physical address, and
  • the mapping relationship between the virtual address of the second data and the physical address of the second data is established in the page table, the mapping relationship between the third virtual address and the third physical address is released, and the fourth data stored in the third physical address is deleted.
  • the data stored in the physical address of the second data is fifth data. In this way, the swap-in of the second data is completed, and the data can be read and written in the memory.
  • the swap-in module may call the user-mode interface of the target application, write the second data from the storage device corresponding to the user-mode interface into a buffer, and write the second data into the buffer
  • the data is buffered data.
  • the buffered data is written from the buffer to the position corresponding to the third physical address, and the data written in the third physical address is the fourth data.
  • the fourth data is copied from the third physical address to the location corresponding to the physical address of the second data, and the data written in the physical address of the second data is the fifth data.
  • the above-mentioned buffer is also a part of the storage space divided in the memory, and is used to temporarily store the data when the second data in the storage device is swapped into the memory. After the physical address is applied for the second data in the memory, the data in the buffer is written into the applied physical address, so as to avoid the problem of slow switching speed of the host due to the slow reading and writing speed of the storage device.
  • the second data, the fourth data, the fifth data and the buffer data are respectively stored in the storage device, the third physical address of the internal memory, the physical address of the second data in the internal memory and the buffer of the same data. Only the storage location of the data changes, and the content of the data remains the same. Moreover, if the second data is the data that writes the initial data from the memory into the storage device, then the virtual address of the initial data and the virtual address of the fifth data are the same virtual address.
  • the host may perform some or all of the steps in the embodiment of the present application, and these steps are only examples, and the embodiment of the present application may also perform other steps or variations of various steps.
  • each step may be performed in a different order presented in the embodiment of the present application, and it may not be necessary to perform all the steps in the embodiment of the present application.
  • the specific structure of the execution body of the data exchange method is not particularly limited in the embodiment of the present application, as long as the method provided in the embodiment of the present application can be realized.
  • the execution subject of the data exchange method provided in the embodiment of the present application may be a host, or a component applied to the host, such as a chip, which is not limited in the embodiment of the present application.
  • the following embodiments are described by taking the execution subject of the data exchange method as the host as an example.
  • the data exchange method provided by the embodiment of the present application may include the following steps 601 - 613 .
  • step 601 is a preparatory operation performed by the preloaded module in the user state space before performing memory swap.
  • Steps 602 to 608 are the process of swapping out the first data from the internal memory to the storage device.
  • Steps 609 to 613 are the process of swapping the second data from the storage device to the internal memory.
  • the host After the target application is started, the host creates a swap-out thread and a swap-in thread under the condition that the target application is included in a pre-stored white list.
  • the white list includes at least one application that supports memory swap.
  • the swap-out thread is used to perform a swap-out operation of the first data
  • the swap-in thread is used to perform a swap-in operation of the second data.
  • step 601 reference may be made to the relevant description of creating a swap-out thread and a swap-in thread by the preloading module in another embodiment, and details are not repeated here.
  • the host obtains a swap-out request of the target application.
  • the host determines first data of the target application in memory in response to the swap-out request.
  • the host cancels the mapping relationship between the first virtual address and the first physical address in the prestored page table, and sets the state information of the first virtual address as the first information.
  • the first virtual address is a virtual address of the first data in the virtual memory
  • the first physical address is an address of the first data in the memory
  • the host allocates a second virtual address to the first data, and establishes a mapping relationship between the second virtual address and the first physical address.
  • the host calls the user mode interface, and writes the first data indicated by the first physical address corresponding to the second virtual address from the memory to the storage device.
  • the host establishes a mapping relationship between the first virtual address and the first switch entry in the page table.
  • the first exchange entry is used to indicate the location of the first data in the storage device.
  • the host cancels the mapping relationship between the second virtual address and the first physical address, and deletes the first data in the memory.
  • steps 602 to 608 reference may be made to the relevant description of swapping out the first data from the internal memory to the storage device by the swapping out module and the page table management module in another embodiment, which will not be repeated here.
  • the host acquires the virtual address of the second data to be accessed.
  • the host When the status information of the virtual address of the second data is the first information, the second data is the data of the target application, and the memory does not include the second data, the host generates a swap-in request of the target application.
  • the host acquires a second swap entry corresponding to the virtual address of the second data according to the prestored page table.
  • the host calls the user mode interface, and writes the second data indicated by the second swap entry from the storage device into the memory.
  • the host establishes a mapping relationship between the virtual address of the second data and the physical address of the second data in the page table.
  • the physical address of the second data is the address of the second data in the memory.
  • steps 609 to 613 please refer to the relevant description of swapping the second data from the storage device to the internal memory by the swap-in module, the page table management module, and the page fault reporting module in another embodiment. This will not be repeated here.
  • An embodiment of the present application provides a data exchange method, which is applied to a host.
  • the host is installed with an operating system and a target application.
  • the operating system includes a user state space.
  • the user state space is provided with a user state interface of the target application, and the user state interface corresponds to a storage device.
  • the host can call the user mode interface to perform operations on the storage device according to the exchange request.
  • the swap request is a swap-out request, it is used to request that the data of the target application be written into the storage device from the memory of the host, and when the swap request is a swap-in request, it is used to request to write the data in the storage device into the memory.
  • memory exchange in the user state is realized by setting the user state interface of the application in the user state space, and calling the user state interface to swap out or swap in the data of the application. Therefore, different user-mode interfaces can be set for different applications.
  • the different user-mode interfaces correspond to different storage devices, providing users with a customized user-mode memory exchange framework, and meeting the diverse needs of different applications for storage devices. , enabling users to design the memory swap mechanism they want.
  • the performance of the memory swap in the user mode is higher than that in the kernel mode.
  • the driver or protocol stack of the current storage device has been moved up to the user mode, so that the memory swap mechanism in the kernel mode cannot use the storage device moved up to the user mode.
  • the embodiment of the present application implements a memory exchange mechanism in the user state, and the mechanism can use a storage device moved up to the user state.
  • Table 2 shows performance-related parameters of the user mode memory swap mechanism. It can be seen from Table 1 that when the host swaps out data, the performance loss is only 2%, and the performance loss of the kernel state memory swap mechanism is greater than 2%.
  • FIG. 7 it is a schematic structural diagram of a data exchange device 70 provided in the embodiment of the present application.
  • the data exchange device 70 may be a host, or a CPU in the host, or a control module in the host, or a client in the host.
  • the data exchange device 70 is used to execute the data exchange method shown in FIG. 6 .
  • the data exchange device 70 may include an acquisition unit 71 and a processing unit 72 .
  • the obtaining unit 71 is configured to obtain a swap request of the target application, the swap request is a swap-in request or a swap-out request, the swap-out request is used to request that the data of the target application be written from the memory of the host to the storage device, and the swap-in request is used to request Write data from storage device to memory.
  • the acquiring unit 71 may be configured to execute step 602 and step 610 .
  • the processing unit 72 is configured to invoke the user mode interface to perform operations on the storage device according to the exchange request obtained by the obtaining unit 71 .
  • the swap request is a swap-out request
  • the processing unit 72 is specifically configured to, in response to the swap-out request, determine the first data of the target application in the memory, and release the first virtual address and the first physical address in the pre-stored page table.
  • the address mapping relationship is to allocate a second virtual address to the first data, and establish a mapping relationship between the second virtual address and the first physical address.
  • call the user mode interface write the first data indicated by the first physical address corresponding to the second virtual address from the memory into the storage device, and establish a mapping relationship between the first virtual address and the first swap entry in the page table.
  • the first exchange entry is used to indicate the location of the first data in the storage device.
  • the first virtual address is a virtual address of the first data in the virtual memory
  • the first physical address is an address of the first data in the memory.
  • the data exchange device 70 further includes a canceling unit 73 and a deleting unit 74 .
  • the release unit 73 is configured to release the mapping relationship between the second virtual address and the first physical address.
  • the release unit 73 may be configured to perform the release of the mapping relationship between the second virtual address and the first physical address in step 608 .
  • a deleting unit 74 configured to delete the first data in the memory.
  • the deleting unit 74 may be configured to perform step 608 of deleting the first data in the memory.
  • the data exchange device 70 further includes a setting unit 75 .
  • the setting unit 75 is configured to set the state information of the first virtual address as first information, and the first information is used to indicate that the exchange type of the first data corresponding to the first virtual address is a user state exchange type.
  • the acquiring unit 71 is specifically configured to: acquire the virtual address of the second data to be accessed; the state information at the virtual address of the second data is the first information, and the second data is When the data of the target application does not include the second data in the memory, a swap request is generated, and the first information is used to indicate that the swap type of the second data is a user mode swap type.
  • the processing unit 72 is specifically configured to: in response to the swap-in request, obtain the second swap entry corresponding to the virtual address of the second data according to the pre-stored page table;
  • the second data is written into the memory from the storage device; the mapping relationship between the virtual address of the second data and the physical address of the second data is established in the page table, and the physical address of the second data is the address of the second data in the memory.
  • the data exchange device 70 further includes an establishment unit 76 .
  • the establishment unit 76 is configured to establish a swap-out thread and a swap-in thread after the target application is started, the swap-out thread is used to execute the swap-out operation of the first data, and the swap-in thread is used to execute the swap-in operation of the second data.
  • the establishment unit 76 may be used to execute step 601 .
  • the establishing unit 76 is specifically configured to establish a swap-out thread and a swap-in thread when the target application is included in a pre-stored white list, and the white list includes at least one application that supports memory swap.
  • the data exchange device 70 provided in the embodiment of the present application includes but is not limited to the above modules.
  • the acquiring unit 71, the processing unit 72, the releasing unit 73, the deleting unit 74, the setting unit 75 and the establishing unit 76 can be realized by calling the program code in the memory 202 by the processor 201 shown in FIG. 2 .
  • the specific execution process reference may be made to the description of the data exchange method shown in FIG. 6 , which will not be repeated here.
  • Another embodiment of the present application also provides a computer-readable storage medium, where computer instructions are stored in the computer-readable storage medium, and when the computer instructions are run on the host, the host executes the method in the method described in the above method embodiment. The individual steps performed by the host.
  • a system-on-a-chip includes one or more interface circuits, and one or more processors.
  • the interface circuit and the processor are interconnected by wires.
  • the interface circuit is used to receive signals from the memory of the host and send signals to the processor, the signals including computer instructions stored in the memory.
  • the processor executes the computer instruction, the host executes various steps performed by the host in the method flow shown in the above method embodiments.
  • a computer program product is also provided.
  • the computer program product includes computer instructions.
  • the host computer executes the steps executed by the host computer in the method flow shown in the above method embodiments. various steps.
  • all or part of them may be implemented by software, hardware, firmware or any combination thereof.
  • a software program When implemented using a software program, it may be implemented in whole or in part in the form of a computer program product.
  • the computer program product includes one or more computer instructions.
  • computer-executed instructions When computer-executed instructions are loaded and executed on a computer, the processes or functions according to the embodiments of the present application are generated in whole or in part.
  • a computer can be a general purpose computer, special purpose computer, a computer network, or other programmable apparatus.
  • Computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, e.g.
  • the computer-readable storage medium may be any available medium that can be accessed by a computer, or may contain one or more data storage devices such as servers and data centers that can be integrated with the medium.
  • the usable medium may be a magnetic medium (for example, a floppy disk, a hard disk, or a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, a solid state disk (solid state disk, SSD)), etc.

Landscapes

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

Abstract

一种数据交换方法及装置,涉及存储技术领域,解决了操作系统内核的内存交换机制无法满足不同应用的多样化需求的问题。数据交换方法应用于主机,主机安装有操作系统和目标应用,操作系统包括用户态空间,用户态空间设置有目标应用的用户态接口,用户态接口对应一个存储设备。具体方案包括:主机获取目标应用的交换请求,并根据该交换请求,调用用户态接口对存储设备执行操作。其中,该交换请求为换入请求或换出请求,换出请求用于请求将目标应用的数据从主机的内存写入存储设备。换入请求用于请求将存储设备中的数据写入内存。

Description

一种数据交换方法及装置
本申请要求于2021年06月16日提交国家知识产权局、申请号为202110669020.8、申请名称为“一种数据交换方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及存储技术领域,尤其涉及一种数据交换方法及装置。
背景技术
主机的正常运行离不开操作系统,如Linux操作系统等。操作系统内核支持内存交换,即将主机的内存中的数据换出至存储设备,或将存储设备的数据换入至内存。主机上除了安装操作系统外还安装有各种应用。随着应用的多样化发展,各种应用对内存交换的需求呈现出多样化的趋势。例如,不同应用在内存交换时想要使用的存储设备可能不同。但是,操作系统内核进行内存交换时使用的存储设备通常是通用的固定设备,无法满足各种应用对存储设备的多样化需求。
发明内容
本申请提供一种数据交换方法及装置,解决了操作系统内核的内存交换机制无法满足不同应用的多样化需求的问题。
为达到上述目的,本申请采用如下技术方案:
第一方面,本申请提供一种数据交换方法,应用于主机,主机安装有操作系统和目标应用,操作系统包括用户态空间,用户态空间设置有目标应用的用户态接口,用户态接口对应一个存储设备。具体方案包括:主机获取目标应用的交换请求,并根据该交换请求,调用用户态接口对存储设备执行操作。其中,该交换请求为换入请求或换出请求,换出请求用于请求将目标应用的数据从主机的内存写入存储设备。换入请求用于请求将存储设备中的数据写入内存。
这样,通过在用户态空间设置应用的用户态接口,并调用该用户态接口进行该应用的数据的换出或换入,实现了用户态的内存交换。从而,针对不同的应用能够设置不同的用户态接口,该不同的用户态接口对应的存储设备不同,为用户提供了定制化的用户态内存交换框架,满足了不同应用对存储设备的多样化需求,使得用户能够设计自己想要的内存交换机制。
在本申请的一种可能的实现方式中,交换请求为换出请求的情况下,上述“根据交换请求,调用用户态接口对存储设备执行操作”的方法可以包括:主机响应于换出请求,在内存中确定目标应用的第一数据,并解除预存的页表中的第一虚拟地址与第一物理地址的映射关系,为第一数据分配第二虚拟地址,建立第二虚拟地址与第一物理地址的映射关系。之后,主机调用用户态接口,将第二虚拟地址对应的第一物理地址指示的第一数据从内存写入存储设备,并在页表中建立第一虚拟地址与第一交换入 口的映射关系。其中第一交换入口用于指示第一数据在存储设备中的位置。第一虚拟地址为第一数据在虚拟内存的虚拟地址,第一物理地址为第一数据在内存中的地址。
这样,实现了基于第二虚拟地址的第一数据的换出过程,保证了用户态空间的换出过程的正确性和可靠性。
在本申请的另一种可能的实现方式中,本申请提供的数据交换方法还可以包括:主机解除第二虚拟地址与第一物理地址的映射关系,删除内存中的第一数据。
通过释放内存中第一数据的存储空间,能够节省内存占用,提高内存占用率。
在本申请的另一种可能的实现方式中,本申请提供的数据交换方法还可以包括:主机将第一虚拟地址的状态信息设置为第一信息,第一信息用于指示第一虚拟地址对应的第一数据的交换类型为用户态交换类型。
在本申请的另一种可能的实现方式中,交换请求为换入请求的情况下,上述“获取目标应用的交换请求”的方法可以包括:主机获取待访问的第二数据的虚拟地址,并在第二数据的虚拟地址的状态信息为第一信息,第二数据为目标应用的数据,且内存中未包括第二数据的情况下,生成换入请求。其中,第一信息用于指示第二数据的交换类型为用户态交换类型。
在本申请的另一种可能的实现方式中,上述“根据交换请求,调用用户态接口对存储设备执行操作”的方法可以包括:主机响应于换入请求,根据预存的页表获取第二数据的虚拟地址对应的第二交换入口,调用用户态接口,将第二交换入口指示的第二数据从存储设备写入内存,之后在页表中建立第二数据的虚拟地址与第二数据的物理地址的映射关系。第二数据的物理地址为第二数据在内存中的地址。
这样,实现了基于缺页异常上报的第二数据的换入过程,保证了用户态空间的换入过程的正确性和可靠性。
在本申请的另一种可能的实现方式中,在主机获取目标应用的交换请求之前,本申请提供的数据交换方法还可以包括:主机在目标应用启动后,建立换出线程和换入线程。其中,换出线程用于执行第一数据的换出操作,换入线程用于执行第二数据的换入操作。
在本申请的另一种可能的实现方式中,上述“建立换出线程和换入线程”的方法可以包括:主机在目标应用包含在预存的白名单的情况下,建立换出线程和换入线程。白名单中包括至少一个支持内存交换的应用。
这样,通过预先设置白名单,仅支持部分特定的应用进行内存交换,能够节省内存的开销,从而提高主机的性能。
第二方面,本申请提供一种数据交换装置。该数据交换装置包括用于执行上述第一方面或上述第一方面的任一种可能的实现方式的数据交换方法的各个模块。
第三方面,本申请提供一种主机,该主机包括存储器和处理器。存储器和处理器耦合。存储器用于存储计算机程序代码,计算机程序代码包括计算机指令。当处理器执行计算机指令时,主机执行如第一方面及其任一种可能的实现方式的数据交换方法。
第四方面,本申请提供一种芯片系统,该芯片系统应用于主机。芯片系统包括一个或多个接口电路,以及一个或多个处理器。接口电路和处理器通过线路互联;接口 电路用于从主机的存储器接收信号,并向处理器发送信号,信号包括存储器中存储的计算机指令。当处理器执行计算机指令时,主机执行如第一方面及其任一种可能的实现方式的数据交换方法。
第五方面,本申请提供一种计算机可读存储介质,该计算机可读存储介质包括计算机指令,当计算机指令在主机上运行时,使得主机执行如第一方面及其任一种可能的实现方式的数据交换方法。
第六方面,本申请提供一种计算机程序产品,该计算机程序产品包括计算机指令,当计算机指令在主机上运行时,使得主机执行如第一方面及其任一种可能的实现方式的数据交换方法。
本申请中第二方面到第六方面及其各种实现方式的具体描述,可以参考第一方面及其各种实现方式中的详细描述;并且,第二方面到第六方面及其各种实现方式的有益效果,可以参考第一方面及其各种实现方式中的有益效果分析,此处不再赘述。
本申请的这些方面或其他方面在以下的描述中会更加简明易懂。
附图说明
图1为本申请实施例提供的数据交换系统的一种示意图;
图2为本申请实施例提供的主机的一种结构示意图之一;
图3为本申请实施例提供的主机的一种结构示意图之二;
图4a为本申请实施例提供的用户态的数据换出的示意图;
图4b为本申请实施例提供的第一数据的换出的场景示意图;
图5为本申请实施例提供的用户态的数据换入的示意图;
图6为本申请实施例提供的数据交换方法的流程示意图;
图7为本申请实施例提供的数据交换装置的结构示意图之一;
图8为本申请实施例提供的数据交换装置的结构示意图之二。
具体实施方式
在本申请实施例中,“示例性的”或者“例如”等词用于表示作例子、例证或说明。本申请实施例中被描述为“示例性的”或者“例如”的任何实施例或设计方案不应被解释为比其它实施例或设计方案更优选或更具优势。确切而言,使用“示例性的”或者“例如”等词旨在以具体方式呈现相关概念。
以下,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个该特征。在本申请实施例的描述中,除非另有说明,“多个”的含义是两个或两个以上。
随着科技的发展,生活和工作中产生的数据越来越多。这些数据中冷数据指的是访问频率低,但仍需要长期保留的数据。为了降低冷数据的存储成本,可以通过内存交换机制将冷数据存储至存储设备中。
目前,操作系统内核执行内存交换的过程为:当主机的内存不足时,操作系统内核将内存中访问频率低的数据,即冷数据,从内存中写入存储设备,并删除内存中的该冷数据。当需要在内存访问写入存储设备的数据时,操作系统内核可以将该数据从存储设备中写入内存。但是,由于操作系统内核进行内存交换时使用的存储设备通常 是通用的固定设备,因此无法满足各种应用对存储设备的多样化需求。
为了解决操作系统内核的内存交换机制无法满足不同应用的多样化需求的问题,本申请实施例提供一种数据交换方法,该方法应用于主机。该主机安装有操作系统和目标应用,操作系统包括用户态空间,该用户态空间设置有目标应用的用户态接口,用户态接口对应一个存储设备。主机获取到目标应用的交换请求后,能够根据该交换请求调用用户态接口对存储设备执行操作。交换请求为换出请求时,用于请求将目标应用的数据从主机的内存写入存储设备,交换请求为换入请求时,用于请求将存储设备中的数据写入内存。这样,通过在用户态空间设置应用的用户态接口,并调用该用户态接口进行该应用的数据的换出或换入,实现了用户态的内存交换。从而,针对不同的应用能够设置不同的用户态接口,该不同的用户态接口对应的存储设备不同,满足了不同应用对存储设备的多样化需求。
为了便于本领域技术人员的理解,在此先对本申请实施例中涉及的术语进行简要介绍。
1、操作系统
操作系统是一台主机必不可少的系统软件,是整个主机的灵魂。常见的操作系统可以包括Windows操作系统、Linux操作系统等。
2、用户态空间(user space)和内核态空间(kernel space)
从逻辑上来说,操作系统可以包括用户态空间和内核态空间。其中用户态空间为应用的活动空间,用于存放应用的程序代码和数据。内核态空间为操作系统的活动空间,用于存放操作系统或操作系统内核的程序代码和数据。通常,用户态空间的应用或进程能访问的主机的硬件资源有限,仅能访问部分硬件资源。内核态空间的操作系统或内核拥有访问主机的所有硬件资源的权限,能访问主机的所有硬件资源。此外,用户态空间的应用无法直接访问主机的硬件资源,可以通过操作系统调用、库函数、脚本的方式访问硬件资源。
本申请实施例提供的数据交换方法适用于数据交换系统。图1示出了该数据交换系统的一种结构。如图1所示,该数据交换系统可以包括:主机11和存储设备12。主机11和存储设备12采用有线通信方式或无线通信方式建立连接。
主机11,用于获取主机11上安装的目标应用的交换请求,并根据交换请求,调用用户态空间中设置的该目标应用的用户态接口对用户态接口对应的存储设备12执行操作。其中,主机11上安装的操作系统包括用户态空间。
可以理解,主机11上安装有多个目标应用时,可以在用户态空间中设置每个目标应用的用户态接口,即一个目标应用对应一个用户态接口。不同的应用对应的用户态接口可以相同或不同。且,一个用户态接口对应一个存储设备。相同的用户态接口对应的存储设备可以相同或不同,不同的用户态接口对应的存储设备可以相同或不同。本申请实施例中,每个应用对应的用户态接口,以及每个用户态接口对应的存储设备是可以预先配置在主机中的,在此不做限定。
在一些实施例中,主机11可以为终端设备、服务器、云计算平台等。终端设备可以是手机(mobile phone)、平板电脑、笔记本电脑、掌上电脑、计算机等。图1中以主机为服务器为例示出。
在一些实施例中,存储设备12,可以为除主机11外的其他主机的内存,还可以为存储介质。该存储介质的类型可以为非易失性闪存(not and flash,NAND flash)、存储级存储器(storage class memory,SCM)等。
需要说明的是,在本申请实施例中,主机11上安装的操作系统除了包括用户态空间外,还可以包括内核态空间。该内核态空间可以设置内核态接口,该内核态接口对应一个存储设备,该存储设备为操作系统内核进行内存交换时使用的设备,该存储设备的类型通常为NAND flash、SCM等。
另外,图1所示的数据交换系统仅用于举例,并非用于限制本申请实施例的技术方案。本领域的技术人员应当明白,在具体实现过程中,数据交换系统还可以包括其他节点,同时也可根据具体需要来确定节点的数量,不予限制。
图2示出了上述主机的一种结构。如图2所示,该主机可以包括处理器201、内存202,用于实现本申请实施例提供的数据交换方法。
处理器201可以是一个通用中央处理器(central processing unit,CPU),微处理器,特定应用集成电路(application-specific integrated circuit,ASIC),或一个或多个用于控制本申请方案程序执行的集成电路。
示例性的,处理器201,用于处理来自主机外部,如其他主机的请求,还用于处理主机内部生成的请求。在本申请实施例中,处理器201可以用于处理主机获取到的交换请求,该交换请求为换出请求或换入请求。
内存202是指与处理器201直接交换数据的内部存储器,它可以随时读写数据,而且速度很快,作为操作系统或其他正在运行中的程序的临时数据存储器。内存202包括至少两种存储器,例如内存既可以是随机存取存储器,也可以是只读存储器(read only memory,ROM)。举例来说,随机存取存储器可以是动态随机存取存储器(dynamic random access memory,DRAM),或者SCM。其中,DRAM是一种半导体存储器,与大部分随机存取存储器(random access memory,RAM)一样,属于一种易失性存储器(volatile memory)。SCM是一种同时结合传统储存装置与存储器特性的复合型储存技术,存储级存储器能够提供比硬盘更快速的读写速度,但存取速度上比DRAM慢,在成本上比DRAM更为便宜。需要说明的是,DRAM和SCM在本申请实施例中只是示例性的说明,内存202还可以包括其他随机存取存储器,例如静态随机存取存储器(static random access memory,SRAM)等。而对于只读存储器,举例来说,可以是可编程只读存储器(programmable read only memory,PROM)、可抹除可编程只读存储器(erasable programmable read only memory,EPROM)等,但不限于此。另外,内存202还可以是双列直插式存储器模块或双线存储器模块(dual in-line memory module,DIMM),即由DRAM组成的模块,还可以是固态硬盘(solid state disk,SSD)。内存202可以是独立存在,并与处理器201相耦合。内存202也可以和处理器201集成在一起。
实际应用中,主机中可配置多个内存,该多个内存可以是相同类型的内存,也可以是不同类型的内存。本申请实施例不对主机的内存的数量和类型进行限定,图2中仅以一个内存202为例示出。此外,可对内存202进行配置使其具有保电功能。保电功能是指系统发生掉电又重新上电时,内存202中存储的数据也不会丢失。具有保电 功能的内存被称为非易失性存储器。
内存202中存储有主机上安装的应用的程序代码和数据,以及主机上安装的操作系统的代码和数据。其中,应用是运行在操作系统的基础之上的程序。
需要说明的是,图2中示出的结构并不构成对该主机的限定,除图2所示部件之外,该主机可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。例如,主机还可以包括声卡、光驱、硬盘、显示器、键盘、鼠标、音响、手写板、话筒、摄像头等输入输出设备。
结合图1和图2,图3示出了主机的一种结构。如图3所示,主机上安装有操作系统和至少一个目标应用。操作系统可以包括用户态空间和内核态空间。其中,用户态空间包括至少一个应用中每个应用的程序代码和数据,内核态空间包括操作系统内核的程序代码和数据。且,用户态空间设置有至少一个应用中每个应用的用户态接口。在具体的实现中,在用户态空间中,每个应用的程序代码中可以包括该应用的用户态接口对应的驱动程序或协议栈,通过运行驱动程序或协议栈便能调用应用的用户态接口。
在主机中,用户态空间可以包括预加载模块、换出模块、换入模块。内核态空间可以包括页表管理模块和缺页异常上报模块。这些模块能够配合完成用户态的内存交换机制。本申请实施例以一个目标应用为例对用户态的内存交换方法进行详细介绍,其他目标应用的内存交换方法均类似,在此不再赘述。
页表管理模块,用于管理主机的页表。页表是数据存储的一种结构,用于存储数据的虚拟地址(virtual address,VA)和物理地址(physical address,PA)的映射关系。虚拟地址为数据在虚拟内存中的逻辑地址,物理地址为数据在内存中的真实地址。在一种实现方式中,页表存储的数据可以通过哈希表来实现。
预加载模块,用于在目标应用启动之后,建立换出线程和换入线程,初始化相关资源。其中,换出线程用于执行第一数据的换出操作,换入线程用于执行第二数据的换入操作。相关资源指的是第一数据的换出或第二数据的换入所需的各种资源。
示例性的,相关资源可以包括页表。可选的,该相关资源还可以包括交换存储器(swap cache)。交换存储器是从主机的内存中划分出来的一部分存储空间,用于将第一数据从内存换出至存储设备时,暂时存储第一数据。该交换存储器存满数据后,再将交换存储器中的数据存储至存储设备。
可选的,预加载模块,具体用于在目标应用启动之后,通过加载用户态空间中该目标应用的程序代码,来建立换出线程和换入线程,并初始化相关资源。
可选的,由于并不是每个应用都支持用户态的内存交换机制,因此预加载模块在建立换出线程和换入线程之前,可以先判断目标应用是否包含在预存的白名单中,该白名单中包括至少一个支持内存交换的应用。在确定目标应用包含在白名单的情况下,预加载模块建立换出线程和换入线程,否则,预加载模块不执行任何操作。白名单包括的应用可以是占用内存较大的应用,例如,游戏应用、视频应用等。日历、计算器等占用内存较小的应用通常不会包含在白名单中,因为该类应用的数据量小,没有进行内存交换的必要。这样,通过预先设置白名单,仅支持部分特定的应用进行内存交换,能够节省内存的开销,从而提高主机的性能。
预加载模块建立好换出线程和换入线程后,换出模块便可以等待接收换出请求,换入模块可以等待接收换入请求。下面先介绍换出模块接收到换出请求的情况。
图4a示出了第一数据的换出过程,如图4a所示,换出模块,用于获取目标应用的换出请求,并调用换出线程进行第一数据的换出。该换出请求用于请求将目标应用的数据从主机的内存写入目标应用的用户态接口对应的存储设备。
可以理解,换出模块可以响应于用户对目标应用的换出操作,生成该目标应用的换出请求。或者,换出模块也可以在确定运行目标应用的内存不足时,生成该目标应用的换出请求。本申请实施例在此对换出请求的触发方式不做限定。
示例性的,假设主机的内存容量为13G,该主机当前已经运行了两个应用,占用内存10G。此时用户启动了另外一个应用。如果主机运行该另外一个应用需要占用5G内存,则主机在确定运行该另外一个应用的内存不足时,生成该另外一个应用的换出请求。
换出模块,还用于响应于目标应用的换出请求,在内存中确定目标应用的待换出的第一数据。该第一数据可以为目标应用的冷数据,即目标应用的访问频率低,但是需要长期存储的数据。示例性的,目标应用为游戏应用时,第一数据可以为该游戏应用的历史记录数据。
换出模块,还用于在确定出目标应用的第一数据之后,判断该第一数据是否允许换出。若确定该第一数据不允许换出,则换出模块结束第一数据的换出流程。若确定该第一数据允许换出,则换出模块可以通过调用定制化接口,向页表管理模块发送一个消息。该消息用于换出模块通知页表管理模块第一数据为待换出的数据。定制化接口指的是用户态空间和内核态空间通信的接口。
页表管理模块,在接收到换出模块发送的消息之后,可以解除预存的页表中第一数据的第一虚拟地址与第一物理地址的映射关系,并为该第一数据分配第二虚拟地址,且建立第二虚拟地址与第一物理地址的映射关系。最后,页表管理模块,还用于通过定制化接口,向换出模块返回第一数据的第二虚拟地址。其中,第一虚拟地址和第二虚拟地址是第一数据在虚拟内存中两个不同的虚拟地址,第一物理地址为第一数据在内存中的真实地址。
可选的,在本申请实施例中,页表管理模块,还用于在接收到来自用户态空间的换出模块的消息之后,将第一虚拟地址的状态信息设置为第一信息,该第一信息用于指示第一虚拟地址对应的第一数据的交换类型为用户态交换类型。或者,页表管理模块,还用于在接收到来自内核态空间的换出模块的消息后,将第一虚拟地址的状态信息设置为第二信息,该第二信息用于指示第一虚拟地址对应的第一数据的交换类型为内核态交换类型。
换出模块,还用于接收页表管理模块发送的第一数据的第二虚拟地址,通过运行目标应用的驱动程序或协议栈调用该目标应用的用户态接口,并根据页表中的第二虚拟地址和第一物理地址的映射关系,将第二虚拟地址对应的第一物理地址指示的第一数据从内存中写入用户态接口对应的存储设备中,写入到存储设备中的数据为第三数据。存储设备在将第三数据成功写入后,可以通过用户态接口向换出模块返回该第一交换入口(swap entry)。第一交换入口用于指示第三数据在该存储设备中的位置。
可选的,在本申请实施例中,如图4b所示,换出模块可以调用目标应用的用户态接口,先将第一数据从内存中写入交换存储器中,写入到交换存储器中的数据为交换数据。交换存储器的存储空间满了之后,可以将该交换数据从交换存储器中写入该用户态接口对应的存储设备中,此时写入存储设备中的数据为第三数据。
需要说明的是,本申请实施例中,第一数据、第三数据和交换数据分别为存储在内存、存储设备和交换存储器中的相同数据。只是数据的存储位置发生变化,数据的内容是相同的。且,将第一数据从内存中写入存储设备后,当需要在内存中访问第一数据时,可以将第三数据从存储设备写入内存。该情况下,写入内存的数据的虚拟地址与第一数据的虚拟地址是同一个虚拟地址。
换出模块,还用于在接收到第一交换入口后,通过定制化接口向页表管理模块发送该第一交换入口。
页表管理模块,还用于在接收到第一交换入口后,在页表中建立第一虚拟地址与第一交换入口的映射关系。页表管理模块,还用于解除页表中第二虚拟地址与第一物理地址的映射关系,并删除内存中的第一数据。这样,便完成了第一数据的换出,通过释放内存中第一数据的存储空间,能够节省内存占用,提高内存占用率。
可选的,在本申请实施例中,页表管理模块,还用于在建立第一虚拟地址与第一交换入口的映射关系之后,设置第一交换入口的状态信息为第三信息,该第三信息用于指示该第一交换入口指示的第三数据为从内存换出至存储设备的数据。
这样,通过图4a实现了基于第二虚拟地址的第一数据的换出过程,保证了用户态空间的换出过程的正确性和可靠性。
在介绍完换出模块接收到换出请求的情况后,接下来介绍换入模块接收到换入请求的情况。
图5示出了第二数据的换入过程。如图5所示,换入模块,用于获取目标应用的换入请求,并调用换入线程进行第二数据的换入。该换入请求用于请求将目标应用的用户态接口对应的存储设备中的数据写入内存。
可以理解的是,当用户需要查看目标应用的第二数据时,可以在主机上进行查看操作。主机的处理器响应于用户的查看操作,生成数据访问请求,并向页表管理模块发送数据访问请求。该数据访问请求可以包括数据访问信息,例如,该数据访问信息可以为第二数据的虚拟地址。页表管理模块在接收到数据访问请求后,可以在页表中查询第二数据的虚拟地址。如果页表中第二数据的虚拟地址对应的数据位置信息为一个物理地址,则表明第二数据存储在内存中,此时可以根据该物理地址在内存获取第二数据。如果页表中第二数据的虚拟地址对应的数据位置信息的状态信息为第三信息,表明页表中存储的数据位置信息为第二交换入口,第二数据未存储在内存中。页表管理模块可以向缺页异常上报模块发送一指示消息,以触发缺页异常上报。缺页异常上报模块在接收到页表管理模块发送的指示消息之后,可以判断此次换入操作是内核态的换入还是用户态的换入。具体的,缺页异常上报模块可以确定页表中的第二数据的虚拟地址的状态信息是第一信息还是第二信息。如果第二数据的虚拟地址的状态信息为第一信息,则表明第二数据的交换类型为用户态交换类型。此时缺页异常上报模块可以在确定第二数据为目标应用的数据的情况下,生成目标应用的换入请求,之 后通过用户异常处理函数(userfaultfd)或者信号处理函数(signal),向用户态空间中的换入模块发送目标应用的换入请求,该换入请求中可以包括第二数据的虚拟地址。这样,用户态空间中的换入模块可以获取到目标应用的换入请求。如果第二数据的虚拟地址的状态信息为第二信息,则表明第二数据的交换类型为内核态交换类型。此时,缺页异常上报模块可以向内核态空间中的换入模块发送换入请求,以便换入模块进行第二数据的换入。
需要说明的是,在本申请实施例中,上述第二数据为从内存中换出至存储设备的数据,上述userfaultfd或者signal可以是在第二数据的换出过程中注册的。具体的,可以是在换出模块确定第二数据允许换出后注册的。第二数据的换出过程与上述实施例第一数据的换出过程相同,在此不再赘述。
换入模块,还用于响应于目标应用的换入请求,调用定制化接口,通过页表管理模块,在页表中获取第二数据的虚拟地址对应的第二交换入口,并调用目标应用的用户态接口,将第二交换入口指示的第二数据从用户态接口对应的存储设备中写入内存中。
在具体的实现中,换入模块在将第二数据从存储设备写入内存之前,可以先申请一个第三虚拟地址和一个第三物理地址。申请好地址后,换入模块可以将第二数据从存储设备拷贝到第三物理地址对应的位置,并建立第三虚拟地址和第三物理地址的映射关系。此时,第三物理地址内存储的数据为第四数据。之后换入模块可以指示页表管理模块为第二数据申请新的物理地址,并将第三虚拟地址对应的第三物理地址指示的第四数据拷贝到该新的物理地址对应的位置,且在页表中建立第二数据的虚拟地址和第二数据的物理地址的映射关系,解除第三虚拟地址和第三物理地址的映射关系,删除第三物理地址存储的第四数据。第二数据的物理地址内存储的数据为第五数据。这样,便完成了第二数据的换入,可以在内存中进行数据的读写。
可选的,在本申请实施例中,换入模块可以调用目标应用的用户态接口,将第二数据从用户态接口对应的存储设备中写入缓冲器(buffer)中,写入缓冲器中的数据为缓冲数据。当为第二数据申请好第三虚拟地址和第三物理地址后,将缓冲数据从缓冲器写入第三物理地址对应的位置,写入第三物理地址的数据为第四数据。最后申请好第二数据的物理地址后,将第四数据从第三物理地址处拷贝到第二数据的物理地址对应的位置,写入第二数据的物理地址的数据为第五数据。
可以理解,上述缓冲器也是内存中划分出来的一部分存储空间,用于将存储设备中的第二数据换入至内存时,暂时存储数据。待在内存中为该第二数据申请好物理地址后,再将缓冲器中的数据写入申请好的物理地址,以避免由于存储设备的读写速度慢导致主机的交换速度慢的问题。
需要说明的是,本申请实施例中,第二数据、第四数据、第五数据和缓冲数据分别为存储在存储设备、内存的第三物理地址、内存的第二数据的物理地址和缓冲器的相同数据。只是数据的存储位置发生变化,数据的内容是相同的。且,如果第二数据是将初始数据从内存中写入至存储设备中的数据,那么初始数据的虚拟地址与第五数据的虚拟地址是同一个虚拟地址。
这样,通过图5实现了基于缺页异常上报的第二数据的换入过程,保证了用户态 空间的换入过程的正确性和可靠性。
下面结合图1-图5对本申请实施例提供的数据交换方法进行具体阐述。
可以理解的,本申请实施例中同一个步骤或者具有相同功能的步骤或者技术特征在不同实施例之间可以互相参考借鉴。
可以理解的,本申请实施例中,主机可以执行本申请实施例中的部分或全部步骤,这些步骤仅是示例,本申请实施例还可以执行其它步骤或者各种步骤的变形。此外,各个步骤可以按照本申请实施例呈现的不同的顺序来执行,并且有可能并非要执行本申请实施例中的全部步骤。
在本申请实施例中,数据交换方法的执行主体的具体结构,本申请实施例并未特别限定,只要能够实现本申请实施例的提供的方法即可。例如,本申请实施例提供的数据交换方法的执行主体可以是主机,或者为应用于主机中的部件,例如,芯片,本申请实施例对此不进行限定。下述实施例以数据交换方法的执行主体为主机为例进行描述。
如图6示,本申请实施例提供的数据交换方法可以包括以下步骤601-步骤613。其中,步骤601为用户态空间中的预加载模块在进行内存交换前执行的准备操作。步骤602-步骤608为第一数据从内存换出至存储设备的过程。步骤609-步骤613为第二数据从存储设备换入至内存的过程。
601、主机在目标应用启动后,在目标应用包含在预存的白名单的情况下,建立换出线程和换入线程。
其中,白名单中包括至少一个支持内存交换的应用。换出线程用于执行第一数据的换出操作,换入线程用于执行第二数据的换入操作。
需要说明的是,步骤601的具体描述可以参考另一实施例中预加载模块建立换出线程和换入线程的相关描述,在此不再赘述。
602、主机获取目标应用的换出请求。
603、主机响应于换出请求,在内存中确定目标应用的第一数据。
604、主机解除预存的页表的第一虚拟地址与第一物理地址的映射关系,将第一虚拟地址的状态信息设置为第一信息。
其中,第一虚拟地址为第一数据在虚拟内存的虚拟地址,第一物理地址为第一数据在内存中的地址。
605、主机为第一数据分配第二虚拟地址,并建立第二虚拟地址与第一物理地址的映射关系。
606、主机调用用户态接口,将第二虚拟地址对应的第一物理地址指示的第一数据从内存写入存储设备。
607、主机在页表中建立第一虚拟地址与第一交换入口的映射关系。
其中,第一交换入口用于指示第一数据在存储设备中的位置。
608、主机解除第二虚拟地址与第一物理地址的映射关系,删除内存中的第一数据。
需要说明的是,步骤602-步骤608的具体描述可以参考另一实施例中换出模块和页表管理模块将第一数据从内存换出至存储设备的相关描述,在此不再赘述。
609、主机获取待访问的第二数据的虚拟地址。
610、主机在第二数据的虚拟地址的状态信息为第一信息,第二数据为目标应用的数据,且内存中未包括第二数据的情况下,生成目标应用的换入请求。
611、主机响应于换入请求,根据预存的页表获取第二数据的虚拟地址对应的第二交换入口。
612、主机调用用户态接口,将第二交换入口指示的第二数据从存储设备写入内存。
613、主机在页表中建立第二数据的虚拟地址与第二数据的物理地址的映射关系。
第二数据的物理地址为第二数据在内存中的地址。
需要说明的是,步骤609-步骤613的具体描述可以参考另一实施例中换入模块、页表管理模块和缺页异常上报模块将第二数据从存储设备换入至内存的相关描述,在此不再赘述。
本申请实施例提供一种数据交换方法,该方法应用于主机。该主机安装有操作系统和目标应用,操作系统包括用户态空间,该用户态空间设置有目标应用的用户态接口,用户态接口对应一个存储设备。主机获取到目标应用的交换请求后,能够根据该交换请求调用用户态接口对存储设备执行操作。交换请求为换出请求时,用于请求将目标应用的数据从主机的内存写入存储设备,交换请求为换入请求时,用于请求将存储设备中的数据写入内存。这样,通过在用户态空间设置应用的用户态接口,并调用该用户态接口进行该应用的数据的换出或换入,实现了用户态的内存交换。从而,针对不同的应用能够设置不同的用户态接口,该不同的用户态接口对应的存储设备不同,为用户提供了定制化的用户态内存交换框架,满足了不同应用对存储设备的多样化需求,使得用户能够设计自己想要的内存交换机制。
进一步的,由于用户态的读写流程比内核态的读写流程的速度快,因此用户态的内存交换的性能高于内核态的内存交换的性能。为了获取更高效的性能,目前存储设备的驱动程序或协议栈已上移到用户态,导致内核态的内存交换机制无法使用上移到用户态的存储设备。本申请实施例实现了用户态的内存交换机制,该机制能够使用上移到用户态的存储设备。在关系型数据库管理系统(mysql)和业务处理规范(transaction processing performance council,TPCC)场景下测试用户态的内存交换机制,换出或换入的时延为微秒级,实现了在用户无感知的情况下进行用户态的内存交换,提高了用户体验。
示例性的,假设在mysql和TPCC场景下,主机将内存中28%的数据换出。表2示出了用户态内存交换机制的性能的相关参数。由表1可知,主机将数据换出时,性能损失仅为2%,内核态内存交换机制的性能损失大于2%。
表1
Figure PCTCN2022097694-appb-000001
上述主要从方法的角度对本申请实施例提供的方案进行了介绍。为了实现上述功能,其包含了执行各个功能相应的硬件结构和/或软件模块。本领域技术人员应该很容易意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,本申请能够以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
如图7所示,为本申请实施例提供的一种数据交换装置70的结构示意图。该数据交换装置70可以是主机,也可以是主机中的CPU,还可以是主机中的控制模块,还可以是主机中的客户端。数据交换装置70用于执行图6所示的数据交换方法。数据交换装置70可以包括获取单元71和处理单元72。
获取单元71,用于获取目标应用的交换请求,交换请求为换入请求或换出请求,换出请求用于请求将目标应用的数据从主机的内存写入存储设备,换入请求用于请求将存储设备中的数据写入内存。例如,结合图6,获取单元71可以用于执行步骤602、步骤610。处理单元72,用于根据获取单元71获取的交换请求,调用用户态接口对存储设备执行操作。
可选的,交换请求为换出请求,处理单元72,具体用于响应于换出请求,在内存中确定目标应用的第一数据,解除预存的页表中的第一虚拟地址与第一物理地址的映射关系,为第一数据分配第二虚拟地址,建立第二虚拟地址与第一物理地址的映射关系。之后,调用用户态接口,将第二虚拟地址对应的第一物理地址指示的第一数据从内存写入存储设备,并在页表中建立第一虚拟地址与第一交换入口的映射关系。其中第一交换入口用于指示第一数据在存储设备中的位置。第一虚拟地址为第一数据在虚拟内存的虚拟地址,第一物理地址为第一数据在内存中的地址。
可选的,如图8所示,数据交换装置70还包括解除单元73和删除单元74。解除单元73,用于解除第二虚拟地址与第一物理地址的映射关系。例如,结合图6,解除单元73可以用于执行步骤608中的解除第二虚拟地址与第一物理地址的映射关系。删除单元74,用于删除内存中的第一数据。例如,结合图6,删除单元74可以用于执行步骤608中的删除内存中的第一数据。
可选的,如图8所示,数据交换装置70还包括设置单元75。设置单元75,用于将第一虚拟地址的状态信息设置为第一信息,第一信息用于指示第一虚拟地址对应的第一数据的交换类型为用户态交换类型。
可选的,交换请求为换入请求时,获取单元71,具体用于:获取待访问的第二数据的虚拟地址;在第二数据的虚拟地址的状态信息为第一信息,第二数据为目标应用的数据,且内存中未包括第二数据的情况下,生成换入请求,第一信息用于指示第二数据的交换类型为用户态交换类型。
可选的,处理单元72,具体用于:响应于换入请求,根据预存的页表获取第二数据的虚拟地址对应的第二交换入口;调用用户态接口,将第二交换入口指示的第二数据从存储设备写入内存;在页表中建立第二数据的虚拟地址与第二数据的物理地址的映射关系,第二数据的物理地址为第二数据在内存中的地址。
可选的,如图8所示,数据交换装置70还包括建立单元76。建立单元76,用于在目标应用启动后,建立换出线程和换入线程,换出线程用于执行第一数据的换出操作,换入线程用于执行第二数据的换入操作。例如,结合图6,建立单元76可以用于执行步骤601。
可选的,建立单元76,具体用于在目标应用包含在预存的白名单的情况下,建立换出线程和换入线程,白名单中包括至少一个支持内存交换的应用。
当然,本申请实施例提供的数据交换装置70包括但不限于上述模块。
在实际实现时,获取单元71、处理单元72、解除单元73、删除单元74、设置单元75和建立单元76可以由图2所示的处理器201调用内存202中的程序代码来实现。其具体的执行过程可参考图6所示的数据交换方法部分的描述,这里不再赘述。
本申请另一实施例还提供一种计算机可读存储介质,该计算机可读存储介质中存储有计算机指令,当计算机指令在主机上运行时,使得主机执行上述方法实施例所示的方法流程中主机执行的各个步骤。
本申请另一实施例还提供一种芯片系统,该芯片系统应用于主机。芯片系统包括一个或多个接口电路,以及一个或多个处理器。接口电路和处理器通过线路互联。接口电路用于从主机的存储器接收信号,并向处理器发送信号,信号包括存储器中存储的计算机指令。当处理器执行计算机指令时,主机执行上述方法实施例所示的方法流程中主机执行的各个步骤。
在本申请另一实施例中,还提供一种计算机程序产品,该计算机程序产品包括计算机指令,当计算机指令在主机上运行时,使得主机执行上述方法实施例所示的方法流程中主机执行的各个步骤。
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件程序实现时,可以全部或部分地以计算机程序产品的形式来实现。该计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行计算机执行指令时,全部或部分地产生按照本申请实施例的流程或功能。计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,计算机指令可以从一个网站站点、计算机、服务器或者数据中心通过有线(例如同轴电缆、光纤、数字用户线(digital subscriber line,DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可以用介质集成的服务器、数据中心等数据存储设备。可用介质可以是磁性介质(例如,软盘、硬盘、磁带),光介质(例如,DVD)、或者半导体介质(例如固态硬盘(solid state disk,SSD))等。
以上所述,仅为本申请的具体实施方式。熟悉本技术领域的技术人员根据本申请提供的具体实施方式,可想到变化或替换,都应涵盖在本申请的保护范围之内。

Claims (18)

  1. 一种数据交换方法,应用于主机,其特征在于,所述主机安装有操作系统和目标应用,所述操作系统包括用户态空间,所述用户态空间设置有所述目标应用的用户态接口,所述用户态接口对应一个存储设备,包括:
    获取所述目标应用的交换请求,所述交换请求为换入请求或换出请求,所述换出请求用于请求将所述目标应用的数据从所述主机的内存写入所述存储设备,所述换入请求用于请求将所述存储设备中的数据写入所述内存;
    根据所述交换请求,调用所述用户态接口对所述存储设备执行操作。
  2. 根据权利要求1所述的数据交换方法,其特征在于,所述交换请求为所述换出请求,所述根据所述交换请求,调用所述用户态接口对所述存储设备执行操作,包括:
    响应于所述换出请求,在所述内存中确定所述目标应用的第一数据;
    解除预存的页表中的第一虚拟地址与第一物理地址的映射关系,所述第一虚拟地址为所述第一数据在虚拟内存的虚拟地址,所述第一物理地址为所述第一数据在所述内存中的地址;
    为所述第一数据分配第二虚拟地址,并建立所述第二虚拟地址与所述第一物理地址的映射关系;
    调用所述用户态接口,将所述第二虚拟地址对应的所述第一物理地址指示的所述第一数据从所述内存写入所述存储设备;
    在所述页表中建立所述第一虚拟地址与第一交换入口的映射关系,所述第一交换入口用于指示所述第一数据在所述存储设备中的位置。
  3. 根据权利要求2所述的数据交换方法,其特征在于,所述数据交换方法还包括:
    解除所述第二虚拟地址与所述第一物理地址的映射关系,删除所述内存中的所述第一数据。
  4. 根据权利要求2或3所述的数据交换方法,其特征在于,所述数据交换方法还包括:
    将所述第一虚拟地址的状态信息设置为第一信息,所述第一信息用于指示所述第一虚拟地址对应的所述第一数据的交换类型为用户态交换类型。
  5. 根据权利要求1所述的数据交换方法,其特征在于,所述交换请求为所述换入请求,所述获取所述目标应用的交换请求,包括:
    获取待访问的第二数据的虚拟地址;
    在所述第二数据的虚拟地址的状态信息为第一信息,所述第二数据为所述目标应用的数据,且所述内存中未包括所述第二数据的情况下,生成所述换入请求,所述第一信息用于指示所述第二数据的交换类型为用户态交换类型。
  6. 根据权利要求5所述的数据交换方法,其特征在于,所述根据所述交换请求,调用所述用户态接口对所述存储设备执行操作,包括:
    响应于所述换入请求,根据预存的页表获取所述第二数据的虚拟地址对应的第二交换入口;
    调用所述用户态接口,将所述第二交换入口指示的所述第二数据从所述存储设备写入所述内存;
    在所述页表中建立所述第二数据的虚拟地址与所述第二数据的物理地址的映射关系,所述第二数据的物理地址为所述第二数据在所述内存中的地址。
  7. 根据权利要求1-6中任一项所述的数据交换方法,其特征在于,在所述获取所述目标应用的交换请求之前,所述数据交换方法还包括:
    在所述目标应用启动后,建立换出线程和换入线程,所述换出线程用于执行第一数据的换出操作,所述换入线程用于执行第二数据的换入操作。
  8. 根据权利要求7所述的数据交换方法,其特征在于,所述建立换出线程和换入线程,包括:
    在所述目标应用包含在预存的白名单的情况下,建立所述换出线程和所述换入线程,所述白名单中包括至少一个支持内存交换的应用。
  9. 一种数据交换装置,位于主机,其特征在于,所述主机安装有操作系统和目标应用,所述操作系统包括用户态空间,所述用户态空间设置有所述目标应用的用户态接口,所述用户态接口对应一个存储设备,所述数据交换装置包括:
    获取单元,用于获取所述目标应用的交换请求,所述交换请求为换入请求或换出请求,所述换出请求用于请求将所述目标应用的数据从所述主机的内存写入所述存储设备,所述换入请求用于请求将所述存储设备中的数据写入所述内存;
    处理单元,用于根据所述获取单元获取的所述交换请求,调用所述用户态接口对所述存储设备执行操作。
  10. 根据权利要求9所述的数据交换装置,其特征在于,所述交换请求为所述换出请求,所述处理单元,具体用于:
    响应于所述换出请求,在所述内存中确定所述目标应用的第一数据;
    解除预存的页表中的第一虚拟地址与第一物理地址的映射关系,所述第一虚拟地址为所述第一数据在虚拟内存的虚拟地址,所述第一物理地址为所述第一数据在所述内存中的地址;
    为所述第一数据分配第二虚拟地址,并建立所述第二虚拟地址与所述第一物理地址的映射关系;
    调用所述用户态接口,将所述第二虚拟地址对应的所述第一物理地址指示的所述第一数据从所述内存写入所述存储设备;
    在所述页表中建立所述第一虚拟地址与第一交换入口的映射关系,所述第一交换入口用于指示所述第一数据在所述存储设备中的位置。
  11. 根据权利要求10所述的数据交换装置,其特征在于,所述数据交换装置还包括:解除单元和删除单元;
    所述解除单元,用于解除所述第二虚拟地址与所述第一物理地址的映射关系;
    所述删除单元,用于删除所述内存中的所述第一数据。
  12. 根据权利要求10或11所述的数据交换装置,其特征在于,所述数据交换装置还包括:设置单元;
    所述设置单元,用于将所述第一虚拟地址的状态信息设置为第一信息,所述第一信息用于指示所述第一虚拟地址对应的所述第一数据的交换类型为用户态交换类型。
  13. 根据权利要求9所述的数据交换装置,其特征在于,所述交换请求为所述换入 请求,所述获取单元,具体用于:
    获取待访问的第二数据的虚拟地址;
    在所述第二数据的虚拟地址的状态信息为第一信息,所述第二数据为所述目标应用的数据,且所述内存中未包括所述第二数据的情况下,生成所述换入请求,所述第一信息用于指示所述第二数据的交换类型为用户态交换类型。
  14. 根据权利要求13所述的数据交换装置,其特征在于,所述处理单元,具体用于:
    响应于所述换入请求,根据预存的页表获取所述第二数据的虚拟地址对应的第二交换入口;
    调用所述用户态接口,将所述第二交换入口指示的所述第二数据从所述存储设备写入所述内存;
    在所述页表中建立所述第二数据的虚拟地址与所述第二数据的物理地址的映射关系,所述第二数据的物理地址为所述第二数据在所述内存中的地址。
  15. 根据权利要求9-14中任一项所述的数据交换装置,其特征在于,所述数据交换装置还包括:建立单元;
    所述建立单元,用于在所述目标应用启动后,建立换出线程和换入线程,所述换出线程用于执行第一数据的换出操作,所述换入线程用于执行第二数据的换入操作。
  16. 根据权利要求15所述的数据交换装置,其特征在于,所述建立单元,具体用于:
    在所述目标应用包含在预存的白名单的情况下,建立所述换出线程和所述换入线程,所述白名单中包括至少一个支持内存交换的应用。
  17. 一种数据交换装置,其特征在于,所述数据交换装置包括存储器和处理器;所述存储器和所述处理器耦合;所述存储器用于存储计算机程序代码,所述计算机程序代码包括计算机指令;当所述处理器执行所述计算机指令时,所述数据交换装置执行如权利要求1-8中任意一项所述的数据交换方法。
  18. 一种计算机可读存储介质,其特征在于,包括计算机指令,当所述计算机指令在数据交换装置上运行时,使得所述数据交换装置执行如权利要求1-8中任意一项所述的数据交换方法。
PCT/CN2022/097694 2021-06-16 2022-06-08 一种数据交换方法及装置 Ceased WO2022262623A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP22824103.0A EP4354305B1 (en) 2021-06-16 2022-06-08 Data exchange method and apparatus
US18/541,176 US12498878B2 (en) 2021-06-16 2023-12-15 Data swapping method and apparatus

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110669020.8A CN115481052B (zh) 2021-06-16 2021-06-16 一种数据交换方法及装置
CN202110669020.8 2021-06-16

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US18/541,176 Continuation US12498878B2 (en) 2021-06-16 2023-12-15 Data swapping method and apparatus

Publications (1)

Publication Number Publication Date
WO2022262623A1 true WO2022262623A1 (zh) 2022-12-22

Family

ID=84419453

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/097694 Ceased WO2022262623A1 (zh) 2021-06-16 2022-06-08 一种数据交换方法及装置

Country Status (4)

Country Link
US (1) US12498878B2 (zh)
EP (1) EP4354305B1 (zh)
CN (1) CN115481052B (zh)
WO (1) WO2022262623A1 (zh)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20240063607A (ko) * 2022-11-03 2024-05-10 삼성전자주식회사 데이터 및 데이터 블록을 제공하는 스왑 메모리 장치, 이의 동작하는 방법, 및 이를 포함하는 전자 장치의 동작하는 방법
CN116319627B (zh) * 2023-03-17 2025-12-16 苏州元脑智能科技有限公司 数据的获取方法及装置、存储介质及电子装置
CN116431540A (zh) * 2023-03-27 2023-07-14 华为技术有限公司 通信方法、装置、系统及存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070094643A1 (en) * 2005-10-25 2007-04-26 Anderson Eric A System and method for writing captured data from kernel-level to a file
CN108989432A (zh) * 2018-07-20 2018-12-11 南京中兴新软件有限责任公司 用户态的文件发送方法、文件接收方法和文件收发装置
CN111522512A (zh) * 2020-04-22 2020-08-11 深圳忆联信息系统有限公司 优化的冷热数据分离方法、装置、计算机设备及存储介质
CN112214168A (zh) * 2020-09-27 2021-01-12 湖南智存合壹信息科技有限公司 设定固态硬盘冷热数据的方法及数据存储系统

Family Cites Families (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7085909B2 (en) * 2003-04-29 2006-08-01 International Business Machines Corporation Method, system and computer program product for implementing copy-on-write of a file
CN102110196B (zh) * 2009-12-25 2015-04-29 中国长城计算机深圳股份有限公司 并行运行多用户操作系统间的数据安全传输方法及系统
CN102779244B (zh) * 2011-05-11 2015-03-25 奇智软件(北京)有限公司 一种文件操作的执行方法及装置
EP3217294B1 (en) * 2014-11-28 2018-11-28 Huawei Technologies Co. Ltd. File access method and apparatus and storage device
US9720846B2 (en) * 2015-05-28 2017-08-01 Red Hat Israel, Ltd. Memory swap for direct memory access by a device assigned to a guest operating system
US9678687B2 (en) * 2015-09-25 2017-06-13 Mcafee, Inc. User mode heap swapping
CN105760275A (zh) * 2016-02-22 2016-07-13 汉柏科技有限公司 一种基于Linux的监控用户态进程内存状态方法及系统
CN107885666B (zh) * 2016-09-28 2021-07-20 华为技术有限公司 一种内存管理方法和装置
CN110121114B (zh) * 2018-02-07 2021-08-27 华为技术有限公司 发送流数据的方法及数据发送设备
CN110554911A (zh) * 2018-05-30 2019-12-10 阿里巴巴集团控股有限公司 内存访问与分配方法、存储控制器及系统
CN110895515B (zh) * 2018-09-12 2024-11-05 南京中兴新软件有限责任公司 内存缓存管理方法、多媒体服务器及计算机存储介质
CN111143072B (zh) 2019-12-29 2023-09-08 浪潮(北京)电子信息产业有限公司 用户态程序内存分配方法、系统及相关组件
CN112948318B (zh) * 2021-03-09 2022-12-06 西安奥卡云数据科技有限公司 一种Linux操作系统下基于RDMA的数据传输方法及装置
US20220398199A1 (en) * 2021-06-15 2022-12-15 Vmware, Inc. User-space remote memory paging

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070094643A1 (en) * 2005-10-25 2007-04-26 Anderson Eric A System and method for writing captured data from kernel-level to a file
CN108989432A (zh) * 2018-07-20 2018-12-11 南京中兴新软件有限责任公司 用户态的文件发送方法、文件接收方法和文件收发装置
CN111522512A (zh) * 2020-04-22 2020-08-11 深圳忆联信息系统有限公司 优化的冷热数据分离方法、装置、计算机设备及存储介质
CN112214168A (zh) * 2020-09-27 2021-01-12 湖南智存合壹信息科技有限公司 设定固态硬盘冷热数据的方法及数据存储系统

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP4354305A4

Also Published As

Publication number Publication date
CN115481052B (zh) 2025-12-05
US20240143220A1 (en) 2024-05-02
US12498878B2 (en) 2025-12-16
EP4354305A4 (en) 2024-08-07
CN115481052A (zh) 2022-12-16
EP4354305B1 (en) 2025-08-06
EP4354305A1 (en) 2024-04-17

Similar Documents

Publication Publication Date Title
CN113674133B (zh) Gpu集群共享显存系统、方法、装置及设备
CN112596960B (zh) 一种分布式存储服务切换方法及装置
US12498878B2 (en) Data swapping method and apparatus
EP4439312A1 (en) Data storage method and system, storage access configuration method and related device
US20140095769A1 (en) Flash memory dual in-line memory module management
US10241550B2 (en) Affinity aware parallel zeroing of memory in non-uniform memory access (NUMA) servers
US20220253252A1 (en) Data processing method and apparatus
WO2021008425A1 (zh) 一种系统启动方法以及相关设备
CN115729438A (zh) 数据访问方法、装置及存储介质
CN116126742A (zh) 内存访问方法、装置、服务器及存储介质
CN110162395B (zh) 一种内存分配的方法及装置
CN115934585A (zh) 内存管理方法、装置和计算机设备
US9697047B2 (en) Cooperation of hoarding memory allocators in a multi-process system
CN115421787A (zh) 指令执行方法、装置、设备、系统、程序产品及介质
WO2022222977A1 (zh) 用于运行云业务实例的物理服务器的内存管理方法和装置
CN114518962A (zh) 内存的管理方法及装置
CN115309665A (zh) 计算机设备及内存注册方法
US11940917B2 (en) System and method for network interface controller based distributed cache
CN107402818A (zh) 一种客户端读写缓存分离的方法及系统
CN112114962A (zh) 一种内存分配方法及装置
WO2021120843A1 (zh) 云主机内存分配方法及云主机、设备及存储介质
CN107209738A (zh) 储存存储器直接访问
CN119718709A (zh) 数据读写方法、服务器及存储介质
CN114528123A (zh) 数据访问方法、装置、设备及计算机可读存储介质
WO2017113329A1 (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: 22824103

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 2022824103

Country of ref document: EP

ENP Entry into the national phase

Ref document number: 2022824103

Country of ref document: EP

Effective date: 20231220

NENP Non-entry into the national phase

Ref country code: DE

WWG Wipo information: grant in national office

Ref document number: 2022824103

Country of ref document: EP