Mobile device resource scheduling method for optimizing I / O performance

Through the resource scheduling method based on reinforcement learning, dynamically adjusting the CPU and DDR frequency, the problems of insufficient process priority identification and I/O delay in the Android operating system are solved, and efficient resource scheduling and low-power optimization of mobile devices are achieved.

CN120469791APending Publication Date: 2025-08-12BEIHANG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510449243.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-10
Publication Date
2025-08-12

AI Technical Summary

Technical Problem

The existing Android operating system resource scheduling mechanism cannot effectively identify process priorities in the Android framework, resulting in poor performance of mobile devices in the face of unpredictable load peaks, and the traditional scheduling mechanism cannot respond to burst I/O load requirements in a timely manner, affecting the user interface response fluency and power consumption.

Method used

The resource scheduling method based on reinforcement learning is adopted to dynamically adjust the CPU and DDR frequency through the reinforcement learning model, and combine the system status monitoring and online training framework to optimize I/O performance, reduce latency and improve response fluency.

Benefits of technology

Accurate resource scheduling is realized according to system status and application needs, eliminating the sampling and exploration overhead of traditional scheduling strategies, improving the I/O performance and user interface response speed of mobile devices, and reducing power consumption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120469791A_ABST
    Figure CN120469791A_ABST
Patent Text Reader

Abstract

The invention provides a mobile equipment resource scheduling method for optimizing I / O (Input / Output) performance, which comprises the following steps of: executing CPU (Central Processing Unit) and DDR (Double Data Rate) frequency scheduling actions by adopting an original strategy gradient algorithm through a reinforcement learning model for executing a mobile equipment resource scheduling decision; the mobile equipment system state monitoring and resource scheduling control framework is used for starting a reinforcement learning model to schedule resources when the system I / O load pressure is high; according to the online training framework of the reinforcement learning model on the mobile equipment, the reinforcement learning model is trained online, so that the reinforcement learning model can quickly cope with a new load scene. According to the mobile equipment resource scheduling method, resource scheduling decision making is carried out based on a data-driven reinforcement learning model, and sampling and exploration overhead of a traditional resource scheduling strategy is eliminated; accurate resource scheduling decisions can be made according to system states and application resource requirements, and the problems of low flexibility and low accuracy of previous work are avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical field:

[0001] The present invention relates to the field of operating systems, and in particular to a mobile device resource scheduling method for optimizing I / O performance. Background technology:

[0002] The Android operating system is an operating system developed for mobile devices (such as mobile phones and virtual reality headsets). Android is built on the Linux kernel, so Android inherits the resource scheduling mechanism (such as I / O scheduling, CPU / DDR frequency scheduling) developed by Linux for desktop devices and servers. However, the resource scheduling problem on mobile devices is very different from that on desktop devices and servers. Mobile applications are highly interactive and user-oriented. They often cause unpredictable load peaks, which increases the difficulty of the scheduler to balance performance and power consumption. In addition, the resource requirements and priorities of mobile applications vary. Users are particularly sensitive to the response speed of foreground applications running on the screen, while background applications generally have less impact on the user experience. These differences illustrate the need for a specialized resource scheduling strategy tailored for the mobile environment. The present invention summarizes the challenges faced by the resource scheduling mechanism in mobile devices as follows.

[0003] First, the resource scheduling mechanism in the Linux kernel cannot recognize the process priorities defined in the Android framework. In the Android framework, processes are divided into foreground, service, and background priority categories. However, these priority categories are inaccessible in the Linux kernel. For example, CPU frequency regulation is managed by the cpufreq module in the Linux kernel. The default frequency regulator in cpufreq, schedutil, tracks the CPU load system-wide and adjusts the frequency accordingly. This frequency regulator cannot obtain the process priority information defined in the Android framework, and therefore cannot prioritize resource allocation for processes / threads that have a significant impact on service quality (such as the main thread or rendering thread of the foreground process), resulting in poor performance in mobile environments.

[0004] Second, previous resource scheduling mechanisms mostly focused only on optimizing the performance of foreground applications, with less attention paid to optimizing internal operating system operations, especially operations in the file system that significantly impact I / O performance. Frequent I / O operations in the file system trigger context switching, interrupt processing, and lock contention for shared resources, resulting in high computational overhead. In the Linux kernel, there is a frequency adjustment mechanism similar to iowait boosting that can adjust the CPU frequency based on the frequency of I / O events, but the existing scheduling mechanism still has some flaws. First, there is a delay in frequency adjustment, which cannot promptly meet the instantaneous demands of sudden I / O loads. Second, traditional CPU schedulers lack accurate perception of kernel workloads, making it difficult to allocate sufficient computing resources to critical background tasks such as file system operations. Summary of the invention:

