Arithmetic unit wake-up latency measurement device, arithmetic unit wake-up latency measurement method, and program
The arithmetic unit wake-up delay measurement device addresses the challenge of inaccurate CPU wake-up delay measurements by precisely tracking start and completion timestamps, enhancing the understanding of performance and power efficiency trade-offs.
Patent Information
- Application Number
- PCT/JP2025/018289
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2025-05-20
- Publication Date
- 2026-11-26
AI Technical Summary
Conventional methods struggle to accurately measure the wake-up delay from CPU idle states, leading to uncertainties in performance degradation and power efficiency, as the actual delay times often differ from vendor-provided worst-case estimates.
An arithmetic unit wake-up delay measurement device that acquires timestamps for the start and completion of CPU wake-up processes, allowing for precise derivation of actual wake-up delays using hardware timer settings, device timestamps, or task scheduling information, and outputs the results to a shared memory for analysis.
Enables accurate measurement of actual CPU wake-up delays, providing insights into performance impacts and enabling optimized settings to balance power efficiency and performance requirements.
Smart Images

Figure JP2025018289_26112026_PF_FP_ABST
Abstract
Description
Arithmetic Unit Wake-Up Delay Measurement Device, Arithmetic Unit Wake-Up Delay Measurement Method, and Program
[0001] The disclosed technology relates to an arithmetic unit wake-up delay measurement device, an arithmetic unit wake-up delay measurement method, and a program.
[0002] A CPU (Central Processing Unit) has a function to control the idle state of the CPU via hardware control, which is called LPI (Low Power Idle). LPI is also often referred to as CPUidle or C-state, and hereinafter, LPI will be described as C-state. When the CPU load decreases, C-state attempts to save power by turning off the power to some of the CPU circuits (Patent Document 1). Patent Document 1 discloses a packet transfer system that takes CPU idle into account.
[0003] Figure 35 is a table showing an example of C-state states. Since the state definitions differ depending on the CPU hardware, Figure 35 is merely a reference example. As shown in Figure 35, there are grades C0 to C6 in the CPUidle state, and the CPU transitions to a deeper sleep state as the period of no CPU load increases. The deeper the sleep state, the lower the CPU power consumption; however, this also increases the time required to return from the sleep state, which may cause problems from the perspective of low latency.
[0004] The state definitions of C-state differ depending on the CPU hardware. For example, there are variations such as models without C4 or C5, and models where the state after C1 is C1E. The deeper the state, the greater the power saving effect; however, this also increases the time required to return from the idle state. Furthermore, the depth to which the CPUidle state transitions is determined by the hardware control of the CPU and depends on the CPU product (in many cases, it cannot be controlled by software such as the kernel).
[0005] In cases where extremely low latency is required, it is possible to set an upper limit on the number of C-states that can be entered or disable the CPU idle function to avoid wake-up delays from C-states. However, it is difficult to determine to what extent running applications are experiencing wake-up delays and resulting performance degradation. Therefore, it is difficult to appropriately set an upper limit on C-states or disable them. For example, in cases where ensuring performance requirements is paramount, the CPU idle function is often excessively restricted, and the power savings that could have been obtained are not realized.
[0006] Figures 36 and 37 are diagrams illustrating the C-state transitions of the CPU core used for calculations. Figure 36 shows the case where CPU idle is enabled, and Figure 37 shows the case where CPU idle is disabled. As shown in Figure 36, when CPU idle is enabled, the CPU core is in a deep sleep state (CPUidle state: grade C6), and the delay time from task generation to recovery is prolonged. When the CPU falls into a deep idle state, it takes a long time to recover, which impairs real-time performance.
[0007] In addition, the delay until recovery shown by the dashed line in Figure 36 has the problem that the length of the delay is unknown. Because the length of the delay is unknown, it is not possible to accurately determine the wake-up delay, and in some cases it may be necessary to disable or excessively restrict CPU idle itself.
[0008] On the other hand, as shown in Figure 37, disabling CPU idle can reduce wake-up delays, but it may worsen power efficiency during periods without tasks. If the wake-up delay caused by CPU idle is actually acceptable, then power efficiency is unnecessarily worsened.
[0009] The traditional wake-up delay time from C-states makes it difficult to understand how much the running application is experiencing performance degradation due to this delay, making it difficult to appropriately set an upper limit on or disable C-states.
[0010] If the OS stores information on the "worst-case wake-up delay from each idle state" provided by the CPU vendor, the user can use this information to decide whether to restrict or disable C-states.
[0011] Figure 38 illustrates the conventional image of obtaining the worst wake-up delay. As shown in Figure 38, the server comprises hardware 10 and an OS / driver 20. Hardware 10 comprises a CPU 11. The OS / driver 20 comprises a vendor-specified worst wake-up delay storage unit 21. The vendor-specified worst wake-up delay storage unit 21 stores information on the worst wake-up delay from each idle state. Let's take the case of Intel Xeon E5-2670 ("Intel" is a registered trademark) as an example. The vendor-specified worst wake-up delay storage unit 26 reads the worst wake-up delay information 26a for each state, "C1: 2 usec C1E: 10 usec C3: 33 usec C6: 133 usec" (Figure 35), and outputs it to the user.
[0012] Figure 39 illustrates an example of the actual wake-up delay from C6 in the Intel Xeon E5-2670 shown in Figure 38. As shown in Figure 39, it is shown that the time required for wake-up varies depending on the operating frequency, and that even wake-up from C6 is limited to around 30 usec. In other words, focusing on wake-up from C6 among the worst-case wake-up delay information 21a for each state shown in Figure 38, the actual wake-up delay from C6 shown in Figure 38 is around 30 usec compared to "C6: 133 usec" stored by the vendor-specified worst-case wake-up delay storage unit 21, indicating a significant discrepancy in the worst-case wake-up delay.
[0013] International Publication No. 2024 / 013831
[0014] Conventional wake-up delay methods from C-states make it difficult to understand how much wake-up delay affects the performance of running applications. Furthermore, even when the OS stores information on the "worst-case wake-up delay from each idle state" provided by the CPU vendor, there is a significant discrepancy between the stored worst-case wake-up delay information (Figure 38) and the actual wake-up delay (Figure 39). Thus, conventional behavioral analysis methods have the challenge of not being able to accurately measure the time required for the processing unit executing the application to resume processing after it has been paused.
[0015] The disclosed technology was developed in view of the above points and aims to accurately measure the time required for a processing unit that executes an application to resume processing after it has paused.
[0016] A arithmetic unit wake-up delay measuring device, which is one embodiment of the disclosed technology, is characterized by comprising: an arithmetic unit wake-up start information acquisition unit that acquires the time at which the idle arithmetic unit begins to wake up as wake-up start information; an arithmetic unit wake-up completion information acquisition unit that acquires the time at which the idle arithmetic unit has completed waking up as wake-up completion information; and an arithmetic unit wake-up delay information derivation unit that derives the wake-up delay from the idle state of the arithmetic unit based on the acquired wake-up start information and wake-up completion information.
[0017] According to the disclosed technology, a processing unit that executes an application can accurately measure the time required to resume processing when processing is paused.
[0018] This figure illustrates the basic principles of the disclosed technology. This figure shows an example of obtaining timestamps for the wake-up start point and wake-up completion point in the time progression of CPU operation of the arithmetic unit wake-up delay measurement device according to the first embodiment. This is a schematic configuration diagram of an arithmetic unit wake-up delay measurement system equipped with the arithmetic unit wake-up delay measurement device according to the first embodiment of the disclosed technology. This figure shows an example of a command using bpftrace when the acquisition point of start information for the arithmetic unit wake-up delay measurement device according to the first embodiment is the hardware timer setting unit. This figure shows an example of a command using bpftrace when the acquisition point of start information for the arithmetic unit wake-up delay measurement device according to the first embodiment is the device internal timestamp acquisition unit. This figure shows an example of a command using bpftrace when the acquisition point of start information for the arithmetic unit wake-up delay measurement device according to the first embodiment is the task assignment unit. This figure shows Embodiment 1 of the arithmetic unit wake-up delay measurement system equipped with the arithmetic unit wake-up delay measurement device according to the first embodiment. This figure shows an implementation example in Embodiment 1 of the arithmetic unit wake-up delay measurement device according to the first embodiment. This is a configuration diagram showing the operation image of the arithmetic unit wake-up start information acquisition unit of the arithmetic unit wake-up delay measurement device according to Embodiment 1 of the arithmetic unit wake-up delay measurement device according to the first embodiment. This is a flowchart showing the operation of the arithmetic unit wake-up start information acquisition unit of the arithmetic unit wake-up delay measurement device according to the first embodiment. This is a configuration diagram showing the operation image of the arithmetic unit wake-up completion information acquisition unit of the arithmetic unit wake-up delay measurement device in Example 1 of the arithmetic unit wake-up delay measurement device according to the first embodiment. This is a flowchart showing the operation of the arithmetic unit wake-up completion information acquisition unit of the arithmetic unit wake-up delay measurement device according to the first embodiment. This is a configuration diagram showing the operation image of the arithmetic unit wake-up delay information derivation unit of the arithmetic unit wake-up delay measurement device in Example 1 of the arithmetic unit wake-up delay measurement device according to the first embodiment. This is a diagram showing an example of text output of the arithmetic unit wake-up delay measurement device according to the first embodiment. This is a diagram showing an example of correspondence between acquired information and output of the arithmetic unit wake-up delay measurement device according to the first embodiment (example of text output showing average value and histogram for each core).This figure shows an example of the correspondence between acquired information and output of the arithmetic unit wake-up delay measurement device according to the first embodiment (an example of output when a power-saving state (CPU idle state) is added). This figure shows Embodiment 2 of the arithmetic unit wake-up delay measurement system equipped with the arithmetic unit wake-up delay measurement device according to the first embodiment. This figure shows an implementation example in Embodiment 2 of the arithmetic unit wake-up delay measurement device according to the first embodiment. This is a configuration diagram showing the operation image of the arithmetic unit wake-up start information acquisition unit in Embodiment 2 of the arithmetic unit wake-up delay measurement device according to the first embodiment. This is a flowchart showing the operation of the arithmetic unit wake-up start information acquisition unit in Embodiment 2 of the arithmetic unit wake-up delay measurement device according to the first embodiment. This figure shows Embodiment 3 of the arithmetic unit wake-up delay measurement system equipped with the arithmetic unit wake-up delay measurement device according to the first embodiment. This figure shows an implementation example in Embodiment 3 of the arithmetic unit wake-up delay measurement device according to the first embodiment. This is a configuration diagram showing the operation image of the arithmetic unit wake-up start information acquisition unit in Embodiment 3 of the arithmetic unit wake-up delay measurement device according to the first embodiment. This is a flowchart showing the operation of the arithmetic unit wake-up start information acquisition unit in Embodiment 3 of the arithmetic unit wake-up delay measurement device according to the first embodiment. This is a schematic diagram of a arithmetic unit wake-up delay measurement system equipped with an arithmetic unit wake-up delay measurement device according to a second embodiment of the disclosed technology. This is a flowchart showing the operation of the arithmetic unit wake-up delay measurement test unit of the arithmetic unit wake-up delay measurement device according to a second embodiment. This is a diagram showing an implementation example of the arithmetic unit wake-up delay measurement device according to a modification 1 of the second embodiment. This is a schematic diagram of a arithmetic unit wake-up delay measurement system equipped with an arithmetic unit wake-up delay measurement device according to a modification 2 of the second embodiment. This is a diagram showing an implementation example of the arithmetic unit wake-up delay measurement device according to a modification 2 of the second embodiment. This is a flowchart showing the operation of the arithmetic unit wake-up start information acquisition unit of the arithmetic unit wake-up delay measurement device according to a modification 2 of the second embodiment. This is a flowchart showing the operation of the arithmetic unit wake-up completion information acquisition unit of the arithmetic unit wake-up delay measurement device according to a modification 2 of the second embodiment. This is a hardware configuration diagram showing an example of a computer that implements the functions of the arithmetic unit wake-up delay measurement device according to each embodiment of the disclosed technology. This is a diagram showing an example of the C-state state in a table.This is a diagram illustrating the C-state transitions of the CPU core used for calculations when CPU idle is enabled. This is a diagram illustrating the C-state transitions of the CPU core used for calculations when CPU idle is disabled. This diagram explains the conventional worst-case wake-up delay acquisition. This diagram explains an example of an actual wake-up delay from C6 in an Intel Xeon E5-2670.
[0019] Hereinafter, an example of an embodiment of the disclosed technology will be described with reference to the drawings. In each drawing, components having the same function will be given the same name and reference numeral, and redundant explanations will be omitted. The disclosed technology relates to an apparatus and method for measuring the time required to restart processing when an arithmetic unit that performs processing of an application resumes processing after processing has been paused.
[0020] (Explanation of the principle) First, let's explain the basic principle of the disclosure technology. The disclosure technology observes the wake-up delay from the CPU idle state occurring on an operating CPU core. The disclosure technology makes it possible to measure the wake-up latency that actually occurs on the CPU core, rather than literature values or vendor recommended values.
[0021] Figure 1 is a diagram illustrating the basic principles of the disclosed technology. The same reference numerals are used for components identical to those in Figure 38. The server constituting the arithmetic unit wake-up delay measurement system 1000 shown in Figure 1 comprises hardware 10, an OS / driver 20, a user space 30, and an arithmetic unit wake-up delay measurement device 100. The server may also be referred to as the arithmetic unit wake-up delay measurement system. The OS / driver 20 has a task management unit 21. The task management unit 21 determines which CPUidle state (C-state) the CPU enters when idle. The user space 30 has an application 1 (in this case, application A) that is the target of operation analysis.
[0022] The arithmetic unit wake-up delay measuring device 100 obtains timestamps for the "process that triggers the wake-up of an idle CPU" and the "process immediately after wake-up is complete" in the task management unit 21 of the OS / driver 20, and derives the time required for the idle CPU to wake up based on these timestamps. More specifically, the arithmetic unit wake-up delay measuring device 100 obtains timestamps for the wake-up start point and wake-up completion point from the task management unit 21, derives the wake-up delay occurring in the operating CPU based on the obtained wake-up start point and wake-up completion point timestamps, and outputs the wake-up latency that occurred on the CPU core to a file / screen (in the following notation, " / " means "or").
[0023] Figure 2 shows an example of acquiring timestamps for the wake-up start and wake-up completion points in the time progression of CPU operation. The arithmetic unit wake-up delay measurement device 100 (Figure 1) acquires a timestamp from the task management unit 21 (Figure 1) at the wake-up start point (arrow a in Figure 2) and acquires a timestamp at the wake-up completion point (arrow b in Figure 2). As a result, the arithmetic unit wake-up delay measurement device 100 can measure the wake-up delay from the idle state that actually occurs on the operating CPU core (thick solid line in Figure 2), rather than the "worst-case wake-up delay" provided by the CPU vendor.
[0024] An embodiment of the disclosed technology based on the above basic concept will now be described. (First Embodiment) [Overall Configuration] Figure 3 is a schematic diagram of a arithmetic unit wake-up delay measurement system equipped with an arithmetic unit wake-up delay measurement device according to the first embodiment of the disclosed technology. The same reference numerals are used for components identical to those in Figure 1. As shown in Figure 3, the arithmetic unit wake-up delay measurement system 1000 includes hardware (HW) 10, an OS / driver 20, and a user space 30, and the arithmetic unit wake-up delay measurement device 100 is provided on the OS / driver 20 and the user space 30.
[0025] <Hardware 10> Hardware 10 includes a CPU 11 having multiple CPU cores #m, ... In addition to the CPU 11, it may also include accelerators such as a GPU (Graphic Processing Unit), FPGA (Field Programmable Gate Array), ASIC (Application Specific Integrated Circuit), and DPU (Data Processing Unit).
[0026] <OS / driver 20> The OS / driver 20 comprises a task management unit 21, a hardware timer setting unit 24, a device timestamp acquisition unit 25, and a arithmetic unit wake-up start information acquisition unit 110 and a arithmetic unit wake-up completion information acquisition unit 120 (described later) which constitute the arithmetic unit wake-up delay measurement device 100. The task management unit 21 comprises a task assignment unit 22 and an arithmetic unit pause command issuance unit 23. The task management unit 21, hardware timer setting unit 24 and device timestamp acquisition unit 25 are functional units relating to existing technology.
[0027] 《Functional parts related to existing technologies》 First, we will explain the functional parts related to existing technologies. We will take the example of a case where the arithmetic unit is a CPU and the OS is Linux (registered trademark). The task management unit 21 is a task scheduler that has task management information including task execution time information.
[0028] The task assignment unit 22 assigns tasks (threads) of application A to the CPU cores #m, ... of the hardware 10.
[0029] The arithmetic unit pause instruction issuing unit 23 is an existing function within the OS and is a mechanism that is called when there are no other tasks to execute. The arithmetic unit pause instruction (CPU pause instruction) issuing unit 23 changes the CPU to an idle state by issuing a CPU pause instruction, specifying the CPU idle state (C-state) designated by the CPU idle management unit (not shown). When the CPU returns from the idle state, it first returns by completing this pause instruction.
[0030] The arithmetic unit pause instruction issuer 23 is called the swapper process in the Linux kernel. The arithmetic unit pause instruction issuer 23 is a process that is started when there are no other tasks to start on the core in question, and MWAIT (CPU pause instruction) is issued within the swapper process.
[0031] The CPU idle management unit (not shown in the diagram) is an existing function within the OS and is a mechanism that determines which CPU idle state (C-state) the CPU enters when idle. The CPU idle management unit is called by the task scheduler (task management unit 21) immediately before issuing a CPU pause command to determine which CPU idle state (C-state) the CPU enters.
[0032] The hardware timer setting unit 24 sets the time and number of times the hardware timer will expire. The timer raises an interrupt when it expires, waking up the idle arithmetic unit, and the timing of the timer's expiration can be considered as the timing of the start of the wake-up process.
[0033] The device's internal timestamp acquisition unit 25, in the case of some devices, has a timestamp acquisition function and can save the timing of raising an interrupt and waking up the arithmetic unit. The device driver is equipped with an interface that acquires the timestamp and provides the acquired timestamp to the OS functions.
[0034] <User Space 30> The user space 30 includes application 1 (in this case, application A) and a arithmetic unit wake-up delay information derivation unit 130 (described later) which constitutes the arithmetic unit wake-up delay measurement device 100.
[0035] [CPU Wake-Up Delay Measurement Device] The CPU wake-up delay measurement device 100 measures the time required for the CPU (CPU 11) that executes the processing of application 1 (application A) to start processing again when it has paused processing. As shown in Figure 3, the CPU wake-up delay measurement device 100 includes a CPU wake-up start information acquisition unit 110 and a CPU wake-up completion information acquisition unit 120 in the OS / driver 20, and a CPU wake-up delay information derivation unit 130 in the user space 30.
[0036] Note that the arrangement of the arithmetic unit wake-up start information acquisition unit 110, the arithmetic unit wake-up completion information acquisition unit 120, and the arithmetic unit wake-up delay information derivation unit 130, which constitute the arithmetic unit wake-up delay measurement device 100, is just one example, and various modifications are possible (see the modified examples in Figures 28 to 31).
[0037] <Calculator Wake-Up Start Information Acquisition Unit 110> The calculator wake-up start information acquisition unit 110 acquires the wake-up start time, which is the wake-up start point for waking up the calculator from an idle state, as wake-up start information. There are three examples of acquisition methods, as shown below.
[0038] (1) An idle arithmetic unit may wake up when the timer expires. The arithmetic unit wake-up start information acquisition unit 110 obtains the timer's expiration time and the time at which the wake-up will begin. Specifically, in order to obtain the wake-up timing of an idle arithmetic unit, the arithmetic unit wake-up start information acquisition unit 110 obtains the remaining timer time from the hardware timer setting unit 24 and the time at which the wake-up will begin (as described in the first embodiment).
[0039] (2) An idle arithmetic unit may wake up when an interrupt is received from a device. The arithmetic unit wake-up start information acquisition unit 110 obtains the time that marks the start of the wake-up by obtaining a timestamp when an idle arithmetic unit is woken up by executing a new task. Specifically, in order to obtain the wake-up timing of an idle arithmetic unit, the arithmetic unit wake-up start information acquisition unit 110 obtains the time that marks the start of the wake-up by obtaining a timestamp from a device timestamp acquisition unit 25 provided by some devices and device drivers (as described in the second embodiment).
[0040] (3) The OS can wake up arithmetic units in an idle state for task scheduling. The arithmetic unit wake-up start information acquisition unit 110 acquires a timestamp when an idle arithmetic unit is woken up by an interrupt, to obtain the time serving as a wake-up start point. Specifically, the arithmetic unit wake-up start information acquisition unit 110 acquires a timestamp as the wake-up start point when a scheduling instruction is issued by the task allocation unit 22, in order to obtain the wake-up timing for task scheduling of the arithmetic unit in the idle state (described in the third embodiment).
[0041] <Arithmetic Unit Wake-Up Completion Information Acquisition Unit 120> The arithmetic unit wake-up completion information acquisition unit 120 acquires, as wake-up completion information, the time serving as a wake-up completion point at which the arithmetic unit in the idle state completes wake-up.
[0042] An example of the acquisition method is as follows. When the arithmetic unit in the idle state wakes up, the issued arithmetic unit pause instruction first completes. The arithmetic unit wake-up completion information acquisition unit 120 acquires a timestamp when the pause instruction is completed, to obtain the time serving as the wake-up completion point. In other words, the arithmetic unit wake-up completion information acquisition unit 120 acquires a timestamp as the wake-up completion point when the pause instruction is completed in the arithmetic unit pause instruction issuing unit 23.
[0043] <Arithmetic Unit Wake-Up Delay Information Derivation Unit 130> The arithmetic unit wake-up delay information derivation unit 130 derives a wake-up delay from the idle state in the arithmetic unit based on the acquired wake-up start information and the wake-up completion information.
[0044] An example of the derivation method is as follows. The arithmetic unit wake-up delay information derivation unit 130 calculates a time from the timestamp of the wake-up start information to the timestamp of the wake-up completion information as the wake-up delay with precision on the order of microseconds.
[0045] An output example is as follows. - Screen output of wake-up delay time - File output of wake-up delay time
[0046] [Hook Points for Timestamp Acquisition] Both the arithmetic unit wake-up start information acquisition unit 110 and the arithmetic unit wake-up completion information acquisition unit 120 operate by hooking into existing OS functions, and acquire timestamps when the OS functions are activated. Here, examples of hook points and hooking methods are described.
[0047] <Example of Hook Point Set by the Arithmetic Unit Wake-up Start Information Acquisition Unit 110> An example of the hook point set by the arithmetic unit wake-up start information acquisition unit 110 will be described. There are the following three examples.
[0048] <(1) When the Hardware Timer Setting Unit 24 is Used> The hardware timer setting unit 24 activates a function that reads the set value of the hardware timer at the timing when the hardware timer is configured. For example, in the Linux kernel, the function to read the timer setting value can be implemented by hooking into the function trace_hrtimer_start().
[0049] <(2) When the In-Device Timestamp Acquisition Unit 25 is Used> The in-device timestamp acquisition unit 25 hooks into a function that is always executed after the device acquires a timestamp. For example, when the target device is a NIC (Network Interface Card) that acquires a timestamp upon packet reception, the operation of acquiring a timestamp upon packet reception can be implemented by hooking into the net_if_receive_skb() function, which is always executed when a packet is received.
[0050] <Case of Using the Task Allocation Unit 22> A hook only needs to be set such that a function for acquiring a time stamp operates at the timing when the task allocation unit 22 issues an instruction to wake up the arithmetic unit. For example, a hook may be set on an instruction (such as a resched_ipi() function or a send_call_function_single_ipi() function) for waking up an arithmetic unit through an Inter-Processor Interrupt (IPI) to allocate a task or an instruction (such as a resched_curr() function) for notifying a thread sleeping while waiting for scheduling, so as to operate a time stamp acquisition function. As described above, a technique for setting a hook exists in the existing technology.
[0051] <Example of Command Using bpftrace, a Tool Utilizing eBPF> Next, the techniques (1) to (3) for setting a hook described above will be specifically described. With respect to the techniques (1) to (3) for setting a hook described above, an example of a command using bpftrace, which is a tool (command-line tool) utilizing eBPF (Extended Berkeley Packet Filter) (“eBPF” is one of the functions provided by the Linux kernel and is a Virtual Machine operating in a kernel space) will be described.
[0052] <Case where Acquisition Point of Start Information is Hardware Timer Setting Unit 24> FIG. 4 is a diagram illustrating an example of a command using bpftrace in a case where an acquisition point of start information is the hardware timer setting unit 24. As illustrated in FIG. 4, the arithmetic unit wake-up start information acquisition unit 110 (FIG. 3) sets a hook on trace_hrtimer_start(), reads a set value of a hardware timer, and outputs the set value to the shared memory 140 (FIG. 7). A command for setting the process is as follows. $ sudo bpftrace -e ‘tracepoint:timer:hrtimer_start{ printf(“expires: %llu ns\n”, args->expires);}’
[0053] Furthermore, the command used by the arithmetic unit wake-up completion information acquisition unit 120 (Figure 3) to hook into cpuidle(), take a timestamp immediately after resuming from the pause instruction, and output it to the shared memory 140 (Figure 7) is as follows: $ sudo bpftrace -e 'tracepoint:power:cpu_idle{ printf(“wakeup: %llu ns\n”, nsecs);}'
[0054] (2) When the acquisition point of start information is the device timestamp acquisition unit 25 Figure 5 shows an example of a command using bpftrace when the acquisition point of start information is the device timestamp acquisition unit 25. As shown in Figure 5, the command to set up the process in which the arithmetic unit wake-up start information acquisition unit 110 (Figure 3) hooks into netif_receive_skb() and accesses the device timestamp and outputs it to the shared memory 140 (Figure 7) is as follows: $ sudo bpftrace -e `kprobe:netif_receive_skb{ printf(“timestamps: %llu ns\n”, args->skb->skb_shared_info->hwtstamp);}'
[0055] The commands for the arithmetic unit wake-up completion information acquisition unit 120 (Figure 3) are the same as those for the arithmetic unit wake-up completion information acquisition unit 120 in Figure 4.
[0056] (3) When the acquisition point of start information is the task assignment unit 22 Figure 6 shows an example of a command using bpftrace when the acquisition point of start information is the task assignment unit 22. As shown in Figure 6, the command to set up the process in which the arithmetic unit wake-up start information acquisition unit 110 (Figure 3) hooks into the resched_curr() function, takes a timestamp when this function is executed, and outputs it to the shared memory 140 (Figure 7) is as follows: $ sudo bpftrace -e `kprobe:resched_curr{ printf(“resched_curr called: %llu ns\n”, nsecs);}'
[0057] The commands for the arithmetic unit wake-up completion information acquisition unit 120 (Figure 3) are the same as those for the arithmetic unit wake-up completion information acquisition unit 120 in Figure 4.
[0058] [Examples] Examples will be described below. Examples 1 to 3 will be given as examples. Implementation examples will be described for each example. Example 1 is an example in which the arithmetic unit wake-up start information acquisition unit 110 obtains the remaining timer time from the hardware timer setting unit 24 to obtain the time that will be the wake-up start point. Example 1 uses the command example in Figure 4. Example 1 will be explained with reference to Figures 7 to 17.
[0059] Example 2 is an example in which the arithmetic unit wake-up start information acquisition unit 110 acquires a timestamp from the device internal timestamp acquisition unit 25 to obtain the time that will be the wake-up start point. Example 2 uses the command example shown in Figure 5. Example 2 will be explained with reference to Figures 18 to 21 (see below).
[0060] Example 3 is an example in which the arithmetic unit wake-up start information acquisition unit 110 acquires a timestamp as the wake-up start point when a scheduling command is issued by the task assignment unit 22. Example 3 uses the command example shown in Figure 6. Example 3 will be explained with reference to Figures 22 to 25 (see below). Examples 1 to 3 will be explained in order below.
[0061] <Example 1> First, Example 1 will be described. In Example 1, the time when the next timer will expire is used as the wake-up start information for the arithmetic unit, as provided by the hardware timer setting unit 24.
[0062] Figure 7 shows an embodiment 1 of the arithmetic unit wake-up delay measurement system equipped with the arithmetic unit wake-up delay measurement device shown in Figure 3. The same reference numerals are used for components identical to those in Figure 3. In Figure 7, functional units that are not in operation in Embodiment 1 are shown with dashed lines (the same notation is used hereafter).
[0063] In the arithmetic unit wake-up delay measurement device 100 shown in Figure 7, a shared memory 140 is placed between the OS / driver 20 and the user space 30.
[0064] 《Examples of information placed in shared memory 140》 Shared memory 140 stores the core number, wake-up start, wake-up completion, and their timestamps. Examples of information placed in shared memory 140 are described below. [core number, wake-up start: 0 / wake-up completion: 1 / , timestamp (microseconds)] [3, 0, 4780192] [3, 1, 4780233] [3, 0, 5128941] [3, 1, 5128979] ... Note that the core number information is not mandatory, but it is generally necessary to clarify "which core caused the wake-up delay". Here, an example is shown in which the core number information is added to shared memory 140.
[0065] [Operation of the arithmetic unit wake-up start information acquisition unit 110 in Figure 7] The arithmetic unit wake-up start information acquisition unit 110 is activated when the hardware timer setting unit 24 is set, acquires the timing of the next timer expiration on the relevant core, and places it in the shared memory 140. In addition to the timestamp, the shared memory 140 can also store supplementary information such as the CPU core number.
[0066] [Operation of the arithmetic unit wake-up completion information acquisition unit 120 in Figure 7] The arithmetic unit wake-up completion information acquisition unit 120 is activated when the arithmetic unit pause instruction is completed, acquires a timestamp on the core that has finished waking up, and places it in the shared memory 140. The shared memory 140 can also store additional information such as the CPU core number and which CPU idle state the CPU was in.
[0067] [Operation of the arithmetic unit wake-up delay information derivation unit 130 in Figure 7] The arithmetic unit wake-up delay information derivation unit 130 calculates and outputs the wake-up delay from the information stored in the shared memory 140. For example, the output examples and output interface examples of the arithmetic unit wake-up delay information derivation unit 130 are as follows: ・Output example 1: Text ・Output example 2: Graphed image ・Output interface example 1: File ・Output interface example 2: Screen output
[0068] <Implementation Example in Embodiment 1> Figure 8 shows an implementation example in Embodiment 1 of Figure 7. The same reference numerals are used for components identical to those in Figure 7. The functions of the arithmetic unit wake-up completion information acquisition unit 120 and the arithmetic unit wake-up delay information derivation unit 130 in Figure 7 can be implemented using existing OS functions. Below, an example using eBPF, a function of Linux, is given.
[0069] [Implementation of the arithmetic unit wake-up start information acquisition unit 110 in Figure 8] The arithmetic unit wake-up start information acquisition unit 110 is loaded into the OS kernel as an eBPF program, and after being loaded into the OS kernel, it performs the following operations. The arithmetic unit wake-up start information acquisition unit 110 hooks into the timing when a function that sets a timer (for example, the hrtimer_start_range_ns() function) is called so that this eBPF program runs. Each time this eBPF program starts, it acquires the time when the timer will next expire and places it in the eBPF map.
[0070] [Implementation of the arithmetic unit wake-up completion information acquisition unit 120 in Figure 8] The arithmetic unit wake-up completion information acquisition unit 120, as an eBPF program loaded into the OS kernel, performs the following operations after being loaded into the OS kernel. The arithmetic unit wake-up completion information acquisition unit 120 hooks the eBPF program to run when cpuidle() is called by the arithmetic unit pause instruction issuing unit 23. Each time this eBPF program starts, it obtains the current timestamp and places it in the eBPF map.
[0071] [Implementation of the arithmetic unit wake-up delay information derivation unit 130 in Figure 8] The arithmetic unit wake-up delay information derivation unit 130 is implemented by a user program located in user space 30 and performs the following roles: - Acquires information located in the eBPF map. - Executes the output (output example 1: text, output example 2: graphed image, output interface example 1: file, output interface example 2: screen output) from the acquired information.
[0072] <Example of operation of the arithmetic unit wake-up start information acquisition unit 110 in Example 1> Figure 9 is a configuration diagram showing the operation image of the arithmetic unit wake-up start information acquisition unit 110 of the arithmetic unit wake-up delay measuring device 100 in Example 1. The same reference numerals are used for the same components as in Figure 7. In addition, the relevant functional units are represented by thick solid lines, and functional units that are not related to operation are represented by dashed lines. The arithmetic unit wake-up start information acquisition unit 110 shown in Figure 9 is activated when the hardware timer setting unit 24 is set, acquires the timing of the next timer expiration on the relevant core, and places it in the shared memory 140.
[0073] Figure 10 is a flowchart showing the operation of the arithmetic unit wake-up information acquisition unit 110 shown in Figure 9. The arithmetic unit wake-up information acquisition unit 110 shown in Figure 9 is loaded into the OS kernel as an eBPF program, etc., and then executes the following flow. This flow is started each time the hardware timer setting unit 24 is called. In step S11, the arithmetic unit wake-up information acquisition unit 110 (Figure 9) acquires the time information of the next timer to expire from the hardware timer setting unit 24 (Figure 9).
[0074] In step S12, the arithmetic unit wake-up start information acquisition unit 110 creates information in the format [core number, wake-up start, timestamp] (see "Example of information to be placed in shared memory 140"), adds it to the shared memory 140 (Figure 9), and terminates the processing of this flow.
[0075] 《"Wake-up Start" Descriptor》 The "Wake-up Start" descriptor created in step S12 above will now be explained. The arithmetic unit wake-up start information acquisition unit 110 stores information to distinguish whether the timestamp is the "wake-up start point" or the "wake-up completion point," in addition to the timestamp. This makes it possible to distinguish between them even if the entries are stored in a memory area shared with the arithmetic unit wake-up completion information acquisition unit 120. Adopting a method of storing information to distinguish whether the timestamp is the "wake-up start point" or the "wake-up completion point" has the advantage of reducing memory overhead and simplifying the implementation of the arithmetic unit wake-up delay information derivation unit 130 (Figure 9).
[0076] Such a descriptor for "wake-up start" can be in any format as long as it is uniquely determined between the arithmetic unit wake-up delay information derivation unit 130. For example, the following format is possible.
[0077] (Example 1) In the case of distinguishing between wake-up start: 0 and wake-up completion: 1 (core number is 3) Example entry: [3, 0, 13367847] Since it only requires 1 bit of information, it operates at the fastest speed and with the lowest memory consumption.
[0078] (Example 2) The string is stored as start, end (core number is 3) Example entry: [3, “start”, 13367847] Example 2 is less efficient than Example 1, but improves the readability of the program. Also, since the output from the arithmetic unit wake-up delay information derivation unit 130 is understandable to the user even if the entry is output without processing, it is possible to reduce the computational load on the arithmetic unit wake-up delay information derivation unit 130.
[0079] 《Core Number》 Next, we will explain the core number used in step S12 above. When acquiring wake-up delays for multiple cores in parallel, information indicating the core number is required. That is, it is necessary to obtain which core the hardware timer setting unit 24 (Figure 9) has set the timer for (in most cases, the hardware timer setting unit 24 itself sets the timer for the core on which it is operating). Note that if you specify a particular core from the beginning when starting this system, information indicating the core number is not necessary as it can be uniquely identified.
[0080] <Example of operation of the arithmetic unit wake-up completion information acquisition unit 120 in Example 1> Figure 11 is a configuration diagram showing the operation image of the arithmetic unit wake-up completion information acquisition unit 120 of the arithmetic unit wake-up delay measuring device 100 in Example 1. The same reference numerals are used for the same components as in Figure 7. In addition, the relevant functional units are represented by thick solid lines, and functional units that are not related to operation are represented by dashed lines. The arithmetic unit wake-up completion information acquisition unit 120 shown in Figure 11 is activated when the arithmetic unit pause instruction is completed, acquires a timestamp on the core that has finished waking up, and places it in the shared memory 140.
[0081] Figure 12 is a flowchart showing the operation of the arithmetic unit wake-up completion information acquisition unit 120 shown in Figure 11. The arithmetic unit wake-up completion information acquisition unit 120 shown in Figure 11 is loaded into the OS kernel as an eBPF program, etc., and then executes the following flow. This flow is started each time the arithmetic unit pause instruction issuing unit 23 returns from a pause instruction. In step S21, the arithmetic unit wake-up completion information acquisition unit 120 (Figure 11) obtains a timestamp from the arithmetic unit pause instruction issuing unit 23. In step S22, the arithmetic unit wake-up completion information acquisition unit 120 creates information in the format [core number, wake-up complete, timestamp], adds it to the shared memory 140 (Figure 11), and terminates the processing of this flow.
[0082] 《"Wake-up Complete" Descriptor》 The "Wake-up Complete" descriptor created in step S22 above will be explained below. The "Wake-up Complete" descriptor can take the following form, for example.
[0083] (Example 1) In the case of distinguishing between wake-up start: 0 and wake-up complete: 1 (core number is 3) Example entry: [3, 1, 13367847] Since it only requires 1 bit of information, it operates at the fastest speed and with the lowest memory consumption.
[0084] (Example 2) The string is stored as start, end (core number is 3) Example entry: [3, “end”, 13367847] Example 2 is less efficient than Example 1, but improves the readability of the program. Also, since the output from the arithmetic unit wake-up delay information derivation unit 130 is understandable to the user even if the entry is output without processing, it is possible to reduce the computational load on the arithmetic unit wake-up delay information derivation unit 130.
[0085] 《Core Number》 Next, we will explain the core number used in step S22 above. When acquiring wake-up delays for multiple cores in parallel, information indicating the core number is required. In this case, it is necessary to acquire which core the arithmetic unit pause instruction issuing unit 23 was executing on and store it in the shared memory 140 (Figure 11). Note that if you start the system by specifying a particular core from the beginning, information indicating the core number is not necessary as it can be uniquely identified without it.
[0086] 《Storing CPU Idle State》 Next, we will explain how to store the CPU idle state. Information indicating which CPU idle state the CPU core has recovered from may be added to the entry. That is, information in the format [core number, wake-up complete, timestamp, CPU idle state] is created and added to the shared memory 140 (Figure 11). Having the information [core number, wake-up complete, timestamp, CPU idle state] makes it possible to distinguish and present "which CPU idle state the wake-up delay occurred from". A specific example will be described later in the arithmetic unit wake-up delay information derivation unit 130 (Figure 13 below). Note that the representation of the CPU idle state does not matter as long as it is uniquely determined between the arithmetic unit wake-up delay information derivation unit 130 (Figure 13 below). For example, there is the following format.
[0087] (Example 1) If C0:0, C1:1, C1E:2, C3:3, C6:4, example entry: [3, 1, 13367886, 4] (Wake-up completed from C6 in core #3)
[0088] (Example 2) Example entry when storing as a string: [3, 1, 13367886, “C6”] (Wake-up complete from C6 in core #3)
[0089] Example 1 is more efficient, but Example 2 is more readable (in this respect, it serves the same purpose as the wake-up completion descriptor).
[0090] Note that CPU idle state information only needs to be included in either the "Wake-up Start" or "Wake-up Complete" entry. Furthermore, since obtaining the CPU idle state in the "Wake-up Start" entry is difficult, or the method differs depending on the implementation, it is more efficient to include the CPU idle state information only in the "Wake-up Complete" entry. In this case, it is best to set the corresponding element in the "Wake-up Start" entry to an invalid value. For example, [3, 0, 13367847, -1] or [3, "start", 13367847, "NULL"].
[0091] <Example of operation of the arithmetic unit wake-up delay information derivation unit 130 in Example 1> Figure 13 is a configuration diagram showing the operation image of the arithmetic unit wake-up delay information derivation unit 130 of the arithmetic unit wake-up delay measuring device 100 in Example 1. The same reference numerals are used for the same components as in Figure 7. In addition, the relevant functional components are represented by thick solid lines, and functional components that are not related to operation are represented by dashed lines. The arithmetic unit wake-up delay information derivation unit 130 shown in Figure 13 calculates and outputs the wake-up delay from the information stored in the shared memory 140 (Figure 13).
[0092] Figure 14 is a flowchart showing the operation of the arithmetic unit wake-up delay information derivation unit 130 shown in Figure 13. The arithmetic unit wake-up delay information derivation unit 130 shown in Figure 13 is started in user space. In step S31, the arithmetic unit wake-up delay information derivation unit 130 refers to the shared memory 140 (Figure 13).
[0093] In step S32, the arithmetic unit wake-up delay information derivation unit 130 determines whether a new entry (as described above for "entry") has been added.
[0094] If no new entries have been added (S32: No), in step S33 the arithmetic unit wake-up delay information derivation unit 130 determines whether or not the shared memory reference interval has been specified by the user.
[0095] This section explains how to specify the shared memory access interval. For example, the following are examples of how to specify it: • The user specifies the access interval as a command-line argument at startup (e.g., 1 msec). • The access interval is written permanently within the program.
[0096] If the arithmetic unit wake-up delay information derivation unit 130 specifies no reference interval or a high-frequency reference interval, the risk of entries overflowing is reduced even if the shared memory 140 (Figure 13) is small, and stable operation can be expected. However, because the arithmetic unit wake-up delay information derivation unit 130 performs references in a busy state, it uses a lot of computing resources. On the other hand, if the arithmetic unit wake-up delay information derivation unit 130 specifies a low-frequency reference interval, the amount of computing resources used by the arithmetic unit wake-up delay information derivation unit 130 is reduced, but the risk of entries overflowing increases. Therefore, this is limited to cases where entries are added only infrequently (or the shared memory 140 needs to be increased).
[0097] Returning to the flow in Figure 14, if the shared memory reference interval is specified by the user (S33: Yes), in step S34 the arithmetic unit wake-up delay information derivation unit 130 sleeps for the specified reference interval and returns to step S31. If the shared memory reference interval is not specified by the user (S33: No), it returns to step S31 as is.
[0098] If a new entry has been added (S32: Yes), in step S35 the arithmetic unit wake-up delay information derivation unit 130 retrieves the added entry from the shared memory 140 (Figure 13).
[0099] In step S36, the arithmetic unit wake-up delay information derivation unit 130 temporarily stores the contents of the acquired entry in memory / storage.
[0100] In step S37, the arithmetic unit wake-up delay information derivation unit 130 determines whether or not the termination conditions are met. Examples of termination conditions are as follows: - The user specifies the termination time at startup (e.g., termination in 10 seconds). - The user specifies the number of termination entries at startup (e.g., termination after 10,000 entries). - The system receives a termination instruction from the user (e.g., receives a signal).
[0101] If the termination condition is not met in step S37 (S37: No), the process returns to step S31. If the termination condition is met (S37: Yes), the arithmetic unit wake-up delay information derivation unit 130 outputs the acquired wake-up delay information to the screen or file (Figures 15 to 17 below) and terminates the processing of this flow.
[0102] [Output Examples] Screen output examples will be explained with reference to Figures 15 to 17. Figure 15 is an example of text output. Figure 16 is an example of screen output. Figure 17 is an example of text output when obtaining CPU idle state information.
[0103] 《Example of correspondence between acquired information and output (example of text output showing average values and histograms for each core)》 Figure 15 is a diagram showing an example of correspondence between acquired information and output (example of text output showing average values and histograms for each core). The left diagram of Figure 15 is an example of information temporarily held in memory / storage at the end of the process. Here, memory / storage refers to the memory that the arithmetic unit wake-up delay information derivation unit 130 (Figure 8) acquires from the shared memory 140 (Figure 8) and temporarily holds. The information shown in the left diagram of Figure 15 is an example of where a wake-up delay of 13367886 - 13367847 = 39 (microseconds) and a wake-up delay of 14474833 - 14474823 = 10 (microseconds) occurred in core 3.
[0104] The upper right diagram of Figure 15 shows the output from the arithmetic unit wake-up delay information derivation unit 130 (arrow c in Figure 15). The upper right diagram of Figure 15 shows an example of text output of the information from the left diagram of Figure 15 [output to screen or text file]; this is raw data. … [3, 0, 13367847] [3, 1, 13367886] [3, 0, 14774823] [3, 1, 14774833] …
[0105] Outputting raw data as text is less visually appealing compared to outputting data as text or graphs after statistical processing. However, it has the advantage of outputting the information with minimal processing, resulting in shorter output times and smaller output file sizes. Furthermore, it facilitates secondary processing, such as statistical analysis, of the output data.
[0106] The right-center diagram of Figure 15 shows the output from the arithmetic unit wake-up delay information derivation unit 130 (arrow d in Figure 15). The right-center diagram of Figure 15 is an example of text output of the information from the left diagram of Figure 15 [output to screen or text file]; an example of statistical data <1>. ... ===== Maximum wake-up delay in Core #3: 56 microseconds Minimum value: 3 microseconds Average value: 24 microseconds Number of samples: 15,000 ===== Wake-up delay in Core #4 ...
[0107] The lower right figure of Figure 15 shows the output from the arithmetic unit wake-up delay information derivation unit 130 (arrow e in Figure 15). The lower right figure of Figure 15 shows example 3 of the text output of the information from the left figure of Figure 15 [output to screen or text file]; example of statistical data <2>. … ===== Frequency distribution of wake-up delay in Core #3 [0, 10): 3,482 [10, 20): 584 [20, 30): 45 [30, 40): 8,826 [40~: 2,063 Total number of samples: 15,000 ===== Wake-up delay in Core #4 …
[0108] 《Example of correspondence between acquired information and output (example of output using images showing average values and histograms for each core)》 Figure 16 is a diagram showing an example of correspondence between acquired information and output (example of text output showing average values and histograms for each core). The left side of Figure 16 is an example of information temporarily held in memory / storage at termination. The information shown in the left side of Figure 16 is an example of where a wake-up delay of 13367886 - 13367847 = 39 (microseconds) and a wake-up delay of 14474833 - 14474823 = 10 (microseconds) occurred in core 3.
[0109] The right-hand figure of Figure 16 shows the output from the arithmetic unit wake-up delay information derivation unit 130 (arrow f in Figure 16). The right-hand figure of Figure 16 shows an example of text output of the information from the left-hand figure of Figure 16 [output to screen or text file]; statistical data graphing. The statistical data graphing in the right-hand figure of Figure 16 represents the frequency distribution of wake-up delays in Core #3 (n=15,000).
[0110] 《Example of correspondence between acquired information and output (Example of output when power saving state (CPU idle state) is added)》 Figure 17 shows an example of the correspondence between acquired information and output (an example of output when power saving state (CPU idle state) is added). When power saving state (CPU idle state) is added, it corresponds to the case where CPU idle state information shown in Figures 11 and 12 is also acquired. The left side of Figure 17 is an example of information temporarily held in memory / storage at termination. … [3, 0, 13367847, -1] [3, 1, 13367886, 4] [3, 0, 14774823, -1] [3, 1, 14774830, 2] …
[0111] The information shown in Figure 17 (left) is an example of where wake-up delays of 13367886 - 13367847 = 39 microseconds and 14474833 - 14474823 = 10 microseconds occurred in core 3. The information shown in Figure 17 (left) includes identifiers for wake-up from 4 (C6) and 2 (C1E) (Figure 35), respectively (the entry for the start of wake-up is marked with the invalid value "-1").
[0112] The upper right diagram of Figure 17 shows the output from the arithmetic unit wake-up delay information derivation unit 130 (arrow g in Figure 17). The upper right diagram of Figure 17 shows an example of text output of the information from the left diagram of Figure 17 [output to screen or text file]; this is raw data. … [3, 0, 13367847, -1] [3, 1, 13367886, 4] [3, 0, 14774823, -1] [3, 1, 14774830, 2] …
[0113] Outputting raw data as text is less visually appealing compared to outputting data as text or graphs after statistical processing. However, it has the advantage of outputting the information with minimal processing, resulting in shorter output times and smaller output file sizes. Furthermore, it facilitates secondary processing, such as statistical analysis, of the output data.
[0114] The lower right diagram of Figure 17 shows the output from the arithmetic unit wake-up delay information derivation unit 130 (arrow h in Figure 15). The lower right diagram of Figure 17 shows an example of text output of the information from the left diagram of Figure 17 [output to screen or text file]; it is an example of statistical data. … ===== Wake-up delay from each state in Core #3 C1: Average 2 microseconds, Maximum 2 microseconds, Minimum 2 microseconds, Sample size: 3,610 C1E: Average 10 microseconds, Maximum 18 microseconds, Minimum 7 microseconds, Sample size: 1,888 C3: Average 20 microseconds, Maximum 24 microseconds, Minimum 18 microseconds, Sample size: 510 C6: Average 38 microseconds, Maximum 51 microseconds, Minimum 35 microseconds, Sample size: 8,992 ===== Wake-up delay from each state in Core #4 … This concludes the explanation of Example 1. Next, Example 2 will be explained.
[0115] <Example 2> Example 2 will now be described. Example 2 is an example in which the arithmetic unit wake-up start information acquisition unit 110 acquires a timestamp from the device internal timestamp acquisition unit 25 to obtain the time that will be the wake-up start point. Example 2 uses the command example shown in Figure 5.
[0116] Figure 18 shows Embodiment 2 of the arithmetic unit wake-up delay measurement system 1000, which includes the arithmetic unit wake-up delay measurement device 100 shown in Figure 3. The same reference numerals are used for the same components as in Figure 3. In Figure 18, the functional components that are not in operation in Embodiment 2 are shown with dashed lines.
[0117] The arithmetic unit wake-up delay measurement device 100 shown in Figure 18 has a shared memory 140 placed between the OS / driver 20 and the user space 30, similar to implementation example 1 in Figure 7.
[0118] 《Example of information placed in shared memory 140》 Shared memory 140 stores the core number, wake-up start, wake-up completion, and their timestamps, similar to the shared memory 140 in Figure 7. An example of information placed in shared memory 140 is the same as in Figure 7, as follows: [core number, wake-up start: 0 / wake-up completion: 1 / , timestamp (microseconds)] [3, 0, 4780192] [3, 1, 4780233] [3, 0, 5128941] [3, 1, 5128979] …
[0119] [Operation of the device timestamp acquisition unit 25 in Figure 18] A device can wake up its arithmetic unit through interrupts or notifications to shared memory. In addition, some devices have an internal clock and can acquire timestamps. A device driver can store the timestamp in memory using interrupts, notifications to shared memory, or the internal clock. In this specification, this existing function by the device driver is referred to as the "device timestamp acquisition unit 25".
[0120] For example, there are NICs that can obtain a timestamp when a packet is received. Such NICs can start their arithmetic unit via an interrupt immediately after receiving a packet, so the timing of packet reception can be used as the wake-up trigger.
[0121] [Operation of the arithmetic unit wake-up information acquisition unit 110 in Figure 18] The arithmetic unit wake-up information acquisition unit 110 is activated after the device timestamp acquisition unit 25 has stored the timestamp of the process leading to the wake-up of the arithmetic unit, and it acquires the relevant timestamp information and places it in the shared memory 140. The arithmetic unit wake-up information acquisition unit 110 can also store supplementary information such as the CPU core number, similar to Embodiment 1.
[0122] [Operation of the arithmetic unit wake-up completion information acquisition unit 120 in Figure 18] The operation of the arithmetic unit wake-up completion information acquisition unit 120 is the same as that of the arithmetic unit wake-up completion information acquisition unit 120 in Figure 7 of Embodiment 1.
[0123] [Operation of the arithmetic unit wake-up delay information derivation unit 130 in Figure 18] The operation of the arithmetic unit wake-up delay information derivation unit 130 is the same as that of the arithmetic unit wake-up delay information derivation unit 130 in Figure 7 of Embodiment 1.
[0124] <Implementation Example in Embodiment 2> Figure 19 shows an implementation example in Embodiment 2 of Figure 18. The same reference numerals are used for components identical to those in Figures 8 and 18. The functions of the arithmetic unit wake-up completion information acquisition unit 120 and the arithmetic unit wake-up delay information derivation unit 130 in Figure 18 can be implemented using existing OS functions. As an example, we will use eBPF, a function of Linux, and describe a case where the NIC has a function to acquire timestamps.
[0125] [Implementation of the arithmetic unit wake-up information acquisition unit 110 in Figure 19] The arithmetic unit wake-up information acquisition unit 110 is loaded into the OS kernel as an eBPF program, and after being loaded into the OS kernel, it performs the following operations. The arithmetic unit wake-up information acquisition unit 110 hooks the eBPF program to start when a command to process packet reception from the NIC occurs (because when the OS processes the packet reception, the NIC has already received the packet and saved the timestamp). Each time the eBPF program starts, it reads the timestamp information held by the timestamp acquisition function in the device and places it in shared memory (eBPF map).
[0126] [Implementation of the arithmetic unit wake-up completion information acquisition unit 120 in Figure 19] The arithmetic unit wake-up completion information acquisition unit 120, as an eBPF program loaded into the OS kernel, performs the following operations after being loaded into the OS kernel. Similar to Embodiment 1 in Figure 8, the arithmetic unit wake-up completion information acquisition unit 120 hooks the timing at which cpuidle() is called by the arithmetic unit pause instruction issuing unit 23 so that the eBPF program runs. Each time this eBPF program starts, it obtains the current timestamp and places it in the eBPF map.
[0127] [Implementation of the arithmetic unit wake-up delay information derivation unit 130 in Figure 19] The arithmetic unit wake-up delay information derivation unit 130 is implemented by a user program located in user space 30 and performs the following roles. Similar to Embodiment 1 in Figure 8, the arithmetic unit wake-up delay information derivation unit 130 acquires information located in the eBPF map and performs output from the acquired information (Output example 1: text, Output example 2: graphed image, Output interface example 1: file, Output interface example 2: screen output).
[0128] <Example of operation of the arithmetic unit wake-up start information acquisition unit 110 in Example 2> Figure 20 is a configuration diagram showing the operation image of the arithmetic unit wake-up start information acquisition unit 110 of the arithmetic unit wake-up delay measuring device 100 in Example 2. The same reference numerals are used for the same components as in Figures 9 and 19. In addition, the relevant functional units are represented by thick solid lines, and functional units that are not related to operation are represented by dashed lines. The arithmetic unit wake-up start information acquisition unit 110 shown in Figure 20 is activated after the timestamp of the process leading to the wake-up of the arithmetic unit has been stored by the device timestamp acquisition unit 25, and acquires the relevant timestamp information and places it in the shared memory 140.
[0129] Figure 21 is a flowchart showing the operation of the arithmetic unit wake-up information acquisition unit 110 shown in Figure 20. The arithmetic unit wake-up information acquisition unit 110 shown in Figure 20 is loaded into the OS kernel as an eBPF program, etc., and then executes the following flow. This flow is started at the timing of an instruction that is sure to occur in the OS after the device has acquired a timestamp (for example, after the NIC has acquired a packet reception timestamp, it is started at the timing when a packet reception instruction occurs in the OS). In step S41, the arithmetic unit wake-up information acquisition unit 110 (Figure 20) reads the timestamp acquired in the device and stored in the shared memory 140 (Figure 20).
[0130] In step S42, the arithmetic unit wake-up start information acquisition unit 110 creates information in the format [core number, wake-up start, timestamp], adds it to the shared memory 140 (Figure 20), and terminates the processing of this flow.
[0131] 《"Start of waking up" descriptor》 The descriptor for "Start of waking up" is the same as described in step S12 of Figure 10 of Example 1.
[0132] 《Descriptor for “core number”》 The descriptor for “core number” is the same as described in step S12 of Figure 10 of Example 1.
[0133] 《Supplementary Explanation of the Unit Awakening Start Information Acquisition Unit 110 in Example 2》 A supplementary explanation will be given regarding the operation of the unit awakening start information acquisition unit 110 in Example 2. In the example shown in Figures 20 and 21 of Example 2, the wake-up start timestamp information is written to the shared memory 140 (Figure 20) after the wake-up completion timestamp has been acquired. Here, the order is reversed, but as long as the timestamp information is saved, no error will occur. The case where the order is reversed will be explained in detail below. (Example) Even if the entry added to the shared memory 140 first is: [3, “end”, 1334753] and the entry added to the shared memory 140 later is: [3, “start”, 1334712], the unit awakening delay information derivation unit 130 can correctly interpret the case where the order is reversed and recognize that a wake-up delay of 41 microseconds has occurred. Note that such reversals of order can occur in other embodiments as well, but they are easily correctable and will not be given special consideration.
[0134] <Example 3> Example 3 will now be described. Example 3 is an example in which the arithmetic unit wake-up start information acquisition unit 110 acquires a timestamp as the wake-up start point when a scheduling command is issued by the task assignment unit 22. Example 3 uses the command example shown in Figure 6.
[0135] Figure 22 shows Embodiment 3 of the arithmetic unit wake-up delay measurement system 1000, which includes the arithmetic unit wake-up delay measurement device 100 shown in Figure 3. The same reference numerals are used for components identical to those in Figure 3. In Figure 22, functional units that are not in operation in Embodiment 3 are shown with dashed lines.
[0136] 《Operation of the arithmetic unit wake-up start information acquisition unit 110 in Example 3》 The arithmetic unit wake-up start information acquisition unit 110 shown in Figure 22 is activated when the task assignment unit 22 (Figure 22) wakes up the arithmetic unit in order to assign a task, at the timing when the task assignment instruction is issued, acquires a timestamp, and places it in the shared memory 140 (Figure 22).
[0137] 《Operation of the arithmetic unit wake-up completion information acquisition unit 120 in Example 3》 The operation of the arithmetic unit wake-up completion information acquisition unit 120 is the same as that of the arithmetic unit wake-up completion information acquisition unit 120 in Figure 9 of Example 1.
[0138] 《Operation of the arithmetic unit wake-up delay information derivation unit 130 in Example 3》 The operation of the arithmetic unit wake-up delay information derivation unit 130 is the same as that of the arithmetic unit wake-up delay information derivation unit 130 in Figure 9 of Example 1.
[0139] Examples of information placed in the shared memory 140 in Example 3: The examples of information placed in the shared memory 140 are the same as the examples of information placed in the shared memory 140 in Figure 9 of Example 1.
[0140] <Implementation Example in Embodiment 3> Figure 23 shows an implementation example in Embodiment 3 of Figure 22. The same reference numerals are used for components identical to those in Figures 8 and 22. The functions of the arithmetic unit wake-up completion information acquisition unit 120 and the arithmetic unit wake-up delay information derivation unit 130 in Figure 18 can be implemented using existing OS functions. Below, an example using eBPF, a function of Linux, is given.
[0141] [Implementation of the arithmetic unit wake-up information acquisition unit 110 in Figure 23] The arithmetic unit wake-up information acquisition unit 110 is loaded into the OS kernel as an eBPF program, and after being loaded into the OS kernel, it performs the following operations. The arithmetic unit wake-up information acquisition unit 110 operates when the arithmetic units are woken up by task assignment. For example, it hooks into the timing when an instruction that wakes up the arithmetic units and assigns tasks via an inter-processor interrupt (IPI) (such as the resched_ipi() function or the send_call_function_signle_ipi() function) or an instruction that notifies a thread sleeping while waiting for a schedule (such as the resched_curr() function) is called so that this eBPF operates. Each time this eBPF program starts up, it acquires a timestamp and places it in shared memory 140 (Figure 23).
[0142] [Implementation of the arithmetic unit wake-up completion information acquisition unit 120 in Figure 23] The arithmetic unit wake-up completion information acquisition unit 120 is the same as the arithmetic unit wake-up completion information acquisition unit 120 in Figure 8 of Embodiment 1.
[0143] [Implementation of the arithmetic unit wake-up delay information derivation unit 130 in Figure 23] The arithmetic unit wake-up delay information derivation unit 130 is the same as the arithmetic unit wake-up delay information derivation unit 130 in Figure 8 of Embodiment 1.
[0144] <Example of operation of the arithmetic unit wake-up start information acquisition unit 110 in Embodiment 3> Figure 24 is a configuration diagram showing the operation image of the arithmetic unit wake-up start information acquisition unit 110 of the arithmetic unit wake-up delay measuring device in Embodiment 3. The same reference numerals are used for the same components as in Figures 8 and 23. The arithmetic unit wake-up start information acquisition unit 110 shown in Figure 24 is activated when the task assignment unit 22 wakes up the arithmetic unit in order to assign a task, at the timing when the task assignment instruction is issued, acquires a timestamp, and places it in the shared memory 140.
[0145] Figure 25 is a flowchart showing the operation of the arithmetic unit wake-up information acquisition unit 110 shown in Figure 24. The arithmetic unit wake-up information acquisition unit 110 shown in Figure 24 is loaded into the OS kernel as an eBPF program, etc., and then executes the following flow. This flow is started when the task assignment unit 22 issues an instruction to wake up the arithmetic unit for task assignment. In step S51, the arithmetic unit wake-up information acquisition unit 110 (Figure 24) acquires a timestamp.
[0146] In step S52, the arithmetic unit wake-up start information acquisition unit 110 creates information in the format [core number, wake-up start, timestamp], adds it to the shared memory 140 (Figure 24), and terminates the processing of this flow.
[0147] 《"Start of waking up" descriptor》 The descriptor for "Start of waking up" is the same as described in step S12 of Figure 10 of Example 1.
[0148] 《Descriptor for “core number”》 The descriptor for “core number” is the same as described in step S12 of Figure 10 of Example 1.
[0149] (Second Embodiment) [Overall Configuration] Figure 26 is a schematic configuration diagram of a arithmetic unit wake-up delay measurement system 1000 equipped with an arithmetic unit wake-up delay measurement device 100A according to a second embodiment of the disclosed technology. The same reference numerals are used for components identical to those in Figure 3. As shown in Figure 26, the arithmetic unit wake-up delay measurement system 1000 comprises hardware (HW) 10, an OS / driver 20, and a user space 30, and the arithmetic unit wake-up delay measurement device 100A is provided on the OS / driver 20 and the user space 30.
[0150] <Hardware 10> Hardware 10 includes a CPU 11 having multiple CPU cores #m, ... In addition to the CPU 11, it may also include accelerators such as a GPU (Graphic Processing Unit), FPGA (Field Programmable Gate Array), ASIC (Application Specific Integrated Circuit), and DPU (Data Processing Unit).
[0151] <OS / driver 20> The OS / driver 20 comprises a task management unit 21, a hardware timer setting unit 24, a device timestamp acquisition unit 25, and a arithmetic unit wake-up start information acquisition unit 110 and a arithmetic unit wake-up completion information acquisition unit 120, which constitute the arithmetic unit wake-up delay measurement device 100A. The task management unit 21 comprises a task assignment unit 22 and an arithmetic unit pause instruction issuance unit 23. The task management unit 21, hardware timer setting unit 24, and device timestamp acquisition unit 25 are functional units relating to existing technology.
[0152] <User Space 30> The user space 30 includes application 1 (in this case, application A), and the arithmetic unit wake-up delay information derivation unit 130 and arithmetic unit wake-up delay measurement test unit 150, which constitute the arithmetic unit wake-up delay measurement device 100A.
[0153] [Calculator Wake-Up Delay Measurement Device] As shown in Figure 26, the calculator wake-up delay measurement device 100A includes a calculator wake-up start information acquisition unit 110 and a calculator wake-up completion information acquisition unit 120 on the OS / driver 20, and a calculator wake-up delay information derivation unit 130 and a calculator wake-up delay measurement test unit 150 on the user space 30.
[0154] <Arithmetic Unit Wake-Up Delay Measurement Test Unit 150> The Arithmetic Unit Wake-Up Delay Measurement Test Unit 150 is a "function for measurement testing" that arbitrarily induces the idle and wake-up of the arithmetic unit. Specifically, the Arithmetic Unit Wake-Up Delay Measurement Test Unit 150 arbitrarily induces the idle and wake-up of the arithmetic unit by issuing instructions that cause the arithmetic unit to enter an idle state (e.g., sleep instructions and various blocking instructions) and instructions that cause it to wake up from the idle state (e.g., timer settings).
[0155] The arithmetic unit wake-up delay measurement test unit 150 performs the following processes, for example: (1) Set a timer and enter a sleep state. (2) Create a thread that sleeps while waiting for a specific notification, and issue a command from another thread to notify the thread. Through these processes, the arithmetic unit wake-up delay measurement test unit 150 can intentionally induce the arithmetic unit to enter an idle state and wake up from there. This makes it possible to measure the wake-up delay when the wake-up occurs. The arithmetic unit wake-up delay measurement device 100A has the advantage of being able to measure wake-up delays even when there is no application, and because the processing content can be specified for wake-up delay measurement, it is possible to measure wake-up delays in "application operations that are likely to cause the worst wake-up delays" and "wake-up delays in various application processes".
[0156] Furthermore, the arithmetic unit wake-up delay measurement device 100A can also create a scenario where the wake-up delay is worst-case by including processing that changes the characteristics of the wake-up delay, and then measure the wake-up delay (an example is given below). In addition, the arithmetic unit wake-up delay measurement device 100A can create a scenario where the wake-up delay is worst-case, measure the wake-up delay, save the processing details, and output them, allowing the user to analyze "what kind of processing was being performed when the wake-up delay became worst-case."
[0157] <Example of the arithmetic unit wake-up delay measurement device 100A> An example of the arithmetic unit wake-up delay measurement device 100A will be described. As an example of the arithmetic unit wake-up delay measurement test unit 150, an example can be given in which a periodic timer is set to wake up the arithmetic unit, and wake-up and sleep are repeated.
[0158] The arithmetic unit wake-up delay measurement test unit 150 executes commands from user space 30 (Figure 26) that periodically cause a timer to expire, and commands that wake up due to the timer's expiration and then go back to sleep. (Example 1) The arithmetic unit wake-up delay measurement test unit 150 creates a timer object that expires periodically using Timerfd_create(), then sleeps until the timer expires using the read() command, wakes up due to the timer's expiration, and then repeats the process of sleeping again while waiting for the timer to expire using the read() command.
[0159] (Example 2) The arithmetic unit wake-up delay measurement test unit 150 sleeps for a specified period of time using nanosleep(). Then, the arithmetic unit wake-up delay measurement test unit 150 sets a hardware timer that expires after a specified number of seconds by the OS, and then puts the arithmetic unit to sleep. When the timer expires, nanosleep() is completed by the arithmetic unit wake-up delay measurement test unit 150, but by calling nanosleep() again after completion, the arithmetic unit can be made to repeatedly wake up and sleep.
[0160] <Operation of the arithmetic unit wake-up delay measurement test unit 150> Figure 27 is a flowchart showing the operation of the arithmetic unit wake-up delay measurement test unit 150 shown in Figure 26. In step S61, the arithmetic unit wake-up delay measurement test unit 150 sets a timer. In step S62, the arithmetic unit wake-up delay measurement test unit 150 executes an instruction to vary the wake-up delay. Specifically, the arithmetic unit wake-up delay measurement test unit 150 saves the +α timer setting and the contents of the above instruction in memory (not shown).
[0161] This section describes instructions for varying the wake-up delay. The wake-up delay varies slightly depending on the CPU's processing status. Therefore, it's possible to include processes to observe various wake-up delays, or even the worst-case scenario.
[0162] (Example 1) Reduce the frequency to the lowest possible level. This is because a lower frequency is thought to result in a slower wake-up process. (Example 2) Issue a large number of memory access instructions to increase cache utilization. This is because the transition time to the idle state is thought to change depending on the cache utilization rate. (Example 3) Execute a random instruction. By performing a random process each time before going to sleep, it is hoped that this will occasionally include an instruction that will result in the worst possible wake-up delay.
[0163] This section explains how to save instruction details. By saving the instructions for varying the wake-up delay along with the timer settings, the user can understand "how much the wake-up delay was during what kind of processing" by combining this with the output of the arithmetic unit wake-up delay information derivation unit.
[0164] Returning to the flow in Figure 27, in step S63, the arithmetic unit wake-up delay measurement test unit 150 sleeps until the timer expires. In step S64, the arithmetic unit wake-up delay measurement test unit 150 determines whether the timer has expired or not. If the timer has not expired (S64: No), it waits until the timer expires. If the timer has expired (S64: Yes), in step S65, the arithmetic unit wake-up delay measurement test unit 150 starts the timer again.
[0165] In step S66, the arithmetic unit wake-up delay measurement test unit 150 determines whether the termination conditions are met. If the termination conditions are not met (S66: No), the process returns to step S61. Examples of the above termination conditions are as follows: - The user specifies the termination time at startup (e.g., termination in 10 seconds). - The user specifies the number of termination entries at startup (e.g., termination after 10,000 wake-ups). - The user provides a termination instruction (e.g., receives a termination signal).
[0166] If the termination condition is met (S66: Yes), in step S67 the arithmetic unit wake-up delay measurement test unit 150 determines whether or not it retains the contents of the instruction that varies the wake-up delay. If it does not retain the contents of the instruction that varies the wake-up delay (S67: No), the processing of this flow is terminated. If it does retain the contents of the instruction that varies the wake-up delay (S67: Yes), in step S68 the arithmetic unit wake-up delay information derivation unit 130 (Figure 26) outputs to a file or screen (see Figures 15 to 17 for examples of output to a file or screen) and terminates the processing of this flow. The saving and output of the instruction that varies the wake-up delay will be described below. By saving the contents of the instruction that varies the wake-up delay together with the timer settings, the user can understand "how much the wake-up delay was during what kind of processing" in conjunction with the output of the arithmetic unit wake-up delay information derivation unit.
[0167] [Variation] An alternative configuration example in which the arrangement of each functional part of the arithmetic unit wake-up delay measuring device is changed will be described.
[0168] <Modification 1> Figure 28 is a schematic diagram of a arithmetic unit wake-up delay measurement system 1000 equipped with the arithmetic unit wake-up delay measurement device 100B of Modification 1. The same reference numerals are used for the same components as in Figure 8. The arithmetic unit wake-up delay measurement device 100B of Modification 1 shown in Figure 28 moves the arithmetic unit wake-up delay information derivation unit 130 of the arithmetic unit wake-up delay measurement device 100 of Figure 8 from the user space 30 to the OS / driver 20 and places it within the OS / driver 20. That is, the arithmetic unit wake-up delay measurement device 100B of Modification 1 shown in Figure 28 is equipped with an arithmetic unit wake-up start information acquisition unit 110, an arithmetic unit wake-up completion information acquisition unit 120, and an arithmetic unit wake-up delay information derivation unit 130 within the OS / driver 20.
[0169] The arithmetic unit wake-up delay measuring device 100B in the modified example 1 potentially reduces overhead by placing the arithmetic unit wake-up delay information derivation unit 130 within the OS / driver 20, thereby eliminating data copying with the user space 30. However, this increases the processing content within the OS / driver 20, generally making the implementation more complex.
[0170] 《Implementation of the arithmetic unit wake-up delay measuring device 100B in Modification 1》 Figure 29 shows an implementation example in Modification 1 of Figure 28. The same reference numerals are used for the same components as in Figures 8 and 28. Even when the arithmetic unit wake-up delay information derivation unit 130 in Figure 29 is included in the OS / driver 20, the existing Linux function eBPF can be used. That is, the arithmetic unit wake-up delay information derivation unit 130 in Figure 29 can be loaded as an eBPF program.
[0171] In this case, the operation and flowchart for the shared memory 140 are the same as in Figures 13 and 14. Also, the interface of the eBPF map is the same as when it is in user space 30, and is exactly the same as the processing content in Figure 13. The only difference is that what was labeled "started in user space" in the flowchart of Figure 14 becomes "started within the OS".
[0172] <Modification 2> Figure 30 is a schematic diagram of the arithmetic unit wake-up delay measurement system 1000 equipped with the arithmetic unit wake-up delay measurement device 100C of Modification 2. The same reference numerals are used for the same components as in Figure 8. The arithmetic unit wake-up delay measurement system 1000 of Modification 2 shown in Figure 30 has an application 1A which is the target of operation analysis and an arithmetic unit wake-up delay measurement device 100C on the user space 30. The application 1A has a time-delay processing setting unit 2 which issues a timer setting command to the hardware timer setting unit 24 of the OS / driver 20 and an in-application task assignment unit 3 which issues a task assignment command to the task management unit 21A of the OS / driver 20.
[0173] The modified example 2 of the arithmetic unit wake-up delay measurement device 100C shown in Figure 30 moves the arithmetic unit wake-up start information acquisition unit 110 and the arithmetic unit wake-up completion information acquisition unit 120 of the arithmetic unit wake-up delay measurement device 100 in Figure 8 from the OS / driver 20 to the user space 30 and places them on the user space 30. That is, the modified example 2 of the arithmetic unit wake-up delay measurement device 100C shown in Figure 30 is equipped with the arithmetic unit wake-up start information acquisition unit 110, the arithmetic unit wake-up completion information acquisition unit 120, and the arithmetic unit wake-up delay information derivation unit 130 on the user space 30.
[0174] The OS / driver 20 includes a hardware timer setting unit 24 that receives timer setting commands from the time-delay processing setting unit 2, and a task management unit 21A that receives task assignment commands from the in-application task assignment unit 3. Note that each functional unit of the arithmetic unit wake-up delay measurement device 100 shown in Figure 8 is moved from the OS / driver 20 to the user space 30 and arranged on the user space 30 as the arithmetic unit wake-up delay measurement device 100C.
[0175] The arithmetic unit wake-up start information acquisition unit 110 and the arithmetic unit wake-up completion information acquisition unit 120, which are located in the user space 30, will now be described. The arithmetic unit wake-up start information acquisition unit 110 shown in Figure 30 acquires information on the timing to wake up idle arithmetic units and stores it in a shared memory 140 with the arithmetic unit wake-up delay information derivation unit 130. An example of the acquisition method is as follows: (1) When application 1A sets a timer via the OS, this setting information is acquired as the wake-up start point.
[0176] (2) When application 1A has an internal task assignment function and issues a command to wake up a thread within the application via the OS task management function, a timestamp is obtained with that timing as the wake-up start point.
[0177] (3) If there is an interface that reads timestamps acquired within the device from user space, the timestamp information is acquired via that interface.
[0178] The arithmetic unit wake-up completion information acquisition unit 120, shown in Figure 30, acquires information on the timing when an idle arithmetic unit has finished waking up and stores it in a shared memory (not shown) between it and the arithmetic unit wake-up delay information derivation unit 130. An example of the acquisition method is as follows: After waking up from an idle state, the wake-up completion point is defined as the time when the application first executes an instruction, and a timestamp is acquired.
[0179] The operation of the arithmetic unit wake-up delay information derivation unit 130 shown in Figure 30 is the same as that of the arithmetic unit wake-up delay information derivation unit 130 shown in Figure 8.
[0180] In the modified example 2, the arithmetic unit wake-up delay measuring device 100C places the arithmetic unit wake-up start information acquisition unit 110, the arithmetic unit wake-up completion information acquisition unit 120, and the arithmetic unit wake-up delay information derivation unit 130 in the user space 30. While this reduces the accuracy of the acquired wake-up delay, it eliminates the need for OS-level information acquisition, making it easier to apply.
[0181] In the modified example 2, the arithmetic unit wake-up delay measurement device 100C is an example in which both the arithmetic unit wake-up start information acquisition unit 110 and the arithmetic unit wake-up completion information acquisition unit 120 within the OS / driver 20 are located in the user space 30. However, it is also possible to configure the device to have either the arithmetic unit wake-up start information acquisition unit 110 or the arithmetic unit wake-up completion information acquisition unit 120 located in the user space 30 (with one of the arithmetic unit wake-up completion information acquisition units 120 remaining within the OS / driver 20).
[0182] 《Implementation of the arithmetic unit wake-up delay measuring device 100C in Modification 2》 Figure 31 shows an implementation example in Modification 2 of Figure 30. The same reference numerals are used for the same components as in Figures 8 and 30. In the implementation example of Modification 2, the arithmetic unit wake-up start information acquisition unit 110 and the arithmetic unit wake-up completion information acquisition unit 120 are located in user space 30, and application 1 performs timer setting. A shared memory 140 is provided between the arithmetic unit wake-up start information acquisition unit 110 and the arithmetic unit wake-up completion information acquisition unit 120 and the arithmetic unit wake-up delay information derivation unit 130. The arithmetic unit wake-up start information acquisition unit 110, the arithmetic unit wake-up completion information acquisition unit 120 and the arithmetic unit wake-up delay information derivation unit 130 are implemented by a user program.
[0183] In the arithmetic unit wake-up delay measurement device 100C, the arithmetic unit wake-up start information acquisition unit 110, the arithmetic unit wake-up completion information acquisition unit 120, and the arithmetic unit wake-up delay information derivation unit 130 all operate as normal user processes.
[0184] The arithmetic unit wake-up start information acquisition unit 110 initiates a trace on application 1, and is activated when the time-delayed processing setting unit 2 of application 1 issues a timer setting command to the hardware timer setting unit 24 of the OS / driver 20, and acquires a timestamp. Subsequently, the arithmetic unit wake-up completion information acquisition unit 120 stores the said timestamp as wake-up start time information in the shared memory 140.
[0185] The arithmetic unit wake-up completion information acquisition unit 120 initiates a trace on application 1, and is activated when application 1 resumes processing on the CPU, and acquires a timestamp. Subsequently, the arithmetic unit wake-up delay information derivation unit 130 stores the timestamp as wake-up completion time information in the shared memory 140.
[0186] 《Operation of the arithmetic unit wake-up start information acquisition unit 110 in Modification 2》 Figure 32 is a flowchart showing the operation of the arithmetic unit wake-up start information acquisition unit 110 in Figure 31. The arithmetic unit wake-up start information acquisition unit 110 in Figure 31 is activated in user space 30 and then performs the following operations. The detailed operation of the arithmetic unit wake-up start information acquisition unit 110 is the same as in Embodiment 1 in Figure 10 and will not be explained. The only difference in the arithmetic unit wake-up start information acquisition unit 110 in Figure 31 is the activation trigger.
[0187] This flow is activated when the timed processing setting unit 2 of application 1 issues a timer setting command to the hardware timer setting unit 24 of the OS / driver 20. In step S71, the arithmetic unit wake-up start information acquisition unit 110 acquires the time information of the next timer to expire. In step S72, the arithmetic unit wake-up start information acquisition unit 110 creates information in the format [core number, wake-up start, timestamp], adds it to the shared memory 140, and terminates the processing of this flow.
[0188] 《Operation of the arithmetic unit wake-up completion information acquisition unit 120 in Modification Example 2》 Figure 33 is a flowchart showing the operation of the arithmetic unit wake-up completion information acquisition unit 120 in Figure 31. The arithmetic unit wake-up completion information acquisition unit 120 in Figure 33 is started in user space 30 and then performs the following operations. The detailed operation of the arithmetic unit wake-up completion information acquisition unit 120 is the same as in Embodiment 1 in Figure 12 and will not be explained. The only difference in the arithmetic unit wake-up completion information acquisition unit 120 in Figure 33 is the startup trigger. This flow is started when application 1 wakes up from sleep and resumes processing. In step S81, the arithmetic unit wake-up completion information acquisition unit 120 acquires a timestamp. In step S82, the arithmetic unit wake-up completion information acquisition unit 120 creates information in the format [core number, wake-up start, timestamp], adds it to the shared memory 140, and terminates the processing of this flow.
[0189] 《Operation of the arithmetic unit wake-up delay information derivation unit 130 in Modification 2》 The operation of the arithmetic unit wake-up delay information derivation unit 130 in Figure 31 is the same as in Embodiment 1 in Figure 14, so the explanation is omitted.
[0190] [Hardware Configuration] The arithmetic unit wake-up delay measurement devices 100 (Figures 3, 7, 8, 9, 11, 13, 18, 19, 20, 22, 23, 24), 100A (Figure 26), 100B (Figures 28, 29), and 100C (Figures 30, 31) according to each of the above embodiments are configured with a server such as the arithmetic unit wake-up delay measurement system 1000 shown in Figures 3, 7, 8, etc. In Figure 3, etc., the arithmetic unit wake-up delay measurement device 100 is shown within the OS / driver 20 of the arithmetic unit wake-up delay measurement system 1000. However, when the arithmetic unit wake-up delay measurement device 100 is implemented using a server, the server is realized by a computer 900 configured as shown in Figure 34, for example. Figure 34 is a hardware configuration diagram showing an example of a computer 900 that implements the functions of the arithmetic unit wake-up delay measurement device 100 (Figures 3, 7, 8, 9, 11, 13, 18, 19, 20, 22, 23, 24), 100A (Figure 26), 100B (Figures 28, 29), and 100C (Figures 30, 31) according to this embodiment. The computer 900 has a CPU 901 as a processor, ROM (Read Only Memory) 902, RAM 903, HDD (Hard Disk Drive) 904, input / output I / F (Interface) 905, communication I / F 906, and media I / F 907.
[0191] The CPU 901 operates based on a program stored in the ROM 902 or HDD 904, and controls the arithmetic unit wake-up delay measurement devices 100, 100A, 100B, and 100C based on a program loaded onto the RAM 903. The CPU 901 also acquires data from the input device 910 via the input / output interface 905 and outputs the generated data to the output device 911. A GPU (Graphics Processing Unit) or the like may also be used as a processor in addition to the CPU 901.
[0192] The HDD 904 stores programs executed by the CPU 901 and data used by those programs. An SSD (Solid State Drive) may be used instead of the HDD 904. 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. The media I / F 907 reads programs or data stored in the recording medium 912 and outputs them to the CPU 901 via the RAM 903.
[0193] In addition to the configurations described above, the functions of the elements disclosed herein may be implemented using circuits or processing circuitry that include general-purpose processors, special-purpose processors, integrated circuits, ASICs (Application Specific Integrated Circuits), FPGAs (Field Programmable Gate Arrays), conventional circuits, and / or combinations thereof, which are programmed using one or more programs stored in one or more memories, or otherwise configured to perform the disclosed functions. A processor is considered processing circuitry or circuitry because it includes transistors and other circuits. A processor may also be a programmed processor that executes programs stored in memory.
[0194] In this disclosure, a circuit, unit, or means is hardware that performs the enumerated functions, or hardware programmed to perform the enumerated functions. Hardware may be any hardware disclosed herein that is programmed or configured to perform the enumerated functions.
[0195] Furthermore, the memory stores a computer program containing computer instructions. These computer instructions provide logic and routines that enable hardware (e.g., processing circuitry or circuitry) to perform the methods disclosed herein. The computer program can be implemented in commonly known forms, such as computer-readable storage media, computer program products, memory devices, recording media such as CD-ROMs, DVDs, Blu-ray Discs, and / or memory in FPGAs or ASICs.
[0196] [Effect] As explained above, the arithmetic unit (CPU 11) (Figures 1, 3, 7, 8, 9, 11, 13, 18, 19, 20, 22, 23, 24, 26, 28, 29, 30, 31, 34) that executes the processing of the application (Application A1) (Figures 1, 3, 7, 8, 9, 11, 13, 18, 19, 20, 22, 23, 24, 26, 28, 29, 3 0, Figures 31, 34) are arithmetic unit wake-up delay measuring devices 100 (Figures 3, 7, 8, 9, 11, 13, 18, 19, 20, 22, 23, 24), 100A (Figure 26), 100B (Figures 28, 29), 100C (Figures 30, 31) that measure the time required to start processing again when processing is paused, and the wake-up start point for waking up an idle arithmetic unit (CPU 11) is The arithmetic unit wake-up start information acquisition unit 110 (Figures 3, 7, 8, 9, 11, 13, 18, 19, 20, 22, 23, 24, 26, 28, 29, 30, 31, 34) acquires wake-up start information as wake-up start information, and the arithmetic unit wake-up completion information acquisition unit 120 (Figures 3, 7, 9, 11, 13, 18, 19, 30, 31, 34) acquires the time at which the idle arithmetic unit has finished waking up as wake-up completion information. The system includes (Figures 20, 22, 23, 24, 26, 28, 29, 30, 31, and 34) an arithmetic unit wake-up delay information derivation unit 130 (Figures 3, 7, 8, 9, 11, 13, 18, 19, 20, 22, 23, 24, 26, 28, 29, 30, 31, and 34) which derives the wake-up delay from the idle state in the arithmetic unit based on the acquired wake-up start information and wake-up completion information.
[0197] In this way, the arithmetic unit wake-up delay measuring devices 100, 100A, and 100B can measure the wake-up delay from the idle state that actually occurs in an operating arithmetic unit. This allows for accurate measurement of the time required to start processing again when an arithmetic unit that executes application processing resumes processing after being paused. Since users can understand the performance degradation caused by the arithmetic unit entering a power-saving state, this contributes to users setting power-saving functions to maximize power-saving effects while meeting performance requirements.
[0198] In the arithmetic unit wake-up delay measuring devices 100 (Figures 3, 7, 9, 11, 13, 18, 19, 20, 22, 23, 24), 100A (Figure 26), 100B (Figures 28, 29), and 100C (Figures 30, 31), the arithmetic unit wake-up start information acquisition unit 110 acquires the timer's expiration time to obtain the time that will be the wake-up start point.
[0199] By doing so, the arithmetic unit wake-up delay measuring devices 100, 100A, 100B, and 100C can acquire information on the timing at which the arithmetic unit wake-up start information acquisition unit 110 wakes up idle arithmetic units. This makes it possible to accurately measure the time required for an arithmetic unit that executes application processing to start processing again when it resumes processing after being paused.
[0200] In the arithmetic unit wake-up delay measuring devices 100 (Figures 3, 7, 9, 11, 13, 18, 19, 20, 22, 23, 24), 100A (Figure 26), 100B (Figures 28, 29), and 100C (Figures 30, 31), the arithmetic unit wake-up start information acquisition unit 110 acquires a timestamp when an idle arithmetic unit is woken up by executing a new task, thereby obtaining the time that marks the start of the wake-up.
[0201] By doing so, the arithmetic unit wake-up delay measuring devices 100, 100A, 100B, and 100C can acquire information on the timing at which the arithmetic unit wake-up start information acquisition unit 110 causes the idle arithmetic unit to execute a new task and wake up. This makes it possible to measure the wake-up delay from the idle state that actually occurs in an operating arithmetic unit.
[0202] In the arithmetic unit wake-up delay measuring devices 100 (Figures 3, 7, 9, 11, 13, 18, 19, 20, 22, 23, 24), 100A (Figure 26), 100B (Figures 28, 29), and 100C (Figures 30, 31), the arithmetic unit wake-up start information acquisition unit 110 acquires a timestamp when the idle arithmetic unit is woken up by an interrupt, and obtains the time that will be the wake-up start point.
[0203] In this way, the arithmetic unit wake-up delay measuring devices 100, 100A, 100B, and 100C can obtain the time that marks the start of wake-up by acquiring the timestamp when the arithmetic unit wake-up start information acquisition unit 110 wakes up the idle arithmetic unit via an interrupt. For example, when a scheduling command is issued by the task assignment unit 22 (Figures 3, 7, 23, and 24), the timing at which the OS wakes up the idle arithmetic unit for task scheduling can be obtained by acquiring the timestamp as the wake-up start point.
[0204] In the arithmetic unit wake-up delay measuring devices 100 (Figures 3, 7, 9, 11, 13, 18, 19, 20, 22, 23, 24), 100A (Figure 26), 100B (Figures 28, 29), and 100C (Figures 30, 31), the arithmetic unit wake-up completion information acquisition unit 120 acquires a timestamp when the pause command is completed and obtains the time that marks the wake-up completion point.
[0205] In this way, the arithmetic unit wake-up delay measuring devices 100, 100A, 100B, and 100C have the arithmetic unit wake-up completion information acquisition unit 120 acquire information on the timing when an idle arithmetic unit has finished waking up. This makes it possible to accurately measure the time required to start processing again when an arithmetic unit that executes application processing resumes processing after being paused.
[0206] In the arithmetic unit wake-up delay measuring devices 100 (Figures 3, 7, 9, 11, 13, 18, 19, 20, 22, 23, 24), 100A (Figure 26), 100B (Figures 28, 29), and 100C (Figures 30, 31), the arithmetic unit wake-up delay information derivation unit 130 calculates the wake-up delay as the period from the timestamp of the wake-up start information to the timestamp of the wake-up completion information.
[0207] In this way, the arithmetic unit wake-up delay measuring devices 100, 100A, 100B, and 100C can have the arithmetic unit wake-up delay information derivation unit 130 derive and output the wake-up delay in the arithmetic unit from the wake-up start information and wake-up completion information. For example, the arithmetic unit wake-up delay information derivation unit 130 can output the wake-up delay time to the screen or output the wake-up delay time to a file.
[0208] In the above embodiments, the implementation is shown using Linux, and methods such as embedding an eBPF program or using a tool called perf to obtain timestamps at targeted points are employed. The same can be achieved in Windows (registered trademark) by utilizing a core function called ETW (Event-Trace-for-Windows). Tools such as WPR and Xperf can be used as substitutes for tools like eBPF and perf in Linux.
[0209] Furthermore, among the processes described in each of the embodiments and application examples above, 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 by known methods. In addition, the processing procedures, control procedures, specific names, and information including various data and parameters shown in the above documents and drawings can be changed at will unless otherwise specified.
[0210] Furthermore, each component of the illustrated device is a functional concept and does not necessarily have to be physically configured as shown. In other words, the specific forms of distribution and integration of each device are not limited to those shown, and all or part of them can be functionally or physically distributed or integrated in any unit according to various loads and usage conditions. Moreover, the processing of some functions may be requested or evaluated by AI (Artificial Intelligence). In short, some functions of each illustrated device may be performed by AI.
[0211] 10 Hardware (HW) 11 CPU (Arithmetic Unit) 12 CPU Core 20 OS / driver 21, 21A Task Management Unit 22 Task Assignment Unit 23 Arithmetic Unit Pause Instruction Issuance Unit 24 Hardware Timer Setting Unit 25 Device Timestamp Acquisition Unit 30 User Space 100, 100A, 100B Arithmetic Unit Wake-up Delay Measurement Device 110 Arithmetic Unit Wake-up Start Information Acquisition Unit 120 Arithmetic Unit Wake-up Completion Information Acquisition Unit 130 Arithmetic Unit Wake-up Delay Information Derivation Unit 140 Shared Memory 150 Arithmetic Unit Wake-up Delay Measurement Test Unit 1000 Arithmetic Unit Wake-up Delay Measurement System
Claims
A device for measuring the wake-up delay of a computing unit, A unit wake-up start information acquisition unit acquires the wake-up start time, which is the wake-up start point for waking up idle units, as wake-up start information. A unit wake-up completion information acquisition unit acquires the time at which the idle unit has finished waking up as wake-up completion information, The system includes a arithmetic unit wake-up delay information derivation unit that derives the wake-up delay from the idle state in the arithmetic unit based on the acquired wake-up start information and wake-up completion information. A device for measuring the wake-up delay of a computing unit, characterized by the following features. The aforementioned calculator wake-up start information acquisition unit acquires the timer's expiration time and obtains the time that will be the wake-up start point. The calculator wake-up delay measuring device according to feature 1. The aforementioned arithmetic unit wake-up start information acquisition unit obtains a timestamp when it wakes up the idle arithmetic unit by having it execute a new task, thereby obtaining the time that will be the wake-up start point. The calculator wake-up delay measuring device according to feature 1. The aforementioned arithmetic unit wake-up start information acquisition unit obtains a timestamp when the idle arithmetic unit is woken up by an interrupt, and acquires the time that will be the wake-up start point. The calculator wake-up delay measuring device according to feature 1. The aforementioned arithmetic unit wake-up completion information acquisition unit obtains a timestamp when the pause command is completed and acquires the time that marks the wake-up completion point. The calculator wake-up delay measuring device according to feature 1. The aforementioned arithmetic unit's wake-up delay information derivation unit calculates the wake-up delay as the period from the timestamp of the wake-up start information to the timestamp of the wake-up completion information. The calculator wake-up delay measuring device according to feature 1. A method for measuring the wake-up delay of a computing unit, comprising a computing unit wake-up delay measuring device, The aforementioned calculator wake-up delay measuring device is A step of obtaining the time that will be the wake-up start point for starting to wake up the idle arithmetic unit as wake-up start information, The steps include obtaining the time at which the idle arithmetic unit completes its wake-up process as wake-up completion information, The process involves deriving the wake-up delay from the idle state in the arithmetic unit based on the acquired wake-up start information and wake-up completion information. A method for measuring the wake-up delay of a computing unit, characterized by the following features. A program for causing a computer to function as a calculator wake-up delay measuring device according to any one of claims 1 to 6.
