[Deepin-Kernel-SIG] [linux 6.18-y] [BORE] linux6.18.22-bore-6.6.3#1633
Conversation
This reverts commit 39c5dcb.
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
Reviewer's GuideUpdates 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_hubflowchart 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"]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 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 |
There was a problem hiding this comment.
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.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
There was a problem hiding this comment.
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()underCONFIG_SCHED_BOREto preserve/compensate virtual lag for the currently running entity. - Harden BORE burst-cache traversal by using
READ_ONCE()andlist_first_or_null_rcu(), and add a scan limit for large thread groups. - Bump
SCHED_BORE_VERSIONfrom 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.
| #ifdef CONFIG_SCHED_BORE | ||
| s64 vlag_unscaled = 0; | ||
| #endif /* !CONFIG_SCHED_BORE */ |
There was a problem hiding this comment.
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).
| #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); |
There was a problem hiding this comment.
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.
| #ifdef CONFIG_SCHED_BORE | ||
| vlag_unscaled = se->vlag; | ||
| #endif /* !CONFIG_SCHED_BORE */ |
There was a problem hiding this comment.
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.
|
/test-ok |
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:
Enhancements: