Skip to content

[codex] raise Treeland service resource priority#976

Closed
deepin-wm wants to merge 2 commits into
linuxdeepin:masterfrom
deepin-wm:codex/highest-service-priority-master
Closed

[codex] raise Treeland service resource priority#976
deepin-wm wants to merge 2 commits into
linuxdeepin:masterfrom
deepin-wm:codex/highest-service-priority-master

Conversation

@deepin-wm

@deepin-wm deepin-wm commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Raise Treeland DDM-mode systemd service to highest normal CPU, I/O, and OOM-protection priorities. Move dde-seatd socket environment ownership to treeland.service.

Changes:

  • Add Environment=SEATD_SOCK=/run/dde-seatd.sock to own the seatd socket configuration
  • Change OOMScoreAdjust=-300 to OOMScoreAdjust=-1000 (maximum protection)
  • Change Nice=-15 to Nice=-20 (highest nice priority)
  • Add CPUWeight=10000 (high CPU weight)
  • Add CPUSchedulingPolicy=rr (round-robin realtime scheduling)
  • Add CPUSchedulingPriority=20 (realtime priority level)
  • Add IOWeight=10000 (high I/O weight)
  • Add IOSchedulingClass=realtime (realtime I/O scheduling)
  • Add IOSchedulingPriority=0 (highest I/O priority)

This PR replaces closed PR #932 which was targeting the old/master branch.

Summary by Sourcery

Increase Treeland systemd service runtime priority and assume ownership of seatd socket configuration.

Enhancements:

  • Raise Treeland service CPU, I/O, and OOM-protection priorities to highest normal levels in its systemd unit.
  • Configure the Treeland service to own the SEATD_SOCK environment for the dde-seatd socket.

Raise Treeland DDM-mode systemd service to highest normal CPU,
I/O, and OOM-protection priorities. Move dde-seatd socket
environment ownership to treeland.service.
@sourcery-ai

sourcery-ai Bot commented Jun 12, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

This PR updates the Treeland systemd unit to run with maximum normal CPU, I/O, and OOM protection priorities, and moves ownership of the dde-seatd socket environment into treeland.service itself.

File-Level Changes

Change Details Files
Elevate Treeland systemd service runtime priorities and own the seatd socket configuration.
  • Add SEATD_SOCK environment variable to the service to own the dde-seatd socket configuration.
  • Increase OOM protection by changing OOMScoreAdjust from -300 to -1000.
  • Increase CPU scheduling priority by changing Nice from -15 to -20.
  • Add CPUWeight=10000 to give the service maximum CPU weight.
  • Enable realtime CPU scheduling via CPUSchedulingPolicy=rr with CPUSchedulingPriority=20.
  • Add IOWeight=10000 to give the service maximum I/O weight.
  • Enable realtime I/O scheduling via IOSchedulingClass=realtime with IOSchedulingPriority=0.
misc/systemd/treeland.service.in

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@github-actions

github-actions Bot commented Jun 12, 2026

Copy link
Copy Markdown

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

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

Hey - I've left some high level feedback:

  • Consider whether using realtime CPU and I/O scheduling (CPUSchedulingPolicy=rr, CPUSchedulingPriority=20, IOSchedulingClass=realtime) is strictly necessary, as this can starve other system services; if it is, it may be safer to gate these settings behind a separate unit or drop-in so distributions can opt-in.
  • Hardcoding SEATD_SOCK to /run/dde-seatd.sock in the main service unit may make it harder for downstreams with different seatd setups; consider making this path configurable via a drop-in or using a more generic environment reference.
  • With both Nice=-20 and CPUWeight=10000 set, the intent for CPU prioritization may not be obvious to future maintainers; adding a brief comment in the unit file explaining why both mechanisms are used and how they’re expected to interact could clarify the design.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider whether using realtime CPU and I/O scheduling (CPUSchedulingPolicy=rr, CPUSchedulingPriority=20, IOSchedulingClass=realtime) is strictly necessary, as this can starve other system services; if it is, it may be safer to gate these settings behind a separate unit or drop-in so distributions can opt-in.
- Hardcoding SEATD_SOCK to /run/dde-seatd.sock in the main service unit may make it harder for downstreams with different seatd setups; consider making this path configurable via a drop-in or using a more generic environment reference.
- With both Nice=-20 and CPUWeight=10000 set, the intent for CPU prioritization may not be obvious to future maintainers; adding a brief comment in the unit file explaining why both mechanisms are used and how they’re expected to interact could clarify the design.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@deepin-wm

Copy link
Copy Markdown
Contributor Author

I have read the CLA Document and I hereby sign the CLA.

deepin-bot Bot added a commit to linuxdeepin/cla that referenced this pull request Jun 12, 2026
Raise Treeland DDM-mode systemd service to highest normal CPU,
I/O, and OOM-protection priorities. Move dde-seatd socket
environment ownership to treeland.service.

Log: 提升 Treeland 服务资源优先级到最高普通优先级
Influence: 提升 Treeland 服务的性能表现,确保系统流畅运行
@deepin-wm deepin-wm closed this Jun 12, 2026
@deepin-wm deepin-wm deleted the codex/highest-service-priority-master branch June 12, 2026 02:12
@deepin-wm deepin-wm restored the codex/highest-service-priority-master branch June 12, 2026 02:12
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.

1 participant