Data storage method, server and storage medium

CN116737075BActive Publication Date: 2026-11-03ALIBABA (CHINA) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310647847.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-01
Publication Date
2026-11-03
Estimated Expiration
2043-06-01

AI Technical Summary

Technical Problem

In FaaS scenarios, MDev-NVMe storage virtualization technology causes excessive CPU usage by I/O polling threads.

Method used

A global I/O polling thread is used to process the virtual storage devices of all security containers created on the host machine, and the polling objects are adjusted based on I/O load, including the use of virtual queues and physical queues, to reduce unnecessary polling operations.

Benefits of technology

This reduces the CPU resource consumption of the I/O polling thread, improving the processing efficiency of computing tasks and system performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116737075B_ABST
    Figure CN116737075B_ABST
Patent Text Reader

Abstract

The embodiment of the application provides a data storage method, a server and a storage medium. The method comprises the following steps: receiving a function as a service (FaaS) request, wherein the FaaS request is used for requesting to create a secure container to execute a computing task; creating the secure container and allocating a virtual storage device for the secure container; adjusting a polling object of a global I / O polling thread based on an I / O load of the secure container already created on a host computer, wherein the polling object comprises a virtual queue in the virtual storage device of the secure container already created on the host computer and / or a plurality of physical queues in the host computer, or the polling object is empty; and wherein the virtual queue is used for storing an I / O submission request generated by the secure container when executing the computing task, and the I / O submission request is used for requesting to submit data to a physical storage device of the host computer, and the physical queue is used for storing an I / O completion instruction generated by the physical storage device. The CPU resource occupied by the I / O polling thread in the FaaS scenario is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data storage, and more specifically, to data storage methods, servers, and storage media. Background Technology

[0002] Functions as a Service (FaaS) is a container-based cloud computing service that allows developers to write, deploy, and run event-driven functions without managing the underlying infrastructure and servers. Data storage in FaaS solutions can be implemented using storage virtualization technology.

[0003] Mediated Device (MDev) - Non-Volatile Memory Express (NVMe) technology is a storage virtualization technology based on Virtual Function I / O (VFIO) - MDev. MDev-NVMe modifies the host machine's NVMe driver. Virtual machines can use MDev virtual storage devices created through the virtual file system (sysfs). However, each virtual storage device creation requires a corresponding I / O polling thread, which continuously polls for I / O submission requests from the virtual storage device and I / O completion instructions from the physical storage device. In FaaS scenarios with high computational request density, this can lead to excessive CPU usage. Summary of the Invention

[0004] This application provides a data storage method, server, and storage medium to reduce the CPU usage of I / O polling threads in FaaS scenarios.

[0005] Firstly, this application provides a data storage method, including:

[0006] Receive Function as a Service (FaaS) requests, which are used to request the creation of a secure container to perform computing tasks;

[0007] Create a secure container and allocate a virtual storage device to the secure container;

[0008] Based on the I / O load of the secure containers already created on the host machine, the polling object of the global I / O polling thread is adjusted. The polling object includes virtual queues in the virtual storage devices of the secure containers already created on the host machine and / or multiple physical queues in the host machine, or the polling object is empty. The virtual queues are used to store I / O commit requests generated by the secure containers when performing computing tasks. The I / O commit requests are used to request the submission of data to the physical storage devices of the host machine. The physical queues are used to store I / O completion instructions generated by the physical storage devices.

[0009] In one implementation, the global I / O polling thread polls the physical queue, including:

[0010] When the global I / O polling thread performs each poll, if an I / O completion instruction is found in the physical queue, the I / O completion instruction is added to the virtual queue, and the instruction count of the virtual storage device is incremented by 1. If the instruction count is greater than a first preset threshold, an interrupt is injected into the secure container. If no I / O completion instruction is found in the physical queue, the timer count of the virtual storage device is incremented by 1. If the timer count is greater than a second preset threshold, an interrupt is injected into the secure container. The interrupt injection into the secure container is used to send the I / O completion instructions in the virtual queue to the secure container.

[0011] In one implementation, the global I / O polling thread polls the physical queue, including:

