-
Notifications
You must be signed in to change notification settings - Fork 107
[Deepin-Kernel-SIG] [linux 6.6-y] [Deepin] sched/fair: Disable newidle balance for KABI #1456
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: linux-6.6.y
Are you sure you want to change the base?
[Deepin-Kernel-SIG] [linux 6.6-y] [Deepin] sched/fair: Disable newidle balance for KABI #1456
Conversation
|
[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 |
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThis PR conditionally disables the proportional newidle balancing feature and its associated statistics when Deepin KABI reservation is enabled, to keep sched_domain’s layout stable for KABI while preserving existing behavior otherwise. Class diagram for sched_domain layout under CONFIG_DEEPIN_KABI_RESERVEclassDiagram
class SchedulerConfig {
<<config>>
+bool CONFIG_DEEPIN_KABI_RESERVE
}
class sched_domain_non_kabi {
+unsigned int nr_balance_failed
+unsigned int newidle_call
+unsigned int newidle_success
+unsigned int newidle_ratio
+u64 max_newidle_lb_cost
+unsigned long last_decay_max_lb_cost
}
class sched_domain_kabi_reserve {
+unsigned int nr_balance_failed
+u64 max_newidle_lb_cost
+unsigned long last_decay_max_lb_cost
}
SchedulerConfig --> sched_domain_non_kabi : CONFIG_DEEPIN_KABI_RESERVE = false
SchedulerConfig --> sched_domain_kabi_reserve : CONFIG_DEEPIN_KABI_RESERVE = true
Flow diagram for newidle balancing behavior with CONFIG_DEEPIN_KABI_RESERVEflowchart TD
A["CPU becomes newly idle"] --> B{CONFIG_DEEPIN_KABI_RESERVE}
B -- false --> C["update_newidle_stats increments newidle_call and newidle_success"]
C --> D{sched_feat NI_RANDOM}
D -- true --> E["Apply randomized weighting for newidle balancing"]
D -- false --> F["Use default weight for newidle balancing"]
E --> G["Call load_balance with CPU_NEWLY_IDLE"]
F --> G["Call load_balance with CPU_NEWLY_IDLE"]
B -- true --> H["Skip newidle_call/newidle_success/newidle_ratio updates"]
H --> I["NI_RANDOM feature disabled at compile time"]
I --> J["Call load_balance with CPU_NEWLY_IDLE using default behavior"]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
66b6ae2 to
50929f9
Compare
deepin inclusion category: kabi some kabi whitelist symbol changed, such as set_cpus_allowed_ptr..etc. the symbol chain is: int wake_up_process(struct task_struct *tsk);->struct task_struct ->struct sched_dl_entity dl,*dl_server; ->struct rq *rq; ->struct sched_domain __rcu *sd; -> +unsigned int newidle_call; +unsigned int newidle_success; +unsigned int newidle_ratio; Before find the way to solve it, disable it for CONFIG_DEEPIN_KABI_RESERVE. Log: change set_cpus_allowed_ptr change wake_up_process change set_user_nice Fixes: 97d5537 ("sched/fair: Proportional newidle balance") Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
50929f9 to
2f37b5e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR disables proportional newidle balancing to preserve kernel ABI stability for Deepin by guarding struct members and features with CONFIG_DEEPIN_KABI_RESERVE. The changes prevent ABI breakage in exported symbols like wake_up_process and set_cpus_allowed_ptr by conditionally removing three new fields (newidle_call, newidle_success, newidle_ratio) from struct sched_domain that were added by commit 97d5537.
Changes:
- Conditionally removes three newidle statistics fields from struct sched_domain
- Guards the NI_RANDOM scheduler feature flag to disable proportional balancing
- Protects all code paths that use the removed fields and feature
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| include/linux/sched/topology.h | Adds deepin_kabi.h include and guards newidle statistics fields in struct sched_domain with CONFIG_DEEPIN_KABI_RESERVE |
| kernel/sched/topology.c | Conditionally excludes initialization of newidle statistics fields in sd_init() |
| kernel/sched/features.h | Guards the NI_RANDOM feature flag definition |
| kernel/sched/fair.c | Guards update_newidle_stats() implementation and NI_RANDOM-based proportional balancing logic |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
This way of fixing is kind of gross... |
deepin inclusion
category: kabi
some kabi whitelist symbol changed, such as set_cpus_allowed_ptr..etc. the symbol chain is:
int wake_up_process(struct task_struct *tsk);->struct task_struct ->struct sched_dl_entity dl,*dl_server;
->struct rq *rq;
->struct sched_domain __rcu *sd;
->
+unsigned int newidle_call;
+unsigned int newidle_success;
+unsigned int newidle_ratio;
Before find the way to solve it, disable it for CONFIG_DEEPIN_KABI_RESERVE.
Log:
change set_cpus_allowed_ptr
change wake_up_process
change set_user_nice
Fixes: 97d5537 ("sched/fair: Proportional newidle balance")
Summary by Sourcery
Disable proportional newidle balancing when Deepin KABI reservation is enabled to preserve kernel ABI stability.
Enhancements:
Summary by Sourcery
Guard proportional newidle balancing and its statistics behind Deepin KABI reservation to avoid changing the sched_domain ABI layout.
Enhancements: