WO2022222977A1 - Procédé et appareil pour gérer une mémoire d'un serveur physique pour exécuter des instances de service en nuage - Google Patents

Procédé et appareil pour gérer une mémoire d'un serveur physique pour exécuter des instances de service en nuage Download PDF

Info

Publication number
WO2022222977A1
WO2022222977A1 PCT/CN2022/088044 CN2022088044W WO2022222977A1 WO 2022222977 A1 WO2022222977 A1 WO 2022222977A1 CN 2022088044 W CN2022088044 W CN 2022088044W WO 2022222977 A1 WO2022222977 A1 WO 2022222977A1
Authority
WO
WIPO (PCT)
Prior art keywords
memory
service instance
memory area
operating system
physical
Prior art date
Application number
PCT/CN2022/088044
Other languages
English (en)
Chinese (zh)
Inventor
汪晶
Original Assignee
华为云计算技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为云计算技术有限公司 filed Critical 华为云计算技术有限公司
Publication of WO2022222977A1 publication Critical patent/WO2022222977A1/fr

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • G06F12/023Free address space management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/10Address translation
    • G06F12/1009Address translation using page tables, e.g. page table structures
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements

Definitions

  • the present application relates to the field of communications, and in particular, to a memory management method and apparatus for running a physical server of a cloud service instance.
  • the operating system allocates 0-4 gigabytes (gigabyte, GB) of virtual memory space for each process, and the virtual memory address in the virtual memory space and the physical memory address in the physical memory are separated, which will give the process no need to care Physical memory addresses bring convenience and security, but the translation of virtual memory addresses and physical memory addresses consumes additional computer resources.
  • the easiest way to record the correspondence between virtual memory addresses and physical memory addresses is to record the correspondence in a table. In order to make the translation speed fast enough, this table must be loaded in memory. However, if the table records each The correspondence between a virtual memory address and a physical memory address is very wasteful.
  • the operating system uses paging to record the corresponding relationship between virtual memory addresses and physical memory addresses.
  • Paging is to manage physical memory with a larger unit "page".
  • the unit of 4KB is for physical memory paging and the page number is set, and the unit of 4 kilobytes (kilobyte, KB) is for virtual memory paging and the page number is set, and each physical memory page corresponds to a 64-byte (byte, B)
  • the page data structure can be used to record the correspondence between the page number of the physical memory and the page number of the virtual memory.
  • the operating system needs to divide an area from physical memory for storing these page data structures with 64B as the basic unit.
  • cloud service instances run in the operating system of the physical server, and the cloud service instance actually runs on the physical memory allocated by the physical server to the operating system.
  • the purpose is to provide physical memory for cloud service instances as much as possible, so as to maximize the creation of benefits, but if 1.5625% of the physical memory allocated to the operating system is used to store the page data structure, this is for cloud service providers. It is said to be a waste of physical memory resources.
  • the present application provides a memory management method and device for running a physical server of a cloud service instance, in which non-overlapping operating system memory areas and service instance memory areas are set in the physical memory of the physical server, so as to
  • the operating system allocates the operating system memory area, and allocates the service instance memory area for the cloud service instance in the operating system. Therefore, the page data structure needs to be generated for the memory in the operating system memory area, and the page data structure does not need to be generated for the service instance memory area. Since the number of generated page data structures is reduced, the space for storing the page data structures is also reduced, so as to achieve the purpose of providing physical memory for use by cloud service instances as much as possible.
  • the present application provides a memory management method for a physical server.
  • the physical server sets non-overlapping operating system memory areas and service instance memory areas in the physical memory, sets a memory address range for the cloud service instance in the service instance memory area, and records the memory address range, where the cloud service instance is in The operating system runs in this memory address range after booting.
  • the operating system of the physical server runs in the operating system memory area.
  • 1.5625% of the physical memory allocated to the operating system is used to store the page data structure, which occupies the memory quota of the cloud service instance running on the operating system.
  • the embodiment of the present invention divides a special service instance memory area in the physical memory for the cloud service instance, and divides a special operating system memory area for the operating system in the physical memory.
  • the operating system can use 1.5625% of the operating system memory area
  • the page data structure is stored, but the cloud service instance does not run in the operating system memory area, but runs in the service instance memory area, because the operating system memory area is smaller than the physical memory provided to the operating system in the prior art (because it is from In the prior art, the physical memory provided to the operating system is divided), so the number of page data structures to be created is reduced, and the physical memory used to store the page data structures becomes smaller, thereby saving more storage space to Provided for use by cloud business instances.
  • the physical server allocates a cloud service instance identifier to the cloud service instance, applies for a free memory space in the service instance memory area, and uses the address range of the memory space obtained by the application as the memory address range.
  • the cloud service instance identifier and the memory address range of the cloud service instance in the service instance memory area are recorded in the management information area of the service instance memory area.
  • the memory address range corresponding to different cloud service instances in the service instance memory area can be distinguished by the service instance identifier, so that memory isolation can be achieved between different cloud service instances, and multiple different cloud services can be run simultaneously in the service instance memory area. instance, the memory of multiple cloud service instances does not affect each other.
  • the memory space occupied by the management information area is smaller, so that more memory space can be saved for use by the cloud business instance.
  • the physical server writes the address corresponding to the memory address range of the cloud service instance in the service instance memory area in the page table of the cloud service instance in the memory area of the operating system.
  • the physical server rewrites the address corresponding to the memory address range of the cloud service instance in the memory area of the service instance recorded in the memory area of the service instance into the page table of the cloud service instance middle.
  • the operating system needs to be restarted.
  • the data in the physical memory allocated to the operating system will be cleared. Therefore, the data in the physical memory of the cloud service instance running in the operating system will be lost, and in this application , because the cloud service instance runs in the memory area of the service instance instead of the memory area of the operating system, restarting the operating system will only clear the data in the physical memory corresponding to the memory area of the operating system. The data is not affected.
  • the operating system restarts by rewriting the address to the page table, it is not necessary to rewrite the relevant data of the cloud service instance into the memory, which can realize the rapid recovery of the cloud service instance.
  • the physical server allocates the physical memory of the physical server to the operating system memory area and the service instance memory area in a preset ratio.
  • the cloud service provider can set a preset ratio according to actual needs, and can manage the memory in a refined manner.
  • the physical server may also write the memory address range of the operating system memory area in the physical memory and the memory address range of the business instance memory area in the physical memory into the memory management unit, so as to realize the partition of memory.
  • the physical server may also notify the memory management unit to modify the recorded memory address range of the operating system memory area in the physical memory and the memory address range of the operating system memory area in the physical memory, so that the operating system The free memory space in the memory area is added to the service instance memory area, or the free memory space in the service instance memory area is added to the operating system memory area. In this way, the function of adjusting the range of the operating system memory area and the service instance memory area can be realized.
  • the physical server generates a page data structure of the operating system memory area during the initialization of the operating system, and the page data structure includes attribute information of memory pages in the operating system memory area.
  • the physical server does not generate the page data structure of the memory area of the service instance. In this way, the initialization speed of the operating system can be accelerated.
  • the physical server traverses the memory management information table in the process of initializing the operating system, determines the memory in the operating system memory area, and establishes a page data structure corresponding to the memory in the operating system memory area.
  • the operating system memory area stores page data structures.
  • the memory management information table is E820. In this way, compatibility can be improved.
  • the memory management information table includes: a tag value corresponding to the memory of the memory area of the service instance.
  • the tag value corresponding to the memory of the business instance memory area is used to indicate that the memory belongs to the memory of the business instance memory area. In this way, it can be more compatible with the existing technology.
  • the cloud service instance includes: a virtual machine or a secure container.
  • a physical server in a second aspect, includes modules for executing the first aspect or any possible implementation manner of the first aspect.
  • a physical server in a third aspect, includes a processor and a memory.
  • the memory is used to store computer-executable instructions, and the processor executes the computer-executable instructions in the memory to perform the operation steps of the method in any possible implementation manner of the first aspect.
  • the present application provides a computer-readable storage medium.
  • the computer-readable storage medium stores instructions that, when executed on a computer, cause the computer to execute the methods of the above aspects.
  • the present application provides a computer program product comprising instructions which, when run on a computer, cause the computer to perform the methods of the above aspects.
  • the present application may further combine to provide more implementation manners.
  • FIG. 1 is a schematic diagram of a system architecture according to an embodiment of the present application.
  • Fig. 2 is the structural representation of a server in Fig. 1;
  • FIG. 3 is a schematic diagram of a correspondence between a virtual address and a physical address provided by an embodiment of the present application
  • FIG. 4 is a schematic flowchart of a memory management method for a physical server provided by an embodiment of the present application
  • FIG. 5 is a schematic structural diagram of the physical memory in FIG. 2;
  • 6A is a schematic diagram of adjusting the memory in the business instance memory area in FIG. 3 to the memory in the operating system memory area;
  • FIG. 6B is a schematic diagram of adjusting the memory in the operating system memory area in FIG. 3 to the memory in the service instance memory area.
  • FIG. 1 exemplarily shows a system architecture to which the embodiments of the present application are applicable.
  • the system may provide a cloud management platform function.
  • Cloud management platform function Provide access interface (such as interface or Application Programming Interface (API)), tenant can operate client remote access access interface to register cloud account and password in cloud management platform, and log in cloud management platform , after the cloud management platform successfully authenticates the cloud account and password, the tenant can further select and purchase virtual machines of specific specifications (processor, memory, disk) on the cloud management platform. After the payment is successful, the cloud management platform provides the purchased virtual machine The remote login account and password of the virtual machine, the client can remotely log in to the virtual machine, and install and run the tenant's application in the virtual machine.
  • API Application Programming Interface
  • the logical function division of the cloud management platform user console, computing management service, network management service, storage management service, authentication service, and image management service.
  • the user console provides interfaces or APIs to interact with tenants
  • the computing management service is used to manage servers running virtual machines and containers and bare metal servers
  • the network management service is used to manage network services (such as gateways, firewalls, etc.)
  • the storage management service is used to manage Manage storage services (such as data bucket services)
  • authentication services are used to manage tenant account passwords
  • image management services are used to manage virtual machine images.
  • Cloud management platform client function Receive control plane commands sent by the cloud management platform, create on the server according to the control plane control commands, and perform full life cycle management of virtual machines.
  • tenants can create, manage, log in and operate virtual machines in the cloud data center through the cloud management platform.
  • a virtual machine refers to a complete computer system with complete hardware system functions simulated by software and running in a completely isolated environment. Anything that can be done in a server can be done in a virtual machine.
  • a virtual machine When creating a virtual machine in a server, you need to use part of the hard disk and memory capacity of the physical machine as the hard disk and memory capacity of the virtual machine.
  • Each virtual machine has an independent hard disk and operating system. virtual machine to operate.
  • Virtual machines can also be called cloud servers (Elastic Compute Service, ECS), elastic instances (different cloud service providers provide different names).
  • ECS Elastic Compute Service
  • FIG. 2 exemplarily shows a schematic structural diagram of a server in FIG. 1 .
  • the server may also be referred to as a physical server.
  • the server 1 in FIG. 1 is used as an example for introduction. It should be noted that the server shown in FIG. 2 may be any server in the system architecture shown in FIG. 1 , and is not limited to server 1 .
  • the server includes a hardware layer and a software layer
  • the hardware layer is a conventional configuration of the server
  • the peripheral component interconnect (PCI) device may be, for example, a network card, a graphics processing unit (graphics processing unit, GPU), offload cards, and other devices that can be plugged into the server's PCI/PCIe slots.
  • PCI peripheral component interconnect
  • the server may also include a processor and memory.
  • the memory in the server in this embodiment of the present application may also be referred to as physical memory or storage.
  • the server may further include a bus system, wherein the processor and the physical memory may be connected through the bus system.
  • the processor can be a chip with signal processing capabilities.
  • the processor may be a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on chip (SoC), or a It is a central processing unit (CPU), a network processor (NP), a digital signal processing circuit (DSP), or a microcontroller (microcontroller unit). , MCU), it can also be a programmable logic device (PLD) or other integrated chips.
  • FPGA field programmable gate array
  • ASIC application specific integrated circuit
  • SoC system on chip
  • MCU microcontroller unit
  • MCU programmable logic device
  • PLD programmable logic device
  • each step of the method in the embodiments of the present application may be completed by an integrated logic circuit of hardware in a processor or an instruction in the form of software.
  • the steps of the method disclosed in conjunction with the embodiments of the present application may be directly embodied as executed by a hardware processor, or executed by a combination of hardware and software modules in the processor.
  • the software modules may be located in random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, registers and other storage media mature in the art.
  • the storage medium is located in the physical memory, and the processor reads the information in the physical memory, and completes the steps of the method in the embodiment of the present application in combination with its hardware.
  • the physical memory in this embodiment of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memory.
  • the non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically programmable Erase programmable read-only memory (electrically EPROM, EEPROM) or flash memory.
  • Volatile memory may be random access memory (RAM), which acts as an external cache.
  • RAM random access memory
  • DRAM dynamic random access memory
  • SDRAM synchronous DRAM
  • SDRAM double data rate synchronous dynamic random access memory
  • ESDRAM enhanced synchronous dynamic random access memory
  • SLDRAM synchronous link dynamic random access memory
  • direct rambus RAM direct rambus RAM
  • the physical memory may include two memory areas, which are an operating system memory area and a service instance memory area, respectively.
  • the operating system runs in the operating system memory area, and allocates memory for cloud service instances in the service instance memory area.
  • a memory management unit may also be set in the physical server.
  • the memory management unit may be a memory management unit (memory management unit, MMU) or the like.
  • MMU memory management unit
  • the memory management unit can have other names, such as memory manager, memory management module, and so on.
  • a memory management unit refers to a module, unit, or component, etc., used to manage memory. The following describes the memory management unit:
  • One or more process programs are executed in the operating system, and the address issued by the program is the address of the virtual memory which is not related to the address of the physical memory. That is, the memory address seen in the program is the address of the virtual memory. For example, the virtual memory range is 0-4GB.
  • the program reads and writes memory, it will be mapped to the actual physical memory. This mapping is called translation.
  • This translation work can be done by Memory management unit (such as MMU) to complete.
  • the memory management unit can receive the address of the virtual memory page sent by the processor, and find out the address corresponding to the address of the virtual memory page according to the mapping relationship between the address of the virtual memory page recorded in the page table and the address of the physical memory page.
  • the address of the physical memory page, and the address of the found physical memory page is sent to the processor, and the processor reads or writes from the address corresponding to the offset in the physical memory page according to the address and offset of the physical memory page. related data.
  • the software layer includes an operating system installed and running on the server (the operating system relative to the virtual machine can be called the host operating system), and the host operating system is provided with a virtual machine manager (virtual machine manager, VMM) (also known as Hypervisor, also known as Virtual Machine Monitor (VMM)).
  • VMM virtual machine manager
  • VMM also known as Hypervisor, also known as Virtual Machine Monitor (VMM)
  • VMM virtual machine manager
  • the role of the virtual machine manager is to realize the computing virtualization, network virtualization and storage virtualization of the virtual machine, and is responsible for managing the virtual machine.
  • the virtual machine manager can virtualize a set of virtual hardware systems independent of real hardware for each virtual machine, such as virtual display, virtual hard disk, virtual processor (Virtual CPU, VCPU), virtual memory, virtual network card, etc.
  • Applications may be run in the virtual machine based on virtual hardware and a virtual machine operating system, wherein the applications are applications installed and configured by the tenant.
  • the virtual machine monitor may run in the operating system memory area mentioned in the embodiment of the present application, or may run in the memory area of the service instance, which is not limited in the embodiment of the present application.
  • Computing virtualization refers to providing part of the processor and memory of the server to the virtual machine
  • network virtualization refers to providing some functions of the network card (such as bandwidth) to the virtual machine
  • storage virtualization refers to providing part of the disk to the virtual machine.
  • the virtual machine manager can also achieve logical isolation between different virtual machines and manage virtual machines, such as creating virtual machines, emulating virtual hardware for virtual machines according to the hardware layer (hardware emulation function), deleting virtual machines, forwarding and/or processing running Network packets between all virtual machines on the server (such as virtual machine 1 and virtual machine 2) or forward network packets between virtual machines on the server and external networks (virtual switching function), processing virtual machines Generated I/O, etc.
  • the running environments (such as virtual machine applications, operating systems, and virtual hardware) in different virtual machines are completely isolated.
  • network packets need to be forwarded through a virtual manager.
  • Tenants can log in to the virtual machine remotely, and operate the virtual machine to install, set, and uninstall applications in the virtual machine operating system environment.
  • two modules may also be set in the virtual machine manager, a module for dividing a memory area and a module for allocating a memory area.
  • the memory area division module can be used to divide the physical memory into the operating system memory area and the service instance memory area.
  • the memory area allocation module can be used to allocate memory for virtual machines.
  • the memory area partitioning module may also be referred to as a random access memory (RAM) partition module, and the memory area allocation module may also be referred to as an instance RAM allocator (instance RAM allocator) module.
  • RAM random access memory
  • instance RAM allocator instance RAM allocator
  • the division of the units of the above apparatus is only a division of logical functions, and may be fully or partially integrated into a physical entity in actual implementation, or may be physically separated.
  • the memory area allocation module and the memory area division module may be implemented by the processor of FIG. 1 by running program instructions stored in the memory area of the operating system.
  • FIG. 2 only takes two virtual machines as an example for illustration. In practical applications, there is no limit to the number of virtual machines virtualized by one server.
  • memory virtualization technology is to provide virtual machines with a continuous physical memory space starting from address 0, and to effectively isolate and schedule memory resources between virtual machines.
  • Memory virtualization technology mainly involves guest virtual address (Guest Virtual Address, GVA)—> guest physical address (Guest Physical Address, GPA)—> host virtual address (Host Virtual Address, HVA)—> host physical address ( Host Physical Address, HPA) conversion.
  • the virtual machine uses the guest physical address (Guest Physical Address, GPA) to represent the virtual machine
  • GPA Guest Physical Address
  • GVA is the address formed by the virtual machine's operating system mapping GPA.
  • the virtual machine's operating system provides GVA to the process or application software set on the virtual machine's operating system, and the virtual machine's operating system records the GVA to GPA.
  • the mapping relationship, the conversion of GVA to GPA is implemented by the page table of the operating system of the virtual machine.
  • HPA is the actual physical memory address
  • HVA is the address formed by the operating system of the host machine mapping the HPA
  • the operating system of the host machine provides the HVA to the process (such as a virtual machine) on the operating system
  • the operating system of the host machine uses the HVA. Record the mapping relationship between HVA and HPA.
  • the conversion from HVA to HPA is implemented by the page table of the operating system of the host.
  • FIG. 3 exemplarily shows a schematic diagram of a correspondence relationship between a virtual address and a physical address provided by an embodiment of the present application.
  • virtual machine 1 and virtual machine 2 are set in the same server (hereinafter referred to as the host machine), and the virtual machine manager of the host machine sets the GPA address range of virtual machine 1 to 0-5GB, which corresponds to The HPA address range on physical memory is 1.5GB-4.5GB and 6.5GB-8.5GB.
  • the virtual machine manager of the host machine sets the GPA address range of the virtual machine 2 to 0-4GB, which corresponds to the HPA address ranges of 9GB-11GB and 13GB-15GB on the physical memory.
  • virtual machine 1 exclusively uses the GPA address range of 0-5GB
  • virtual machine 2 exclusively uses the GPA address range of 0-4GB.
  • Both the 0-5GB GPA address range and the 0-4GB GPA address range can correspond to different HPA address ranges on the physical memory, so as to achieve virtual machine memory isolation.
  • the GPA address range is related to the virtual machine specifications described above.
  • the tenant can set the virtual machine 1 with a memory size of 5G in the virtual machine specification in the cloud management platform.
  • the virtual machine manager is notified by the cloud management platform that it needs to Create virtual machine 1 with a GPA of 0-5G.
  • FIG. 4 exemplarily shows a schematic flowchart of a memory management method for a physical server provided by an embodiment of the present application.
  • the method may be executed by the virtual machine manager in the host operating system in the above-mentioned FIG. 2 .
  • the method may be executed by the memory area division module and the memory area allocation module in the virtual machine manager in FIG. 2 .
  • the method may be executed by the processor shown in FIG. 2, and the related functions of the memory area division module and the memory area allocation module may be implemented by the processor executing program instructions stored in the memory area of the operating system.
  • the method can include:
  • the memory area division module is configured to set non-overlapping operating system memory areas and service instance memory areas in the physical memory of the physical server, where the operating system of the physical server runs in the operating system memory area.
  • S201 may be executed by the aforementioned processor shown in FIG. 2 , and the relevant functions of the memory area division module may be implemented by the processor executing the program instructions stored in the memory area of the operating system.
  • the memory area allocation module is configured to set a memory address range for the cloud service instance in the service instance memory area, and record the memory address range, where the cloud service instance runs in the memory address range after being started in the operating system.
  • S202 may be executed by the processor shown in FIG. 2, and the relevant functions of the memory area allocation module may be implemented by the processor executing the program instructions stored in the memory area of the operating system.
  • cloud service examples include, but are not limited to: virtual machines (virtual machines, VMs) and containers (containers).
  • the benefits brought by the page data structure can include: fragmentation It can realize advanced features such as memory exchange, merging of the same memory pages, and memory on demand (Populate on demand, POD), etc.), but in fact, since a piece of memory is allocated to a cloud business instance, how does the cloud business instance use it? For this part of memory, the host operating system of the physical server will no longer interfere, nor will the memory in this memory area be used for other purposes. Therefore, even if the physical memory is used for the physical memory area allocated to the cloud service instance Establishing a page data structure does not fully utilize the benefits of the page data structure.
  • the management of the service instance memory area in the embodiment of the present application abandons the management method through the page data structure according to the characteristics of the cloud computing service, thereby saving the page corresponding to the memory used for storing the memory of the cloud service instance
  • the memory of the data structure based on this scheme, the cloud service provider can provide as much physical memory of the physical server as possible to the tenants, so as to obtain greater benefits.
  • a page data structure of the operating system memory area can be generated, and the page data structure includes attribute information of the memory pages in the operating system memory area, such as physical memory and virtual memory in the operating system memory area.
  • the page data structure includes attribute information of the memory pages in the operating system memory area, such as physical memory and virtual memory in the operating system memory area.
  • the work of generating the page data structure is The amount is reduced, so the operating system initialization startup speed can be accelerated.
  • the memory area allocation module may allocate a cloud service instance identifier to the cloud service instance, apply for a free memory space in the memory area of the service instance, and use the address range of the applied memory space as the physical memory of the cloud service instance
  • the memory address range of the cloud service instance and the memory address range of the physical memory of the cloud service instance are recorded in the management information area of the service instance memory area.
  • the content can also be executed by the processor shown in FIG. 2, and the relevant functions of the memory area allocation module can be implemented by the processor executing the program instructions stored in the memory area of the operating system.
  • FIG. 5 exemplarily shows a schematic structural diagram of the physical memory in FIG. 2.
  • the physical memory includes an operating system memory area and a service instance memory area.
  • the memory area allocation module can perform memory management based on the management information area in the service instance memory area.
  • the memory area allocation module establishes a management information area in the service instance memory area, and the management information area can be stored in a part of the area demarcated in the service instance memory area.
  • FIG. 5 also schematically shows the physical memory area allocated by the memory area allocation module for cloud service instance 1 and the memory area allocated for cloud service instance 2 in the service instance memory area.
  • the service instance memory area may further include free space, such as free space 2 .
  • the memory area allocation module may record the mapping relationship between the identifier of cloud service instance 1 and the memory address range of the physical memory area of cloud service instance 1, and the identifier of cloud service instance 2 and the physical memory area of cloud service instance 2 in the management information area. The mapping relationship of the memory address range.
  • the operating system memory area can be used to run the operating system, memory management can be performed based on the page data structure in the operating system memory area, that is, by establishing a page data structure in the operating system memory area, the Management of operating system memory areas.
  • the page data structure may be stored in a portion of an area demarcated in the operating system memory area. In this way, the requirements of the operating environment of the operating system can be complied with.
  • the operating system memory area in FIG. 5 may also include free space, such as free space 1 .
  • a 4KB page in the operating system memory area corresponds to a 64B page data structure, and the page data structure may include the address of the virtual memory corresponding to the address of the physical memory of the 4KB page.
  • the service instance memory area can be managed through the management information area. For example, according to the information recorded in the management information area, you can know which memory in the business instance memory area is allocated to which cloud service instance, and also know which memory in the business instance memory area is in an idle state. In this way, the memory in the memory area of the service instance in the idle state can be allocated to other cloud service instances for use.
  • the memory address range corresponding to different cloud service instances in the service instance memory area can be distinguished by the service instance identifier, so that memory isolation can be achieved between different cloud service instances, and multiple cloud service instances can be run simultaneously in the service instance memory area.
  • the memory of multiple cloud service instances does not affect each other.
  • the memory space occupied by the management information area is smaller, so that more memory space can be saved for use by the cloud service instance.
  • the cloud service instance When the operating system is restarted, the contents stored in the operating system memory area will be cleared. Since the business instance memory area is not an area that can be used to run the operating system, as the operating system restarts, the business instance memory area will be cleared. content will not be cleared. That is, the data in the memory area of the service instance will not be affected. Therefore, after the operating system is upgraded and restarted, the cloud service instance will not be affected.
  • the cloud service can be quickly restored according to the information stored in the management information area of the memory area of the service instance. For instance, for the cloud service provider, the operating system can be upgraded at any time, and there is no need to worry about the data of the cloud service instance on the tenant side, so it is more convenient.
  • the memory area allocation module can set virtual memory for the cloud service instance, and the address range of the virtual memory does not exist in essence, only to make the cloud service instance think that it is running in the memory address range set in the operating system, Therefore, in the above S202, the memory area allocation module may set a memory address range for the cloud service instance in the service instance memory area, and write the memory address of the physical memory of the cloud service instance in the page table of the cloud service instance in the operating system memory area The address corresponding to the range.
  • the memory area allocation module can first record the memory address of the operating system memory area in the page table of the cloud service instance, and then modify the address in the page table of the cloud service instance so that the address points to the cloud service instance Memory in the business instance memory area.
  • the compatibility of the embodiments of the present application can be improved.
  • the cloud service instance when memory is allocated to a cloud service instance, the cloud service instance is allocated memory that can be used to run the memory area of the operating system.
  • the memory area is not partitioned in the prior art, and the memory range of the physical server that the operating system can run is the same as the memory range that can be allocated to the cloud service instance.
  • the memory of the memory area used for running the operating system can still be allocated to the cloud service instance, and then the address recorded in the page table of the cloud service instance can be modified.
  • the memory area allocation module may first record an invalid memory address in the page table of the cloud service instance, and then modify the address so that the address points to the memory of the cloud service instance in the service instance memory area.
  • the memory address range of the memory of the cloud service instance in the service instance memory area is recorded in the page table of the cloud service instance. In this way, the steps of modifying the address recorded in the page table of the cloud service instance can be reduced, and the solution can be simplified.
  • the memory area allocation module may record the mapping relationship between the memory address range of the virtual memory of the cloud service instance and the memory address range of the physical memory of the cloud service instance in the page table.
  • the mapping relationship is, for example, the mapping relationship between GVA and HPA in the above-mentioned FIG. 3 .
  • the cloud service instance can run in the physical memory allocated for the cloud service instance according to the mapping relationship. Specifically, after the cloud service instance is started, the processor running the cloud service instance sends the virtual memory address of the cloud service instance and the identifier of the cloud service instance to the memory management unit. According to the mapping relationship in the page table, the memory management unit can The memory address range of the virtual memory that identifies the corresponding cloud service instance is converted into the memory range of the physical memory, and the processor is notified to access the memory range of the physical memory corresponding to the cloud service instance.
  • a cloud service instance is used as a virtual machine for introduction below.
  • the program of the virtual machine needs to be installed in the operating system, and after the program of the virtual machine is installed, the operating system can assign a process number to the virtual machine, and can also record the memory address range of the virtual memory of the virtual machine in the page table of the cloud service instance.
  • the mapping relationship with the memory address range of the virtual machine's physical memory It should be noted that the page table of the cloud service instance refers to a page table used to record the mapping relationship between the address of the virtual memory and the address of the physical memory of the cloud service instance.
  • the processor needs to run the process corresponding to the virtual machine
  • the processor needs to send the address of the virtual memory corresponding to the process to the memory management unit according to the process ID of the virtual machine, and the memory management unit
  • the address of the physical memory corresponding to the address of the virtual memory can be obtained.
  • the memory management unit sends the found address of the physical memory to the processor, and the processor reads or writes relevant data from the address of the physical memory, so that the processor runs the program of the virtual machine stored in the physical memory the goal of.
  • the processor runs the program of the virtual machine, the virtual machine can be started.
  • the page table in the embodiment of the present application is different from the above-mentioned page data structure, and the page table includes the mapping relationship between the memory address range of the virtual memory of the cloud service instance and the memory address range of the physical memory of the virtual machine. , when the processor needs to access the physical memory of the cloud service instance, it can access the physical memory of the cloud service instance by querying the page table through the memory management unit.
  • the page data structure is used to store the attribute information of the memory of the operating system memory area.
  • a 64B page data structure corresponding to a 4KB page may include the address of the virtual memory corresponding to the address of the physical memory of the 4KB page.
  • the processor can search according to the information stored in the page data structure.
  • the 64B data structure corresponding to the 4KB page can also store other attribute information of the 4KB page, such as: information identifying which NUMA node the 4KB page belongs to, the number of times the 4KB page is referenced in the kernel, and how many times the 4KB page is simultaneously used process sharing and so on.
  • the page data structure can be stored in the memory area of the operating system, and the page table of the cloud service instance can be stored in the memory area of the operating system or the memory area of the service instance.
  • the page table of the cloud service instance When the page table of the cloud service instance is stored in the operating system memory area, when the operating system is restarted, the page table of the cloud service instance will be cleared. Since the information in the memory area of the service instance will not be cleared, after the operating system is restarted, the memory area allocation module can rewrite the address corresponding to the memory address range of the physical memory of the cloud service instance recorded in the memory area of the service instance to the cloud. in the page table of the business instance. Specifically, the memory area allocation module can quickly rebuild the page table of the cloud service instance based on the content recorded in the management information area, thereby speeding up the restarting speed of the operating system.
  • the memory area dividing module in S201 may allocate the physical memory of the physical server to the operating system memory area and the service instance memory area in a preset ratio. For example, according to the ratio of 3.125%, each 4G physical memory is divided into 128M as the operating system memory area, and 3968M as the business instance memory area.
  • multiple preset ratios may be set, and the memory of physical servers of different specifications may correspond to one of the preset ratios.
  • the memory size required for the operation of the operating system may be determined according to experience, and then the preset ratio may be determined according to the total memory size of the physical server. In this way, the memory space of the memory area of the service instance can be increased as much as possible on the premise of meeting the memory requirements of the operating system, thereby increasing the number of cloud service instances.
  • the memory area division module may specifically write the memory address range of the operating system memory area in the physical memory and the memory address range of the business instance memory area in the physical memory into the memory management unit. Specifically, the memory area division module can notify the memory management unit of the memory address range of the operating system memory area in the physical memory and the memory address range of the business instance memory area in the physical memory, and the memory management unit records the operating system in the memory management information table. The memory address range of the memory area in the physical memory and the memory address range of the business instance memory area in the physical memory.
  • the memory management unit may include a memory management information table. For example, in the process of initializing the operating system (for example, when the physical server is powered on, the operating system is initialized), traverse the memory management information table, determine the memory of the operating system memory area, and establish the memory corresponding to the operating system memory area. Page data structure, which stores the page data structure in the operating system memory area.
  • a tag value can be set for a segment of memory, and the tag value can indicate whether the segment of memory belongs to the operating system memory area.
  • the tag value can also be used to indicate whether the segment of memory belongs to the business instance memory area.
  • the memory management unit may determine the memory address range belonging to the operating system memory area and the memory address range belonging to the service instance memory area according to the tag value corresponding to the memory in the memory management information table.
  • the memory management information table may specifically be an E820 table.
  • the tag value corresponding to the memory address range of the segment of memory can be set to disable.
  • the tag value corresponding to the memory address range of this segment of memory can be set as a new tag value, specifically, it can be distinguished from the existing tag value in the E820 table.
  • the tag value of for example, the tag value can be defined as "VM".
  • the memory area division module can dynamically adjust the operating system memory area and the service instance memory area: that is, the memory area division module can convert the memory in the operating system memory area into the memory in the service instance memory area, and the memory area division The module can convert the memory in the business instance memory area into the memory in the operating system memory area.
  • the memory area division module can notify the memory management unit to modify the memory address range of the operating system memory area in the physical memory and the memory address range of the operating system memory area in the physical memory, so as to make the memory area of the operating system free Add the memory space of the service instance to the memory area of the service instance, or add the free memory space in the memory area of the service instance to the memory area of the operating system.
  • the step of notifying the memory management unit may be performed by the aforementioned processor shown in FIG. 2 , and the relevant functions of the memory area division module may be implemented by the processor executing program instructions stored in the memory area of the operating system.
  • the memory of the unused service instance memory area can be adjusted to the operating system memory area. It is worth noting that after this part of the memory is adjusted to the operating system memory area, a page data structure needs to be established for this part of the memory, and memory is allocated from the operating system memory area to store the page data structure.
  • FIG. 6A exemplarily shows a schematic diagram of adjusting the memory in the memory area of the business instance in FIG. 5 to the memory in the memory area of the operating system.
  • the free space 2 in the memory area of the business instance can be converted into the operating system memory area.
  • the page data structure created for the free space 2 needs to be stored in the operating system memory area.
  • the unused operating system memory area memory can be adjusted to the business instance memory area. After being adjusted to operate the business instance memory area, the memory occupied by the page data structure corresponding to this part of the memory is released. .
  • FIG. 6B exemplarily shows a schematic diagram of adjusting the memory space in the operating system memory area in FIG. 5 to the memory of the service instance memory area.
  • the free space 1 can be converted from the operating system memory area to the service instance memory area of memory.
  • the memory space occupied by the page data structure corresponding to the free space 1 in the operating system memory area can be released.
  • the memory area allocation module may record the usage status of the memory of the business instance memory area in the management information area, and the usage status of the memory may include an occupied status and an idle status.
  • a memory block is marked as occupied, it means that the memory block is allocated for use by the cloud service instance.
  • the memory block is marked as free, it means that the memory block is not currently allocated to the cloud service instance.
  • the memory block can be allocated to the cloud service instance.
  • the usage status of the memory can be recorded by means of bits (ie, bitmap).
  • the memory area of a business instance is 512GB, and one bit is used to represent a memory block with a size of 1GB (it can also be a memory block of other size, such as a 4M memory block).
  • the bit position corresponding to the memory block can be set to 1
  • the bit position corresponding to the memory block can be set to 0. It can be seen that in this method, a certain number of bits can be used to manage the memory of the business memory area. Compared with the method of building a page data structure to manage the memory, the storage space occupied by the management information area is smaller, so it can be further Save more storage space.
  • the usage status of the memory block may be recorded by recording the memory address range. For example, if "00000000aafe8000-00000000aaffd000" is allocated for use by cloud service instance 1, the information that "00000000aafe8000-00000000aaffd000" is occupied can be recorded in the management information area. It can be seen that in this method, the memory of the business memory area can be managed by recording the starting address of the memory block and the usage status of the memory block. Compared with the method of establishing a page data structure to manage the memory, the management information area occupies more The storage space is smaller, so it can further save more storage space.
  • the memory area allocation module can record the usage status of this part of the memory area in the management information area. For example, in FIG. 6B above, when the memory area division module adjusts the free space 1 to the service instance memory area, the memory area allocation module can record information such as the free space 1 is currently in an idle state in the management information area.
  • the management information area also includes NUMA affinity information of the cloud service instance in the memory area of the service instance memory area.
  • the NUMA affinity information may be information of a NUMA node managed by the memory, such as information of a processing core associated with the NUMA node, information of a NUMA node number to which the memory belongs, and the like.
  • the memory area allocation module may allocate memory for the cloud service instance, and the name of the method for allocating memory may be called in a variety of ways, for example, it may be called a class partner algorithm. The name is not qualified.
  • the method of allocating memory is described below through an example: For example, the memory area of a business instance is 512 GB, and cloud business instance 1 needs 100 GB of memory, so the 100 GB memory block is allocated to the cloud business instance 1. After that, when cloud service instance 2 requests a 20 GB memory block, 20 GB of memory is allocated to cloud service instance 2 from the memory in the idle state of the memory area of the service instance. After the cloud service instance 1 no longer needs memory, you can release the 100 GB memory block occupied by the cloud service instance 1, and update the usage status of the 100 GB memory block from the occupied state to the idle state in the management information area.
  • the present application also provides a computer program product, the computer program product includes: computer program code or instructions, when the computer program code or instructions are run on a computer, the computer is made to execute FIG. 4 Relevant method steps involved in S201 and S202.
  • the present application further provides a computer-readable storage medium, where the computer-readable medium stores program codes, and when the program codes are executed on a computer, the computer is made to execute S201 and S201 in FIG. 4 . Relevant method steps involved in S202.
  • the present application further provides a chip system, where the chip system may include a processor.
  • the processor is coupled to the memory and can be used to execute the relevant method steps involved in S201 and S202 in Fig. 4 .
  • the chip system further includes a memory.
  • Memory used to store computer programs (also called code, or instructions).
  • the processor is used to call and run the computer program from the memory, so that the device with the chip system installed performs the relevant method steps involved in S201 and S202 in FIG. 4 .
  • At least one involved in the embodiments of the present application includes one or more; wherein, multiple refers to greater than or equal to two.
  • words such as “first” and “second” are only used for the purpose of distinguishing the description objects, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating or implying order.
  • a computer program product includes one or more computer instructions.
  • the computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable device.
  • Computer instructions may be stored on or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website site, computer, server, or data center over a wire (e.g.
  • coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless means to transmit to another website site, computer, server or data center.
  • a computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, a data center, or the like that includes an integration of one or more available media.
  • Useful media may be magnetic media (eg, floppy disk, hard disk, magnetic tape), optical media (eg, high-density digital video disc (DVD)), or semiconductor media (eg, solid state disc (SSD)) )Wait.
  • the network equipment in the above apparatus embodiments corresponds to the terminal equipment and the network equipment or terminal equipment in the method embodiments, and corresponding steps are performed by corresponding modules or units, for example, the communication unit (transceiver) performs the receiving or sending in the method embodiments.
  • the steps other than sending and receiving can be performed by the processing unit (processor).
  • processor For functions of specific units, reference may be made to corresponding method embodiments.
  • the number of processors may be one or more.
  • a component may be, but is not limited to, a process running on a processor, a processor, an object, an executable, a thread of execution, a program, and/or a computer.
  • an application running on a computing device and the computing device may be components.
  • One or more components may reside within a process and/or thread of execution, and a component may be localized on one computer and/or distributed between two or more computers.
  • these components can execute from various computer readable media having various data structures stored thereon.
  • a component may, for example, be based on a signal having one or more data packets (eg, data from two components interacting with another component between a local system, a distributed system, and/or a network, such as the Internet interacting with other systems via signals) Communicate through local and/or remote processes.
  • data packets eg, data from two components interacting with another component between a local system, a distributed system, and/or a network, such as the Internet interacting with other systems via signals
  • the disclosed system, apparatus and method may be implemented in other manners.
  • the apparatus embodiments described above are only illustrative.
  • the division of units is only a logical function division.
  • there may be other division methods for example, multiple units or components may be combined or integrated. to another system, or some features can be ignored, or not implemented.
  • the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.
  • Units described as separate components may or may not be physically separated, and components shown as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
  • the functions, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer-readable storage medium.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Memory System Of A Hierarchy Structure (AREA)
  • Stored Programmes (AREA)

