Skip to content

feat: add third-party service detection for short idle power management#1143

Merged
xionglinlin merged 1 commit into
linuxdeepin:masterfrom
xionglinlin:feat/idle-fix
Jun 11, 2026
Merged

feat: add third-party service detection for short idle power management#1143
xionglinlin merged 1 commit into
linuxdeepin:masterfrom
xionglinlin:feat/idle-fix

Conversation

@xionglinlin

Copy link
Copy Markdown
Contributor

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

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

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @xionglinlin, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@deepin-ci-robot

Copy link
Copy Markdown

[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.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

return runningServices, nil
}

func isSystemServiceName(name string) bool {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

太粗暴了

@xionglinlin xionglinlin merged commit 16329dc into linuxdeepin:master Jun 11, 2026
15 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants