Data refreshing method, device, medium and electronic device for cloud service

Obtain the target update range through KVM, and only the TLB table entries that need to be refreshed for the target virtual processor are refreshed, solving the problem of memory access performance degradation caused by frequent preemption or scheduling of the virtual processor, and improving the stability and operation efficiency of cloud services.

CN117271065BActive Publication Date: 2025-08-19BEIJING VOLCANO ENGINE TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311436277.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-10-31
Publication Date
2025-08-19
Estimated Expiration
2043-10-31

AI Technical Summary

Technical Problem

In cloud service scenarios, memory access performance degradation caused by frequent preemption or scheduling of virtual processors, affecting stability and operational efficiency.

Method used

Obtain the target update range through KVM, and only the TLB table entries that need to be refreshed by the target virtual processor are refreshed, retaining unnecessary refreshed TLB table entries, and increasing the hit rate of the TLB table entries.

Benefits of technology

Improves memory access performance and improves stability and operation efficiency in cloud service scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117271065B_ABST
    Figure CN117271065B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a data refresh method, device, medium and electronic device for cloud services. The method comprises: when an operating system of a virtual machine initiates a refresh instruction for a virtual processor, prohibiting a refresh operation on an address translation lookaside buffer (TLB) of a target virtual processor within the operating system of the virtual machine, wherein the target virtual processor is a virtual processor currently being preempted in the operating system of the virtual machine; when the target virtual processor is rescheduled, obtaining a target update range corresponding to the target virtual processor through a kernel virtual machine (KVM), the target update range being used to indicate TLB table entries that need to be refreshed for the target virtual processor; performing a refresh operation on the TLB of the target virtual processor according to the target update range through the KVM, refreshing the TLB table entries of the target virtual processor based on the target update range by the KVM, retaining TLB table entries that do not need to be refreshed, thereby improving the hit rate of the TLB table entries and improving memory access performance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a data refresh method, device, medium, and electronic device for cloud services. Background Art

[0002] The TLB (Translation Lookaside Buffer) can also be referred to as the "fast table". When the processor wants to access a virtual address / linear address, it will first search the TLB based on the virtual address. If there is no corresponding entry in the table, it is called a TLB miss, and the corresponding physical address must be calculated by accessing the page table in the slow RAM (Random Access Memory). At the same time, the physical address is stored in a TLB entry. Subsequent accesses to the same linear address can directly obtain the physical address from the TLB entry, which is called a TLB hit.

[0003] In related technologies, when situations such as process switching and kernel page table changes occur, the TLB needs to be refreshed. Summary of the Invention

[0004] This summary is provided to briefly introduce concepts that will be described in detail in the detailed description below. This summary is not intended to identify key features or essential features of the claimed technical solution, nor is it intended to limit the scope of the claimed technical solution.

[0005] In a first aspect, the present disclosure provides a data refresh method for a cloud service, comprising:

[0006] When the operating system of the virtual machine initiates a refresh instruction for a virtual processor, prohibiting the refresh operation on the TLB of a target virtual processor in the operating system of the virtual machine, wherein the target virtual processor is a virtual processor currently being preempted in the operating system of the virtual machine;

[0007] When the target virtual processor is rescheduled, obtaining a target update range corresponding to the target virtual processor through KVM, where the target update range is used to indicate TLB entries that need to be refreshed for the target virtual processor;

[0008] A refresh operation is performed on the TLB of the target virtual processor according to the target update range through the KVM.

[0009] In a second aspect, the present disclosure provides a data refresh device for cloud services, comprising:

[0010] a prohibition module, configured to prohibit, when the operating system of the virtual machine initiates a refresh instruction for the virtual processor, from performing a refresh operation on the TLB of a target virtual processor within the operating system of the virtual machine, wherein the target virtual processor is a virtual processor currently being preempted in the operating system of the virtual machine;

[0011] A first acquisition module is configured to acquire, through KVM, a target update range corresponding to the target virtual processor when the target virtual processor is rescheduled, the target update range being used to indicate TLB entries that need to be refreshed for the target virtual processor;

[0012] A first refresh module is configured to perform a refresh operation on the TLB of the target virtual processor according to the target update range through the KVM.

[0013] In a third aspect, the present disclosure provides a computer-readable medium having a computer program stored thereon, which, when executed by a processing device, implements the steps of the data refresh method for cloud services described in the first aspect.