Abstract

La présente demande concerne un procédé et un appareil pour gérer une mémoire d'un serveur physique pour exécuter des instances de service en nuage. Une zone de mémoire de système d'exploitation et une zone de mémoire d'instance de service qui ne se chevauchent pas mutuellement sont prévues dans une mémoire physique du serveur physique. Le système d'exploitation du serveur physique fonctionne dans la zone de mémoire du système d'exploitation. Une plage d'adresse mémoire est définie pour des instances de service en nuage dans la zone de mémoire d'instance de service, et la plage d'adresse mémoire est enregistrée, les instances de service en nuage étant exécutées dans la plage d'adresse mémoire après avoir été démarrées dans le système d'exploitation. Comme des structures de données de page sont générées pour la mémoire dans la zone de mémoire du système d'exploitation, mais qu'il n'est pas nécessaire de générer des structures de données de page pour la zone de mémoire d'instance de service, le nombre de structures de données de page générées est réduit, et par conséquent, l'espace pour stocker les structures de données de page est également réduit, et le but de fournir la mémoire physique pour des instances de service en nuage autant que possible peut être atteint.
PCT/CN2022/088044 2021-04-21 2022-04-21 Procédé et appareil pour gérer une mémoire d'un serveur physique pour exécuter des instances de service en nuage WO2022222977A1 (fr)

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
CN202110430939 2021-04-21
CN202110430939.1 2021-04-21
CN202110700121.7 2021-06-23
CN202110700121.7A CN115221073A (zh) 2021-04-21 2021-06-23 用于运行云业务实例的物理服务器的内存管理方法和装置