[0012] If the number of I / O completion instructions obtained through polling is greater than or equal to a preset proportion of the maximum number of completion instructions in the physical queue, then the polling of the physical queue ends and the polling of the next physical queue begins.

[0013] In one implementation, the I / O load includes the number of I / O submission requests, and adjusting the polling object of the global I / O polling thread based on the I / O load of the security containers already created on the host machine includes:

[0014] If the number of I / O submission requests in the virtual queue of the virtual storage device of the secure container is greater than or equal to the third preset threshold, the secure container is identified as an active secure container.

[0015] If the number of active security containers among the security containers already created on the host machine is less than or equal to the fourth preset threshold, then the number of polling objects of the global I / O polling thread is reduced.

[0016] If the number of active security containers among those already created on the host machine is greater than a fourth preset threshold, then the polling objects of the global I / O polling thread are increased.

[0017] In one implementation, prior to the receiving function (i.e., the FaaS service request), the method further includes:

[0018] Multiple physical queues are created in the host machine's memory;

[0019] Create a kernel thread as a global I / O polling thread, and bind the global I / O polling thread to the multiple physical queues.

[0020] One implementation also includes:

[0021] The initial polling object of the global I / O polling thread is set to include a virtual queue in the virtual storage device of the security container already created on the host machine and multiple physical queues in the host machine.

[0022] In one implementation, allocating a virtual storage device to the secure container includes:

[0023] Determine whether there is a virtual storage device in the virtual storage device resource pool that satisfies the FaaS request;

[0024] If it exists, the virtual storage device is assigned to the security container; if it does not exist, a new virtual storage device that satisfies the FaaS request is created, and the newly created virtual storage device is assigned to the security container.

[0025] In one implementation, when the polling object of the global I / O polling thread does not include the virtual queue, the I / O submission request is processed when memory-mapped I / O triggers a virtual machine trap; when the polling object of the global I / O polling thread does not include the physical queue, the I / O completion instruction is processed when a physical interrupt occurs.

[0026] In one implementation, the global I / O polling thread polls the virtual queue to send I / O submission requests from the virtual queue to the physical queue to store the data corresponding to the I / O submission requests in the physical storage device; the global I / O polling thread polls the physical queue to send I / O completion instructions from the physical queue to the virtual queue to indicate that the I / O submission request processing is complete.

[0027] Secondly, this application provides a server, including: a memory and a processor;

[0028] The memory is used to store computer programs;

[0029] The processor is configured to execute a computer program stored in the memory, wherein the computer program, when executed, causes the processor to perform the method of claim 1.

[0030] Thirdly, this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, causes the processor to perform the method described in the first aspect.

[0031] In the data storage method, server, and storage medium provided in this application, a global I / O polling thread is used to handle the virtual storage devices of all security containers created on the host machine, and the polling objects of the global I / O polling thread are adjusted based on the I / O load of all security containers created on the host machine, thereby reducing the CPU resource consumption of the I / O polling thread. Attached Figure Description

[0032] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0033] Figure 1 This is a schematic diagram of MDev-NVMe storage virtualization;

[0034] Figure 2 This is a flowchart illustrating a data storage method provided in an embodiment of this application;

[0035] Figure 3 This is a schematic diagram of the architecture of a data storage system provided in an embodiment of this application;

[0036] Figure 4 This is a schematic diagram of a polling mode provided in an embodiment of this application;

[0037] Figure 5 This is a schematic diagram of the structure of a data storage device provided in an embodiment of this application;

[0038] Figure 6 This is a schematic block diagram of the server provided in the embodiments of this application. Detailed Implementation

[0039] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0040] Figure 1 This is a diagram illustrating MDev-NVMe storage virtualization. MDev-NVMe is a storage virtualization technology based on VFIO-Mdev. It modifies the host machine's NVMe driver to an MDev-NVMe driver and creates MDev virtual storage devices through the sysfs system for virtual machines to use. All virtual machines can run native NVMe drivers. The problem with this approach is that each creation of an MDev virtual storage device requires an I / O polling thread. This thread continuously polls for I / O submission requests from the virtual storage device and I / O completion instructions from the physical storage device. In FaaS scenarios where computation requests are generated frequently—that is, when a large number of virtual storage devices are created—the I / O polling thread consumes excessive amounts of CPU resources on the host machine.

[0041] In view of this, this application proposes an optimization scheme for the above-mentioned solution, which utilizes a global I / O polling thread to handle all virtual storage devices, and adjusts the polling mode of the global I / O polling thread, i.e., the polling objects, based on the I / O load, thereby reducing the CPU usage of the I / O polling thread. The following description is based on specific embodiments.

[0042] Figure 2 This is a flowchart illustrating a data storage method provided in an embodiment of this application. Figure 2 As shown, the method includes:

[0043] S201. Receive FaaS request. FaaS request is used to request the creation of a secure container to perform computing tasks.

[0044] For example, a FaaS request can be triggered by any cloud computing service. For instance, a cloud computing service may need to use a first function for computation, which provides an interface for the service to call. The cloud computing service calls this interface to generate a FaaS request to request the creation of a secure container to run the first function, that is, to execute the corresponding computation task.

[0045] It should be noted that in the FaaS scenario, since functions are used as services and are used extensively for computation during cloud computing, there may be a large number of FaaS requests in a short period of time, which means there is a need to create a large number of secure containers in a short period of time.

[0046] S202. Create a secure container and allocate a virtual storage device to the secure container.

[0047] In response to a FaaS request, a secure container is created on the host machine, and a virtual storage device is allocated to the secure container. This virtual storage device can be directly allocated from an existing virtual storage device in a virtual storage device resource pool, which may contain multiple pre-created virtual storage devices, or the virtual storage device can be newly created.

[0048] Optionally, determine whether a virtual storage device that satisfies the FaaS request exists in the virtual storage device resource pool; if it exists, allocate the virtual storage device to the security container; if it does not exist, create a new virtual storage device that satisfies the FaaS request and allocate the new virtual storage device to the security container.

[0049] The global I / O polling thread is a kernel thread of the host machine. The host machine uses this global I / O polling thread to perform I / O processing on all the secure containers running on the host machine.

[0050] S203. Based on the I / O load of the security containers already created on the host machine, adjust the polling object of the global I / O polling thread. The polling object includes virtual queues in the virtual storage devices of the security containers already created on the host machine and / or multiple physical queues in the host machine, or the polling object is empty.

[0051] The virtual queue is used to store I / O commit requests generated by the secure container when performing computing tasks. The I / O commit requests are used to request data to be submitted to the host's physical storage device. The physical queue is used to store I / O completion instructions generated by the physical storage device.

[0052] The global I / O polling thread polls the virtual queue to send I / O commit requests from the virtual queue to the physical queue so that the data corresponding to the I / O commit requests can be stored in the physical storage device; the global I / O polling thread polls the physical queue to send I / O completion instructions from the physical queue to the virtual queue to indicate that the I / O commit request has been processed.

[0053] Both the virtual queue and the physical queue contain two queues: a commit queue and a completion queue. The commit queue in the virtual queue stores I / O commit requests generated by the secure container. When the global I / O polling thread polls the commit queue in the virtual queue, if an I / O commit request is found, it is placed into the commit queue in the physical queue, thus storing the corresponding data on the physical storage device. The completion queue in the physical queue stores I / O completion instructions generated by the physical storage device after data storage is complete. When the global I / O polling thread polls the completion queue in the physical queue, if an I / O completion instruction is found, it is placed into the completion queue in the virtual queue, thus indicating to the secure container that the I / O commit request has been processed.

[0054] The virtual queues for each virtual storage device are created when the virtual storage device is created, and the physical queues on the host machine are also created in advance. Before creating the global I / O polling thread, multiple physical queues are created in the host machine's memory; then, a kernel thread is created as the global I / O polling thread, and the global I / O polling thread is bound to these multiple physical queues.