[0014] In a fourth aspect, the present disclosure provides an electronic device, comprising:

[0015] a storage device having a computer program stored thereon;

[0016] A processing device is used to execute the computer program in the storage device to implement the steps of the data refresh method for cloud services described in the first aspect.

[0017] Through the above technical solution, in scenarios where virtual processors are frequently preempted or scheduled, KVM (Kernel-based Virtual Machine) refreshes the TLB table entries of the target virtual processor based on the target update range, retaining TLB table entries that do not need to be refreshed, thereby improving the hit rate of TLB table entries and memory access performance, which is conducive to improving stability and operating efficiency in cloud service scenarios, etc.

[0018] Other features and advantages of the present disclosure will be described in detail in the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] The above and other features, advantages and aspects of the various embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and that the originals and elements are not necessarily drawn to scale. In the drawings:

[0020] Figure 1The figure is a flowchart of a data refresh method for cloud services according to an exemplary embodiment of the present disclosure.

[0021] Figure 2 It is a schematic diagram of an architecture according to an exemplary embodiment of the present disclosure.

[0022] Figure 3 The figure is a block diagram showing a data refresh device for cloud services according to an exemplary embodiment of the present disclosure.

[0023] Figure 4 It is a block diagram of an electronic device according to an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION

[0024] The following describes embodiments of the present disclosure in more detail with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as limited to the embodiments described herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of protection of the present disclosure.

[0025] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.

[0026] As used herein, the term "including" and its variations are open-ended, i.e., "including but not limited to." The term "based on" means "based, at least in part, on." The term "one embodiment" means "at least one embodiment," the term "another embodiment" means "at least one additional embodiment," and the term "some embodiments" means "at least some embodiments." Other terms are defined in the following description.

[0027] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0028] It should be noted that the modifications of "one" and "multiple" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, they should be understood as "one or more".

[0029] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0030] It is understandable that before using the technical solutions disclosed in the various embodiments of this disclosure, the type, scope of use, usage scenarios, etc. of the personal information involved in this disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.

[0031] For example, in response to a user's active request, a prompt message is sent to the user to clearly inform the user that the operation requested will require the acquisition and use of the user's personal information. This allows the user to independently choose whether to provide personal information to the electronic device, application, server, storage medium, or other software or hardware that performs the operations of the disclosed technical solution based on the prompt message.

[0032] As an optional but non-limiting implementation, in response to receiving a user's active request, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. Furthermore, the pop-up window may also contain a selection control for the user to select "agree" or "disagree" to provide personal information to the electronic device.

[0033] It is understandable that the above notification and user authorization process are merely illustrative and do not limit the implementation of the present disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of the present disclosure.

[0034] At the same time, it is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) must comply with the requirements of relevant laws, regulations and relevant provisions.

[0035] In related technologies, most cloud services are deployed in server clusters, and virtualization technology is used to reuse hardware on individual physical servers, allowing them to carry more services without affecting operations. However, a VCPU (Virtual Central Processing Unit) is just a process on a physical machine and may be preempted or blocked for a period of time. In related technologies, all TLB entries managed by the VCPU are refreshed. This VCPU-based refresh will cause a certain degree of memory access performance degradation in scenarios where the VCPU is frequently preempted. In cloud service scenarios, stability and operational efficiency are the foundation of cloud services. This VCPU-based refresh that causes memory access performance degradation will seriously affect the stability and operational efficiency of cloud services.

[0036] In view of this, the embodiments of the present disclosure provide a data refresh method, device, medium and electronic device for cloud services. KVM refreshes the TLB table entries of the target virtual processor based on the target update range, retains the TLB table entries that do not need to be refreshed, thereby improving the hit rate of the TLB table entries and improving the memory access performance, which is beneficial to improving the stability and operating efficiency in the cloud service scenario, etc.

[0037] The present disclosure is exemplarily described below with reference to the accompanying drawings.

[0038] Figure 1 This is a flow chart of a data refresh method for cloud services according to an exemplary embodiment of the present disclosure, with reference to Figure 1 , the data refresh method for cloud services includes the following steps:

[0039] Step 110: When the operating system of the virtual machine initiates a refresh instruction for the virtual processor, prohibiting the refresh operation on the TLB of the target virtual processor in the operating system of the virtual machine, wherein the target virtual processor is the virtual processor currently being preempted in the operating system of the virtual machine;

[0040] Step 120: When the target virtual processor is rescheduled, obtain a target update range corresponding to the target virtual processor through KVM, where the target update range is used to indicate TLB entries that need to be refreshed for the target virtual processor.

[0041] Step 130: Perform a refresh operation on the TLB of the target virtual processor according to the target update range through the KVM.

[0042] It is worth noting that only the TLB entries in the target virtual processor's TLB that belong to the target update range are refreshed, and the TLB entries in the target virtual processor's TLB that do not belong to the target update range do not need to be refreshed.

[0043] Through the above method, in scenarios where virtual processors are frequently preempted or scheduled (for example, in super-resolution scenarios, a physical CPU is shared by multiple virtual machine vCPUs), KVM refreshes the TLB entries of the target virtual processor based on the target update range, retaining TLB entries that do not need to be refreshed, thereby improving the hit rate of TLB entries and memory access performance, which is beneficial to improving stability and operating efficiency in cloud service scenarios, etc.

[0044] It is worth noting that the virtual machine's operating system (guest os) cannot sense when the VCPU is preempted, so when the KVM senses that the VCPU is preempted, the KVM sets a corresponding preemption flag on the virtual processor, and the virtual processor with the preemption flag set is used to indicate that the virtual processor is currently preempted. The preemption flag can be stored in the shared memory of the virtual machine's operating system and KVM, so that the virtual machine's operating system can sense whether the VCPU is preempted by accessing this memory. In this case, the above-mentioned step of prohibiting the TLB of the target virtual processor from being refreshed when the virtual machine's operating system initiates a refresh instruction for the virtual processor can include the following method: when the virtual machine's operating system initiates a refresh instruction for the virtual processor, the virtual processor carrying the preemption flag is removed from the virtual processor set, and the removed virtual processor performs a refresh operation through KVM when it is rescheduled.

[0045] The virtual processor set is the set of VCPUs that need to perform TLB table entry updates. However, there may be two types of VCPUs in the virtual processor set: one is the currently preempted VCPU, and the other is the currently unpreempted VCPU. Because the preempted VCPU is removed from the virtual processor set, and the removed virtual processor is refreshed by KVM when it is rescheduled, the virtual machine's operating system will not update the TLB table entries by sending an IPI (inter-processor interrupt), thereby achieving the purpose of prohibiting the refresh operation on the target virtual processor's TLB within the virtual machine's operating system.

[0046] Among them, the VCPU that is not currently preempted can directly update the TLB table entries in the operating system of the virtual machine by sending an IPI. Specifically, the above method can also include the following steps: after removing the virtual processor carrying the preemption flag from the virtual processor set, obtaining the target update range corresponding to the remaining virtual processors in the virtual processor set; using the remaining virtual processors in the operating system of the virtual machine, according to the target update range corresponding to the remaining virtual processors, performing a refresh operation on the TLB of the remaining virtual processors, thereby retaining the TLB table entries that do not need to be refreshed, thereby improving the TLB hit rate and improving memory access performance. Among them, when the target virtual processor is rescheduled, it means that the current target virtual processor has been released from preemption.

[0047] In a possible manner, the above-mentioned data refresh method for cloud services may also include the following steps: when the operating system of the virtual machine is initialized, a corresponding structure is allocated to each virtual processor within the operating system of the virtual machine through the operating system of the virtual machine, the structure of the virtual processor is used to record the corresponding target update range, and the structure is stored in the kernel address space of the operating system of the virtual machine; the physical address of the structure is notified to the KVM through the operating system of the virtual machine.

[0048] The KVM and the virtual machine's operating system can share a kernel address space. This kernel address space is used to record the target update range corresponding to the target virtual processor, that is, to store the aforementioned structure, so that the KVM can access the target update range corresponding to the target virtual processor. For example, when the virtual machine's operating system is initialized, it writes the corresponding registered MSR instruction to inform the KVM of the corresponding physical address in the address space, allowing the KVM to access the target update range corresponding to the target virtual processor.

[0049] In the case where the physical address of the structure is notified to the KVM through the operating system of the virtual machine, the above-mentioned step of obtaining the target update range corresponding to the target virtual processor through the KVM when the target virtual processor is rescheduled can be implemented in the following manner: when the target virtual processor is rescheduled, the structure corresponding to the target virtual processor is read from the corresponding physical address through the KVM, and the target update range corresponding to the target virtual processor is obtained from the structure.