Publications (1)

Publication Number Publication Date
WO2022222977A1 true WO2022222977A1 (fr) 2022-10-27

Family

ID=83606945

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/088044 WO2022222977A1 (fr) 2021-04-21 2022-04-21 Procédé et appareil pour gérer une mémoire d'un serveur physique pour exécuter des instances de service en nuage

Country Status (2)

Country Link
CN (1) CN115221073A (fr)
WO (1) WO2022222977A1 (fr)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080005522A1 (en) * 2003-08-07 2008-01-03 Siemens Corporate Research, Inc. Advanced memory management architecture for large data volumes
CN103608792A (zh) * 2013-05-28 2014-02-26 华为技术有限公司 支持多核架构下资源隔离的方法及系统
CN107977264A (zh) * 2016-10-24 2018-05-01 阿里巴巴集团控股有限公司 一种虚拟机内存资源的调度方法以及装置
CN109343956A (zh) * 2018-09-20 2019-02-15 阿里巴巴集团控股有限公司 一种操作系统配置方法及装置

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080005522A1 (en) * 2003-08-07 2008-01-03 Siemens Corporate Research, Inc. Advanced memory management architecture for large data volumes
CN103608792A (zh) * 2013-05-28 2014-02-26 华为技术有限公司 支持多核架构下资源隔离的方法及系统
CN107977264A (zh) * 2016-10-24 2018-05-01 阿里巴巴集团控股有限公司 一种虚拟机内存资源的调度方法以及装置
CN109343956A (zh) * 2018-09-20 2019-02-15 阿里巴巴集团控股有限公司 一种操作系统配置方法及装置

Also Published As

Publication number Publication date
CN115221073A (zh) 2022-10-21

Similar Documents

Publication Publication Date Title
US20220179701A1 (en) System and method for dynamic data protection architecture
US20190155548A1 (en) Computer system and storage access apparatus
US9612966B2 (en) Systems, methods and apparatus for a virtual machine cache
WO2018120986A1 (fr) Procédé de transmission de paquet, et hôte physique
JP4942966B2 (ja) パーティションバス
US20180336158A1 (en) Systems and methods for data transfer with coherent and non-coherent bus topologies and attached external memory
US20110302577A1 (en) Virtual machine migration techniques
CA2734069A1 (fr) Fourniture de ressources virtuelles en utilisant une resolution de noms
US10296369B2 (en) Systems and methods for protocol termination in a host system driver in a virtualized software defined storage architecture
US9542108B2 (en) Efficient migration of virtual storage devices to a remote node using snapshots
US9436386B2 (en) Shared reference counters among a plurality of virtual storage devices
US10235195B2 (en) Systems and methods for discovering private devices coupled to a hardware accelerator
US11922072B2 (en) System supporting virtualization of SR-IOV capable devices
US20180335956A1 (en) Systems and methods for reducing data copies associated with input/output communications in a virtualized storage environment
US20230051825A1 (en) System supporting virtualization of sr-iov capable devices
CN111367472A (zh) 虚拟化方法和装置
US11880301B2 (en) Enabling efficient guest access to peripheral component interconnect express (PCIe) configuration space
US11836356B2 (en) Snapshots with smart network interface controller
WO2022222977A1 (fr) Procédé et appareil pour gérer une mémoire d'un serveur physique pour exécuter des instances de service en nuage
US10228859B2 (en) Efficiency in active memory sharing
TWI811730B (zh) 用於限制組合式系統中資料可存取性之方法、系統及電腦可讀取媒體
US20220358049A1 (en) Memory access handling for peripheral component interconnect devices
US11687280B2 (en) Method and system for efficient servicing of storage access requests
US12013787B2 (en) Dual personality memory for autonomous multi-tenant cloud environment
WO2022068753A1 (fr) Système de serveur, et procédé et appareil d'installation de conteneur

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

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 22791083

Country of ref document: EP

Kind code of ref document: A1