[0055] As previously explained, in FaaS scenarios, there may be a large number of FaaS requests in a short period of time, which means that a large number of security containers may be created in a short period of time. In this case, the global I / O polling thread needs to poll all virtual queues and physical queues, which will consume a lot of CPU resources. Therefore, in this embodiment, the polling objects of the global I / O polling thread are adjusted based on the I / O load of the security containers already created on the host machine. The I / O load includes the number of I / O submission requests. If the I / O load of the created security containers is high, that is, the number of I / O submission requests is large, then it is necessary to poll the virtual queues and / or physical queues in a timely manner. If the I / O load of the created security containers is low, that is, the number of I / O submission requests is small, then it is not necessary for the global I / O polling thread to continuously and actively poll all virtual queues and physical queues. The number of polling objects of the global I / O polling thread can be reduced, and other mechanisms with lower CPU consumption can be used to trigger I / O processing.

[0056] Optionally, if the number of I / O submission requests in the virtual queue of the virtual storage device of the secure container is greater than or equal to a third preset threshold, the secure container is identified as an active secure container; if the number of active secure containers among those already created on the host is less than or equal to a fourth preset threshold, the number of polling objects of the global I / O polling thread is reduced; if the number of active secure containers among those already created on the host is greater than the fourth preset threshold, the number of polling objects of the global I / O polling thread is increased.

[0057] Optionally, adjusting the polling object of the global I / O polling thread can also be called adjusting the polling mode of the global I / O polling thread. That is, different polling modes can correspond to different polling objects. For example, in full polling mode, the polling objects include virtual queues in the virtual storage devices of the security containers created on the host machine and multiple physical queues on the host machine. In half polling mode, the polling objects include virtual queues in the virtual storage devices of the security containers created on the host machine or multiple physical queues on the host machine. In addition, when the polling object is empty, that is, the global I / O polling thread does not poll, it can be called full trigger mode.

[0058] In both half-polling and full-trigger modes, when the polling object of the global I / O polling thread does not include the virtual queue, the I / O submission request is processed when the memory-mapped I / O triggers a virtual machine trap; when the polling object of the global I / O polling thread does not include the physical queue, the I / O completion instruction is processed when a physical interrupt occurs.

[0059] Optionally, after creating the global I / O polling thread, the initial polling objects of the global I / O polling thread can be set to include virtual queues in the virtual storage devices of the security containers already created on the host machine and multiple physical queues on the host machine. Then, adjustments can be made based on the I / O load.

[0060] Optionally, when the global I / O polling thread polls the physical queue, if an I / O completion instruction is found in the physical queue, it is added to the virtual queue, and the instruction count for the virtual storage device is incremented by 1. If the instruction count exceeds a first preset threshold, an interrupt is injected into the secure container. If no I / O completion instruction is found in the physical queue, the timer for the virtual storage device is incremented by 1. If the timer count exceeds a second preset threshold, an interrupt is injected into the secure container. Injecting an interrupt into the secure container is used to send the I / O completion instructions from the virtual queue to the secure container. After each I / O completion instruction is polled, it is first added to the virtual queue, but no interrupt is generated to notify the secure container. Instead, the interrupt aggregation method is used to send multiple I / O completion instructions to the secure container through a single interrupt, further reducing CPU usage. Even if no I / O completion instruction is polled, the number of instructions does not increase, but the number of timers is accumulated. Thus, after multiple polls, even if the number of instructions does not reach the first preset threshold, as long as the number of timers reaches the second preset threshold, an interrupt is still triggered, notifying the security container of the accumulated I / O completion instructions in the virtual queue.

[0061] Optionally, when the global I / O polling thread polls physical queues, if the number of I / O completion instructions obtained from polling a physical queue is greater than or equal to a preset proportion of the maximum number of completion instructions for that physical queue, then the polling of that physical queue ends, and the polling of the next physical queue begins. After polling all physical queues has ended, a new round of polling begins.

[0062] The data storage method provided in this application uses a global I / O polling thread to handle the virtual storage devices of all security containers created on the host machine. Furthermore, the polling objects of the global I / O polling thread are adjusted based on the I / O load of all security containers created on the host machine, thereby reducing the CPU resource consumption of the I / O polling thread.

