mirror of
https://github.com/torvalds/linux.git
synced 2026-07-30 19:21:28 +02:00
Revert "sched: Use bitshift over division"
This reverts commit bec4f0b0ebe82f2c99c519b424794c17ae2ff8b7. Change-Id: Ib7f02388dfcb5b263a636e261c4e43ee5f4f93b6 Signed-off-by: Shaleen Agrawal <quic_shalagra@quicinc.com>
This commit is contained in:
parent
492decfdc4
commit
181cb9d560
|
|
@ -38,13 +38,7 @@ enum task_boost_type {
|
|||
};
|
||||
|
||||
#define WALT_NR_CPUS 8
|
||||
/*
|
||||
* RAVG_HIST_SHIFT trick can only be used if RAVG_HIST_SIZE is a power of 2.
|
||||
*/
|
||||
#define RAVG_HIST_SIZE 8
|
||||
#define RAVG_HIST_SHIFT 3
|
||||
#define RAVG_HIST_MASK (RAVG_HIST_SIZE - 1)
|
||||
|
||||
/* wts->bucket_bitmask needs to be updated if NUM_BUSY_BUCKETS > 16 */
|
||||
#define NUM_BUSY_BUCKETS 16
|
||||
#define NUM_BUSY_BUCKETS_SHIFT 4
|
||||
|
|
|
|||
|
|
@ -2071,7 +2071,7 @@ static void update_history(struct rq *rq, struct task_struct *p,
|
|||
for (; samples > 0; samples--) {
|
||||
hist[wts->cidx] = runtime;
|
||||
hist_util[wts->cidx] = runtime_scaled;
|
||||
wts->cidx = ++(wts->cidx) & RAVG_HIST_MASK;
|
||||
wts->cidx = ++(wts->cidx) % RAVG_HIST_SIZE;
|
||||
}
|
||||
|
||||
for (i = 0; i < RAVG_HIST_SIZE; i++) {
|
||||
|
|
@ -2087,7 +2087,7 @@ static void update_history(struct rq *rq, struct task_struct *p,
|
|||
} else if (sysctl_sched_window_stats_policy == WINDOW_STATS_MAX) {
|
||||
demand = max;
|
||||
} else {
|
||||
avg = sum >> RAVG_HIST_SHIFT;
|
||||
avg = div64_u64(sum, RAVG_HIST_SIZE);
|
||||
if (sysctl_sched_window_stats_policy == WINDOW_STATS_AVG)
|
||||
demand = avg;
|
||||
else
|
||||
|
|
@ -2116,7 +2116,7 @@ static void update_history(struct rq *rq, struct task_struct *p,
|
|||
|
||||
wts->demand = demand;
|
||||
wts->demand_scaled = demand_scaled;
|
||||
wts->coloc_demand = sum >> RAVG_HIST_SHIFT;
|
||||
wts->coloc_demand = div64_u64(sum, RAVG_HIST_SIZE);
|
||||
wts->pred_demand_scaled = pred_demand_scaled;
|
||||
|
||||
if (demand_scaled > sysctl_sched_min_task_util_for_colocation)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user