[0005] In order to solve the problems existing in the above-mentioned prior art, the present invention proposes a mobile device resource scheduling method for optimizing I / O performance based on reinforcement learning, which is used to dynamically and actively adjust the CPU and DDR frequencies according to system characteristics when the program is running, optimize I / O performance, reduce I / O latency, improve the user interface response smoothness, and reduce power consumption. The present invention consists of the following three parts. (1) A reinforcement learning model for executing mobile device resource scheduling decisions. (2) A mobile device system status monitoring and resource scheduling control framework. (3) An online training framework for the reinforcement learning model on a mobile device. The specific steps of each part are as follows:

[0006] 1. Reinforcement Learning Model for Executing Mobile Device Resource Scheduling Decisions

[0007] Step 1: Select the vanilla policy gradient algorithm, or VPG (Vanilla Policy Gradient), as the reinforcement learning model for resource scheduling decisions. This model contains only one actor neural network. The neural network has three hidden layers, with 32, 64, and 32 neurons, respectively. The number of neurons in the input layer is set to the number of collected features, and the number of neurons in the output layer is set to the number of scheduled actions. The output layer uses the softmax function as the activation function, which means that one action in the action space is selected for execution at a time. The remaining neural network layers use ReLU as the activation function.

[0008] Step 2: Select key system features of mobile devices as input features of the reinforcement learning model.

[0009] Step 21: Use simpleperf to analyze the CPU overhead of each function call in the file system during the execution of the I / O-intensive program Mobibench. The number of executions per second of function calls with high CPU overhead is added to the input feature set of the reinforcement learning model. Specifically, the number of executions per second of the fault_in_readable, wake_up_page_bit, f2fs_write_begin, copy_page_from_iter_atomic, f2fs_set_data_page_dirty, and pagecache_get_page functions are included.

[0010] Step 22: Add other features that can reflect the usage status of computing resources and storage resources to the reinforcement learning model input feature set, including: number of instructions per clock cycle, last-level cache miss rate, number of memory accesses, number of context switches, and number of load migrations.

[0011] Step 3: Set the model action space. The reinforcement learning model requires scheduling resources including CPU frequency and DDR frequency. Controllable parameters include: CPU small core (cores 0-3) frequency upper limit, CPU small core frequency lower limit, CPU large core (cores 4-7) frequency upper limit, CPU large core frequency lower limit, CPU super core (core 8) frequency upper limit, CPU super core frequency lower limit, DDR frequency upper limit, and DDR frequency lower limit. In the action space, each controllable parameter has one adjustment action for increasing and one adjustment action for decreasing. This means there are 8*2=16 actions in total.

[0012] Step 4: Set the piecewise reward function of the reinforcement learning model while optimizing I / O performance and power consumption. The reward function is designed as follows:

[0013] r=r I / O +r power

[0014] r I / O =-log(await)

[0015] r power =1-power / TDP

[0016] The reward function includes:

[0017] (1) I / O performance reward I / O . Where await is the average delay of I / O operations. The acquisition method is: access / proc / diskstats, collect four data: the number of completed read operations r, the number of completed write operations w, the total number of milliseconds consumed by read operations rt, and the total number of milliseconds consumed by write operations wt. After an interval of t seconds, re-access the file and obtain r', w', rt', wt' after t seconds. await is calculated as: ((rt'-rt)+(wt'-wt)) / ((r'+w')-(r+w)). The smaller the await, the shorter the time it takes to complete the I / O operation, and the reward value r obtained. I / O The higher.

[0018] (2) Low power consumption reward r power The performance metric is the ratio of the average power consumption per unit time of all frames between two scheduling actions to the CPU's Thermal Design Power (TDP). The average power consumption is calculated by multiplying voltage by current.

[0019] (2) Mobile device system status monitoring and resource scheduling control framework

[0020] In step 5, the framework reads the / proc / pressure / io file every 100 milliseconds to determine the current system I / O load and activates the model for frequency scheduling as needed. If the average I / O pressure of a process over the past 10 seconds exceeds a threshold of 5.0, the reinforcement learning model is activated for resource scheduling.

[0021] (3) Online training framework for reinforcement learning models on mobile devices

[0022] Step 6. In this invention, the data acquisition module, a system module within the Linux kernel, collects input features for the reinforcement learning model described in Step 2. The reinforcement learning model and resource scheduling framework, a system service within the Android framework, collects feature data from the data acquisition module at 100 millisecond intervals; inputs the reinforcement learning model to obtain resource scheduling actions; executes the actions by writing new frequency values to the Linux system file interface for controlling frequency limits; and collects await and power consumption from the data acquisition module to calculate the reinforcement learning model reward described in Step 4.

