Scheduling method combining system real-time event-driven and time-driven

introduction

At present, virtualized operating systems (hypervisors) are widely used in servers, PCs, etc. These applications have low real-time requirements. After a lot of testing and analysis, it is found that one of the main sources of poor real-time performance of the virtualized operating system is the poor real-time performance of the scheduling algorithm. It is necessary to transform the scheduling method of the virtualized operating system in real time so that it can be applied to occasions with high real-time requirements. This paper presents a real-time scheduling method based on the combination of system event-driven and time-driven. Practice has shown that this method effectively solves the real-time problem brought by the virtualized operating system in embedded system applications.

1 Question raised

Based on the virtualized operating system (hypervisor), multiple operating systems (GueSTOS) on a single CPU can be run simultaneously in mutually isolated memory domains. As shown in Figure 1, the arrows indicate scheduling. Among them, the system scheduling adopts a two-level scheduling strategy. The virtualized operating system performs the first-level scheduling of GuestOS (Domain). The GuestOS performs the second-level scheduling of its own tasks. It is difficult to guarantee the real-time response of the system.

Figure 1 Virtualized operating system

For the first-level scheduling (Domain scheduling), the traditional scheduling strategy is based on the time slice scheduling method (SEDF, BVT, ARR, Credit, etc.), which is usually used in occasions with low real-time requirements (network server, etc.). For occasions with high real-time requirements (mobile phones, etc.), the real-time scheduling is difficult to meet the system requirements. The specific performance is: low CPU utilization, slow interrupt response, insufficient data communication rate between GuestOS, etc. In order to improve these performances, a new scheduling method that meets real-time applications must be designed. According to actual testing and analysis, the main bottleneck of poor real-time response is that GuestOS cannot be scheduled in time.

The method in this paper mainly reforms the first-level scheduling strategy, that is, the virtualized operating system scheduling method for GuestOS (Domain).

2 Solution

The method in this paper adopts the strategy that the system real-time events drive the Domain scheduler. When there are urgent or important events in the system that require real-time response, these events have the opportunity to drive the Domain scheduler to generate scheduling behaviors, so that (emergency or important events) can be quickly processed. When no urgent or important events occur, the Domain scheduler uses a scheduling algorithm based on time slices (weights).

2.1 Scheduling principle

Figure 2 shows the scheduling principle. In Figure 2, when an urgent or important event such as a system hardware interrupt, GuestOS event sending, or Guest Idle occurs, there is an opportunity to drive the Domain scheduler through a strong principle and switch the Domain to be processed quickly. When there are no urgent or important events in the system, the domain scheduler performs scheduling by the weak principle (time slice, etc.).

Figure 2 Scheduling principle

2.2 Real-time analysis

Take interrupt processing as an example to analyze the interrupt response time, as shown in Figure 3. As can be seen from Figure 3, the interrupt response time of the original scheduling strategy includes: "Waiting for the end of the Domain scheduling time slice" + "Doamin switch". The new scheduling strategy only includes "Doamin switch" time. It can be seen that with the new strategy, the real-time interruption response has been improved.

Figure 3 Interrupt real-time response analysis

In virtual operating system applications, there are often real-time responses to the following three types of events that need to be considered:

Type 0 event-the underlying hardware interrupt needs to be quickly responded to a domain in the upper layer;

Type 1 events-Communication events between Domain (GuestOS) need to be quickly processed by another Doamin;

Type 2 event-When the task in Domain (GuetOS) is idle, it actively gives up the CPU and notifies the Domain scheduler to make other Domain (GuestOS) get a chance to run.

The real-time response time analysis of these events is similar to the interrupt response.

In this method, as shown in FIG. 4, the above three types of events all drive the Domain Scheduler in the form of setting trigger events. The Domain Scheduler can be generated according to these event combinations, the current GuestOS state combination, and the current Domain scheduling state Scheduling decision.

2.3 Method implementation

2.3.1 Event definition

When this method is specifically implemented, according to the specific application of the real-time system, first define emergency / important events (events that need to trigger scheduling to meet the real-time response requirements), and classify them according to the three types of real-time events described in Section 2.2 And design priority ranking. Category 0 events have the highest priority, category 1 events have the highest priority, category 2 events have the lowest priority, and each category of events is also sorted according to priority.

2.3.2 State definition

Then, according to the system design and operation, list the Domain state combination and GuestOS state combination, as listed in Table 1 and Table 2. Finally, according to the system operation requirements, a query table for driving event scheduling is designed, as listed in Table 3.

Table 1 shows the combination of GuestOS running states, indicating the task running status in each guestOS. Each GuestOS can be in two states of Run or Idle, and the combination of multiple GuestOS states (this article uses 2 GuestOS instructions), you can make a guestOS state combination table.

Table 1 GuestOS state combination

Figure 4 Event-driven real-time scheduling method

Budget Laptop

Everyone want a budget laptop. There are different level according to application scenarios. 14 inch Budget Laptop For Students for your elementary project, 10.1 inch Low Budget Laptop for kids play or online learning, 15.6inch celeron j4125 Budget Laptop For Programmers, 14inch budget i5 laptop for your business projects, 15.6inch budget i7 laptop for university students, officers who love bigger screen and performance focused, etc. Of course, other type laptops also optional, like Yoga Laptop , 2 In 1 Laptop , android laptop, etc

As a professional manufacture of custom laptop, Android Tablet, Mini PC , All In One PC, we can provide unique and satisfy oem service. What you need to do is kindly share the exact parameters and special points care more, thus we can provide solutions accordingly.

When you have tender, you can contact us and send the parameters list require, then will provide the most matched one for you. More simple way is that you share your budget, design, delivery time , etc. Believe you can always get a right solution here.

Budget Laptop,20k Budget Laptop,Low Budget Laptop,Top 10 Budget Laptops,Budget Laptop For Programmers

Henan Shuyi Electronics Co., Ltd. , https://www.shuyilaptops.com

Posted on