[0050] In a possible manner, the above-mentioned data refresh method for cloud services may also include the following steps: after executing the refresh operation of the TLB of the target virtual processor, clearing the preemption flag set for the target virtual processor, so that the operating system of the virtual machine can accurately perceive whether the VCPU is preempted.

[0051] Figure 2 This is a schematic diagram of an architecture according to an exemplary embodiment of the present disclosure, and a data refresh method for cloud services is implemented based on this architecture. Figure 2 ,exist Figure 2In this example, GUEST represents the virtual machine's operating system, KVM runs on the host, and the host represents the physical machine. KVM virtualizes the host's hardware resources, memory, and other resources. The virtual machine in this embodiment is based on the x86 architecture. In this embodiment, by sharing a memory segment between KVM and GUEST and recording the range (i.e., the target update range) to be flushed when a PVTLB update occurs, KVM performs a flush on a specific range rather than flushing all TLB entries. This reduces the flush scope and preserves some unnecessary TLB entries.

[0052] Depend on Figure 2 It can be seen that CPU1 is preempted and thus sets the preemption flag (for example Figure 2 The Pv_flush tag shown in the figure is used to flush the VCPU in the flush mask (i.e., the virtual processor set). The VCPU does not refresh the TLB entries by sending an IPI, but instead refreshes the TLB entries in the KVM running on the host. In the related prior art, TLB Entry1, TLB Entry2, and TLB Entry3 are refreshed. However, the solution proposed in this disclosure only refreshes TLB Entry1 based on the range, thereby retaining the TLB entries that do not need to be refreshed. This helps improve the hit rate of TLB entries for frequently preempted VCPUs in super-resolution scenarios, thereby improving memory access performance.

[0053] Figure 3 This is a block diagram of a data refresh device for cloud services according to an exemplary embodiment of the present disclosure, with reference to Figure 3 , the data refreshing device 300 for cloud services includes:

[0054] a prohibition module 301 configured to prohibit, in the operating system of the virtual machine, a refresh operation on the TLB of a target virtual processor when the operating system of the virtual machine initiates a refresh instruction for the virtual processor, wherein the target virtual processor is a virtual processor currently being preempted in the operating system of the virtual machine;

[0055] A first acquisition module 302 is configured to acquire, through KVM, a target update range corresponding to the target virtual processor when the target virtual processor is rescheduled, the target update range being used to indicate TLB entries that need to be refreshed for the target virtual processor;

[0056] The first refresh module 303 is configured to perform a refresh operation on the TLB of the target virtual processor according to the target update range through the KVM.

[0057] In a possible embodiment, the data refreshing device 300 for cloud services further includes:

[0058] an allocation module, configured to allocate a corresponding structure to each virtual processor in the operating system of the virtual machine through the operating system of the virtual machine when the operating system of the virtual machine is initialized, wherein the structure of the virtual processor is used to record the corresponding target update range, and the structure is stored in the kernel address space of the operating system of the virtual machine;

[0059] A notification module, configured to notify the KVM of the physical address of the structure through the operating system of the virtual machine;

[0060] The first acquisition module 302 is specifically used to: when the target virtual processor is rescheduled, read the structure corresponding to the target virtual processor from the corresponding physical address through KVM, and obtain the target update range corresponding to the target virtual processor from the structure.

[0061] In a possible embodiment, the data refreshing device 300 for cloud services further includes:

[0062] A setting module is used to set a corresponding preemption flag for the virtual processor through the KVM when the virtual processor is preempted, wherein the preemption flag can be accessed by the operating system of the virtual machine, and the virtual processor with the preemption flag is used to indicate that the virtual processor is currently preempted;

[0063] The prohibition module 301 is specifically configured to remove the virtual processor carrying the preemption flag from the virtual processor set when the operating system of the virtual machine initiates a refresh instruction for the virtual processor, and the removed virtual processor performs a refresh operation through the KVM when it is rescheduled.

[0064] In a possible embodiment, the data refreshing device 300 for cloud services further includes:

[0065] a second acquisition module, configured to acquire target update ranges corresponding to the remaining virtual processors in the virtual processor set after removing the virtual processor carrying the preemption flag from the virtual processor set;

[0066] The second refresh module is configured to perform a refresh operation on the TLBs of the remaining virtual processors in the operating system of the virtual machine through the remaining virtual processors according to the target update ranges corresponding to the remaining virtual processors.

[0067] In a possible embodiment, the data refreshing device 300 for cloud services further includes:

[0068] The clearing module is used to clear the preemption flag set for the target virtual processor after the refresh operation of the TLB of the target virtual processor is completed.

[0069] Among them, the implementation of each module in the above-mentioned data refresh device 300 for cloud services can refer to the above-mentioned related embodiments, and this embodiment will not be described in detail here.

[0070] The embodiment of the present disclosure further provides a computer-readable medium having a computer program stored thereon, which implements the steps of the above-mentioned data refresh method for cloud services when executed by a processing device.

[0071] The present disclosure also provides an electronic device, including:

[0072] a storage device having a computer program stored thereon;

[0073] A processing device is used to execute the computer program in the storage device to implement the steps of the above-mentioned data refresh method for cloud services.

[0074] Reference below Figure 4 , which shows a schematic structural diagram of an electronic device 400 suitable for implementing the embodiments of the present disclosure. The terminal devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 4 The electronic device shown is only an example and should not limit the functions and scope of use of the embodiments of the present disclosure.

[0075] like Figure 4 As shown, the electronic device 400 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 401, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 402 or a program loaded from a storage device 408 into a random access memory (RAM) 403. Various programs and data required for the operation of the electronic device 400 are also stored in the RAM 403. The processing device 401, the ROM 402, and the RAM 403 are connected to each other via a bus 404. An input / output (I / O) interface 405 is also connected to the bus 404.

[0076] Typically, the following devices may be connected to the I / O interface 405: an input device 406 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 407 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 408 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 409. The communication device 409 may allow the electronic device 400 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 4 The electronic device 400 is shown with various devices, but it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed instead.

[0077] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 409, or installed from the storage device 408, or installed from the ROM 402. When the computer program is executed by the processing device 401, the above-mentioned functions defined in the method of the embodiment of the present disclosure are performed.

[0078] It should be noted that the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, device, or component. In the present disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to wires, optical cables, RF (radio frequency), etc., or any suitable combination thereof.

[0079] In some embodiments, the electronic devices can communicate using any currently known or future developed network protocol, such as HTTP (HyperText Transfer Protocol), and can be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.

[0080] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.

[0081] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device: when the operating system of the virtual machine initiates a refresh instruction for the virtual processor, prohibits the electronic device from performing a refresh operation on the TLB of the target virtual processor within the operating system of the virtual machine, wherein the target virtual processor is the virtual processor currently preempted in the operating system of the virtual machine; when the target virtual processor is rescheduled, obtains a target update range corresponding to the target virtual processor through the KVM, wherein the target update range is used to indicate the TLB table entries that need to be refreshed for the target virtual processor; and performs a refresh operation on the TLB of the target virtual processor according to the target update range through the KVM.

[0082] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including, but not limited to, object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on the remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).

