SetFrameRateAndPrioType 测试用例报错修复 Created-by: ymw1997 Commit-by: ymw1997 Merged-by: openharmony_ci Description: ### 一、内容说明(相关的Issue) https://gitcode.com/openharmony/xts_hats/issues/969 ### 二、建议测试周期和提测地址 建议测试完成时间:xxxx.xx.xx 投产上线时间:xxxx.xx.xx 提测地址:CI环境/压测环境 测试账号: ### 三、变更内容 * 3.1 关联PR列表 * 3.2 数据库和部署说明 1. 常规更新 2. 重启unicorn 3. 重启sidekiq 4. 迁移任务:是否有迁移任务,没有写 "无" 5. rake脚本:`bundle exec xxx RAILS_ENV = production`;没有写 "无" * 3.4 其他技术优化内容(做了什么,变更了什么) - 重构了 xxxx 代码 - xxxx 算法优化 * 3.5 废弃通知(什么字段、方法弃用?) * 3.6 后向不兼容变更(是否有无法向后兼容的变更?) ### 四、研发自测点(自测哪些?冒烟用例全部自测?) 自测测试结论: ### 五、测试关注点(需要提醒QA重点关注的、可能会忽略的地方) 检查点: | 需求名称 | 是否影响xx公共模块 | 是否需要xx功能 | 需求升级是否依赖其他子产品 | |------|------------|----------|---------------| | xxx | 否 | 需要 | 不需要 | | | | | | 接口测试: 性能测试: 并发测试: 其他: See merge request: openharmony/linux_frame_aware_sched!216
The Part of Frame Aware Sched
Introduction
The part of Frame Aware Sched belongs to subsystem named Resource Schedule Subsystem.
In order to ensure the cpu scheduling supply, it updates the process scheduling groups and adjust the kernel schedule parameters to influence the kernel scheduling behavior according to the information of the application frame drawing and the application life cycle status.
Directory Structure
//foundation/resourceschedule/frame_aware_sched
├── common # common tool class of the component
│ └── include
│ ├── frame_info_const.h # frame drawing process information
│ ├── frame_aware_constants.h # general parameter configuration
│ ├── frame_aware_log_domain.h # encapsulates hilog for log printing
│ └── single_instance.h # class template encapslating singleton mode
│
├── interfaces
│ └── innerkits # directory of internal interfaces
│
├── frameworks
│ └── core
│ ├── frame_aware_collector # frame information collector in apps
│ └── frame_aware_policy # components of the frame_aware_sched mechanism
│
├── profiles # component configuration file
└── test # directory for storing self-test cases.
Framework
According to the thread it belongs to during execution, the Farme Aware Sched is devided into two parts, which are Frame Aware Collector and Frame Aware Policy. The framework is shown in the following picture.
-
Frame Aware Collector: which is the core strategy of drawing frames, including frame event processing module, slide scene strategy module, and model processing module.
Module-frame event processing : responsible for coordinating and dispatching the message information of the frame drawing sub-process of the JS-UI subsystem and the Graphic subsystem.
Module-slide scene strategy: responsible for the sliding scene recognize and provide the scenario-based fine scheduling by the interface of the model processing module.
Module-model processing module: responsible for providing the adjustment and scheduling algorithm of each sub-process.
-
Frame Aware Policy: which is consists of four part: event processing module, application management module, and RTG (Related-Thread-Group) management module and scheduling parameter control module.
Module-Application state event processing: which is responsible for registering and receiving messages from the global resource management and control subsystem, such as application state switch, window focus state change, etc, and distributing messages to the application management and control module and RTG grouping module.
Module-Application management: responsible for the unified management of the application messages of the event processing module.
Module-RTG Managerment: the kernel interface set, sets the RTG accoding to the application state to realize thread scheduling management.
Module-Scheduling Parameter Control:responsible for reading the default scheduling prameter configuration.
The component of Frame Information Collection
The frame information collection is mainly responsible for adjusting the parameters of kernel scheduling and scaling the thread load. When the user slides on the application, it recognizes the key threads (such as draw frame thread and render thread) , perceives the sub-process of the application frame drawing, and adjust the kernel scheduling parameters according to the task timeout status to perform real-time resources.
- According to the screen refresh rate, it analyze the current frame rate information. The resource supply of key threads is increased according to the time to end of the drawing frame.
- Adjust resource supply according to the duration of each sub-process during graphics rendering process.
- Adjust resource supply for frame sub-process task with high frame loss rate.
The component of Frame Aware Policy
As the basis for the realization of application frame perception, the frame aware policy is mainly reposible for controlling thread groups and thread priorities, realizing the unified management of application threads and ensuring the performance of the entire system.
Usage Guidelines
System developers can add or remove this part by configuring the product definition JSON file under /productdefine/common/products to enable or disable this part:
"resourceschedule:frame_aware_sched":{}
Repositories Involved
- resource_schedule_service
- ace_ace_engine
- graphic_graphic_2d
- aafwk_standard
- frame_aware_sched
