Computer system, task scheduling device, wakeup method for waiting process, and program

By introducing virtual idle tasks and adjusting recovery time in the computer system, the problem of increasing delay time when the process recovers from the stop state is solved, and faster wake-up and lower power consumption are achieved.

CN119604852APending Publication Date: 2025-03-11NIPPON TELEGRAPH & TELEPHONE CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202280098442.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2022-07-29
Publication Date
2025-03-11

AI Technical Summary

Technical Problem

In the prior art, there is a problem of increasing delay time when a process resumes from a stop state, which is mainly caused by context switching and sleep state recovery.

Method used

By introducing virtual idle tasks on the processor, the standby process continues to occupy the processor when it enters the standby state, avoiding context switching, and controlling the depth of the sleep state by adjusting the recovery time.

Benefits of technology

Reduces the time it takes to wake up the standby process after an event occurs, and reduces CPU power consumption and context switching delay.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119604852A_ABST
    Figure CN119604852A_ABST
Patent Text Reader

Abstract

A computer system (1000) having a processor comprising a plurality of cores and running a process that executes a predetermined command using the time on the processor, the process comprising: a standby process (101) that is in a wait state before notification, and that, if notification is present, wakes up and resumes running; and a notification process (90) sending a notification to wake up the standby process when the event occurs, the standby process (101) having a virtual idle task (103) that continues to occupy the processor when entering the standby state.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a computer system, a task scheduling device, a waiting process awakening method and a program. Background Art

[0002] In a computer system, sometimes a general-purpose processor (CPU) is installed on a computer (hereinafter referred to as a server). When there is no need to keep a process running on the CPU, the process is set to a stopped state, and a notification is sent from another process when necessary to return the process to an operating state.

[0003] Fig.19 This is a diagram showing inter-process communication within a server using a polling method.

[0004] like Fig.19 As shown, an application program (hereinafter referred to as "APL") [A: waiting party] 1 delegates the processing of a task to APL [B: notifying party] 1 (S1). Then, APL [A: waiting party] 1 requests the processing result by polling (S2). APL [B: notifying party] 1 executes the task processing delegated by APL [A: waiting party] 1 (S3).

[0005] When the APL [B: notifying party] 1 completes the entrusted task processing, it responds to the polling request and sends the processing result to the APL [A: waiting party] 1 (S4). The APL [A: waiting party] 1 executes the next processing (S5).

[0006] Fig. 20 FIG. 1 is a diagram showing inter-process communication within a server based on a notification method. Fig.19 The same processing is marked with the same step number.

[0007] like Fig. 20 As shown, APL [A: waiting party] 1 delegates the processing of a task to APL [B: notifying party] 1 (S1). APL [A: waiting party] 1 performs sleep control and enters a sleep state (S6).

[0008] APL [B: notifying party] 1 executes the task processing requested by APL [A: waiting party] 1 (S3).

[0009] When the APL [B: notifying party] 1 completes the entrusted task processing, it notifies the APL [A: waiting party] 1 of the completion of the processing (S7).

[0010] APL [A: waiting party] 1 receives the processing completion notification from APL [B: notifying party] 1 (S7), wakes up from the sleep state, and requests APL [B: notifying party] 1 for the processing result (S8).

[0011] APL [B: notifying party] 1 receives the result request from APL [A: waiting party] 1, and sends the processing result to APL [A: waiting party] 1 (S4). APL [A: waiting party] 1 executes the next processing (S5).

[0012] exist Fig.19 In the polling method, for example, a process A entrusts task processing to another process B, and polls whether the task processing of process B is completed during the period until the task processing of process B is completed. Process A is in operation and power consumption increases.

[0013] exist Fig. 20 In the notification method, after the task entrusted to process B is completed, sleep control is adopted in which process A enters a sleep state. Process A enters a sleep state, so power consumption can be reduced. When process A enters a sleep state, process B notifies process A that the processing is completed. Process A, which receives the notification, wakes up from sleep and requests process B to complete the task. However, since process A wakes up from sleep, a delay time for recovery is generated.

[0014] In order to quickly communicate between processes on the same server, notifications are usually made through resources such as shared file descriptors. However, since the resumption of a process from a stopped state is managed by the scheduler and governor of the OS, users may experience unexpected delays.

[0015] As a conventional technique, there is a notification mechanism using the function "eventfd+epoll_wait" in Linux OS (registered trademark).

[0016] Fig.21 This is a diagram showing a notification system using eventfd+epoll_wait.

[0017] like Fig.21 As shown, the server has hardware (HW) 10, OS 20, and a standby process [core #n] 30 and a notification process [core #m] 32 in the user space. Fig. 20 The process is “Process A” of APL[A: waiting side]1, and the notifying process [core #m]32 is “Process B” of APL[B: notifying side]1.

[0018] The hardware (HW) 10 includes a CPU 11 . The standby process [core #n] 30 includes a standby function 31 .

[0019] The OS 20 has an event monitoring instance 21 and a notification FD (File Descriptor) 22. The notification FD 22 is an integer value that specifies a file when access is delegated to the OS 20. When a program operates a file, the file to be operated is assigned for identification· (hereinafter, "·" means "and") authentication.

[0020] In the prior art, according to Fig.21 Notify and wake up according to the process 1. to 9.

[0021] 1. The standby process 30 ("process A") creates an event monitoring instance 21 (eventpoll).

[0022] 2. The standby process 30 creates a notification FD 22 (eventfd) which is an FD used for notification, and registers it in the event monitoring instance 21 in 1. above.

[0023] 3. The standby process 30 transfers the notification FD 22 to the notification process 32 ("process B"). Thus, the standby process 30 ("process A") and the notification process 32 ("process B") agree to use the notification FD 22.

[0024] 4. The standby process 30 specifies the event monitoring instance 21 of 1. above and publishes the standby function 31 (epoll_wait), and enters a blocked (sleeping) state. When the standby function 31 (epoll_wait) is published, the standby process 30 is in a sleeping state until the event is published. The standby process 30 itself is in a sleeping state, but there is no other process on the CPU core, which is equivalent to an idle state. When the standby process 30 enters sleep, an idle task is generated. The idle task is a state where the CPU core does nothing, but is automatically generated when there is no process.

[0025] 5.<Event>

[0026] 6. The notification process 32 detects the occurrence of an event and writes it to the notification FD 22.

[0027] 7. When writing notification FD22, the event monitoring callback is executed (occurred).

[0028] 8. When an event monitoring callback occurs, an instruction is issued to the standby function 31 that is waiting for the event monitoring instance 21. The standby function 31 that receives the instruction detects the event and wakes up.

[0029] 9. The standby process 30 that calls the standby function 31 starts processing again.

[0030] In addition, there is also a case where the creation of the notification FD mentioned in 2. above is executed by the notification process 32.

[0031] The prior art is further described.

[0032] Fig. 22 This is a diagram for explaining the standby process of the prior art described in Non-Patent Document 1.

[0033] like Fig. 22 As shown, the standby process 40 has a standby part 41 and a sleep part 42, and the idle process 50 (idle task) has an idle part 51. In addition, the OS kernel 60 has a scheduler 61 and a C-state control part 62 (C-state will be described later).

[0034] The idle process 50 has no other processes (threads) on this CPU core.

[0035] In the conventional power saving method, the standby unit 41 calls the sleep unit 42, and the process (standby process 40) enters the waiting state. When there is no other process in the executable state, the scheduler 61 calls the process with the idle unit 51. The idle unit 51 uses the C-state control unit 62 to switch the CPU to the sleep state or turn off the power.

[0036] In the prior art, context switching inevitably occurs. Context switching is a process of saving / restoring (hereinafter, " / " means "or") the state (context) of the CPU so that multiple processes can share one CPU.

[0037] In the prior art, the C-state recovery time is determined by the kernel. The kernel determines the depth of the C-state based on the idle time estimated by the C-state control unit 62. The time to recover from the C-state is generated (Non-Patent Document 2).

[0038] Fig.23 This is a diagram showing an example of the C-state state in a table. In addition, the state definition varies depending on the CPU hardware, so Fig.23 It's just a reference example.

[0039] like Fig.23 As shown, in the CPU idle state, there are levels C0 to C6, and as the CPU has no workload for a longer time, it switches to a deeper sleep state. The CPU power consumption in a deeper sleep state decreases, but on the other hand, the time required for recovery is also increased accordingly, which sometimes becomes a problem from the perspective of low latency.

[0040] The definition of C-state varies depending on the CPU hardware. For example, there are models without C4 and C5, and models with C1 followed by C1E.

[0041] As the state becomes deeper, the power saving effect becomes better, but correspondingly, the time required to recover from the idle state also becomes longer.

[0042] In addition, the depth to which the CPU idle state transitions is controlled by the CPU hardware and depends on the CPU product (in most cases it cannot be controlled by software such as the kernel).

[0043] Prior art literature

[0044] Patent Literature

[0045] Non-patent document 1: cpuidle-Do nothing, efficiently, [online], [retrieved on July 6, 2007], Internet 〈URL: http: / / landley.net / kdocs / ols / 2007 / ols2007v2-pages-119-126.pdf〉;

[0046] Non-patent document 2: CPU analysis, [online], [retrieved on July 6, 2019], Internet 〈URL: https: / / docs.microsoft.com / ja-jp / windows-hardware / test / wpt / cpu-analysis〉. Summary of the invention

[0047] Problem that the invention aims to solve

[0048] In the conventional technology, there is a problem of increased delay time.

[0049] (1) Increased latency due to context switching time

[0050] Fig.24 It is a diagram explaining the problems of the prior art.

[0051] Fig.24 The next section is the scheduling of the standby process (core #n). Fig.24 The upper part is the scheduling of the notification process (core #m).

[0052] The following 1. to 3. are already executed during initialization.

[0053] 1. Create an event monitoring instance

[0054] 2. Create a notification FD and register an event monitoring instance

[0055] 3. FD for transmission notification

[0056] When the standby process 71 is in sleep mode in 4., it is possible to schedule an idle task to the CPU core. Fig.24In the process, the event receiver (core #n) executes the standby process processing 71 and the standby function 72, and then switches to the standby process processing 71 and the standby function 72. Fig.24 The reference numeral a) is transferred to the idle task 76. As described above, when the standby process is in the sleep state, when there is no idle state of any other process on the CPU core, the idle task 76 is generated. By operating the idle task 76, the CPU core (event receiver (core #n)) is gradually lowered to a deeper sleep state (CPU idle), which can reduce power consumption.

[0057] On the other hand, in the event sender (core #m), when 5. an event occurs, 6. notification FD is written 74, 7. event monitoring callback 75 is executed, and the event sender (core #m) performs an inter-processor interrupt ( Fig.24 Reference numeral b).

[0058] When the standby function is awakened in 8., the idle task 76 is scheduled again, and then, via context switching ( Fig.24 The reference numeral c) schedules the standby function, and becomes 9. Resume the standby process processing ( Fig.24 No. 78).

[0059] A context switch usually switches between a state in which the kernel is working and a state in which the user is working.

[0060] The context switch from the idle task 76 to the standby function wakeup 77 ( Fig.24 c), resulting in a large delay ( Fig.24 ☆ mark d). That is, context switching time is generated when switching to the standby function, resulting in a large delay.

[0061] (2) Increased latency caused by sleep state (C-state) recovery

[0062] When the CPU enters the idle state, the CPU transitions to the sleep state step by step or directly until the sleep state (C-state) is reached which is permitted by the governor of the OS.

[0063] When the governor of the OS allows a deeper sleep state as a policy for the entire server (for example, C6), a long recovery time of more than 100 us is generated until the CPU returns to the operating state (C0).

[0064] Fig.25 is Fig.24 FIG. 1 is a diagram showing the C-state transitions of the CPU cores used for computing superimposed on the scheduling.

[0065] like Fig.25As shown, when there is no task for a long time, the CPU core is in a deeper sleep state (CPU idle state: level C6), and the task occurs ( Fig.25 After the reference numeral e), the delay time until recovery is extended. When the CPU is downgraded to a deeper CPU idle state, a lot of time is required until recovery, and there is a problem of loss of real-time performance.

[0066] In a system such as a base station (BBU) where real-time performance is the top priority, the above-mentioned problem cannot be ignored.

[0067] Therefore, in the base station (BBU), countermeasures are taken, such as disabling the C-state or limiting the idle state transition to a limited depth such as C1. In other words, sometimes it is necessary to sacrifice power saving and make adjustments toward real-time performance.

[0068] The present invention has been made in view of such a background, and an object of the present invention is to reduce the time taken to wake up the standby process after an event occurs.

[0069] Solutions for solving problems

[0070] In order to solve the above-mentioned problem, the present invention is a computer system having a processor composed of multiple cores and running a process that uses the time on the processor to execute specified commands, characterized in that the process has: a standby process, which is in a waiting state before receiving a notification, and wakes up and starts running again when receiving a notification; and a notification process, which sends a notification when an event occurs to wake up the standby process, and the standby process has a virtual idle task that continues to occupy the processor when entering the standby state.

[0071] Effects of the Invention

[0072] According to the present invention, the time taken to wake up the standby process after an event occurs can be reduced. BRIEF DESCRIPTION OF THE DRAWINGS

[0073] Figure 1 This is a schematic diagram of the structure of a computer system according to an embodiment of the present invention.

[0074] Figure 2 This is a computer system context switch exclusion (feature) for explaining an embodiment of the present invention. <1> )’s picture.

[0075] Figure 3 This diagram shows a C-state transition state of a CPU core superimposed on the scheduling of the CPU core used for calculation in the computer system according to the embodiment of the present invention.

[0076] Figure 4It is a diagram showing the behavior of the standby process at <when ​​the standby starts>, <while the standby is in progress>, and <when ​​an event occurs> in a comparative example of the computer system according to the embodiment of the present invention.

[0077] Figure 5 This is a diagram showing the behavior of the standby process at <start of standby>, <during standby>, and <when ​​an event occurs> of the computer system according to the embodiment of the present invention.

[0078] Figure 6 It is a diagram showing the behavior of the standby process at <when ​​the standby starts>, <while the standby is in progress>, and <when ​​an event occurs> in a comparative example of the computer system according to the embodiment of the present invention.

[0079] Figure 7 This is a diagram showing the behavior of the standby process at <start of standby>, <during standby>, and <when ​​an event occurs> of the computer system according to the embodiment of the present invention.

[0080] Figure 8 This is a diagram showing an actual operation state of a comparative example of a computer system according to an embodiment of the present invention.

[0081] Fig. 9 This is a diagram showing an actual operation of the computer system according to the embodiment of the present invention.

[0082] Fig.10 This is a diagram for explaining an application scope 1 of a computer system according to an embodiment of the present invention.

[0083] Fig.11 This is a diagram for explaining an application scope 2 of the computer system according to the embodiment of the present invention.

[0084] Fig.12 This is a sequence when the computer system according to the embodiment of the present invention requires a virtual idle function before an event occurs.

[0085] Fig.13 This is a sequence in the case where the virtual idle function is not required before an event occurs in the computer system according to the embodiment of the present invention.

[0086] Fig.14 This is a sequence when the virtual idle function is required after an event occurs in the computer system according to the embodiment of the present invention.

[0087] Fig.15 This is a flowchart of a virtual idle function executed by a virtual idle determination unit of a computer system according to an embodiment of the present invention.

[0088] Fig.16 This is a flowchart of determining a maximum restoration time by a restoration time determination unit of a computer system according to an embodiment of the present invention.

[0089] Fig.17 This is a diagram showing an operation example when the computer system according to the embodiment of the present invention executes the maximum restoration time determination process.

[0090] Fig.18 This is a hardware configuration diagram showing an example of a computer realizing the function of a task scheduling device in a computer system according to an embodiment of the present invention.

[0091] Fig.19 This is a diagram showing inter-process communication within a server using a polling method.

[0092] Fig. 20 It is a diagram showing the inter-process communication within the server of the notification method.

[0093] Fig.21 This is a diagram showing a notification system using eventfd+epoll_wait.

[0094] Fig. 22 This is a diagram for explaining the standby process of the prior art.

[0095] Fig.23 The following is a diagram showing an example of the C-state state in a table.

[0096] Fig.24 It is a diagram explaining the problems of the prior art.

[0097] Fig.25 is Fig.24 A diagram showing the scheduling overlay with the C-state transitions of the CPU cores used for operations. DETAILED DESCRIPTION

[0098] Hereinafter, a computer system and the like for implementing a mode for implementing the present invention (hereinafter referred to as “the present embodiment”) will be described with reference to the drawings.

[0099] [summary]

[0100] Figure 1 FIG. 1 is a schematic diagram of a computer system according to an embodiment of the present invention. Fig. 22 The same structural parts are marked with the same reference numerals.

[0101] This embodiment is an example of a computer system applied to a CPU. In addition to the CPU, the same can be applied to processors such as GPU (Graphic Processing Unit), FPGA (Field Programmable Gate Array), and ASIC (Application Specific Integrated Circuit) when there is an idle state function.

[0102] like Figure 1 As shown, the computer system 1000 has a kernel 60 , a CPU core (core #m, core #n, core #x) 80 , a notification process 90 , an idle process 50 , and a task scheduling device 100 .

[0103] The kernel 60 includes a scheduler 61 , a C-state control unit 62 , fd (file descriptor) 63 such as eventfd, and a socket (communication socket) 64 such as a Unix domain socket.

[0104] The idle process 50 has an idle part 51. The idle process 50 is in standby mode so that other processes (threads) can use the CPU core.

[0105] A computer system 1000 has a processor composed of multiple cores and runs a process that uses the time on the processor to execute specified commands. The process includes: a standby process 101, which is in a waiting state before receiving a notification and wakes up and starts running again when receiving a notification; a notification process 90, which sends a notification when an event occurs to wake up the standby process; and an idle process 50, which is generated when there is no process on the processor and does not execute any command.

[0106] [Task Scheduling Device 100]

[0107] The task scheduling device 100 includes a standby unit 110 , a virtual idle unit 120 , a virtual idle determination unit 130 , a recovery time determination unit 140 (recovery time control unit), and a recovery time setting unit 150 (recovery time control unit).

[0108] The standby part 110 and the virtual idle part 120 constitute the standby process 101 and cooperate with the idle part 51 of the idle process 50 (idle task).

[0109] The virtual idleness determination unit 130 , the restoration time determination unit 140 , and the restoration time setting unit 150 constitute the management unit 102 .

[0110] The standby process 101 is in a waiting state before receiving a notification, and wakes up and starts running again when receiving a notification.

[0111] The standby unit 110 maintains an executable state. The standby unit 110 receives a virtual idle function request from the virtual idle judgment unit 130 and performs standby setting and executable state setting. Specifically, according to the instruction of the virtual idle judgment unit 130, the virtual idle unit 120 is executed or context switching is performed in an idle process having an idle function.

[0112] The virtual idle part 120 maintains a sleep (NOP) state in which no instruction is executed. The virtual idle part 120 executes and calls the C-state control part 62 that controls the operation state of the CPU instead of the idle part 51.

[0113] When the virtual idle part 120 enters the standby state, the standby process 101 has a virtual idle task 103 ( Figure 5 , Figure 7 ).

[0114] Here, when an event occurs, the kernel scheduler gives execution time to the standby process 101. Since the virtual idle task 103 to be executed soon is executed during the extension of the standby process, context switching accompanying process switching can be eliminated.

[0115] The virtual idle judgment unit 130 determines whether to execute the virtual idle unit 120 (virtual idle task) based on the process occurrence status and / or delay time conditions on the same processor, and instructs the standby unit 110. Here, the reason for determining whether to execute the virtual idle unit 120 is that, as will be described later, Fig.10 As described above, when the notification process and the standby process are running on the same CPU core, not only is the effect of running the virtual idle part to eliminate context switching not achieved, but it may also cause an increase in processing delay in other processes.

[0116] The restoration time determination unit 140 determines the restoration time corresponding to the maximum C-state that the virtual idle unit 120 can lower based on the delay time condition and the current C-state. The restoration time determination unit 140 notifies the restoration time setting unit 150 of the maximum restoration time.

[0117] The restoration time setting unit 150 sets the maximum restoration time for the C-state control unit 62 using the maximum restoration time from the restoration time determination unit 140. After the virtual idle portion 120 ends, the restoration time setting unit 150 returns to the original maximum restoration time.

[0118] The above-mentioned recovery time determination unit 140 and recovery time setting unit 150 constitute a recovery time setting unit for setting the recovery time from the occurrence of the task to the recovery of the virtual idle task 103. The recovery time control unit is a functional unit that does not transition to a deeper sleep state by overwriting the determined recovery time with the maximum recovery time and shortening the maximum recovery time.

[0119] Next, the operation of the computer system 1000 configured as described above will be described.

[0120] [Basic Concept of the Task Scheduling Device 100]

[0121] feature <1> : Context switch exclusion

[0122] Makes the standby process behave the same as the idle task, eliminating context switches from the idle task.

[0123] The standby function performs the same work as the idle task in its context, so no context switch to the existing idle task occurs. Thus, <Condition 1: Notification time is reduced> is satisfied.

[0124] During the operation of the standby function, the CPU core can be lowered to a deeper sleep state, similar to the idle task, thereby satisfying <Condition 2: Power saving>.

[0125] Figure 2 Is to explain the context switch exclusion (feature <1> ). Fig.24 The same processes are marked with the same reference numerals.

[0126] Figure 2 The next section is the scheduling of the event receiver (core #n), Figure 2 The upper part is the scheduling of the event dispatcher (core #m).

[0127] The following 1. to 3. are already executed during initialization.

[0128] 1. Create an event monitoring instance

[0129] 2. Create a notification FD and register an event monitoring instance

[0130] 3. FD for transmission notification

[0131] The event receiver (core #n) does not transfer to the idle task (no context switch occurs) after the standby process 71 ( Figure 2 , becomes 4. standby function·8. standby function wakeup 201. That is, in the standby function·standby function wakeup 201, the 4. standby function performs the same behavior as the idle task ( Figure 2 bb).

[0132] On the other hand, in the event sender (core #m), when 5. an event occurs, 6. notification FD is written 74, 7. event monitoring callback 75 is executed, and the event sender (core #m) performs an inter-processor interrupt ( Figure 2 Reference numeral b).

[0133] 4. The standby function performs the same behavior as the idle task, so when 8. The standby function wakes up, the idle task is not scheduled, so no context switch occurs ( Figure 2 , becomes 9. recovery standby process processing 78.

[0134] The standby function performs the same work as the idle task in its context, so there is no context switch to the existing idle task. Fig.24 ) Thus, <Condition 1: Reduction of notification time> can be satisfied.

[0135] Here, although Figure 2 Not shown in the figure, during the standby function, the idle task ( Fig.24 76) Similarly, the CPU core can be downgraded to a deeper sleep state. Thus, <Condition 2: Power saving> can be satisfied.

[0136] feature <2> : Specify the recovery time of the virtual idle task

[0137] This is controlled by specifying the maximum resume time of the virtual idle task without dropping to a deeper sleep state.

[0138] The maximum resume time is overwritten with the resume time determined by the governor of the OS to shorten the maximum resume time. As a result, the computer system does not transition to a deeper sleep state, and thus the delay time until the standby function wakes up can be shortened. Thus, <Condition 1: Notification time reduction> is satisfied.

[0139] On the other hand, by extending the maximum resume time, it is possible to transition to a deeper sleep state, further reducing the power consumption of the HW. Thus, <Condition 2: Power saving> is satisfied.

[0140] Figure 3 is Figure 2 The diagram shows the scheduling of the CPU cores superimposed with the C-state transitions for the operations. Fig.25 The same processes are marked with the same reference numerals.

[0141] like Figure 3 As shown, specify that the task occurs ( Figure 3 The maximum value of the recovery time from the reference symbol dd) to the recovery ( Figure 3 The reason why such a maximum value of the recovery time can be specified is that a standby function·standby function wakeup 201 can be set in which the standby function performs the same behavior as the idle task, and there is a degree of freedom in the scheduling of the standby function·standby function wakeup 201.

[0142] Regarding the above-specified maximum value of the resume time, when the maximum resume time is set to a shorter value, the CPU core is downgraded to a shallower sleep state, so the power saving effect is small. In addition, when the maximum resume time is set to a longer value, it is downgraded to a deeper sleep state, so the power saving effect is large. However, when the CPU core is downgraded to a deeper sleep state, it takes time to resume.

[0143] [Operation of the Task Scheduling Device 100]

[0144] [Work 1]

[0145] Operation 1 of the task scheduling device 100 will be described in comparison with a comparative example (conventional technology).

[0146] First, the operation of the comparative example (conventional technology) will be described.

[0147] Figure 4 1 is a diagram showing the behavior of the standby process at <standby start>, <standby>, and <event occurrence> of the comparative example. Figure 1 The same structures and processes are denoted by the same reference numerals.

[0148] <When standby starts>

[0149] The server has a CPU core 80 (event receiver (core #n)) and a CPU core 80 (event sender (core #m)). When standby starts, a standby process 91 enters a task queue 85 on the CPU core 80 (core #n).

[0150] <On standby>

[0151] The so-called waiting state means that the standby process 91 enters the waiting queue 86 on the CPU core 80 (core #n).

[0152] During standby, the standby process 91 is separated from the task queue 85 ( Figure 4 Arrow f), enter Figure 4 The waiting queue 86 on the right side becomes a waiting state.

[0153] Here, in the case of no other process state on the CPU core 80 (core #n), that is, in the idle state, an idle task 92 is generated on the CPU core 80 (core #n). The idle task 92 is an automatically generated process (task) that makes the task queue 85 not empty.

[0154] <When the incident occurs>

[0155] When event publishing detection is performed in kernel mode, the notification process 90 is transmitted via the kernel 60 ( Figure 1 )'s fd63 and socket 64 receive the notification, and the standby process 91 returns again Figure 4 The central task queue 85 ( Figure 4 When the standby process 91 returns to the task queue 85, a context switch occurs between the standby process 91 and the idle task 92 ( Fig.24 denoted by reference numeral c).

[0156] Next, the operation of this embodiment will be described.

[0157] Figure 5 1 is a diagram showing the behavior of the standby process at <standby start>, <standby>, and <event occurrence> of the present embodiment. Figure 1 and Figure 4 The same structures and processes are denoted by the same reference numerals.

[0158] <When standby starts>

[0159] The server has a CPU core 80 (event receiver (core #n)) and a CPU core 80 (event sender (core #m)). The standby process 101 enters the task queue 85 on the CPU core 80 (core #n). In <When the standby starts>, the behavior of the standby process is the same in this embodiment and the comparative example.

[0160] <On standby>

[0161] picture Figure 4 As described in the comparative example of FIG. 8 , when the standby process 91 returns to the task queue 85, a context switch of the standby process 91 occurs with the idle task 92 ( Fig.24 In order to solve this problem, it is sufficient to not generate the idle task 92.

[0162] Therefore, in this embodiment, the standby process 101 includes a standby unit 110 and a virtual idle unit 120 ( Figure 1 ). That is, the standby process 101 Figure 4The standby process 91 further imports the virtual idle part 120 (virtual idle task 103). The virtual idle task 103 does not generate the idle task 92, and therefore continues to occupy the CPU core 80 (core #n) in a manner that does not allow the standby process 101 to enter the task queue 85. That is, by importing the virtual idle task 103, the CPU core is not given up to other processes, and the CPU core continues to be occupied. In more detail, the occupation of the CPU core refers to continuing to occupy the CPU without giving up the CPU time. Specifically, the virtual idle task 103 publishes epoll, but does not give up the CPU time to other processes (threads), and continues to occupy it.

[0163] like Figure 5 As shown in the reference numeral ff, the standby process 101 continues to remain in the task queue 85. Figure 4 In the comparative example, in standby, the standby process 91 is separated from the task queue 85 and enters the waiting queue 86 to become a waiting state. In contrast, in the present embodiment, although the virtual idle task 103 issues epoll, it does not give up CPU time to other processes (threads) and continues to occupy it, so that the standby process 101 continues to stay in the task queue.

[0164] As a result, the virtual idle task 103 continues to occupy the CPU core 80 (core #n), so the standby process 101 can continue to stay in the task queue 85 without causing context switching.

[0165] In addition, if Figure 4 As described in the comparative example, the idle task 92 is in the task queue 85, so that the CPU core 80 (core #n) can be transferred to the idle state.

[0166] The virtual idle task 103 of this embodiment performs the same actions as the idle task 92. The virtual idle task 103 is a task that basically does nothing like the idle task 92, but by having the virtual idle task 103 that performs the same work as the idle task 92, the virtual idle task 103 can cause the CPU to execute a sleep (NOP) command. This can reduce the CPU cycle and suppress the power consumption of the CPU core.

[0167] <When the incident occurs>

[0168] When using kernel mode event distribution detection, the standby process 101 is started from the notification process 90 via the kernel 60 ( Figure 1 )'s fd63 and socket 64 receive the notification. The standby process 101 continues to stay in the task queue 85 ( Figure 5 gg), so when the kernel mode event is used for detection, when the notification is received, it is already in the task queue 85. Therefore, no context switching occurs ( Figure 2 Figure numeral cc).

[0169] [Work 2]

[0170] Operation 2 of the task scheduling device 100 will be described in comparison with a comparative example (conventional technology).

[0171] First, the operation of the comparative example (conventional technology) will be described.

[0172] Figure 6 1 is a diagram showing the behavior of the standby process at <standby start>, <standby>, and <event occurrence> of the comparative example. Figure 4 The same structures and processes are denoted by the same reference numerals.

[0173] The task scheduling device 100 allocates CPU execution time to processes in the executable state (task running) of the task queue 85 .

[0174] <When standby starts>

[0175] Since only the standby process exists in the task queue 85, the task scheduling device 100 gives the standby process an execution time ( Figure 6 Reference numeral h).

[0176] <On standby>

[0177] When the task queue 85 is empty, the task scheduling device 100 generates an idle task 92 and allocates execution time to the idle task 92. At this time, a context switch occurs ( Figure 6 In addition, during standby, the standby process 91 is separated from the task queue 85 ( Figure 6 Arrow j), enters the waiting queue 86 and becomes a waiting state.

[0178] <When the incident occurs>

[0179] When the task scheduling device 100 calls the standby process 91 when an event occurs, it gives execution time to the standby process 91. At this time, a context switch occurs ( Figure 6 In addition, the standby process 91 returns to Figure 6 The central task queue 85 ( Figure 4 1).

[0180] Next, the operation of this embodiment will be described.

[0181] Figure 7 1 is a diagram showing the behavior of the standby process at <standby start>, <standby>, and <event occurrence> of the present embodiment. Figure 5 The same structures and processes are denoted by the same reference numerals.

[0182] The task scheduling device 100 allocates CPU execution time to processes in the executable state (task running) of the task queue 85 .

[0183] <When standby starts>

[0184] The task scheduling device 100 has only the standby process 101 in the task queue 85, so the standby process 101 is given an execution time ( Figure 7 Figure 1 shows the reference numeral hh).

[0185] <On standby>

[0186] In the task scheduling device 100, the standby process 101 remains in the executable state, so the execution time ( Figure 7 That is, the virtual idle task 103 continues to occupy the CPU core 80 (core #n) (refer to Figure 5 <Standby>), so the standby process 101 can continue to stay in the task queue 85 without context switching.

[0187] <When the incident occurs>

[0188] When the task scheduling device 100 calls the standby process 101 when an event occurs, it gives the standby process 101 an execution time ( Figure 7 Figure 1 shows the reference numeral jj).

[0189] [Actual working situation]

[0190] The actual operation of the task scheduling device 100 will be described while being compared with a comparative example (conventional technology).

[0191] First, actual operation of a comparative example (conventional technology) will be described.

[0192] Figure 8 It is a diagram showing an actual operation state of a comparative example.

[0193] like Figure 8 As shown, the driver / hardware has a cpu idle driver (ACPI / intel_idle) 306. The kernel has a task scheduler 100, sysfs 303, a cpu idle governor 304, and a cpu idle framework 305. The user space has epoll_wait 301 and an idle task 302.

[0194] In the task scheduling device 100, when the standby function (epoll_wait301) enters the waiting state (idle task 302), the kernel function switch_to is used to switch the process. Execute the context switch from epoll_wait301 to the idle task 302 ( Figure 8 denoted by reference numeral c).

[0195] Fig. 9 It is a diagram showing the actual operation of this embodiment.

[0196] like Fig. 9 As shown, the driver / hardware has a cpu idle driver (ACPI / intel_idle) 306. The kernel has a task scheduler 100, sysfs 303, a cpu idle governor 304, and a cpu idle framework 305. The user space has epoll_wait 301 and an idle task 302.

[0197] In the task scheduling device 100, the standby function (epoll_wait301) is directly issued to the cpu idle frame 305 using cpuidle_idle_call. At this time, the standby function (epoll_wait301) itself remains in an executable state, that is, it does not become a waiting state. In addition, there is no other process, so the task scheduling device 100 does not switch to the switching object of other processes. Therefore, in the task scheduling device 100, the standby function (epoll_wait301) is always in use time.

[0198] In addition, in the direct issuance of the wait function (epoll_wait301) through cpuidle_idle_call, the maximum recovery time can also be specified.

[0199] In addition, you can also specify the maximum recovery time ( Fig. 9 11).

[0200] The task scheduling device 100 keeps the wait function (epoll_wait301) in an executable state and uses the time. Figure 5 The "virtual idle task 103 issues epoll, but does not give up CPU time to other processes (threads) and continues to occupy it." corresponds to the description in <Standby>.

[0201] [Scope of application]

[0202] [Application 1]

[0203] The application scope of the task scheduling device 100 is described.

[0204] The standby process 101 can be executed on the same CPU core as the notification process 90 and other processes. On the other hand, in order to maximize the effect, the standby process 101 is preferably executed on a different CPU core from the notification process 90 and other processes.

[0205] Fig.10 FIG. 1 is a diagram for explaining an application scope 1 of the task scheduling device 100. Figure 1 The same processes are marked with the same reference numerals.

[0206] <Notification process and standby process run on different CPU cores>( Fig.10 Left image)

[0207] The present invention is applicable to a case where the notification process 90 and the standby process 101 are executed on different CPU cores (core #m and core #n).

[0208] Sleep state: core #n sleeping.

[0209] Delay effect: High-speed wake-up of standby processes.

[0210] Risk: None.

[0211] <The notification process and the standby process are on the same CPU core>( Fig.10 (middle picture)

[0212] This can be applied to the case where the notification process 90 and the standby process 101 are in the same CPU core (core #n). The notification process 90 and the standby process 101 compete for CPU time ( Fig.10 The reference numerals in the middle figure are mm).

[0213] Sleep state: core #n is not fully asleep due to notification process 90.

[0214] ·Delay effect: Since there is a notification process 90, the delay improvement effect is small (there is a context switch with the notification process 90, and the C-state is not deep to begin with).

[0215] Risk: Since the standby process 101 becomes executable, the notification process 90 sends event detection and notification more slowly.

[0216] <The standby process and other processes are on the same CPU core>( Fig.10 (right picture)

[0217] This can be applied to the case where the standby process 101 and other processes 104 are in the same CPU core (core #n). The notification process 90 and the standby process 101 compete for CPU time ( Fig.10 Reference numeral nn in the right figure).

[0218] Sleep state: core #n is not completely asleep due to other processes 104.

[0219] Latency effect: Since there are other processes 104, the latency improvement effect is small (there is context switching with other processes 104, and the C-state is not deep to begin with).

[0220] Risk: The standby process 101 becomes executable, thereby taking away the time that other processes 104 could have run.

[0221] [Application 2]

[0222] The notification process 90 and the standby process 101 are respectively applied to either the user space or the kernel space.

[0223] Fig.11 FIG. 2 is a diagram for explaining the application scope 2 of the task scheduling device 100. Figure 1 and Fig.10 The same processes are marked with the same reference numerals.

[0224] Fig.11 The upper left figure is an example of a case where the notifying process is in user space and the standby process is in user space.

[0225] Fig.11 The upper right figure is an example of a case where the notification process is in user space and the standby process is in kernel space.

[0226] Fig.11 The lower left figure is an example of a case where the notifying process is in kernel space and the standby process is in user space.

[0227] Fig.11 The lower right figure is an example of a case where the notification process is in kernel space and the standby process is in kernel space.

[0228] As described above, the notification process 90 and the standby process 101 can be arranged in either the user space or the kernel space.

[0229] [Application 3]

[0230] As the file descriptor used for notification, eventfd, singalfd, timerfd, etc. can be given as examples.

[0231] Examples of standby functions for monitoring resources include read(), select(), poll(), and epoll(). Any function performs blocking or non-blocking operations, and when blocked, it is downgraded to TASK_INTERRUPTIBLE / TASK_UNINTERRUPTIBLE event waiting, so the present invention can be applied.

[0232] [Control Timing]

[0233] The control sequence of the task scheduling device 100 will be described.

[0234] [Control sequence 1]

[0235] Fig.12 It is the timing of the situation where a virtual idle function is required before the event occurs.

[0236] The standby process 101 requests the virtual idle determination unit 130 to start the standby process ( S101 ).

[0237] The virtual idleness determination unit 130 requests the restoration time determination unit 140 to determine the restoration time ( S102 ).

[0238] The recovery time determination unit 140 determines the recovery time (S103). The detailed process of recovery time determination in step S103 will be described later. Fig.16 Give a narrative.

[0239] The restoration time determination unit 140 notifies the restoration time setting unit 150 of the restoration time ( S104 ).

[0240] The restoration time setting unit 150 performs restoration time setting to the C-state control unit 62 ( S1051 ).

[0241] C-state control unit 62 responds to restoration time setting unit 150 regarding restoration time setting ( S106 ).

[0242] Upon receiving the restoration time setting response from C-state control unit 62 , restoration time setting unit 150 responds with the restoration time to restoration time determination unit 140 ( S107 ).

[0243] The restoration time determination unit 140 notifies the virtual idle time determination unit 130 of the restoration time determination response from the restoration time setting unit 150 ( S108 ).

[0244] The virtual idle judgment unit 130 judges whether the virtual idle function is needed (S109). The detailed process of judging whether the virtual idle function is needed in step S109 will be described later. Fig.15 Give a narrative.

[0245] The virtual idle determination unit 130 makes a virtual idle function request to the standby unit 110 of the standby process 101 ( S110 ).

[0246] The standby unit 110 receives the virtual idle function request from the virtual idle determination unit 130 and performs standby setting and executable state setting ( S111 ).

[0247] The standby unit 110 notifies the virtual idle function determination unit 130 of the virtual idle function response to the virtual idle function request ( S112 ).

[0248] The standby unit 110 requests the virtual idle unit 120 to start the virtual idle ( S113 ).

[0249] The virtual idle part 120 requests the C-state control part 62 to perform C-state control ( S114 ).

[0250] [Control sequence 2]

[0251] Fig.13 This is the timing for situations where virtual idle functionality is not required before an event occurs. Fig.12 The same number is used for the same control sequence.

[0252] The standby process 101 requests the virtual idle determination unit 130 to start the standby process ( S101 ).

[0253] The virtual idleness determination unit 130 requests the restoration time determination unit 140 to determine the restoration time ( S102 ).

[0254] The recovery time determination unit 140 determines the recovery time (S103). The detailed process of recovery time determination in step S103 will be described later. Fig.15 Give a narrative.

[0255] The restoration time determination unit 140 notifies the restoration time setting unit 150 of the restoration time ( S104 ).

[0256] The restoration time setting unit 150 performs restoration time setting to the C-state control unit 62 ( S1051 ).

[0257] C-state control unit 62 responds to restoration time setting unit 150 regarding restoration time setting ( S106 ).

[0258] Upon receiving the restoration time setting response from C-state control unit 62 , restoration time setting unit 150 responds with the restoration time to restoration time determination unit 140 ( S107 ).

[0259] The restoration time determination unit 140 notifies the virtual idle time determination unit 130 of the restoration time determination response from the restoration time setting unit 150 ( S108 ).

[0260] The virtual idle judgment unit 130 judges whether the virtual idle function is needed (S109). The detailed process of judging whether the virtual idle function is needed in step S109 will be described later. Fig.16 Give a narrative.

[0261] The virtual idle determination unit 130 makes an idle function request to the standby unit 110 of the standby process 101 ( S201 ).

[0262] The standby unit 110 receives the idle function request from the virtual idle determination unit 130 and performs standby setting and waiting state setting ( S202 ).

[0263] The standby unit 110 notifies the virtual idle determination unit 130 of an idle function response to the idle function request ( S203 ).

[0264] The standby unit 110 requests the scheduler 61 to start idle time ( S204 ).

[0265] The scheduler 61 issues an idle start request to the idle unit 51 ( S205 ).

[0266] Idle section 51 requests C-state control to C-state control section 62 ( S114 ).

[0267] [Control Timing 3]

[0268] Fig.14 It is the timing of the situation where a virtual idle function is required after an event occurs.

[0269] The notification process 90 makes a notification to the standby unit 110 using a file descriptor or the like ( S301 ).

[0270] The standby unit 110 requests the virtual idle unit 120 to end the virtual idle ( S302 ).

[0271] The virtual idle unit 120 requests the C-state control unit 62 to perform C-state control ( S303 ).

[0272] The standby unit 110 requests the virtual idleness determination unit 130 to end the virtual idleness ( S304 ).

[0273] The virtual idle determination unit 130 notifies the standby process 101 of the end of the standby process ( S305 ).

[0274] The standby process 101 restarts the processing (S306).

[0275] The virtual idle determination unit 130 sets the restoration time to the C-state control unit 62 ( S307 ).

[0276] The C-state control unit 62 sends a restoration time setting response to the virtual idle determination unit 130 ( S308 ).

[0277] [flow chart]

[0278] The flowchart of the task scheduling device 100 is described.

[0279] [process Figure 1 ]

[0280] Fig.15 1 is a flowchart of executing the virtual idle function of the virtual idle determination unit 130. Fig.12 and Fig.13 The detailed process of step S109 of "determining whether virtual idleness is required" is shown in FIG.

[0281] In step S11, the virtual idle determination unit 130 determines whether the number of other processes 104 running in the same core as the standby process 101 while the standby process 101 is sleeping is 0 (see Fig.10 (right image).

[0282] When the number of other processes 104 operating in sleep mode is zero ( S11 : Yes), it is determined that an idle task has occurred, and in step S12 , the virtual idle determination unit 130 executes a virtual idle function.

[0283] In step S13 , the virtual idle determination unit 130 determines whether the sleep state control of the CPU by hardware setting (BIOS) is valid.

[0284] When the CPU sleep state control is valid (S13: Yes), it is judged as C-state. In step S14, the virtual idle determination unit 130 determines whether the OS governor recovery time is greater than the allowed recovery time (OS governor recovery time>allowed recovery time).

[0285] When the recovery time of the OS speed regulator is greater than the allowed recovery time (S14: Yes), it is determined that maximum recovery time control is required. In step S15, the virtual idle judgment unit 130 sets the recovery time allowed by the maximum recovery time (sets the maximum recovery time = the allowed recovery time), and ends the processing of this flow.

[0286] In the above step S11, when the number of other processes 104 running in sleep mode is not 0 (S11: No), it is determined that there is no idle task. In step S16, the virtual idle determination unit 130 does not execute the virtual idle function and the process proceeds to step S17.

[0287] In the above step S13, when the sleep state control of the CPU is not valid, or in the above step S14, when the recovery time of the OS speed regulator is less than the allowed recovery time (when the recovery time of the OS speed regulator ≤ the allowed recovery time), in step S17, the virtual idle judgment unit 130 does not specify the maximum recovery time and ends the processing of this flow.

[0288] [process Figure 2 ]

[0289] Fig.16 1 is a flowchart of the recovery time determination by the recovery time determination unit 140. Fig.12 and Fig.13 The detailed process of "restoration time determination" in step S103.

[0290] This process is a method of using actual measured C-state recovery times to determine the maximum recovery time.

[0291] In step S21, when the C-state actually measured in time slot #n = maximum recovery time, the recovery time determination unit 140 determines whether the actually measured C-state is equal to the C-state allowed by the maximum recovery time (C-state = C-state allowed by the maximum recovery time).

[0292] When C-state = C-state allowed by maximum recovery time (S21: Yes), in step S22, the recovery time determination unit 140 determines whether (C-state recovery time allowed by maximum recovery time + increment of recovery time of C-state one layer deeper) is less than the allowed delay time.

[0293] When (the C-state recovery time allowed by the maximum recovery time + the incremental recovery time of the C-state one layer deeper) is less than the allowed delay time (S22: Yes), in step S23, the recovery time determination unit 140 sets the maximum recovery time of time slot #n+1 + the incremental recovery time of the C-state one layer deeper (allowed C-state + 1), and ends the processing of this flow.

[0294] In the above step S21, when the C-state is not the C-state allowed by the maximum recovery time (S21: No), it is determined that the recovery time is shortened, and in step S24, the recovery time determination unit 140 sets the maximum recovery time of time slot #n+1 minus the difference in recovery time of the C-state of one shallower layer (allowed C-state - 1), and ends the processing of this flow.

[0295] In the above step S22, when (the C-state recovery time allowed by the maximum recovery time + the increment of the recovery time of the C-state one layer deeper) ≥ the allowed delay time (S22: No), in step S25, the recovery time determination unit 140 does not modify the maximum recovery time and ends the processing of this flow.

[0296] In the above flow, it is determined for each time slot whether delay addition is permitted even when transitioning to an upper C-state or whether transitioning to a lower C-state is possible.

[0297] Here, when there is periodicity in past experience, it is also possible to immediately switch to the target C-state. In addition, when the C-state actually measured is C0, the CPU is busy, so it is also possible to immediately return to C0 without executing in stages.

[0298] Fig.17 It shows execution Fig.16 A diagram of a work example in the case of maximum recovery time determination processing. Fig.17 The vertical axis represents the allowed delay, and the horizontal axis represents time. Fig.17 The dashed line in the figure represents the maximum recovery time allowed by the C-state recovery time. Fig.17 The solid line in represents the actual measured C-state recovery time. Fig.17 As shown in FIG. 1 , when the allowable C-state recovery time is set, the actual measured C-state recovery time is consistent with it. Fig.17 In the example, in time slot t3, the C3 of the target C-state is greater than the allowed delay, so an example of not being allowed is shown ( Fig.17 00).

[0299] [Hardware structure]

[0300] The task scheduling device 100 ( Figure 1 ) by, for example Fig.18 The present invention is implemented by a computer 900 having the structure shown.

[0301] Fig.18 is a diagram showing the implementation of the task scheduling device 100 ( Figure 1 )'s function as a computer 900 of an example of a hardware structure diagram.

[0302] The computer 900 includes a CPU 901 , a ROM 902 , a RAM 903 , a HDD 904 , a communication interface (I / F) 906 , an input / output interface (I / F) 905 , and a medium interface (I / F) 907 .

[0303] The CPU 901 operates based on the program stored in the ROM 902 or the HDD 904 to perform the task scheduling device 100 ( Figure 1 ) The ROM 902 stores a boot program executed by the CPU 901 when the computer 900 is started, a program depending on the hardware of the computer 900, and the like.

[0304] The CPU 901 controls an input device 910 such as a mouse and a keyboard, and an output device 911 such as a display, via an input / output I / F 905. The CPU 901 acquires data from the input device 910 via the input / output I / F 905, and outputs generated data to the output device 911. In addition, as a processor, a GPU (Graphics Processing Unit) or the like may be used together with the CPU 901.

[0305] HDD 904 stores programs executed by CPU 901 and data used by the programs, etc. Communication I / F 906 receives data from other devices via a communication network (eg, NW (network) 922) and outputs it to CPU 901, and transmits data generated by CPU 901 to other devices via the communication network.

[0306] The medium I / F 907 reads the program or data stored in the recording medium 912 and outputs it to the CPU 901 via the RAM 903. The CPU 901 loads the target processing program from the recording medium 912 to the RAM 903 via the medium I / F 907, and executes the loaded program. The recording medium 912 is an optical recording medium such as a DVD (Digital Versatile Disc), a PD (Phase change rewritable Disk), a magneto-optical recording medium such as an MO (Magneto Optical disk), a magnetic recording medium, a conductor storage tape medium, or a semiconductor memory.

[0307] For example, in the computer 900 as a task scheduling device 100 ( Figure 1 ) functions, the CPU 901 of the computer 900 implements the function of the task scheduling device 100 by executing the program loaded on the RAM 903. In addition, the data in the RAM 903 is stored in the HDD 904. The CPU 901 reads and executes the program of the target processing from the recording medium 912. In addition, the CPU 901 can also read the program of the target processing from other devices via the communication network (NW 922).

[0308] [Effect]

[0309] As described above, the computer system 1000 ( Figure 1 ) has a processor composed of multiple cores and runs a process that uses the time on the processor to execute a specified command, and the process has: a standby process 101 ( Figure 5 , Figure 7), which is in a waiting state before being notified, wakes up and starts running again when notified; and a notification process 90, which sends a notification when an event occurs to wake up the standby process, and the standby process 101 has a virtual idle task 103 ( Figure 5 , Figure 7 ).

[0310] Thus, the computer system 1000 can perform the idle task 92 (which does not execute any command) in the standby process 101 when there is no process on the processor. Figure 4 , Figure 6 ) The same behavior as the idle task 92. When the standby process is awakened, the idle task 92 is not scheduled, so the standby process processing is resumed without context switching. That is, the virtual idle task 103 performs the same behavior as the idle task 92 in the standby process 101, eliminating the context switch from the idle task 92. Therefore, it is possible to reduce the time spent on waking up the standby process after an event occurs.

[0311] In computer system 1000( Figure 1 ), characterized in that the virtual idle task 103 ( Figure 5 , Figure 7 ) causes the processor to execute a sleep command.

[0312] Thus, the virtual idle task 103 can cause the CPU to execute a sleep (NOP) command. That is, the virtual idle task 103 maintains a sleep state in which no command is executed, replacing the idle part 51 ( Figure 1 ) and calls and executes the C-state control unit 62 ( Figure 1 ). This can reduce the CPU cycle and suppress the power consumption of the CPU core.

[0313] A task scheduling device 100( Figure 1 ), in computer system 1000( Figure 1 ) is used to schedule a process, the computer system 1000 has a processor composed of multiple cores and runs a process that uses the time on the processor to execute a specified command, and the task scheduling device has: a standby process 101 ( Figure 5 , Figure 7 ), which is in a waiting state before being notified, wakes up and starts running again when notified; and virtual idle task 103 ( Figure 5 , Figure 7 ), when entering the standby state, the standby process 101 continues to occupy the processor's tasks.

[0314] Thus, the task scheduling device 100 resumes the standby process without context switching, and thus can minimize the time taken to wake up the standby process after an event occurs.

[0315] In the task scheduling device 100 ( Figure 1 ), characterized in that the virtual idle task 103 ( Figure 5 , Figure 7 ) causes the processor to execute a sleep command.

[0316] Thus, the virtual idle task 103 can cause the CPU to execute a sleep (NOP) instruction, thereby reducing the CPU cycle and suppressing the power consumption of the CPU core.

[0317] In the task scheduling device 100 ( Figure 1 ) is characterized in that it has a virtual idle determination unit 130, which determines whether to execute the virtual idle task 103 based on the process occurrence status and / or delay time conditions on the same processor.

[0318] Thus, the virtual idle task 103 can be executed under appropriate conditions based on the process occurrence state and delay time conditions on the processor. The virtual idle task 103 has the effect, and is executed only under conditions that do not affect other processes, so the actual effects of "eliminating context switching by processor occupancy" and "executing a sleep command" can be achieved.

[0319] In the task scheduling device 100 ( Figure 1 ), characterized in that it has a recovery time setting unit (a recovery time determination unit 140 and a recovery time setting unit 150), which is set in the virtual idle task 103 ( Figure 5 , Figure 7 ) The recovery time from when the task occurs to when it is restored.

[0320] Thus, the task scheduling device 100 can shorten the delay time until the standby process (standby function) wakes up.

[0321] In the task scheduling device 100 ( Figure 1 ) is characterized in that the recovery time control unit (recovery time determination unit 140 and recovery time setting unit 150) overwrites the determined recovery time with the maximum recovery time, and by shortening the maximum recovery time, the sleep state will not be converted to a deeper sleep state.

[0322] Thus, the maximum recovery time of the virtual idle task is specified, and control can be performed so as not to fall into a deep sleep state. The delay time from task allocation to the start of calculation is suppressed, and calculation with high real-time performance can be performed.

[0323] That is, the task scheduling device 100 can shorten the delay time until the standby process (standby function) wakes up. Therefore, <Condition 1: Reduction of notification time> can be satisfied. In addition, the task scheduling device 100 can reduce the power of the HW by extending the maximum recovery time and switching to a deeper sleep state, and can satisfy <Condition 2: Power saving>.

[0324] It should be noted that, among the various processes described in the above embodiments, all or part of the processes described as being performed automatically can be performed manually, or all or part of the processes described as being performed manually can be performed automatically by a known method. In addition, the information on the processing sequence, control sequence, specific names, various data, and parameters included in the above text and shown in the drawings can be changed arbitrarily unless otherwise specified.

[0325] In addition, the components of each device shown in the figure are conceptual functions and do not necessarily need to be physically configured as shown in the figure. In other words, the specific distribution and integration of each device is not limited to the figure, and all or part of them can be functionally or physically distributed and integrated in arbitrary units according to various workloads, usage conditions, etc.

[0326] In addition, with respect to the above-mentioned structures, functions, processing parts, processing units, etc., part or all of them can also be implemented by hardware, such as by designing in an integrated circuit. In addition, the above-mentioned structures, functions, etc. can also be implemented by software for interpreting and executing programs for the processor to implement each function. Information such as programs, tables, files, etc. that implement each function can be stored in a storage device such as a memory, a hard disk, an SSD (Solid State Drive), or a recording medium such as an IC (Integrated Circuit) card, an SD (Secure Digital) card, or an optical disk.

[0327] Description of Reference Numerals

[0328] 50: idle process (idle task);

[0329] 51: Idle section;

[0330] 60: kernel;

[0331] 61: Scheduler;

[0332] 62: C-state control unit;

[0333] 90: Notification process;

[0334] 92: Idle task;

[0335] 100: task scheduling device;

[0336] 101: standby process;

[0337] 103: virtual idle task;

[0338] 110: standby unit;

[0339] 120: virtual idle part;

[0340] 130: virtual idle determination unit;

[0341] 140: a recovery time determination unit (a recovery time control unit);

[0342] 150: recovery time setting unit (recovery time control unit);

[0343] 1000: Computer systems;

[0344] CPU core #m, CPU core #n, …: CPU core.

Claims

1. A computer system having a processor composed of a plurality of cores and running a process for executing a predetermined command using time on the processor, characterized in that: The process includes: a standby process, which is in a waiting state before receiving a notification, and wakes up and starts running again when receiving a notification; and a notification process, which sends a notification when an event occurs to wake up the standby process. The standby process has a virtual idle task that continues to occupy the processor when entering the standby state.

2. The computer system according to claim 1, characterized in that: The virtual idle task causes the processor to execute a sleep command.

3. A task scheduling device for scheduling a process in a computer system, wherein the computer system has a processor composed of multiple cores and runs the process, and the process uses the time on the processor to execute a specified command, wherein the task scheduling device is characterized by having: A standby process, which waits until notified and wakes up and starts running again when notified; and The virtual idle task is a task in which the standby process continues to occupy the processor when the processor enters the standby state.

4. The task scheduling device according to claim 3, characterized in that: The virtual idle task causes the processor to execute a sleep command.

5. The task scheduling device according to claim 3, characterized in that: have: The virtual idle determination unit determines whether to execute the virtual idle task based on the process occurrence status and / or delay time conditions on the same processor.

6. The task scheduling device according to claim 3, characterized in that: have: The recovery time control unit sets the recovery time of the virtual idle task from the time the task occurs to the time the task is restored.

7. A waiting process awakening method, which is a waiting process awakening method of a task scheduling device, wherein the task scheduling device schedules a process in a computer system, the computer system has a processor composed of multiple cores and runs the process, and the process uses the time on the processor to execute a specified command, and the waiting process awakening method is characterized in that: The task scheduling device performs: A standby process, which waits until notified and wakes up and starts running again when notified; and The virtual idle task is a task in which the standby process continues to occupy the processor when the processor enters the standby state. 8 . A program for causing a computer to function as the task scheduling device according to claim 3 .