[0023] Step 7: The reinforcement learning model is deployed using TensorFlow Lite, enabling online training on mobile devices. Whenever 32 scheduling records are accumulated, they are fed into the reinforcement learning model as a batch for model training and neural network parameter updates.

[0024] The advantages of this invention include: It designs an intelligent resource scheduling method based on reinforcement learning to address the issue of I / O performance tuning for Android mobile devices. This method utilizes a data-driven reinforcement learning model to make resource scheduling decisions, eliminating the sampling and exploration overhead of traditional resource scheduling strategies. It can make precise resource scheduling decisions based on system status and application resource requirements, avoiding the low flexibility and accuracy of previous approaches. Furthermore, it leverages the exploration capabilities of the reinforcement learning model to automatically explore more efficient resource scheduling solutions. Description of the drawings:

[0025] Figure 1 This is a flow chart of a mobile device resource scheduling method for optimizing I / O performance. Specific implementation methods:

[0026] In order to make the above features and effects of the present invention more clearly understood, embodiments are given below for detailed description.

[0027] 1. Operating environment. The terminal of this embodiment uses the Google Pixel 8 smartphone. The terminal uses the Android 14.0.0 operating system and the Linux kernel version is 5.15.170. The terminal processor has three CPU sets: (1) small core, ARM Cortex-A510 (cores 0-3); (2) large core, ARM Cortex A715 (cores 4-7); (3) super large core, ARM Cortex-X3 (core 8). All cores in each CPU set have the same frequency band. The running memory is 8GB LPDDR5X, equipped with 128GB UFS3.1, and the fixed frame rate is 60 frames per second.

[0028] 2. Specific steps. Figure 1 The flowchart of one embodiment of the present invention is shown. The present invention mainly includes the following steps:

[0029] 1. Reinforcement Learning Model for Executing Mobile Device Resource Scheduling Decisions

[0030] According to step 1 of the present invention, the original policy gradient algorithm, namely VPG (Vanilla Policy Gradient), is selected as the reinforcement learning model for executing resource scheduling decisions, and a neural network structure is configured.

[0031] According to step 2 of the present invention, key system features of mobile devices are selected as input features for the reinforcement learning model. There are 11 features in total: number of instructions per clock cycle, last-level cache miss rate, number of memory accesses, number of context switches, number of load migrations, number of fault_in_readable executions per second, number of wake_up_page_bit executions per second, number of f2fs_write_begin executions per second, number of copy_page_from_iter_atomic executions per second, number of f2fs_set_data_page_dirty executions per second, and number of pagecache_get_page executions per second.

[0032] According to step 3 of the present invention, the model action space is set. There are a total of 8 frequency configuration parameters that need to be controlled, including: the upper frequency limit of the CPU small cores (cores 0-3), the lower frequency limit of the CPU small cores, the upper frequency limit of the CPU large cores (cores 4-7), the lower frequency limit of the CPU large cores, the upper frequency limit of the CPU super core (core 8), the lower frequency limit of the CPU super core, the upper frequency limit of the DDR frequency, and the lower frequency limit of the DDR frequency. In the model action space, for each controllable parameter, there is one adjustment action for increasing and one adjustment action for decreasing. That is, there are a total of 8*2=16 actions.

[0033] According to step 4 of the present invention, a piecewise reward function of the reinforcement learning model is set.

[0034] (2) Mobile device system status monitoring and resource scheduling control framework

[0035] According to step 5 of the present invention, the system status is detected every 100 milliseconds to determine whether to call reinforcement learning to schedule CPU and DDR frequency. If scheduling is required, the 11 reinforcement learning model input features are collected and normalized using the maximum and minimum value normalization method, that is, feature normalized =(max-feature) / (max-min). Feature refers to the characteristic value, normalized Refers to the normalized feature. max and min refer to the maximum and minimum values of the feature in the dataset, respectively. The normalized feature is input into the reinforcement learning model to obtain the scheduling action. The action is executed by writing the new frequency value to the system file interface provided by Linux for controlling the upper and lower frequency limits.

[0036] (3) Online training framework for reinforcement learning models on mobile devices

[0037] According to step 6 of the present invention, a resource scheduling framework is deployed in the Android framework, and a data acquisition module is deployed in the Linux kernel. The monitoring and scheduling processes of the resource scheduling module are started through the broadcast action of the Android activity manager ActivityManager.

[0038] According to step 7 of the present invention, the model is trained online on a Google Pixel 8 smartphone without server assistance.

[0039] The present invention also proposes a storage medium for storing a program for executing any one of the mobile device resource scheduling methods for optimizing I / O performance.

