Intra-server delay control device, intra-server delay control method and program
The user-space in-server delay control device with a polling thread and adaptive sleep management addresses latency and power efficiency issues by dynamically adjusting to application characteristics, achieving low-latency and power-efficient packet transfer.
Patent Information
- Application Number
- JP2023186709
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2023-10-31
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2042-01-27
AI Technical Summary
Existing server delay control methods face challenges in achieving low latency and power efficiency due to the use of polling threads in the kernel, which are difficult to adapt to applications with varying characteristics, leading to increased power consumption and delays.
An in-server delay control device is implemented in the user space with a polling thread that monitors packet arrival, includes a data arrival monitoring unit, a data arrival notification unit, and a sleep management unit to manage thread sleep and wake-up based on application characteristics, controlling the timing of hardware interrupts.
This approach reduces power consumption and latency in packet transfer within the server, accommodating applications with different characteristics by dynamically adjusting the polling model to match their needs.
Smart Images

Figure 0007574902000001 
Figure 0007574902000002 
Figure 0007574902000003
Abstract
Description
[Technical Field]
[0001] The present invention relates to an intra-server delay control device, an intra-server delay control method, and a program. [Background technology]
[0002] With the advancement of virtualization technology such as NFV (Network Functions Virtualization), systems are being built and operated for each service.In addition, a system called Service Function Chaining (SFC) is becoming mainstream, which divides service functions into reusable modules and runs them in independent virtual machine (VM) environments (such as containers) to use them as components when needed, improving operability, rather than building systems for each service.
[0003] A known technology for configuring virtual machines is a hypervisor environment consisting of Linux (registered trademark) and KVM (kernel-based virtual machine). In this environment, a Host OS (an OS installed on a physical server is called a Host OS) with a built-in KVM module acts as a hypervisor and runs in a memory area called kernel space, which is different from user space. In this environment, a virtual machine runs in user space, and a Guest OS (an OS installed on a virtual machine is called a Guest OS) runs within that virtual machine.
[0004] Unlike a physical server running a Host OS, a virtual machine running a Guest OS controls all hardware (HW), including network devices (typically Ethernet (registered trademark) card devices), as registers required for interrupt processing from the HW to the Guest OS and for writing from the Guest OS to the hardware. In this type of register control, notifications and processing that should be performed by physical hardware are simulated by software, so performance is generally lower than in a Host OS environment.
[0005] To address this performance degradation, there is a technology that reduces HW emulation, particularly from the guest OS to the host OS or external processes that exist outside the virtual machine, and improves communication performance and versatility through a high-speed, unified interface. One such technology is a device abstraction technology called Virtio, or paravirtualization technology, which has already been incorporated into many general-purpose operating systems, including Linux (registered trademark) and FreeBSD (registered trademark), and is currently in use.
[0006] Virtio defines data exchange using queues designed with ring buffers as a unidirectional transport for data input / output such as console, file input / output, and network communication, through queue operations. By using the Virtio queue specifications to prepare the number and size of queues appropriate for each device when the Guest OS starts, communication between the Guest OS and outside the virtual machine can be achieved using only queue operations without performing hardware emulation.
[0007] Data transfer technologies within a server include New API (NAPI), DPDK (Data Plane Development Kit), and KBP (Kernel Busy Poll).
[0008] When a packet arrives, the New API (NAPI) processes the packet by issuing a hardware interrupt request and then a software interrupt request (see Non-Patent Document 1) (see FIG. 19 below).
[0009] DPDK implements packet processing functions in the user space where applications run, and immediately harvests packets as they arrive from the user space using a polling model. Specifically, DPDK is a framework for controlling the network interface card (NIC), a task previously handled by the Linux kernel (registered trademark), in the user space. The biggest difference from the Linux kernel's processing is the inclusion of a polling-based reception mechanism called a pull mode driver (PMD). Typically, in the Linux kernel, an interrupt is generated when data arrives at the NIC, triggering reception processing. In contrast, in a PMD, a dedicated thread continuously checks for data arrival and performs reception processing. PMD enables high-speed packet processing by eliminating overhead such as context switches and interrupts. DPDK significantly improves packet processing performance and throughput, allowing more time for data plane application processing. However, DPDK monopolizes computer resources such as the central processing unit (CPU) and NIC.
[0010] Patent Document 1 describes a server network delay control device (KBP: Kernel Busy Poll). KBP constantly monitors packet arrivals within the kernel using a polling model. This suppresses softIRQs and achieves low-latency packet processing.
[0011] [Rx-side packet processing using New API (NAPI)] FIG. 19 is a schematic diagram of packet processing on the Rx side using the New API (NAPI) implemented in Linux kernel 2.5 / 2.6 and later (see Non-Patent Document 1). As shown in FIG. 19, the New API (NAPI) executes a data processing APL1 placed in a user space 60 available to a user on a server equipped with an OS 70 (e.g., a Host OS), and transfers packets between the NIC 11 of the HW 10 connected to the OS 70 and the data processing APL1.
[0012] The OS 70 includes a kernel 71 , a ring buffer 72 , and a driver 73 , and the kernel 71 includes a protocol processing unit 74 . Kernel 71 is a core function of OS 70 (for example, Host OS), and monitors hardware and manages the execution status of programs on a process-by-process basis. Here, kernel 71 responds to requests from data processing APL1 and also conveys requests from HW 10 to data processing APL1. Kernel 71 processes requests from data processing APL1 via a system call (a "user program running in non-privileged mode" requests processing from the "kernel running in privileged mode"). The kernel 71 transmits a packet to the data processing APL1 via the socket 75. The kernel 71 receives a packet from the data processing APL1 via the socket 75.
[0013] The Ring Buffer 72 is located in the memory space of the server and is managed by the Kernel 71. The Ring Buffer 72 is a buffer of a certain size that stores messages output by the Kernel 71 as logs, and when the upper limit size is exceeded, the messages are overwritten from the beginning.
[0014] Driver73 is a device driver that monitors hardware using kernel71. Note that Driver73 depends on kernel71, and if the created (built) kernel source changes, it will become a different driver. In this case, you will need to obtain the relevant driver source and rebuild it on the OS that uses the driver to create the driver.
[0015] The protocol processing unit 74 performs protocol processing of L2 (data link layer), L3 (network layer), and L4 (transport layer) defined by the OSI (Open Systems Interconnection) reference model.
[0016] Socket75 is an interface that kernel71 uses for inter-process communication. Socket75 has a socket buffer and does not require frequent data copying. The process for establishing communication via Socket75 is as follows: 1. The server creates a socket file that accepts clients. 2. A name is given to the accepting socket file. 3. A socket queue is created. 4. The first connection from the client in the socket queue is accepted. 5. A socket file is created on the client side. 6. The client issues a connection request to the server. 7. On the server side, a connection socket file is created separately from the accepting socket file. As a result of establishing communication, data processing APL1 can call system calls such as read() and write() on kernel71.
[0017] In the above configuration, the Kernel 71 receives notification of the arrival of a packet from the NIC 11 via a hardware interrupt (hardIRQ), and schedules a software interrupt (softIRQ) for packet processing. The New API (NAPI) implemented in Linux kernel 2.5 / 2.6 above processes packets using a hardware interrupt (hardIRQ) and then a software interrupt (softIRQ) when a packet arrives. As shown in Figure 19, packet transfer using the interrupt model transfers packets using interrupt processing (see symbol a in Figure 19), which causes a wait for the interrupt processing and increases the delay in packet transfer.
[0018] The following is an overview of packet processing on the NAPI Rx side. [Rx side packet processing configuration using New API (NAPI)] FIG. 20 is a diagram for explaining an outline of Rx-side packet processing by New API (NAPI) in the area surrounded by the dashed line in FIG. <Device driver> As shown in Figure 20, the Device driver includes NIC11 (physical NIC), which is a network interface card, hardIRQ81, which is a handler that is called when a processing request is made to NIC11 and executes the requested processing (hardware interrupt), and netif_rx82, which is a processing function unit for software interrupts.
[0019] <Networking layer> The Networking layer includes softIRQ 83, a handler that is called when a processing request from netif_rx 82 occurs and executes the requested processing (software interrupt), and do_softirq 84, a control function unit that executes the software interrupt (softIRQ). Also included are net_rx_action 85, a packet processing function unit that receives and executes the software interrupt (softIRQ), poll_list 86, which registers information about the net device (net_device) that indicates which device the hardware interrupt from the NIC 11 belongs to, netif_receive_skb 87, which creates the sk_buff structure (a structure that allows the Kernel 71 to recognize the status of the packet), and Ring Buffer 72.
[0020] <Protocol layer> The protocol layer includes packet processing function units such as ip_rcv88 and arp_rcv89.
[0021] The above netif_rx 82, do_softirq 84, net_rx_action 85, netif_receive_skb 87, ip_rcv 88, and arp_rcv 89 are program components (function names) used for packet processing in the Kernel 71.
[0022] [Rx side packet processing operation using New API (NAPI)] Arrows (symbols) b to m in FIG. 20 indicate the flow of packet processing on the Rx side. When the hardware function unit 11a of the NIC 11 (hereinafter referred to as NIC 11) receives a packet (or frame) in a frame from the other device, it copies the arriving packet to the Ring Buffer 72 by DMA (Direct Memory Access) transfer without using the CPU (see symbol b in Figure 20). This Ring Buffer 72 is a memory space in the server, and is managed by the Kernel 71 (see Figure 19).
[0023] However, if the NIC 11 simply copies the packet that has arrived to the Ring Buffer 72, the Kernel 71 will not be able to recognize the packet. Therefore, when a packet arrives, the NIC 11 raises a hardware interrupt (hardIRQ) to hardIRQ 81 (see symbol c in Figure 20), and netif_rx 82 executes the following process, which allows the Kernel 71 to recognize the packet. Note that hardIRQ 81, shown enclosed in an oval in Figure 20, represents a handler rather than a functional unit.
[0024] Netif_rx 82 is the function that actually performs the processing. When hardIRQ 81 (handler) is started (see symbol d in Figure 20), it saves net device (net_device) information, which is one of the pieces of information contained in the hardware interrupt (hardIRQ), in poll_list 86, indicating which device the hardware interrupt from NIC 11 belongs to. Then, netif_rx 82 registers queue pruning. Here, queue pruning refers to referencing the contents of packets stored in the buffer and deleting the corresponding queue entry from the buffer, taking into account the next processing to be performed on that packet. Specifically, when a packet is stuffed into the Ring Buffer 72, netif_rx 82 uses the NIC 11 driver to register future queue pruning in poll_list 86 (see symbol e in Figure 20). As a result, queue pruning information resulting from the stuffing of packets into the Ring Buffer 72 is registered in poll_list 86.
[0025] In this way, in Figure 20<Device driver> In the figure, when the NIC 11 receives a packet, it copies the packet that has arrived to the Ring Buffer 72 by DMA transfer. The NIC 11 also starts up the hardIRQ 81 (handler), and the netif_rx 82 registers the net_device in the poll_list 86 and schedules a software interrupt (softIRQ). So far, we have completed the steps in Figure 20.<Device driver> Processing of hardware interrupts in the suspend state stops.
[0026] Then, netif_rx82 uses the information (specifically, the pointer) in the queue stored in poll_list86 to notify softIRQ83 (handler) via a software interrupt (softIRQ) that it will harvest the data stored in Ring Buffer72 (see symbol f in Figure 20), and notifies do_softirq84, which is the software interrupt control function unit (see symbol g in Figure 20).
[0027] do_softirq84 is a software interrupt control function unit that defines each software interrupt function (there are various types of packet processing, and interrupt processing is one of them. This defines the interrupt processing). Based on this definition, do_softirq84 notifies net_rx_action85, which actually processes the software interrupt, of the current (relevant) software interrupt request (see symbol h in Figure 20).
[0028] When the turn of the softIRQ comes, net_rx_action 85 calls a polling routine for reaping packets from Ring Buffer 72 based on net_device registered in poll_list 86 (see symbol i in FIG. 20), and reaps the packets (see symbol j in FIG. 20). At this time, net_rx_action 85 continues reaping until poll_list 86 becomes empty. Thereafter, net_rx_action 85 notifies netif_receive_skb 87 (see symbol k in FIG. 20).
[0029] The netif_receive_skb 87 creates an sk_buff structure, analyzes the contents of the packet, and sends the processing to the subsequent protocol processing unit 74 (see FIG. 19) for each type. That is, the netif_receive_skb 87 analyzes the contents of the packet, and when processing is to be performed according to the contents of the packet,<Protocol layer> If it is L2, the process is passed to arp_rcv 89 (symbol m in FIG. 20).
[0030] Figure 21 shows an example of video (30 FPS) data transfer. The workload shown in Figure 21 has a transfer rate of 350 Mbps, and data is transferred intermittently every 30 ms.
[0031] FIG. 22 is a diagram showing the CPU utilization rate used by the busy poll thread in the KBP described in Patent Document 1. In FIG. As shown in Fig. 22, in KBP, the kernel thread occupies a CPU core to perform busy poll. Even in the case of intermittent packet reception as shown in Fig. 21, KBP always uses the CPU regardless of whether packets arrive, which poses a problem of increased power consumption.
[0032] Next, we will explain the DPDK system. [DPDK system configuration] FIG. 23 is a diagram illustrating the configuration of a DPDK system that controls the HW 110 that includes the accelerator 120. The DPDK system includes HW 110, OS 140, DPDK 150, which is high-speed data transfer middleware arranged on user space 160, and data processing APL 1. The data processing APL1 is packet processing that is performed prior to the execution of the APL. The HW 110 communicates with the data processing APL 1 to send and receive data. In the following description, as shown in Fig. 23 , the data flow in which the data processing APL 1 receives packets from the HW 110 is referred to as Rx-side reception, and the data flow in which the data processing APL 1 transmits packets to the HW 110 is referred to as Tx-side transmission.
[0033] The HW 110 includes an accelerator 120 and a NIC 130 (physical NIC) for connecting to a communication network. The accelerator 120 is a computation unit hardware that performs specific calculations at high speed based on input from the CPU. Specifically, the accelerator 120 is a PLD (Programmable Logic Device) such as a GPU (Graphics Processing Unit) or an FPGA (Field Programmable Gate Array). In Fig. 23, the accelerator 120 includes a plurality of Cores (Core processors) 121, Rx queues (queues) 122 that hold data in a first-in, first-out list structure, and Tx queues 123.
[0034] A part of the processing of the data processing APL1 is offloaded to the accelerator 120, thereby achieving performance and power efficiency that cannot be achieved by software (CPU processing) alone. It is conceivable that the accelerator 120 described above will be applied to a large-scale server cluster, such as a data center that implements NFV (Network Functions Virtualization) or SDN (Software Defined Network).
[0035] The NIC 130 is NIC hardware that realizes a network interface, and includes an Rx queue 131 and a Tx queue 132 that hold data in a first-in, first-out list structure. The NIC 130 is connected to an associated device 170 via, for example, a communication network, and transmits and receives packets. The NIC 130 may be, for example, a SmartNIC, which is a NIC with an accelerator. The SmartNIC is a NIC that can reduce the load on the CPU by offloading load-intensive processing, such as IP packet processing, which can cause a decrease in processing power.
[0036] DPDK 150 is a framework for controlling NICs in user space 160, and specifically consists of high-speed data transfer middleware. DPDK 150 has a polling-based reception mechanism, PMD (Poll Mode Driver) 151 (a driver that can select polling mode or interrupt mode for data arrival). PMD 151 has a dedicated thread that continuously checks for data arrival and performs reception processing.
[0037] DPDK150 realizes packet processing functions in user space 160 where APL runs, and reduces packet transfer delays by immediately reaping packets when they arrive from user space 160 using a polling model. In other words, DPDK150 reaps packets by polling (busy polling the queue in the CPU), so there is no waiting and delays are small.
[0038] Patent Document 1 describes a server network delay control device (KBP: Kernel Busy Poll). KBP constantly monitors packet arrivals within the kernel using a polling model. This suppresses softIRQs and achieves low-latency packet processing.
[0039] Incidentally, both packet transfers using the interrupt model and the polling model have the following problems. In the interrupt model, packets are transferred by software interrupt processing, where the kernel processes packets after receiving an event (hardware interrupt) from the hardware. Because the interrupt model transfers packets by interrupt (software interrupt) processing, there are issues such as conflicts with other interrupts and waiting times when the interrupt destination CPU is being used by a higher priority process, which can increase packet transfer delays. In this case, if the interrupt processing becomes congested, the waiting delays will increase even more. For example, in packet transfer based on the interrupt model, packets are transferred by interrupt processing, which causes waiting for the interrupt processing, resulting in a large delay in packet transfer.
[0040] The mechanism by which delay occurs in the interrupt model will be explained below. In a typical kernel, packet transfer processing is performed by software interrupt processing after hardware interrupt processing. When a software interrupt occurs in packet forwarding processing, the software interrupt processing cannot be executed immediately under the following conditions (1) to (3). Therefore, arbitration is performed by a scheduler such as ksoftirqd (a kernel thread for each CPU that is executed when the software interrupt load becomes high), and the interrupt processing is scheduled, resulting in a wait on the order of milliseconds. (1) When there is a conflict with other hardware interrupt processing (2) When there is a conflict with other software interrupt processing (3) When other high-priority processes, kernel threads (migration threads, etc.), or interrupt destination CPUs are in use Under the above conditions, the software interrupt process cannot be executed immediately. [Prior art documents] [Patent documents]
[0041] [Patent Document 1] International Publication No. 2021 / 130828 [Non-patent literature]
[0042] [Non-Patent Document 1] New API (NAPI), [online], [Retrieved January 11, 2022], Internet <URL: http: / / http: / / lwn.net / 2002 / 0321 / a / napi-howto.php3> Summary of the Invention [Problem to be solved by the invention]
[0043] When a polling thread for reception is deployed within the kernel, as in the server network latency control device (KBP) described in Patent Document 1, the focus is on versatility, making it difficult to perform reception processing that takes into account the characteristics of each application. As a result, low latency and power-saving features in reception processing may be compromised. For example, the above-mentioned power-saving server network latency control device has a function that immediately puts the polling thread to sleep when reception processing ends and no further data arrives (poll_list becomes empty). This function is generally expected to improve power saving. On the other hand, if an application has the characteristic of "receiving data from the kernel immediately without requiring in-kernel protocol processing," the reception processing may be immediately completed and poll_list may become empty, causing the thread to go to sleep even when data is being received continuously. As a result, wake-ups due to hardware interrupts may occur frequently, compromising power saving and low latency features.
[0044] The present invention has been made in light of this background, and its objective is to transfer packets with reduced delay within the server while reducing power consumption, even for applications with different characteristics. [Means for solving the problem]
[0045] In order to solve the above-mentioned problems, a delay control device within a server is provided which is placed in user space and launches a thread that monitors packet arrivals using a polling model, and which comprises: a data arrival monitoring unit that monitors the device's receive queue by polling and acquires the data if a packet has arrived; a data arrival notification unit that notifies the application program of the data acquired by the data arrival monitoring unit and passes it on; and a sleep management unit that puts the thread to sleep if a packet does not arrive for a specified period of time and wakes the thread from sleep mode by a hardware interrupt when a packet arrives, wherein the sleep management unit controls the timing of the sleep by allowing the hardware interrupt based on the characteristics of the application program. [Effects of the Invention]
[0046] According to the present invention, it is possible to reduce power consumption and packet transfer with reduced delay within the server even for applications with different characteristics. [Brief explanation of the drawings]
[0047] [Figure 1] 1 is a schematic configuration diagram of an intra-server delay control system according to a first embodiment of the present invention. [Figure 2] 3 is a diagram for explaining the operation of the intra-server delay control system according to the first embodiment of the present invention. FIG. [Figure 3] 10 is a flowchart of a transfer process (when a data arrival notifying unit does not process a packet) during operation of a polling thread in the intra-server delay control device of the intra-server delay control system according to the first embodiment of the present invention. [Figure 4] 10 is a diagram illustrating the operation of a transfer process (when a data arrival notification unit does not process a packet) during the operation of a polling thread of an intra-server delay control device of an intra-server delay control system according to the first embodiment of the present invention. FIG. [Figure 5]10 is a flowchart of a transfer process (when a data arrival notifying unit processes a packet) during operation of a polling thread of an intra-server delay control device of the intra-server delay control system according to the first embodiment of the present invention. [Figure 6] 10 is a diagram illustrating the operation of a transfer process (when a data arrival notifying unit processes a packet) during the operation of a polling thread of an intra-server delay control device of an intra-server delay control system according to the first embodiment of the present invention. FIG. [Figure 7] 1 is a processing flowchart showing a process from when a polling thread of an intra-server delay control device of an intra-server delay control system according to a first embodiment of the present invention wakes up from a sleep state. [Figure 8] 1 is a diagram illustrating the operation of a polling thread of an intra-server delay control device of an intra-server delay control system according to a first embodiment of the present invention from a sleep state to wake-up. FIG. [Figure 9] FIG. 10 is a schematic configuration diagram of an intra-server delay control system according to a second embodiment of the present invention. [Figure 10] FIG. 10 is an explanatory diagram of the operation of a characteristic information collection unit of the intra-server delay control device of the intra-server delay control system according to the second embodiment of the present invention. [Figure 11] 10 is an explanatory diagram of the operation of the logic distribution unit of the intra-server delay control device of the intra-server delay control system according to the second embodiment of the present invention. FIG. [Figure 12] 10 is a processing flowchart of logic change to a data arrival monitoring unit in an intra-server delay control device of an intra-server delay control system according to a second embodiment of the present invention. [Figure 13] FIG. 10 is an explanatory diagram of the operation of changing logic to a data arrival monitoring unit in an intra-server delay control device of an intra-server delay control system according to a second embodiment of the present invention. [Figure 14] 10 is a processing flowchart of logic change to a data arrival notification unit in an intra-server delay control device of an intra-server delay control system according to a second embodiment of the present invention. [Figure 15]FIG. 10 is an explanatory diagram of the operation of changing logic to a data arrival notification unit in an intra-server delay control device of an intra-server delay control system according to a second embodiment of the present invention. [Figure 16] 10 is a processing flowchart of logic change to a sleep management unit in an intra-server delay control device of an intra-server delay control system according to a second embodiment of the present invention. [Figure 17] 10 is an explanatory diagram of the operation of changing logic to a sleep management unit in an intra-server delay control device of an intra-server delay control system according to a second embodiment of the present invention. FIG. [Figure 18] 1 is a hardware configuration diagram showing an example of a computer that realizes the functions of an intra-server delay control device in an intra-server delay control system according to the first and second embodiments of the present invention. FIG. [Figure 19] This is a schematic diagram of Rx-side packet processing using the New API (NAPI) implemented in Linux kernel 2.5 / 2.6. [Figure 20] 20 is a diagram illustrating an outline of Rx-side packet processing by New API (NAPI) in the area surrounded by the dashed line in FIG. 19. FIG. [Figure 21] FIG. 10 is a diagram showing an example of video (30 FPS) data transfer. [Figure 22] FIG. 1 is a diagram showing the CPU utilization rate used by a busy poll thread in the KBP described in Patent Document 1. [Figure 23] FIG. 1 is a diagram illustrating the configuration of a DPDK system that controls HW equipped with an accelerator. DETAILED DESCRIPTION OF THE INVENTION
[0048] Hereinafter, an intra-server delay control system and the like in an embodiment for carrying out the present invention (hereinafter referred to as "the present embodiment") will be described with reference to the drawings. (First embodiment) 1 is a schematic diagram of an intra-server delay control system according to a first embodiment of the present invention, in which the same components as those in FIG. 23 are denoted by the same reference numerals. As shown in FIG. 1, the intra-server delay control system 1000 executes a data processing APL (Application) 1 (application program; hereinafter, referred to as "application") located in a user space 160 available to a user on a server equipped with an OS (e.g., a Host OS) 140, and transfers packets between a NIC 130 (device) of a HW 110 connected to the OS and the data processing APL 1. The intra-server delay control system 1000 includes HW 110, OS 140, intra-server delay control device 200 arranged on user space 160, and data processing APL1. The data processing APL1 is packet processing that is performed prior to the execution of the APL. The HW110 communicates with the data processing APL1 to send and receive data. The HW 110 includes a NIC 130 (device) for connecting to a communication network. The HW 110 may include an accelerator 120 shown in FIG.
[0049] [In-server delay control device] The intra-server delay control device 200 is a polling thread that is placed in user space. The polling thread (internal server delay control device 200) is characterized by being provided in user space, not in the OS kernel. Since the polling thread (internal server delay control device 200) defines data reception processing in user space, it is possible to change the reception processing method according to the application characteristics (characteristics of the application program).
[0050] The intra-server delay control device 200 includes a data arrival monitor 210 , a data arrival notifier 220 , and a sleep manager 230 .
[0051] <Data Arrival Monitoring Unit 210> The data arrival monitor 210 monitors the receiving queue of the device by polling, and when a packet arrives, acquires the data and passes it to the data arrival notifier 220 . Specifically, the data arrival monitoring unit 210 monitors the reception queue of the device by polling. When a packet has arrived, it refers to the packets held in the ring buffer and performs pruning to delete the corresponding queue entry from the ring buffer based on the next process to be performed. That is, the data arrival monitoring unit 210 monitors the reception queue of the device by polling and performs immediate pruning. The data arrival monitoring unit 210 checks whether data has arrived at the reception queue of the device at a predetermined timing based on the characteristics of the application.
[0052] After a stop for a predetermined time, the data arrival monitoring unit 210 checks whether data has arrived at the reception queue of the device. That is, the data arrival monitoring unit 210 suppresses the number of CPU cycles by sandwiching a temporary stop in polling and monitors according to the characteristics of the application.
[0053] <Data arrival notification unit 220> The data arrival notification unit 220 notifies and transfers the data acquired by the data arrival monitoring unit 210 to the application.
[0054] When the characteristics of the application are such that it processes packets sequentially, the data arrival notification unit 220 notifies immediately when a packet arrives. On the other hand, when the characteristics of the application are such that it processes packets in batches, the data arrival notification unit 220 notifies when a predetermined number of packets have arrived.
[0055] The data arrival notification unit 220 has a packet processing function and, based on the characteristics of the application program, executes the packet processing function. When the packet processing function is executed, it does not notify the application program. Thus, the data arrival notification unit 220 can select a method of notifying in batches or sequentially according to the characteristics of the application, and can also cause this functional unit to process packets.
[0056] <Sleep management unit 230> The sleep management unit 230 controls the timing of allowing hardware interrupts and going to sleep based on the characteristics of the application. The sleep management unit 230 puts the polling thread to sleep and allows HW interrupts, or disables HW interrupts and wakes up the polling thread. In this case, the sleep timing can be controlled according to the characteristics of the application.
[0057] The sleep management unit 230 puts the polling thread to sleep when no packet has arrived, and when a packet arrives again, it is woken up by a hard IRQ and starts polling.
[0058] When starting sleep during polling, the sleep management unit 230 stops the polling thread, enables HW interrupts, and sleeps. At this time, the power consumption during sleep is further reduced by lowering the CPU operating frequency and operating voltage.
[0059] The sleep management unit 230 has a mechanism to control the timing of enabling HW interrupts and going to sleep according to the characteristics of the application. For example, in the case of an application in which packets arrive immediately even if the driver's receive queue becomes empty, polling can be continued.
[0060] When the sleep management unit 230 is asleep, it is woken up by a hardware interrupt that occurs when a packet arrives, and starts polling while the hardware interrupt is disabled. At this time, the CPU operating frequency and voltage are reset to higher values.
[0061] The sleep management unit 230 compares the time that has elapsed since the packet did not arrive with the time that is appropriate for the characteristics of the application, and if the time that has elapsed since the packet did not arrive is equal to or greater than the time that is appropriate for the characteristics of the application, it enables a hardware interrupt and puts the thread to sleep.
[0062] The operation of the intra-server delay control system 1000 configured as described above will now be described. [Overall operation of the server delay control system 1000] FIG. 2 is a diagram for explaining the operation of the intra-server delay control system 1000 of FIG. Arrows (symbols) aa to gg in FIG. 2 indicate the flow of packet processing on the Rx side. When the NIC 130 receives a packet (or a frame) from the other device in a frame, it bypasses the OS 140 and transmits the packet to the data arrival monitor 210 of the polling thread (intra-server delay control device 200).
[0063] <Operation of Data Arrival Monitoring Unit 210> The data arrival monitor 210 monitors the receiving queue of the device by polling (see FIG. 2). <polling>(see symbol aa), and when a packet arrives, it is harvested and handed over to the data arrival notification unit 220 (see symbol bb in FIG. 2). If the application's latency requirements are not strict or the packet arrival intervals are not short, pausing the polling makes it possible to monitor reception while reducing the number of CPU cycles (power saving).
[0064] The data arrival monitor 210 starts a polling thread that monitors packet arrivals and directly monitors the receive queue of the network device. When a packet arrives, it is immediately harvested without waiting, enabling low-latency packet processing ("Feature 1: Low-latency packet transfer").
[0065] <Operation of the data arrival notification unit 220> The data arrival notification unit 220 notifies the data processing APL (Application) 1 of the data collected by the data arrival monitoring unit 210 and passes it over (see FIG. 2). <notify>; Symbol cc reference).
[0066] Here, for an application that processes packets sequentially, it is possible to select an arrival notification method according to the characteristics of the application, such as "notify immediately when data arrives" or "for an application that processes packets in batches, notify when a certain number of data has arrived". Furthermore, when the application is simple, instead of notifying, it is also possible to reduce the overhead of arrival notification and process packets by having a function to process packets.
[0067] The Polling Thread (server internal delay control device 200) can achieve further reduction in latency and power consumption according to the characteristics of the application and traffic information by controlling the frequency of polling for harvesting, the method of notifying the application of the arrived data, and the timing of putting the Polling Thread to sleep ("Feature 2: Reception processing with awareness of application characteristics and traffic information").
[0068] <Operation of Sleep Management Unit 230> When a packet arrives, NIC 130 raises a HW interrupt (hardIRQ) to hardIRQ81 (handler) (in FIG. 2 <interrupt>When the hardwire 81 (handler) is started, the sleep management unit 230 is woken up by a HW interrupt that occurs when a packet arrives (see symbol dd in FIG. 2). <wakeup>(see symbol ee), and starts polling while disabling HW interrupts. In other words, the sleep management unit 230 puts the polling thread to sleep when no packet has arrived, and when a packet arrives again, it is woken up by the HardIRQ 81 and starts polling.
[0069] The sleep management unit 230 puts the polling thread to sleep and allows HW interrupts, or disables HW interrupts and wakes up the polling thread (see the block in FIG. 2). <enable disable>(See symbol ff). In this case, you can control the timing of sleep according to the characteristics of the application.
[0070] When starting sleep during polling, the sleep management unit 230 stops the polling thread and sleeps while allowing HW interrupts (see FIG. 2).<Polling Start / stop> (See symbol gg.) At this time, power consumption during sleep is further reduced by lowering the CPU operating frequency and operating voltage.
[0071] The sleep management unit 230 has a mechanism to control the timing of enabling HW interrupts and going to sleep according to the characteristics of the application. For example, in the case of an application in which packets arrive immediately even if the driver's receive queue becomes empty, polling can be continued.
[0072] The sleep management unit 230 puts the polling thread to sleep when no packets have arrived. This reduces unnecessary CPU usage and achieves power savings. Further power savings can be achieved by lowering the CPU operating voltage and operating frequency when the device goes to sleep ("Feature 3: Power Saving"). In addition, the Polling Thread in the sleep state can be woken up by the HardIRQ handler 81 when a packet arrives, thereby avoiding softIRQ contention and enabling immediate startup.
[0073] <How to determine parameters U, T, and K> A method for determining the parameters U, T, and K used in the flowcharts of FIGS. 3 and 5 will be described later. The Polling Thread (intra-server delay control device 200) uses a data arrival monitoring interval U (a parameter of the data arrival monitoring unit 210), a time T from when a packet does not arrive until sleep is entered (a parameter of the sleep management unit 230), and the number of batches K for notifying or processing packets (a parameter of the data arrival notification unit 220). In the first embodiment, the parameters U, T, and K are fixed values set in advance by the operator. In the second embodiment described below, the parameters U, T, and K are dynamically set via the logic management unit 310 (for convenience of explanation, they are described together here).
[0074] Example of determining the data arrival monitoring interval U There are fixed values set in advance by the operator, and dynamic settings via the logic management unit 310 (described later). In the case of dynamic setting via the logic manager 310 (described later), there are the following two examples. Example 1: The data arrival monitor 210 acquires the packet arrival frequency, and sets U so that arrival monitoring can be performed at a frequency close to that frequency. Example 2: Obtain the maximum allowable delay from an application or a controller external to the server, and set U so that arrival monitoring can be performed at a frequency that maintains that delay.
[0075] Example of determining the time T from packet non-arrival to sleep There are fixed values set in advance by the operator, and dynamic settings via the logic management unit 310 (described later). In the case of dynamic setting via the logic manager 310, there are two examples: Example 1: The sleep management unit 230 acquires the time from when the sleep state is entered to when the wake-up state is reached, and if this interval is so short that it adversely affects the delay time and power saving performance, T is increased. Example 2: The packet arrival frequency is acquired from the data arrival monitor 210, an application, or a controller external to the server, and if it is high, T is made small so that sleep can occur as much as possible.
[0076] Example of determining the number of batches K to notify or process packets The batch number K will now be described. That is, when multiple packets are stored in the Ring_Buffer area, the data arrival monitor unit 210 cuts the multiple packets together and passes them to the subsequent protocol processor (not shown). This number of packets cut together is called a quota, which is also called batch processing, and the number of processes is called the batch number (batch processing number). There are fixed values set in advance by the operator, and dynamic settings via the logic management unit 310 (described later). In the case of dynamic configuration via the logic manager 310 (described below), the following example is given. Example 1: Obtain batch processing information within the application from the application and set K accordingly.
[0077] Next, the transfer process during the operation of the Polling Thread will be described with reference to Figures 3 to 6. The transfer process during the operation of the Polling Thread can be performed in two cases: when the data arrival notification unit 220 does not process packets (see Figures 3 and 4), and when the data arrival notification unit 220 processes packets (see Figures 5 and 6). Each case will be described below.
[0078] [Transfer Processing During Polling Thread Operation (When the Data Arrival Notification Unit 220 Does Not Process Packets)] <Flowchart> FIG. 3 is a flowchart of the transfer process during the operation of the polling thread (when the data arrival notification unit 220 does not process packets).
[0079] In step S11, the data arrival monitor 210 checks, at intervals appropriate for the application characteristics, whether data has arrived in the receive queue of the NIC 130. The data arrival monitor 210 pauses for a time U, for example, before checking. In step S12, the data arrival monitor 210 determines whether or not data has arrived in the receiving queue. If no data has arrived in the receiving queue (S12: No), the process proceeds to step S17.
[0080] When data has arrived at the reception queue (S12: Yes), in step S13, the data arrival monitoring unit 210 acquires the data from the reception queue and transmits the corresponding information to the data arrival notification unit 220 (when multiple data have arrived at the reception queue, it transmits for the multiple data). Also, at this time, the Sleep management unit 230 resets the elapsed time S since the packet became outstanding to 0.
[0081] In step S14, the data arrival notification unit 220 adds the number of packets N that have arrived so far and compares it with the batch number K suitable for the application characteristics.
[0082] In step S15, the data arrival notification unit 220 determines whether N≥K. If N<K (S15: No), it returns to step S11 above.
[0083] If N≥K (S15: Yes), in step S16, the data arrival notification unit 220 notifies the application of the data arrival, delivers the data, sets the number of packets N that have arrived so far to 0, and returns to step S11 above.
[0084] In step S17, the Sleep management unit 230 compares the elapsed time S since the packet became outstanding with the time T suitable for the application characteristics.
[0085] In step S18, the Sleep management unit 230 determines whether S≥T. If S<T (S18: No), it returns to step S11 above.
[0086] If S≥T (S18: Yes), in step S19, the Sleep management unit 230 enables the HW interrupt, lowers the CPU operation frequency and operation voltage, puts the Polling Thread to sleep, and ends the processing of this flow.
[0087] The number of batches K (≧1), the time T (≧0) suitable for the application characteristics, and the pause time U (≧0) will be described below. K, T, and U are set in advance by the operator. K, T, and U are also dynamically changed by the logic management unit 310 (an example of how K, T, and U are determined will be described later in the second embodiment).
[0088] <Operation explanation diagram> FIG. 4 is a diagram for explaining the operation of the transfer process during the operation of the polling thread (when the data arrival notifying unit 220 does not process the packet). When the NIC 130 receives a packet, it copies the packet directly to the Ring Buffer (a buffer in main memory) using DMA (Direct Memory Access) without going through the CPU (see Figure 4). <polling>(See symbol aa.) This Ring Buffer is set in advance so that it can be accessed directly from the Polling Thread in User Space 160 without going through the OS kernel.
[0089] The NIC 130 generates an interrupt to the CPU that the polling thread is running on, and the CPU notifies the polling thread of its wake-up in the context of a hardware interrupt, waking up the sleep management unit 230. After that, the polling thread runs on the CPU.
[0090] The sleep management unit 230 sets the frequency of the CPU to a high value and inhibits interrupts to the CPU (see FIG. 4). <enable>(See symbol ff). The CPU frequency can also be changed from User Space 160 by setting the CPU governor.
[0091] The sleep management unit 230 instructs the data arrival monitor unit 210 to start polling (see FIG. 4).<Polling stop> (See symbol gg.) The instruction to start the polling is specifically a call from the sleep management unit 230 to a function that handles the processing of the data arrival monitoring unit 210.
[0092] The data arrival monitoring unit 210 checks the arrival of packets in the Ring Buffer area where the packets are DMA'd at an arrival check interval determined in advance by the operator, and if a packet has arrived, it transmits the address information (pointer) of the packet to the data arrival notification unit 220 (see symbol bb in Figure 4).
[0093] The data arrival notifying unit 220 checks whether the number of pieces of pointer information transmitted from the data arrival monitoring unit 210 reaches the number of batches for notifying packets, which has been determined in advance by the operator (steps S14 to S15 in FIG. 3).
[0094] If the number of transmitted pointer information reaches the determined number of batches for notifying packets, the process proceeds to the following processing. If not, the process returns to packet arrival confirmation by the data arrival monitor 210.
[0095] The data arrival notification unit 220 stores the address information in the memory shared by the application and the polling thread, starts a thread in which the application runs, and executes the process within that thread (see FIG. 4). <notify>; see sign cc).
[0096] If the period during which no packets have arrived continues for a period of time determined in advance by the operator, the data arrival monitor 210 calls the sleep manager 230 (step S12 in FIG. 3). When the data arrival monitor 210 returns, the process returns to the sleep manager 230.
[0097] The sleep management unit 230 reduces the CPU frequency, enables interrupts to the CPU, and puts the polling thread into a sleep state (step S19 in FIG. 3).
[0098] [Transfer Processing During Polling Thread Operation (When the Data Arrival Notification Unit 220 Processes Packets)] If the operator has configured the application logic to be executed in the same thread, the processing is performed within the polling thread.
[0099] <Flowchart> 5 is a flowchart of the transfer process during the operation of the polling thread (when the data arrival notification unit 220 processes packets). Steps that perform the same processes as in the flow of FIG. 3 are given the same numbers, and the explanation will be omitted. In step S15, the data arrival notifying unit 220 determines whether or not N≧K holds, and if N≧K holds (S15: Yes), the process proceeds to step S21. In step S21, data arrival notification unit 220 processes the packet (for example, transfers it to another server) and returns to step S11. Data arrival notification unit 220 also sets the number of packets N that have arrived so far to 0. Because data arrival notification unit 220 processes the packet, there is no process of notifying an application of data arrival and handing over the data, as in data arrival notification unit 220 in step S16 of FIG. 3.
[0100] <Operation explanation diagram> 6 is a diagram illustrating the operation of transfer processing (when the data arrival notification unit 220 processes packets) during the operation of the polling thread. The same components as those in the operation explanatory diagram of FIG. 4 are assigned the same numbers and their explanations will be omitted.
[0101] The data arrival notification unit 220 processes packets. The packet processing performed by the data arrival notification unit 220 in the polling thread is a relatively light load process, such as transfer processing to another server.
[0102] [Processing until Polling Thread wakes up from Sleep state] Figure 7 is a processing flowchart showing how the Polling Thread wakes up from a sleep state. Figure 8 is a diagram explaining its operation. The same components as those in the diagram explaining the operation in Figure 2 are assigned the same numbers. In step S31, data arrives at the NIC 130, and an interrupt is issued from the NIC 130 to the CPU. In step S32, the HW interrupt context is started in the CPU. In step S33, the sleep management unit 230 of the polling thread is woken up in the context of the HW interrupt.
[0103] Specifically, as shown in FIG. 8, when a packet arrives, the NIC 130 raises a HW interrupt (hardIRQ) to the hardIRQ 81 (handler) (see FIG. 8). <interrupt>When the hardwire 81 (handler) is started, the sleep management unit 230 is woken up by a HW interrupt that occurs when a packet arrives (see symbol dd in FIG. 8). <wakeup>;see symbol ee), and start polling while disabling HW interrupts.
[0104] In step S34, the sleep management unit disables the interrupt from the NIC 130 (see FIG. 8). <enable>; see symbol ff), set the CPU operating frequency and operating voltage high, and start polling of the data arrival monitor unit 210. When polling is in progress, the sleep manager 230 stops the polling thread when starting sleep, and sleeps while permitting HW interrupts (see symbol ff in FIG. 8).<Polling Start > ; see sign gg).
[0105] (Second embodiment) 9 is a schematic diagram of an intra-server delay control system according to a second embodiment of the present invention. Components that are the same as those in FIG. 1 are given the same reference numerals, and explanations of overlapping parts will be omitted. As shown in FIG. 9, the intra-server delay control system 1000A includes HW 110, OS 140, intra-server delay control device 300 arranged on user space 160, and data processing APL1.
[0106] The intra-server delay control device 300 includes a logic management unit 310 in addition to the functional units of the intra-server delay control device 200 in FIG. 1, ie, the data arrival monitoring unit 210, the data arrival notification unit 220, and the sleep management unit 230 (hereinafter referred to as "each functional unit"). The logic management unit 310 collects application characteristic information and thread processing information, and based on the collected information, changes the processing logic of at least one of the functional units among the data arrival monitoring unit 210, the data arrival notification unit 220, and the sleep management unit 230 in the case of an application in which the load fluctuates depending on the time of day and the processing method and processing speed fluctuate.
[0107] <Logic Management Unit 310> When multiple processing logics are possible for each functional unit of the intra-server delay control device 200 in FIG. 1, the logic management unit 310 dynamically selects a processing logic and notifies each functional unit of the selected processing logic. In the case of an application in which the load fluctuates depending on the time of day and the processing method and processing speed fluctuate, the logic management unit 310 maintains low latency and power saving by changing the processing logic of each functional unit within the polling thread and changing the reception processing method.
[0108] The logic management unit 310 comprises two functional units: a characteristic information collection unit 311 and a logic distribution unit 312 . The characteristic information collection unit 311 collects application and traffic characteristics from applications and polling threads. The characteristic information collection unit 311 collects information necessary to appropriately determine logic suitable for characteristics that vary over time.
[0109] The logic distribution unit 312 appropriately determines and distributes logic suitable for each functional unit based on the application and traffic characteristic information collected by the characteristic information collection unit 311. The logic distribution unit 312 instructs each functional unit to operate using logic suitable for characteristics that vary over time. The characteristic information collecting unit 311 and the logic distribution unit 312 will be described in detail below with reference to an explanatory diagram of their operation.
[0110] <Characteristic information collection unit 311> First, the characteristic information collecting unit 311 will be described. FIG. 10 is a diagram illustrating the operation of the characteristic information collecting unit 311. As shown in FIG. The characteristic information collection unit 311 collects characteristic information from applications and polling threads. The characteristic information collection unit 311 collects application characteristic information and polling thread processing information and passes it to the logic distribution unit 312. The application characteristic information and polling thread processing information are information for determining the logic of each functional unit. The collected information is used to determine the logic suitable for each functional unit.
[0111] An example of application characteristic information will be described. An example of application characteristic information is "changes in packet processing methods within an application." For example, when the load on the Application Logic increases and the packet processing method is changed from sequential processing to batch processing, the characteristic information collector 311 collects this information (see symbol hh in FIG. 10). This information is used, for example, to change the processing logic of the data arrival notifier 220 from "notifying the application sequentially when data arrives" to "notifying the application after K pieces of data have arrived."
[0112] An example of processing information of the Polling Thread will be described. An example of processing information for the Polling Thread is "statistical information on the time from entering sleep to waking up." For example, if there is an increase in cases where the user wakes up immediately after entering sleep, information on this is collected (see symbol ii in FIG. 10). This information is used, for example, to change the logic by which the sleep management unit 230 starts sleep from "immediate sleep when no packet arrives" to "sleep after a certain time has elapsed since no packet arrives."
[0113] Above, application characteristic information and polling thread processing information were given as examples of information for determining the logic of each functional unit, but it is also possible to receive information from another system and use it to select logic, rather than just characteristic information from within the same server, such as an application or polling thread. For example, when the intra-server delay control device 300 is installed in a vDU (virtualized Distributed Unit) server or a vCU (virtualized Centralized Unit) server in a vRAN (virtualized Radio Access Network), it can receive information on the service provision status from a higher-level controller, a RIC (RAN Intelligent Controller), and use this information to select logic.
[0114] <Logic Distribution Unit 312> Next, the logic distribution unit 312 will be described. FIG. 11 is a diagram illustrating the operation of the logic distribution unit 312. The logic distribution unit 312 determines and distributes logic suitable for each functional unit based on the information collected by the characteristic information collection unit 311, and changes the logic of each functional unit.
[0115] Example of data arrival monitoring logic distribution If the latency requirement of the application becomes weaker or the data arrival frequency becomes lower, it may be acceptable to reduce the frequency of data arrival monitoring to save power. In this case, change from "monitoring data arrival by busy loop" to, for example, "monitoring data arrival once every 1 μs" (see symbol jj in Figure 11).
[0116] Example of data arrival notification logic distribution When application processing is changed from sequential processing to batch processing, it may be better to batch the data arrival notification as well to reduce latency and power consumption. In this case, the logic of "sequentially notifying the application of data arrival" is changed to "notifying the application of data arrival after K pieces of data have arrived" (see symbol kk in Figure 11).
[0117] Sleep start logic distribution example If it becomes common for the system to go to sleep and then wake up immediately due to an interrupt, change the logic from "go to sleep immediately when no data has arrived" to "go to sleep Tμs after no data has arrived" to prevent increased delays and power consumption due to excessive interrupts (see symbol ll in Figure 11).
[0118] The operation of the intra-server delay control system 1000A configured as described above will be described below. [Overall operation of the server delay control system 1000A]
[0119] <Settings> The logic management unit 310 runs on a CPU separate from the polling thread. A shared memory exists between each functional unit in the polling thread and the logic manager 310.
[0120] <Operation 1> When the NIC 130 receives a packet, it copies the packet directly to the Ring Buffer (a buffer in main memory) using DMA (Direct Memory Access) without going through the CPU. Note that this Ring Buffer is set up in advance so that it can be accessed directly from the Polling Thread in User Space without going through the OS kernel.
[0121] The NIC 130 generates an interrupt to the CPU that the polling thread is running, and the CPU notifies the polling thread of its wake-up in the context of a hardware interrupt, waking up the sleep management unit 230 . From then on, the polling thread will run on that CPU.
[0122] The sleep management unit 230 sets the CPU frequency to a high value and prohibits interrupts to the CPU. The CPU frequency can also be changed from User Space by setting the CPU governor.
[0123] The sleep management unit 230 records the time from when the sleep state is entered to when the user wakes up, and stores the time in a memory shared with the logic management unit 310 .
[0124] The sleep management unit 230 instructs the data arrival monitoring unit 210 to start polling (the sleep management unit 230 calls a function that handles the processing of the data arrival monitoring unit 210). At this time, the sleep management unit 230 reads out the time information from when the packet did not arrive until when the sleep unit goes to sleep from a memory area shared with the logic management unit 310, and calls the function that handles the processing of the data arrival monitoring unit 210 by specifying this value as an argument.
[0125] The data arrival monitor 210 refers to the memory shared with the logic manager 310 and reads the arrival confirmation interval. At this arrival confirmation interval, the data arrival monitor 210 checks the arrival of the packet in the ring buffer area where the packet is DMA-transferred. If the packet has arrived, it transmits the address information (pointer) of the packet to the data arrival notifier 220.
[0126] The data arrival notification unit 220 checks whether the number of pointer information pieces transmitted from the data arrival monitoring unit 210 has reached the number of batches written in the memory shared with the logic management unit 310. If the number of pointer information pieces has reached the number of batches written in the memory shared with the logic management unit 310, the unit proceeds to the following operation. If not, the unit returns to the arrival confirmation operation of the data arrival monitoring unit 210 and executes the processing in a loop.
[0127] The data arrival notification unit 220 stores address information in a memory shared by the application and the polling thread, starts a thread on which the application runs, and executes processing within that thread. If the operator has configured the application logic (data processing APL1) to be executed in the same thread, the processing is performed within the polling thread.
[0128] In the above, if the time specified as an argument has elapsed while no packet has arrived, the data arrival monitoring unit 210 calls the sleep management unit 230. That is, when the data arrival monitoring unit 210 returns, processing returns to the sleep management unit 230. Immediately before returning the function, the data arrival monitoring unit 210 writes the average packet arrival frequency while the polling thread is running to a memory shared with the logic management unit 310.
[0129] The sleep management unit 230 reduces the CPU frequency, enables interrupts to the CPU, and puts the polling thread into a sleep state.
[0130] When the application (data processing APL1) changes the number of batch processes in response to the load or the like, it writes the change appropriately to the memory shared with the logic management unit 310. When the application runs in a thread separate from the polling thread, a separate shared memory is set up in advance between the application and the logic management unit 310.
[0131] <Operation 2> The following runs on a different CPU from the Polling Thread and operates independently in terms of time. The following <Action 2> and the above <Action 1> can occur in parallel. The characteristic information collection unit 311 circulates and monitors each shared memory with the function unit in the polling thread, and if writing has been performed in the shared memory, it executes the following process.
[0132] If the data arrival frequency is written in a memory shared with the data arrival monitoring unit 210 and the value is smaller than the current data arrival confirmation interval, the data arrival frequency is set as the new data arrival confirmation interval and the logic distribution unit 312 is called (a function corresponding to the logic distribution unit 312 is called).
[0133] The logic distribution unit 312 writes the new data arrival confirmation interval into the memory shared with the data arrival monitoring unit 210 .
[0134] If the batch number has been written in the memory shared with the application, the batch number is set as the new data arrival notification batch number, and the logic distribution unit 312 is called (a function corresponding to the logic distribution unit 312 is called).
[0135] The logic distribution unit 312 writes the new number of data arrival notification batches in the memory shared with the data arrival notification unit 220 .
[0136] The time from going to sleep to waking up is written in the memory shared with the sleep management unit 230, and if this value is smaller than a predetermined threshold (for example, 5 μs) (the threshold differs depending on the system, so prior setting is required), it decides to extend the time from when a packet does not arrive until going to sleep by 5 μs, and calls the logic distribution unit 312 (calls the function corresponding to the logic distribution unit 312).
[0137] The logic distribution unit 312 writes the new "time from when a packet does not arrive until when sleep is entered" in the memory shared with the sleep management unit 230. This completes the description of the overall operation of the intra-server delay control system 1000A.
[0138] [Operation of the logic management unit 310] Next, an example of processing by the logic management unit 310 will be described with reference to the flowcharts and operation explanatory diagrams shown in FIGS.
[0139] <Example of logic changes to the data arrival monitor unit 210> First, as an example of processing by the logic management unit 310, an example of logic change to the data arrival monitoring unit 210 will be described. Fig. 12 is a processing flowchart for changing logic in the data arrival monitor unit 210. Fig. 13 is a diagram for explaining the operation. The same components as in Fig. 11 are assigned the same numbers. 12, in step S41, the data arrival monitor 210 acquires the packet arrival frequency and periodically notifies the characteristic information collector 311 (see symbol mm in FIG. 13). For example, the data arrival monitor 210 transmits the packet arrival frequency to the characteristic information collector 311 at the timing when Polling is put to sleep.
[0140] In step S42, the characteristic information collector 311 compares the packet arrival frequency with the current arrival monitoring interval. If the packet arrival frequency is less than the arrival monitoring interval (S43: No), the process proceeds to step S46.
[0141] In step S43, if the packet arrival frequency is greater than or equal to the arrival monitoring interval (S43: Yes), in step S44 the characteristic information collection unit 311 decides to widen the arrival monitoring interval (for example, by 1 μs) and transmits the logic change to the logic distribution unit 312 (see symbol nn in Figure 13).
[0142] In step S45, the logic distribution unit 312 distributes the logic to the data arrival monitoring unit 210, widens the arrival monitoring interval, and ends the processing of this flow.
[0143] On the other hand, if the packet arrival frequency is less than the arrival monitoring interval in step S43 (S43: No), then in step S46 the characteristic information collecting unit 311 decides to narrow the arrival monitoring interval and notifies the logic distribution unit 312 of the change in logic. For example, the characteristic information collecting unit 311 notifies that the arrival monitoring interval will be narrowed by 1 μs (see symbol nn in FIG. 13).
[0144] In step S47, the logic distribution unit 312 distributes the logic to the data arrival monitoring unit 210, narrows the arrival monitoring interval, and ends the processing of this flow.
[0145] <Example of logic changes to the data arrival notification unit 220> Next, as an example of processing by the logic management unit 310, an example of changing the logic to the data arrival notification unit 220 will be described. Fig. 14 is a processing flowchart for changing the logic of the data arrival notification unit 220. Fig. 15 is a diagram for explaining the operation. The same components as in Fig. 11 are assigned the same numbers. In the flow of FIG. 14, in step S51, when the data processing APL1 (application) changes the number of batch processes, it notifies the logic management unit 310 of the number of batch processes (see symbol oo in FIG. 15).
[0146] In step S52, the characteristic information collection unit 311 determines to notify the arrival of data with the changed number of batch processes, and notifies the logic distribution unit 312 of the change in logic.
[0147] In step S53, the logic distribution unit 312 distributes the number of batch processes to the data arrival notification unit 220 (see the symbol pp in FIG. 15), causing it to change and end the processing of this flow.
[0148] <Example of Logic Change to the Sleep Management Unit 230> Next, as an example of the processing of the logic management unit 310, an example of logic change to the Sleep management unit 230 will be described. FIG. 16 is a flowchart of the processing of logic change to the Sleep management unit 230. FIG. 17 is an operation explanatory diagram thereof. The same reference numerals are assigned to the same components as in FIG. 11. In the flow of FIG. 16, in step S61, the Sleep management unit 230 records the time from entering Sleep until being woken up by a HardIRQ, and transmits that information to the characteristic information collection unit 311 (see the symbol qq in FIG. 17). For example, the Sleep management unit 230 transmits via shared memory at the timing of waking up.
[0149] In step S62, the characteristic information collection unit 311 calculates the average time from when the Polling Thread enters Sleep until it is woken up, and determines whether there is an adverse impact on performance. The determination of whether there is an adverse impact on performance varies depending on the system. For example, assume an average time of 5 μs from when entering Sleep until being woken up.
[0150] In step S63, the characteristic information collection unit 311 discriminates whether the average time from entering Sleep until being woken up is 5 μs. If the average time from entering Sleep until being woken up is 5 μs (S63: Yes), in step S64, the characteristic information collection unit 311 determines to increase the time from when a packet is not received until entering Sleep (for example, increase it by 5 μs), and transmits the logic change to the logic distribution unit 312 (see the symbol rr in FIG. 17).
[0151] In step S65, the logic distribution unit 312 distributes the logic to the data arrival notification unit 220, changes the time from when a packet does not arrive until the sleep state is entered, and ends the processing of this flow.
[0152] [Hardware configuration] The intra-server delay control devices 200 and 300 according to the first and second embodiments are realized by a computer 900 having a configuration as shown in FIG. 18, for example. FIG. 18 is a hardware configuration diagram showing an example of a computer 900 that realizes the functions of the intra-server delay control devices 200 and 300. As shown in FIG. The computer 900 includes a CPU 901 , a ROM 902 , a RAM 903 , a HDD 904 , a communication interface (I / F) 906 , an input / output interface (I / F) 905 , and a media interface (I / F) 907 .
[0153] The CPU 901 operates based on a program stored in the ROM 902 or the HDD 904, and controls each part of the intra-server delay control devices 200, 300 shown in Figures 1 and 9. The ROM 902 stores a boot program executed by the CPU 901 when the computer 900 starts up, programs that depend on the hardware of the computer 900, and the like.
[0154] The CPU 901 controls an input device 910 such as a mouse or keyboard, and an output device 911 such as a display, via an input / output I / F 905. The CPU 901 acquires data from the input device 910 via the input / output I / F 905, and outputs generated data to the output device 911. Note that a GPU (Graphics Processing Unit) or the like may be used as a processor together with the CPU 901.
[0155] The HDD 904 stores programs executed by the CPU 901, data used by such programs, and the like. The communication I / F 906 receives data from other devices via a communication network (e.g., NW (Network) 920) and outputs it to the CPU 901, and also transmits data generated by the CPU 901 to other devices via the communication network.
[0156] The media I / F 907 reads a program or data stored in the recording medium 912 and outputs it to the CPU 901 via the RAM 903. The CPU 901 loads a program related to the target processing from the recording medium 912 onto the RAM 903 via the media I / F 907 and executes the loaded program. The recording medium 912 is an optical recording medium such as a DVD (Digital Versatile Disc), PD (Phase change rewritable Disk), a magneto-optical recording medium such as a MO (Magneto Optical disk), a magnetic recording medium, a conductor memory tape medium, or a semiconductor memory or the like.
[0157] For example, when the computer 900 functions as the in-server delay control devices 200 and 300 configured as one device according to the present embodiment, the CPU 901 of the computer 900 realizes the functions of the in-server delay control devices 200 and 300 by executing the program loaded onto the RAM 903. Also, the data in the RAM 903 is stored in the HDD 904. The CPU 901 reads and executes a program related to the target processing from the recording medium 912. In addition, the CPU 901 may read a program related to the target processing from other devices via the communication network (NW 920).
[0158] [Application Example] <Application Example to VM Configuration> The present invention can be applied to each of a host in a VM (Virtual Machine) configuration and a Polling Thread arranged in a guest. By doing this, in a system with a virtual server configuration of VM, it is possible to transfer packets with reduced delay within the server without modifying the APL in either the Host OS or the Guest OS.
[0159] <Example of application to container configuration> The present invention can also be applied to a polling thread arranged in a container configuration. In systems with virtual server configurations such as containers, packet transfer can be performed with reduced delay within the server without modifying the application.
[0160] <Example of application to bare metal configuration (non-virtualized configuration)> The present invention can be applied to systems with a non-virtualized configuration, such as a bare metal configuration, and can perform packet transfer with reduced latency within the server without modifying the application.
[0161] <Scale in / out> When traffic volume is high and multiple NIC devices or NIC ports are used, by running multiple Polling Threads in association with these, it is possible to scale in / out Polling Threads while controlling the HW interrupt frequency.
[0162] [effect] As described above, the intra-server delay control device according to the first embodiment is an intra-server delay control device 200 (see FIG. 1) that is placed in a user space and launches a thread that monitors packet arrivals using a polling model. The intra-server delay control device 200 monitors the receive queue of a device (NIC 130) by polling and acquires the data if a packet has arrived. The intra-server delay control device 200 is equipped with a data arrival monitoring unit 210 that notifies an application program (data processing APL1) of the data acquired by the data arrival monitoring unit 210 and passes it on. The intra-server delay control device 200 is characterized in that the sleep management unit 230 controls the timing of sleep by allowing a hardware interrupt (hard IRQ) based on the characteristics of the application program.
[0163] In this way, the intra-server delay control device 200 stops software interrupts (softIRQs) for packet processing, which are the main cause of network delays. The data arrival monitor 210 of the intra-server delay control device 200 executes a thread that monitors packet arrivals, and when a packet arrives, performs packet processing using a polling model (without softIRQs). If no packet arrives within a predetermined period, the sleep management unit 230 puts the thread (polling thread) to sleep, so that the thread (polling thread) goes to sleep when no packet arrives. When a packet arrives, the sleep management unit 230 wakes up the thread using a hardware interrupt (hardIRQ). Furthermore, the sleep management unit 230 controls the timing of allowing a hardware interrupt (hardIRQ) and going to sleep based on the characteristics of the application program. This provides the following effects (1) to (4).
[0164] (1) A polling model is realized that stops software interrupts (softIRQs) that cause delays when packets arrive. In other words, unlike the existing technology NAPI, the intra-server delay control system 1000 realizes a polling model instead of the interrupt model that is the main cause of network delays. When a packet arrives, it is immediately harvested without waiting, enabling low-latency packet processing ("Achieving low latency with a polling model").
[0165] (2) The polling thread in the intra-server delay control device 200 monitors packet arrivals in polling mode. The polling thread that monitors packet arrivals goes to sleep while no packets have arrived. When no packets have arrived, the CPU is not used due to the sleep state, which can result in power savings ("Reducing unnecessary CPU usage and achieving power savings through sleep management of the polling thread").
[0166] (3) Furthermore, the reception processing method can be changed to suit the characteristics of the application program, making it possible to achieve both low latency and power saving even for application programs with different characteristics ("Achieving low latency and power saving tailored to application programs").
[0167] (4) Since the data reception process is defined in the user space, the reception process method can be changed to suit the characteristics of the application program. The present invention can be applied to a case where there is a polling thread in user space, such as in DPDK.
[0168] In this way, the intra-server delay control device 200 (see FIG. 1) can achieve both low latency and power saving by managing the sleep of the polling thread that performs packet forwarding processing when there is a polling thread in the user space. Furthermore, it can achieve both low latency and power saving even for applications with different application program characteristics.
[0169] In the intra-server delay control device 200, the sleep management unit 230 compares the time that has elapsed since the packet did not arrive with a predetermined time that is suited to the characteristics of the application program, and if the time that has elapsed since the packet did not arrive is equal to or greater than the time that is suited to the characteristics of the application program, it enables a hardware interrupt and puts the thread to sleep.
[0170] In this way, the sleep management unit 230 controls the timing of allowing HW interrupts and going to sleep according to the characteristics of the application program. For example, the sleep management unit 230 can continue polling in the case of an application program in which packets arrive immediately even if the driver's receive queue becomes empty during polling. This makes it possible to achieve even lower latency and power savings according to the characteristics of the application program and traffic characteristics.
[0171] In the intra-server delay control device 200, the data arrival monitoring unit 210 is characterized in that it checks whether data has arrived in the receiving queue of the device at a predetermined timing based on the characteristics of the application program.
[0172] By doing this, the frequency of reaping by polling can be controlled according to the characteristics of the application program and traffic information, thereby achieving further reduction in latency and power saving according to the characteristics of the application program and traffic.
[0173] In the intra-server delay control device 200, the data arrival monitoring unit 210 is characterized in that it checks whether data has arrived in the receiving queue of the device after a predetermined period of suspension.
[0174] By doing this, if the delay requirements of the application program are not strict or the packet arrival interval is not short, the data arrival monitoring unit 210 can temporarily suspend polling (for example, after pausing for a specified period of time, check whether data has arrived in the device's reception queue), thereby enabling reception monitoring while reducing the number of CPU cycles and achieving power savings.
[0175] In the intra-server delay control device 200, the data arrival notification unit 220 is characterized in that if the application program has the characteristic of processing packets sequentially, it notifies immediately when a packet arrives, and if the application program has the characteristic of processing packets in batches, it notifies when a predetermined number of packets have arrived.
[0176] By doing so, it is possible to select an arrival notification method that matches the characteristics of the application program, and it is possible to achieve even shorter delays that match the characteristics of the application program.
[0177] In the intra-server delay control device 200, the data arrival notification unit 220 has a packet processing function, executes the packet processing function according to the characteristics of the application program, and is characterized in that when the packet processing function is executed, the application program is not notified.
[0178] By doing this, if the application program is simple, it is possible to process packets without sending notifications by providing a function to process packets, reducing the overhead of sending notifications, and achieving further reductions in latency according to the characteristics of the application program.
[0179] The server delay control device 300 (see FIG. 9) according to the second embodiment is characterized by having a logic management unit 310 that collects characteristic information of the application program and processing information of the thread, and based on the collected information, changes the processing logic of at least one of the functional units among the data arrival monitoring unit 210, the data arrival notification unit 220, and the sleep management unit 230 in the case of an application program in which the load fluctuates depending on the time period and the processing method and processing speed fluctuate.
[0180] In this way, the logic management unit 310 dynamically determines the processing logic of each functional unit of the polling thread (data arrival monitoring unit 210, data arrival notification unit 220, sleep management unit 230) in accordance with the characteristics of the application program and the processing of the thread, and distributes it to each functional unit. As a result, even for applications whose characteristics change dynamically, low latency and power saving in the receiving process can be maintained by operating each functional unit with processing logic that matches the changing characteristics.
[0181] It should be noted that, among the processes described in the above embodiments, all or part of the processes described as being performed automatically can be performed manually, or all or part of the processes described as being performed manually can be performed automatically using a known method. In addition, the information including the processing procedures, control procedures, specific names, various data, and parameters shown in the above documents and drawings can be changed as desired unless otherwise specified. Furthermore, the components of each device shown in the figure are conceptual functional components and do not necessarily have to be physically configured as shown in the figure. In other words, the specific form of distribution and integration of each device is not limited to that shown in the figure, and all or part of them can be functionally or physically distributed and integrated in any unit depending on various loads, usage conditions, etc.
[0182] Furthermore, the above-described configurations, functions, processing units, processing means, etc. may be partially or entirely implemented in hardware, for example, by designing them as integrated circuits. Furthermore, the above-described configurations, functions, etc. may be implemented in software that causes a processor to interpret and execute programs that implement the respective functions. Information such as programs, tables, and files that implement the respective functions may be stored in a memory, a recording device such as a hard disk or a solid-state drive (SSD), or a recording medium such as an integrated circuit (IC) card, a secure digital (SD) card, or an optical disc. [Explanation of symbols]
[0183] 1 Data processing APL (application program) 10 HW 70 Guest OS 72 Ring Buffer 74 Protocol Processing Unit 110 HW 130 NIC (physical NIC) (device) 140 OS 160 user space 200,300 Server Delay Control Device (Polling Thread) 210 Data arrival monitoring unit (each functional unit) 220 Data arrival notification unit (each functional unit) 230 Sleep management department (each functional department) 310 Logic Management Department 311 Characteristics Information Collection Department 312 Logic Distribution Department 1000 Server Delay Control System< / enable> < / wakeup> < / interrupt> < / notify> < / enable> < / polling> < / enable> < / wakeup> < / interrupt> < / notify> < / polling>
Claims
1. A server-side delay control device that is located in a user space and launches a thread that monitors packet arrivals using a polling model, a data arrival monitor unit that monitors the receiving queue of the device by polling and acquires data when a packet has arrived; a data arrival notification unit that notifies an application program of the data acquired by the data arrival monitoring unit and transfers the data to the application program; a sleep management unit that puts the thread to sleep if no packet arrives for a predetermined period of time, and that wakes up the thread from sleep mode by a hardware interrupt when a packet arrives; The sleep management unit controls the timing of enabling the hardware interrupt and going to sleep based on the characteristics of the application program. The delay control device in a server is characterized by:
2. A method for controlling delay in a server by a delay control device in a server, the method including: launching a thread that is arranged in a user space and monitors arrival of a packet using a polling model; The server delay control device includes: monitoring a receiving queue of the device by polling, and acquiring data if a packet has arrived; notifying an application program of the acquired data and transferring the data to the application program; If no packet arrives for a predetermined period of time, the thread is put to sleep, and when a packet arrives, the thread is woken up by a hardware interrupt; and controlling the timing of enabling the hardware interrupt and going to sleep based on the characteristics of the application program. A method for controlling delay within a server.
3. A program for causing a computer to function as the server internal delay control device according to claim 1.
Citation Information
Patent Citations
Low-power-consumption adaptive polling
JP2004199683A
Techniques for Received Packet Processing and Associated Power Management in Network Devices
JP2018507457A
Variable polling interval based on historical timing results
US20090089784A1
Intra-server delay control device, intra-server delay control method, and program
WO2021130828A1