[0063] Figure 3 This is a schematic diagram of the architecture of a data storage system provided in an embodiment of this application. For example... Figure 3 As shown, this data storage system includes: a FaaS controller module, a virtual storage device pool module, a physical resource pool module, a global I / O polling thread module, and a load monitoring module. The implementation principles of each module and the interactions between them are as follows:

[0064] 1: Initialize the physical resource pool module.

[0065] The system detects the NVMe physical storage device in the current data storage system, creates a partition on the NVMe physical storage device for use by the host machine's native processes and ordinary containers, and creates another partition for use by virtual machines, i.e., secure containers. Based on this partition, a certain number of physical queues are created in the host machine's memory. The created physical queues are then encapsulated and added to the queue-related data structures in the physical resource pool module, exposing the corresponding interfaces for use by other modules.

[0066] 2: Initialize the global I / O polling thread module.

[0067] A kernel thread is created to perform I / O tasks as the global I / O polling thread, and the created physical queue is bound to the global I / O polling thread. A corresponding control block data structure is created for the global I / O polling thread, which maintains data such as the physical queues owned by the global I / O polling thread and the FaaS security container instances of the services. The current I / O mode to be executed by the global I / O polling thread is set, with a default of full polling mode, which can be adjusted at any time by the load monitoring module.

[0068] like Figure 4As shown, in full polling mode, the global I / O polling thread polls both I / O commit requests from secure containers and I / O completion instructions from physical storage devices. In half polling mode, the global I / O polling thread only polls I / O completion instructions from physical storage devices; I / O commit requests from secure containers are processed when a virtual machine exit (vm-exit) is triggered by Memory-mapped I / O (MMIO). In full trigger mode, I / O commit requests from secure containers are processed only when a vm-exit is triggered by MMIO; I / O completion instructions from physical storage devices are processed only when a physical interrupt occurs.

[0069] The global I / O polling thread has interrupt aggregation capabilities. The FaaS controller module can register interrupt aggregation parameters in the virtual storage device, namely a first preset threshold corresponding to the instruction count (irq_accum) and a second preset threshold corresponding to the timer count (pass_time). The global I / O polling thread sets irq_accum to 0 and pass_time to 0 for the current virtual storage device. Each time the physical queue is polled, if a completed instruction from that virtual storage device is found, it is added to the virtual sequence, and irq_accum is incremented by 1. If irq_accum is greater than the first preset threshold, an interrupt is injected into the safe container. If no completed instruction is found, pass_time is incremented by 1. If pass_time is greater than the second preset threshold, an interrupt is also injected into the safe container. After the interrupt is injected, both irq_accum and pass_time are set to 0.

[0070] 3: Virtual storage device pool.

[0071] In FaaS scenarios, a large number of FaaS requests often suddenly appear in a short period of time, requiring a large number of virtual storage devices to be available. However, at other times, the number of FaaS requests may be extremely low. In order to quickly provide virtual storage devices during peak request periods and save system resources during periods with fewer requests, a virtual storage device pool module was proposed.

[0072] The virtual storage device pool requests disk block resources from the physical resource pool module. When it receives a request to obtain a virtual storage device from the FaaS controller module, if there is a suitable virtual storage device in the pool, it will directly provide one. Otherwise, it will create a corresponding virtual storage device, including creating a virtual queue and mapping the virtual queue to a physical queue. When a virtual storage device is released by the FaaS controller module, its corresponding disk block will undergo data security processing.

[0073] In this embodiment, multiple virtual queues can be mapped to the same physical queue. Therefore, the number of virtual storage devices that can be created in this embodiment is not limited. In practical applications, the upper limit of the number of virtual storage devices in the system can also be set as needed, for example, to 1024.

[0074] 4: The load monitoring module initializes, interacts with the global I / O polling thread module, and begins monitoring the current I / O load.