[0040] The present invention also proposes a mobile device equipped with an operating system integrated with any one of the mobile device resource scheduling methods for optimizing I / O performance.

Claims

1. A mobile device resource scheduling method for optimizing I / O performance, characterized in that: include: (1) A reinforcement learning model for executing resource scheduling decisions on mobile devices, using the original policy gradient algorithm to execute CPU and DDR frequency scheduling actions; (2) A mobile device system status monitoring and resource scheduling control framework, which is used to enable reinforcement learning models to schedule resources when the system I / O load is high; (3) An online training framework for reinforcement learning models on mobile devices. Online training of reinforcement learning models enables the reinforcement learning models to quickly respond to new load scenarios.

2. A mobile device resource scheduling method for optimizing I / O performance according to claim 1, characterized in that: The reinforcement learning models used to perform resource scheduling decisions on mobile devices include: Step 1: Select the original policy gradient algorithm (VPG) as the reinforcement learning model for resource scheduling decisions. This model contains only one Actor neural network with three hidden layers. The number of neurons in the hidden layers is 32, 64, and 32, respectively. The number of neurons in the input layer is set to the number of collected features, and the number of neurons in the output layer is set to the number of scheduled actions. The output layer activation function uses the softmax function, that is, one action in the action space is selected for execution each time. The remaining neural network layers use ReLU as the activation function. Step 2: Select key system features of mobile devices as input features of the reinforcement learning model; Step 3: Set the model action space. The resources that the reinforcement learning model needs to schedule include CPU frequency and DDR frequency. The controllable parameters include: CPU small core frequency upper limit, CPU small core frequency lower limit, CPU large core frequency upper limit, CPU large core frequency lower limit, CPU super core frequency upper limit, CPU super core frequency lower limit, DDR frequency upper limit, and DDR frequency lower limit. In the action space, for each controllable parameter, there is one adjustment action for increasing and one adjustment action for decreasing, that is, there are a total of 8*2=16 actions. Step 4: Set the piecewise reward function for the reinforcement learning model while optimizing I / O performance and power consumption. The reward function is designed as follows: r=r I / O +r power r I / O =-log(await) r power =1-powr / TDP Where r is the reward function, r I / O is the I / O performance bonus, r power is the low power consumption reward, await is the response time, powr is the average power consumption per unit time of all frames between two scheduling actions, and TDP is the CPU thermal design power consumption.

3. A mobile device resource scheduling method for optimizing I / O performance according to claim 2, characterized in that: Step 2 includes: Step 21. Use simpleperf to analyze the CPU overhead of each function call in the file system during the execution of the I / O-intensive program Mobibench. Add the number of executions per second of function calls with high CPU overhead to the input feature set of the reinforcement learning model. Specifically, the number of executions per second of the fault_in_readable, wake_up_page_bit, f2fs_write_begin, copy_page_from_iter_atomic, f2fs_set_data_page_dirty, and pagecache_get_page functions. Step 22: Add other features that can reflect the usage status of computing resources and storage resources to the reinforcement learning model input feature set, including: number of instructions per clock cycle, last-level cache miss rate, number of memory accesses, number of context switches, and number of load migrations.

4. The method for scheduling mobile device resources for optimizing I / O performance according to claim 1, wherein: The mobile device system status monitoring and resource scheduling control framework includes: The framework reads the / proc / pressure / io file every 100 milliseconds to determine the current system I / O load level and activates the model for frequency scheduling as needed. If the average I / O pressure of a process in the past 10 seconds is greater than the threshold of 5.0, the reinforcement learning model is activated for resource scheduling.

5. The method for scheduling mobile device resources for optimizing I / O performance according to claim 1, wherein: The online training framework for reinforcement learning models on mobile devices includes: The data acquisition module, a system module in the Linux kernel, is used to collect input features for the reinforcement learning model. The reinforcement learning model and resource scheduling framework, a system service in the Android framework, collects feature data from the data acquisition module at 100 millisecond intervals; inputs the reinforcement learning model to obtain resource scheduling actions; writes new frequency values to the system file interface provided by Linux for controlling the upper and lower frequency limits to execute actions; and collects await and power consumption from the data acquisition module to calculate the reinforcement learning model reward value. The reinforcement learning model is deployed using TensorFlow Lite, which enables online training of the model on mobile terminals. Whenever 32 scheduling records are accumulated, these 32 scheduling records are input into the reinforcement learning model as a batch for model training and updating of neural network parameters.

6. A storage medium for storing a program for executing any one of the mobile device resource scheduling methods for optimizing I / O performance according to claims 1 to 5.

7. An operating system equipped with an operating system integrated with any one of the mobile device resource scheduling methods for optimizing I / O performance according to claims 1 to 5.