[0083] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the module, program segment, or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0084] The modules described in the embodiments of the present disclosure may be implemented in software or hardware, wherein the name of a module does not necessarily limit the module itself.

[0085] The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, and without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chip (SOCs), complex programmable logic devices (CPLDs), and the like.

[0086] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0087] The above description is merely a preferred embodiment of the present disclosure and an illustration of the technical principles employed. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by the specific combination of the above-mentioned technical features, but also includes other technical solutions formed by any combination of the above-mentioned technical features or their equivalents without departing from the above-mentioned disclosed concepts. For example, a technical solution formed by replacing the above-mentioned features with (but not limited to) technical features with similar functions disclosed in this disclosure.

[0088] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details have been included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.

[0089] Although the subject matter has been described using language specific to structural features and / or methodological logical acts, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are merely example forms of implementing the claims. Regarding the apparatus in the above-described embodiments, the specific manner in which each module performs operations has been described in detail in the embodiments related to the method and will not be elaborated upon here.

Claims

1. A data refresh method for cloud services, characterized in that: include: When the operating system of the virtual machine initiates a refresh instruction for a virtual processor, prohibiting a refresh operation on a translation lookaside buffer (TLB) of a target virtual processor in the operating system of the virtual machine, wherein the target virtual processor is a virtual processor currently being preempted in the operating system of the virtual machine; When the target virtual processor is rescheduled, obtaining, by a kernel virtual machine KVM, a target update range corresponding to the target virtual processor from a memory shared by the KVM and the operating system, the target update range being used to indicate TLB entries that need to be refreshed for the target virtual processor; A refresh operation is performed on the TLB of the target virtual processor according to the target update range through the KVM.