[0075] The load monitoring module primarily aims to maximize CPU resource conservation while minimizing the impact on storage performance when the overall system load is low. Specifically, it determines the current system I / O load by monitoring the number of globally active secure containers. If the number of active secure containers is less than or equal to a fourth preset threshold, the polling mode of the global I / O polling thread is downgraded by one level, for example, from full polling to polling mode, or from half polling mode to full triggering mode. If the number of active secure containers is greater than the fourth preset threshold, the polling mode of the global I / O polling thread is upgraded by one level, for example, from half polling mode to full polling mode, or from full triggering mode to half polling mode.

[0076] 5: Initialize the FaaS controller module, interact with the four previously initialized modules, obtain their information, and complete the binding.

[0077] When a FaaS request arrives, the FaaS controller module receives the message, executes the creation of a secure container, requests a virtual storage device from the virtual storage device resource pool, and allocates it to the secure container. It then passes the secure container information to the global I / O polling thread module, which binds the global I / O polling thread to the secure container and executes the corresponding I / O operation.

[0078] In addition, the FaaS controller module periodically scans the entire virtual storage device pool and deletes virtual storage devices that have not been used for a long time, releasing their resources.

[0079] Figure 5 This is a schematic diagram of the structure of a data storage device provided in an embodiment of this application. Figure 5 As shown, the data storage device 500 includes:

[0080] The receiving module 501 is used to receive a Function as a Service (FaaS) request, wherein the FaaS request is used to request the creation of a secure container to perform a computing task;

[0081] Module 502 is used to create a secure container, allocate a virtual storage device to the secure container, and bind the secure container to a global I / O polling thread;

[0082] Polling module 503 is used to adjust the polling object of the global I / O polling thread based on the I / O load of the security containers created on the host machine. The polling object includes virtual queues in the virtual storage devices of the security containers created on the host machine and / or multiple physical queues in the host machine, or the polling object is empty.

[0083] The virtual queue stores I / O submission requests generated by the secure container during computation tasks, while the physical queue stores I / O completion instructions generated by the host machine's physical storage device. The global I / O polling thread polls the virtual queue, sending I / O submission requests from the virtual queue to the physical queue to store the data corresponding to the I / O submission requests in the physical storage device. The global I / O polling thread also polls the physical queue, sending I / O completion instructions from the physical queue to the virtual queue to indicate that the I / O submission request processing is complete.

[0084] In one implementation, the polling module 503 is used for:

[0085] When the global I / O polling thread performs each poll, if an I / O completion instruction is found in the physical queue, the I / O completion instruction is added to the virtual queue, and the instruction count of the virtual storage device is incremented by 1. If the instruction count is greater than a first preset threshold, an interrupt is injected into the secure container. If no I / O completion instruction is found in the physical queue, the timer count of the virtual storage device is incremented by 1. If the timer count is greater than a second preset threshold, an interrupt is injected into the secure container. The interrupt injection into the secure container is used to send the I / O completion instructions in the virtual queue to the secure container.

[0086] In one implementation, the polling module 503 is used for:

[0087] If the number of I / O completion instructions obtained through polling is greater than or equal to a preset proportion of the maximum number of completion instructions in the physical queue, then the polling of the physical queue ends and the polling of the next physical queue begins.

[0088] In one implementation, the polling module 503 is used for:

[0089] If the number of I / O submission requests in the virtual queue of the virtual storage device of the secure container is greater than or equal to the third preset threshold, the secure container is identified as an active secure container.

[0090] If the number of active security containers among the security containers already created on the host machine is less than or equal to the fourth preset threshold, then the number of polling objects of the global I / O polling thread is reduced.

[0091] If the number of active security containers among those already created on the host machine is greater than a fourth preset threshold, then the polling objects of the global I / O polling thread are increased.

[0092] In one implementation, module 502 is also used for:

[0093] Multiple physical queues are created in the host machine's memory;

[0094] Create a kernel thread as a global I / O polling thread, and bind the global I / O polling thread to the multiple physical queues.

[0095] In one implementation, the polling module 503 is also used for:

[0096] The initial polling object of the global I / O polling thread is set to include a virtual queue in the virtual storage device of the security container already created on the host machine and multiple physical queues in the host machine.

[0097] In one implementation, module 502 is created for:

[0098] Determine whether there is a virtual storage device in the virtual storage device resource pool that satisfies the FaaS request;

