feat: add third-party service detection for short idle power management#1143
Merged
Merged
Conversation
Add system service detection mechanism to prevent short idle state when third-party services are running. This change introduces a new DSG configuration "systemServices" containing a whitelist of system- level services. During short idle checks, the system now monitors running services via systemctl and compares them against the whitelist. If any running service is not in the whitelist and doesn't match known Deepin/UOS prefixes, short idle is prevented. This complements the existing third-party application detection for more comprehensive power management. Also optimizes thread safety for DSG configuration maps with mutex protection and copy-on-snapshot patterns. Log: Added third-party service detection to optimize short idle power management Influence: 1. Test short idle behavior with only system services running (should enter short idle) 2. Test short idle with third-party service installed and running (should not enter short idle) 3. Test with third-party service stopped (should enter short idle) 4. Test system service whitelist configuration changes take effect dynamically 5. Test performance of running service detection in various system states 6. Test concurrent access to system service maps feat: 添加第三方service服务检测以优化短idle电源管理 新增系统服务检测机制,防止第三方服务运行时进入短idle状态。引入新的DSG 配置"systemServices",包含系统级服务白名单。在短idle检查过程中,通过 systemctl监控运行中的服务并与白名单比对。如果存在不在白名单且不匹配 Deepin/UOS前缀的服务,则阻止进入短idle。此功能补充了已有的第三方应用检 测,实现更全面的电源管理。同时通过互斥锁保护和快照复制模式,优化了DSG配 置映射的线程安全性。 Log: 新增第三方服务检测,优化短idle电源管理 Influence: 1. 测试仅运行系统服务时的短idle行为(应进入短idle) 2. 测试安装并运行第三方服务时的短idle行为(不应进入短idle) 3. 测试停止第三方服务后的短idle行为(应进入短idle) 4. 测试系统服务白名单配置变更动态生效 5. 测试不同系统状态下运行服务检测的性能 6. 测试系统服务映射的并发访问 PMS: TASK-389737 Change-Id: Ia23d22457ad1d7c221b4c4abb7d684affab292dd
There was a problem hiding this comment.
Sorry @xionglinlin, you have reached your weekly rate limit of 500000 diff characters.
Please try again later or upgrade to continue using Sourcery
mhduiy
approved these changes
Jun 11, 2026
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: mhduiy, xionglinlin The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
mhduiy
reviewed
Jun 11, 2026
| return runningServices, nil | ||
| } | ||
|
|
||
| func isSystemServiceName(name string) bool { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add system service detection mechanism to prevent short idle state when third-party services are running. This change introduces a new DSG configuration "systemServices" containing a whitelist of system- level services. During short idle checks, the system now monitors running services via systemctl and compares them against the whitelist. If any running service is not in the whitelist and doesn't match known Deepin/UOS prefixes, short idle is prevented. This complements the existing third-party application detection for more comprehensive power management. Also optimizes thread safety for DSG configuration maps with mutex protection and copy-on-snapshot patterns.
Log: Added third-party service detection to optimize short idle power management
Influence:
feat: 添加第三方service服务检测以优化短idle电源管理
新增系统服务检测机制,防止第三方服务运行时进入短idle状态。引入新的DSG
配置"systemServices",包含系统级服务白名单。在短idle检查过程中,通过
systemctl监控运行中的服务并与白名单比对。如果存在不在白名单且不匹配
Deepin/UOS前缀的服务,则阻止进入短idle。此功能补充了已有的第三方应用检
测,实现更全面的电源管理。同时通过互斥锁保护和快照复制模式,优化了DSG配
置映射的线程安全性。
Log: 新增第三方服务检测,优化短idle电源管理
Influence:
PMS: TASK-389737
Change-Id: Ia23d22457ad1d7c221b4c4abb7d684affab292dd