2. The method according to claim 1, characterized in that The method further comprises: When the operating system of the virtual machine is initialized, a corresponding structure is allocated to each virtual processor in the operating system of the virtual machine through the operating system of the virtual machine, the structure of the virtual processor is used to record the corresponding target update range, and the structure is stored in the kernel address space of the operating system of the virtual machine; Notifying the KVM of the physical address of the structure through the operating system of the virtual machine; When the target virtual processor is rescheduled, obtaining a target update range corresponding to the target virtual processor through the KVM includes: In the case where the target virtual processor is rescheduled, a structure corresponding to the target virtual processor is read from a corresponding physical address through KVM, and a target update range corresponding to the target virtual processor is obtained from the structure.

3. The method according to claim 1, characterized in that The method further comprises: When the virtual processor is preempted, the KVM sets a corresponding preemption flag for the virtual processor, wherein the preemption flag can be accessed by the operating system of the virtual machine, and the virtual processor with the preemption flag is used to indicate that the virtual processor is currently preempted; When the operating system of the virtual machine initiates a refresh instruction for the virtual processor, prohibiting the refresh operation on the TLB of the target virtual processor includes: When the operating system of the virtual machine initiates a refresh instruction for the virtual processor, the virtual processor carrying the preemption flag is removed from the virtual processor set, and the removed virtual processor performs a refresh operation through the KVM when it is rescheduled.

4. The method according to claim 3, characterized in that The method further comprises: After removing the virtual processor carrying the preemption flag from the virtual processor set, obtaining target update ranges corresponding to the remaining virtual processors in the virtual processor set; A refresh operation is performed on the TLBs of the remaining virtual processors in the operating system of the virtual machine according to the target update ranges corresponding to the remaining virtual processors.

5. The method according to claim 4, characterized in that The method further comprises: After the refresh operation on the TLB of the target virtual processor is completed, the preemption flag set for the target virtual processor is cleared.

6. A data refresh device for cloud services, characterized in that: include: a prohibition module, configured to prohibit, when the operating system of the virtual machine initiates a refresh instruction for the virtual processor, from performing a refresh operation on the TLB of a target virtual processor within the operating system of the virtual machine, wherein the target virtual processor is a virtual processor currently being preempted in the operating system of the virtual machine; A first acquisition module is configured to acquire, through the KVM, a target update range corresponding to the target virtual processor from a memory shared by the KVM and the operating system when the target virtual processor is rescheduled, the target update range being used to indicate TLB entries that need to be refreshed for the target virtual processor; A first refresh module is configured to perform a refresh operation on the TLB of the target virtual processor according to the target update range through the KVM.

7. The device according to claim 6, characterized in that The device further comprises: an allocation module, configured to allocate a corresponding structure to each virtual processor in the operating system of the virtual machine through the operating system of the virtual machine when the operating system of the virtual machine is initialized, wherein the structure of the virtual processor is used to record the corresponding target update range, and the structure is stored in the kernel address space of the operating system of the virtual machine; A notification module, configured to notify the KVM of the physical address of the structure through the operating system of the virtual machine; The first acquisition module is specifically used to: when the target virtual processor is rescheduled, read the structure corresponding to the target virtual processor from the corresponding physical address through KVM, and obtain the target update range corresponding to the target virtual processor from the structure.

8. The device according to claim 6, characterized in that The device further comprises: A setting module is used to set a corresponding preemption flag for the virtual processor through the KVM when the virtual processor is preempted, wherein the preemption flag can be accessed by the operating system of the virtual machine, and the virtual processor with the preemption flag is used to indicate that the virtual processor is currently preempted; The prohibition module is specifically configured to remove the virtual processor carrying the preemption flag from the virtual processor set when the operating system of the virtual machine initiates a refresh instruction for the virtual processor, and the removed virtual processor performs a refresh operation through the KVM when it is rescheduled.

9. A computer-readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processing device, the steps of the data refresh method for cloud services described in any one of claims 1 to 5 are implemented.

10. An electronic device, characterized in that: include: a storage device having a computer program stored thereon; A processing device is used to execute the computer program in the storage device to implement the steps of the data refresh method for cloud services described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • TLB filling method and device of virtual machine and storage medium

    CN110196757A

  • Memory page changing method and system and storage medium

    CN114201269A