[0099] If it exists, the virtual storage device is assigned to the security container; if it does not exist, a new virtual storage device that satisfies the FaaS request is created, and the newly created virtual storage device is assigned to the security container.

[0100] In one implementation, when the polling object of the global I / O polling thread does not include the virtual queue, the I / O submission request is processed when memory-mapped I / O triggers a virtual machine trap; when the polling object of the global I / O polling thread does not include the physical queue, the I / O completion instruction is processed when a physical interrupt occurs.

[0101] The apparatus in this application embodiment is used to implement the data storage method in any of the foregoing embodiments. Its implementation principle and technical effect are similar, and will not be repeated here.

[0102] Figure 6 This is a schematic block diagram of the server provided in an embodiment of this application. Figure 6 As shown, the server 600 may include at least one processor 601 for implementing the data storage method provided in the embodiments of this application. The server 600 may also be referred to as a host machine.

[0103] Optionally, the server 600 further includes at least one memory 602 for storing program instructions and / or data. The memory 602 is coupled to the processor 601. The coupling in this embodiment is an indirect coupling or communication connection between devices, units, or modules, and can be electrical, mechanical, or other forms, for information exchange between devices, units, or modules. The processor 601 may operate in conjunction with the memory 602. The processor 601 may execute program instructions stored in the memory 602. At least one of the at least one memory may be included in the processor.

[0104] Optionally, the server 600 further includes a communication interface 603 for communicating with other devices via a transmission medium, thereby enabling the server 600 to communicate with other devices. The communication interface 603 may be, for example, a transceiver, interface, bus, circuit, or a device capable of transmitting and receiving functions. The processor 601 can utilize the communication interface 603 to transmit and receive data and / or information, and to implement the methods provided in the embodiments of this application. See the detailed description in the foregoing embodiments for further details, which will not be repeated here.

[0105] This application embodiment does not limit the specific connection medium between the processor 601, memory 602, and communication interface 603. This application embodiment... Figure 6 The processor 601, memory 602, and communication interface 603 are connected via bus 604. Bus 604 is... Figure 6 The connections between other components are shown in thick lines only and are not intended to be limiting. This bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, Figure 6 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0106] It should be understood that the processor in the embodiments of this application can be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method embodiments can be completed by the integrated logic circuitry in the processor's hardware or by instructions in software form. The processor can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules can be located in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in memory, and the processor reads the information in the memory and, in conjunction with its hardware, completes the steps of the above method.

[0107] It should also be understood that the memory in the embodiments of this application can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous linked dynamic random access memory (SLDRAM), and direct rambus RAM (DR RAM). It should be noted that the memory used in the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0108] This application also provides a computer-readable storage medium storing a computer program (also referred to as code or instructions). When the computer program is run, it causes the computer to perform the methods as described in any of the foregoing embodiments.

[0109] The terms “unit”, “module”, etc., used in this specification may be used to refer to computer-related entities, hardware, firmware, combinations of hardware and software, software, or software in execution.

[0110] Those skilled in the art will recognize that the various illustrative logical blocks and steps described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application. In the several embodiments provided in this application, it should be understood that the disclosed apparatus, devices, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for example, the division of units is merely a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the shown or discussed mutual couplings or direct couplings or communication connections may be through some interfaces; indirect couplings or communication connections between devices or units may be electrical, mechanical, or other forms.

[0111] The unit described as a separate component may or may not be physically separate. The component shown as a unit may or may not be a physical unit; that is, it may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0112] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0113] In the above embodiments, the functions of each functional unit can be implemented entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. This computer program product includes one or more computer instructions (programs). When the computer program instructions (programs) are loaded and executed on a computer, all or part of the flow or function according to the embodiments of this application is generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., digital video discs (DVDs)), or semiconductor media (e.g., solid-state disks (SSDs)).

[0114] If this function is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, ROM, RAM, magnetic disks, or optical disks.

[0115] The user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of the relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse.

[0116] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A data storage method, characterized in that, include: Receive Function as a Service (FaaS) requests, which are used to request the creation of a secure container to perform computing tasks; Create a secure container and allocate a virtual storage device to the secure container; Based on the I / O load of the security containers already created on the host machine, adjust the polling object of the global I / O polling thread. The polling object includes virtual queues in the virtual storage devices of the security containers already created on the host machine and / or multiple physical queues in the host machine, or the polling object is empty. The virtual queues are used to store I / O submission requests generated by the security containers when performing computing tasks. The I / O submission requests are used to request data to be submitted to the physical storage devices of the host machine. The physical queues are used to store I / O completion instructions generated by the physical storage devices. The I / O load includes the number of I / O submission requests. Adjusting the polling object of the global I / O polling thread based on the I / O load of the security containers already created on the host machine includes: If the number of I / O submission requests in the virtual queue of the virtual storage device of the secure container is greater than or equal to the third preset threshold, the secure container is identified as an active secure container. If the number of active security containers among the security containers already created on the host machine is less than or equal to the fourth preset threshold, then the number of polling objects of the global I / O polling thread is reduced. If the number of active security containers among those already created on the host machine is greater than a fourth preset threshold, then the polling objects of the global I / O polling thread are increased.

2. The method according to claim 1, characterized in that, The global I / O polling thread polls the physical queue, including: When the global I / O polling thread performs each poll, if an I / O completion instruction is found in the physical queue, the I / O completion instruction is added to the virtual queue, and the instruction count of the virtual storage device is incremented by 1. If the instruction count is greater than a first preset threshold, an interrupt is injected into the secure container. If no I / O completion instruction is found in the physical queue, the timer count of the virtual storage device is incremented by 1. If the timer count is greater than a second preset threshold, an interrupt is injected into the secure container. The interrupt injection into the secure container is used to send the I / O completion instructions in the virtual queue to the secure container.

3. The method according to claim 1, characterized in that, The global I / O polling thread polls the physical queue, including: If the number of I / O completion instructions obtained through polling is greater than or equal to a preset proportion of the maximum number of completion instructions in the physical queue, then the polling of the physical queue ends and the polling of the next physical queue begins.

4. The method according to claim 1, characterized in that, Before the receiving function, i.e., the FaaS service request, the method further includes: Multiple physical queues are created in the host machine's memory; Create a kernel thread as a global I / O polling thread, and bind the global I / O polling thread to the multiple physical queues.

5. The method according to claim 4, characterized in that, Also includes: The initial polling object of the global I / O polling thread is set to include the virtual queue of the security container already created on the host machine and the multiple physical queues.

6. The method according to claim 1, characterized in that, The process of allocating a virtual storage device to the secure container includes: Determine whether there is a virtual storage device in the virtual storage device resource pool that satisfies the FaaS request; If it exists, the virtual storage device is assigned to the security container; if it does not exist, a new virtual storage device that satisfies the FaaS request is created, and the newly created virtual storage device is assigned to the security container.

7. The method according to claim 1, characterized in that, When the polling object of the global I / O polling thread does not include the virtual queue, the I / O submission request is processed when memory-mapped I / O triggers a virtual machine trap; when the polling object of the global I / O polling thread does not include the physical queue, the I / O completion instruction is processed when a physical interrupt occurs.

8. The method according to claim 1, characterized in that, The global I / O polling thread polls the virtual queue to send I / O submission requests in the virtual queue to the physical queue so that the data corresponding to the I / O submission requests is stored in the physical storage device. The global I / O polling thread polls the physical queue to send I / O completion instructions from the physical queue to the virtual queue to indicate that the I / O submission request processing is complete.

9. A server, characterized in that, include: Memory and processor; The memory is used to store computer programs; The processor is configured to execute a computer program stored in the memory, wherein the computer program, when executed, causes the processor to perform the method of any one of claims 1-8.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, causes the processor to perform the method as described in any one of claims 1-8.

11. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, causes the processor to perform the method as described in any one of claims 1-8.

Citation Information

Patent Citations

  • NVMe storage virtualization method and system with predictable time delay

    CN112667356A

  • Storage transactions with predictable latency

    CN115210693A