[暂不合并]feat(service): disable THP before clipboard service startup#266
[暂不合并]feat(service): disable THP before clipboard service startup#266mhduiy wants to merge 1 commit into
Conversation
1. Add ExecStartPre script to disable Transparent Huge Pages before dde-clipboard-daemon and dde-clipboard services start 2. Use leading dash (-) to allow service startup even if THP disable script fails Log: Disable THP before clipboard services start to improve performance feat(service): 剪切板服务启动前禁用透明大页 1. 在 dde-clipboard-daemon 和 dde-clipboard 两个服务中增加 ExecStartPre 脚本,启动前禁用透明大页 2. 使用前置短横线 (-) 确保即使脚本失败也不影响服务正常启动 Log: 剪切板服务启动前禁用透明大页以提升性能 PMS: TASK-390043
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: mhduiy 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 |
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThis PR updates the systemd units for dde-clipboard-daemon and dde-clipboard to run a pre-start script that disables Transparent Huge Pages (THP) for performance, while allowing the services to continue starting even if the THP-disabling step fails. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- Consider guarding the THP disable ExecStartPre commands with existence checks (e.g., ConditionPathExists or shell
test -earound/sys/kernel/mm/transparent_hugepage/*) so the units behave cleanly on kernels or environments where THP is not exposed in the usual locations. - If the same THP-disabling logic is duplicated in both service files, consider centralizing it in a single script or systemd unit to avoid divergence and make future changes easier.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider guarding the THP disable ExecStartPre commands with existence checks (e.g., ConditionPathExists or shell `test -e` around `/sys/kernel/mm/transparent_hugepage/*`) so the units behave cleanly on kernels or environments where THP is not exposed in the usual locations.
- If the same THP-disabling logic is duplicated in both service files, consider centralizing it in a single script or systemd unit to avoid divergence and make future changes easier.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
deepin pr auto review你好!我是CodeGeeX。我已仔细审查了你提供的 Git Diff 内容。本次修改主要为两个 DDE (Deepin Desktop Environment) 剪贴板相关的 systemd 服务单元文件增加了 以下是我从语法逻辑、代码质量、代码性能和代码安全四个维度进行的审查与改进建议: 1. 语法逻辑
2. 代码质量
3. 代码性能
4. 代码安全
综合改进建议示例如果你确认需要使用 CMake 变量来替代硬编码路径,修改后的 [Service]
Type=dbus
BusName=org.deepin.dde.daemon.Clipboard1
# 使用 CMake 变量替换硬编码路径,确保安装路径的一致性和可配置性
ExecStartPre=-@CMAKE_INSTALL_FULL_LIBEXECDIR@/dde-thp-disable
ExecStart=@CMAKE_INSTALL_FULL_BINDIR@/dde-clipboard-daemon
Slice=session.slice
Restart=on-failure总结:本次修改逻辑清晰,语法正确, |
Log: Disable THP before clipboard services start to improve performance
feat(service): 剪切板服务启动前禁用透明大页
Log: 剪切板服务启动前禁用透明大页以提升性能
PMS: TASK-390043
Summary by Sourcery
Enhancements: