Skip to content

Commit 2f37b5e

Browse files
committed
sched/fair: Disable newidle balance for KABI
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 <[email protected]>
1 parent 0d3594d commit 2f37b5e

File tree

4 files changed

+12
-1
lines changed

4 files changed

+12
-1
lines changed

include/linux/sched/topology.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#include <linux/topology.h>
66

77
#include <linux/sched/idle.h>
8-
8+
#include <linux/deepin_kabi.h>
99
/*
1010
* sched-domains (multiprocessor balancing) declarations:
1111
*/
@@ -106,9 +106,12 @@ struct sched_domain {
106106
unsigned int nr_balance_failed; /* initialise to 0 */
107107

108108
/* idle_balance() stats */
109+
#ifndef CONFIG_DEEPIN_KABI_RESERVE
109110
unsigned int newidle_call;
110111
unsigned int newidle_success;
111112
unsigned int newidle_ratio;
113+
#endif /* !CONFIG_DEEPIN_KABI_RESERVE */
114+
112115
u64 max_newidle_lb_cost;
113116
unsigned long last_decay_max_lb_cost;
114117

kernel/sched/fair.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11923,6 +11923,7 @@ void update_max_interval(void)
1192311923

1192411924
static inline void update_newidle_stats(struct sched_domain *sd, unsigned int success)
1192511925
{
11926+
#ifndef CONFIG_DEEPIN_KABI_RESERVE
1192611927
sd->newidle_call++;
1192711928
sd->newidle_success += success;
1192811929

@@ -11931,6 +11932,7 @@ static inline void update_newidle_stats(struct sched_domain *sd, unsigned int su
1193111932
sd->newidle_call /= 2;
1193211933
sd->newidle_success /= 2;
1193311934
}
11935+
#endif /* !CONFIG_DEEPIN_KABI_RESERVE */
1193411936
}
1193511937

1193611938
static inline bool
@@ -12629,6 +12631,7 @@ static int sched_balance_newidle(struct rq *this_rq, struct rq_flags *rf)
1262912631
if (sd->flags & SD_BALANCE_NEWIDLE) {
1263012632
unsigned int weight = 1;
1263112633

12634+
#ifndef CONFIG_DEEPIN_KABI_RESERVE
1263212635
if (sched_feat(NI_RANDOM)) {
1263312636
/*
1263412637
* Throw a 1k sided dice; and only run
@@ -12643,6 +12646,7 @@ static int sched_balance_newidle(struct rq *this_rq, struct rq_flags *rf)
1264312646
}
1264412647
weight = (1024 + weight/2) / weight;
1264512648
}
12649+
#endif /* !CONFIG_DEEPIN_KABI_RESERVE */
1264612650

1264712651
pulled_task = load_balance(this_cpu, this_rq,
1264812652
sd, CPU_NEWLY_IDLE,

kernel/sched/features.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,11 @@ SCHED_FEAT(UTIL_EST, true)
122122

123123
SCHED_FEAT(LATENCY_WARN, false)
124124

125+
#ifndef CONFIG_DEEPIN_KABI_RESERVE
125126
/*
126127
* Do newidle balancing proportional to its success rate using randomization.
127128
*/
128129
SCHED_FEAT(NI_RANDOM, true)
130+
#endif /* !CONFIG_DEEPIN_KABI_RESERVE */
129131

130132
SCHED_FEAT(HZ_BW, true)

kernel/sched/topology.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1616,10 +1616,12 @@ sd_init(struct sched_domain_topology_level *tl,
16161616
.last_balance = jiffies,
16171617
.balance_interval = sd_weight,
16181618

1619+
#ifndef CONFIG_DEEPIN_KABI_RESERVE
16191620
/* 50% success rate */
16201621
.newidle_call = 512,
16211622
.newidle_success = 256,
16221623
.newidle_ratio = 512,
1624+
#endif /* !CONFIG_DEEPIN_KABI_RESERVE */
16231625

16241626
.max_newidle_lb_cost = 0,
16251627
.last_decay_max_lb_cost = jiffies,

0 commit comments

Comments
 (0)