Skip to content

[Deepin-Kernel-SIG] [linux 6.18-y] [BORE] linux6.18.22-bore-6.6.3#1633

Merged
opsiff merged 2 commits intodeepin-community:linux-6.18.yfrom
opsiff:linux-6.18.y-2026-04-16-bore-6.6.3
Apr 17, 2026
Merged

[Deepin-Kernel-SIG] [linux 6.18-y] [BORE] linux6.18.22-bore-6.6.3#1633
opsiff merged 2 commits intodeepin-community:linux-6.18.yfrom
opsiff:linux-6.18.y-2026-04-16-bore-6.6.3

Conversation

@opsiff
Copy link
Copy Markdown
Member

@opsiff opsiff commented Apr 16, 2026

update to linux6.18.22-bore-6.6.3

Summary by Sourcery

Update BORE scheduler integration and safeguards while bumping to version 6.6.3.

Bug Fixes:

  • Prevent potential invalid list access when traversing descendant tasks in the BORE burst-cache path.
  • Limit burst-cache thread-group scans to avoid excessive iteration in large thread groups.
  • Preserve and correctly adjust virtual lag for the currently running entity when reweighting under CONFIG_SCHED_BORE to maintain proper deadlines.

Enhancements:

  • Strengthen child-counting and descendant traversal in BORE scheduling logic by using READ_ONCE and null-safe list helpers.
  • Bump SCHED_BORE version identifier from 6.6.2 to 6.6.3.

opsiff and others added 2 commits April 16, 2026 10:21
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
@sourcery-ai
Copy link
Copy Markdown

sourcery-ai bot commented Apr 16, 2026

Reviewer's Guide

Updates the BORE scheduler integration to version 6.6.3, tightening child/descendant traversal to be RCU-safe and bounded by a scan limit, and adjusting CFS entity reweighting to correctly preserve and restore vlag/vruntime when BORE is enabled.

Flow diagram for RCU-safe descendant traversal in inherit_from_ancestor_hub

flowchart TD
  A_start["Start inherit_from_ancestor_hub for_each_child"] --> B_init["scan_count = 0"]
  B_init --> C_loop_start{"Next direct_child?"}

  C_loop_start -- "No" --> Z_end["Return count"]
  C_loop_start -- "Yes" --> D_limits

  D_limits{"Count/scan limits reached?"} -->|"count >= BURST_CACHE_SAMPLE_LIMIT"| Z_end
  D_limits -->|"scan_count++ >= BURST_CACHE_SCAN_LIMIT"| Z_end
  D_limits -->|"Within limits"| E_set_desc

  E_set_desc["descendant = direct_child"] --> F_desc_loop{"count_children_upto2(descendant) == 1"}

  F_desc_loop -- "No" --> G_check_eligible
  F_desc_loop -- "Yes" --> H_next_desc

  H_next_desc["next_descendant = list_first_or_null_rcu(descendant->children)"] --> I_next_null{"next_descendant is NULL?"}
  I_next_null -- "Yes" --> G_check_eligible
  I_next_null -- "No" --> J_update_desc["descendant = next_descendant"] --> F_desc_loop

  G_check_eligible{"task_is_bore_eligible(descendant)?"} -->|"No"| C_loop_start
  G_check_eligible -->|"Yes"| K_inc_count["count++"] --> C_loop_start

  Z_end --> A_done["End inherit_from_ancestor_hub"]
Loading

File-Level Changes

Change Details Files
Harden BORE child/descendant traversal to be RCU-safe and avoid invalid list access.
  • Refactor count_children_upto2 to READ_ONCE() the first and second child list pointers instead of dereferencing next directly.
  • Change descendant walking loop to use list_first_or_null_rcu when following children and break out if no next descendant is found.
  • Add a scan_count limit to the descendant traversal loop by reusing BURST_CACHE_SCAN_LIMIT to avoid unbounded walks.
kernel/sched/bore.c
Bound BORE thread-group burst cache sampling by a scan limit.
  • Introduce scan_count in inherit_from_thread_group to cap the number of scanned threads using BURST_CACHE_SCAN_LIMIT.
  • Short-circuit the thread iteration when either the sample or scan limit is reached.
kernel/sched/bore.c
Adjust reweight_entity behavior under CONFIG_SCHED_BORE to preserve vlag/vruntime for the current entity instead of re-placing it.
  • Capture se->vlag before reweighting when the entity is on the runqueue and BORE is enabled.
  • For the current entity, restore vruntime based on the saved vlag and avoid calling place_entity, updating deadline only if it was relative.
  • Keep existing place_entity path for non-current entities or when BORE is disabled.
kernel/sched/fair.c
Bump the exposed BORE scheduler version string to 6.6.3.
  • Update SCHED_BORE_VERSION macro from 6.6.2 to 6.6.3.
include/linux/sched/bore.h

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

@deepin-ci-robot deepin-ci-robot requested review from BLumia and myml April 16, 2026 05:35
@deepin-ci-robot
Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from opsiff. For more information see the Code Review Process.

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

Copy link
Copy Markdown

@sourcery-ai sourcery-ai bot left a comment

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:

  • The new use of list_first_or_null_rcu() in inherit_from_ancestor_hub() assumes an RCU read-side critical section; double-check that the full traversal (including the for_each_child macro and descendant loop) is always executed under rcu_read_lock(), or switch to a non-RCU list helper if that guarantee does not hold.
  • The CONFIG_SCHED_BORE ifdefs added to reweight_entity() significantly change the vruntime/deadline adjustment path for curr entities; it would be helpful to briefly justify in a comment why curr is treated specially here (restoring vlag_unscaled and bypassing place_entity) to make the interaction with protect_slice() and rel_deadline clearer for future readers.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The new use of list_first_or_null_rcu() in inherit_from_ancestor_hub() assumes an RCU read-side critical section; double-check that the full traversal (including the for_each_child macro and descendant loop) is always executed under rcu_read_lock(), or switch to a non-RCU list helper if that guarantee does not hold.
- The CONFIG_SCHED_BORE ifdefs added to reweight_entity() significantly change the vruntime/deadline adjustment path for curr entities; it would be helpful to briefly justify in a comment why curr is treated specially here (restoring vlag_unscaled and bypassing place_entity) to make the interaction with protect_slice() and rel_deadline clearer for future readers.

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.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the BORE scheduler integration in the CFS/EEVDF codepaths while bumping the in-tree BORE version to 6.6.3, focusing on safer traversal/scan bounds and preserving scheduling invariants during reweighting.

Changes:

  • Adjust reweight_entity() under CONFIG_SCHED_BORE to preserve/compensate virtual lag for the currently running entity.
  • Harden BORE burst-cache traversal by using READ_ONCE() and list_first_or_null_rcu(), and add a scan limit for large thread groups.
  • Bump SCHED_BORE_VERSION from 6.6.2 to 6.6.3.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
kernel/sched/fair.c Updates CFS entity reweighting to preserve current entity timing/lag properties under BORE.
kernel/sched/bore.c Makes descendant traversal null-safe and limits scanning in burst-cache inheritance logic.
include/linux/sched/bore.h Bumps the reported BORE version string to 6.6.3.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread kernel/sched/fair.c
Comment on lines +3883 to +3885
#ifdef CONFIG_SCHED_BORE
s64 vlag_unscaled = 0;
#endif /* !CONFIG_SCHED_BORE */
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

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

The #endif comment says "!CONFIG_SCHED_BORE" but the corresponding conditional is "#ifdef CONFIG_SCHED_BORE". Please update the trailing comment to match the actual condition to avoid confusion during future maintenance (and keep it consistent with kernel style expectations).

Copilot uses AI. Check for mistakes.
Comment thread kernel/sched/fair.c
Comment on lines +3929 to 3939
#ifdef CONFIG_SCHED_BORE
if (curr) {
se->vruntime += vlag_unscaled - se->vlag;
if (se->rel_deadline) {
se->deadline += se->vruntime;
se->rel_deadline = 0;
}
}
else
#endif /* !CONFIG_SCHED_BORE */
place_entity(cfs_rq, se, 0);
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

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

Same issue here: the trailing #endif comment says "!CONFIG_SCHED_BORE" even though the block is guarded by "#ifdef CONFIG_SCHED_BORE". Please correct the comment to match the conditional for clarity.

Copilot uses AI. Check for mistakes.
Comment thread kernel/sched/fair.c
Comment on lines +3891 to +3893
#ifdef CONFIG_SCHED_BORE
vlag_unscaled = se->vlag;
#endif /* !CONFIG_SCHED_BORE */
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

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

The trailing #endif comment here also uses "!CONFIG_SCHED_BORE" while closing an "#ifdef CONFIG_SCHED_BORE" block. Please fix the comment to avoid misleading readers.

Copilot uses AI. Check for mistakes.
@opsiff opsiff changed the title [Deepin-Kernel-SIG] [linux 6.18-y] [BORE] linux6.18.18-bore-6.6.2 [Deepin-Kernel-SIG] [linux 6.18-y] [BORE] linux6.18.22-bore-6.6.3 Apr 16, 2026
@opsiff
Copy link
Copy Markdown
Member Author

opsiff commented Apr 16, 2026

/test-ok

@opsiff opsiff merged commit 4ed4cc0 into deepin-community:linux-6.18.y Apr 17, 2026
14 of 16 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.

4 participants