mirror of
https://github.com/torvalds/linux.git
synced 2026-07-31 19:47:08 +02:00
sched: walt: Remove finding historical runtimes in pred
When determining predictive demand, we currently look at the history samples in our past 8 windows that fall under the bucket range for which we are evaluating. However, this level of precision is not required, and can be dropped in favor of reduction of overheads. Change-Id: Icef5d23b1574c625ef1a6d6228603d2b18aa8a40 Signed-off-by: Shaleen Agrawal <quic_shalagra@quicinc.com>
This commit is contained in:
parent
4be9ca4e32
commit
ef3ba55b55
|
|
@ -1188,9 +1188,7 @@ static inline int busy_to_bucket(u32 normalized_rt)
|
|||
* A new predicted busy time is returned for task @p based on @runtime
|
||||
* passed in. The function searches through buckets that represent busy
|
||||
* time equal to or bigger than @runtime and attempts to find the bucket
|
||||
* to use for prediction. Once found, it searches through historical busy
|
||||
* time and returns the latest that falls into the bucket. If no such busy
|
||||
* time exists, it returns the medium of that bucket.
|
||||
* to use for prediction. Once found, it returns the midpoint of that bucket.
|
||||
*/
|
||||
static u32 get_pred_busy(struct task_struct *p,
|
||||
int start, u32 runtime)
|
||||
|
|
@ -1198,7 +1196,6 @@ static u32 get_pred_busy(struct task_struct *p,
|
|||
int i;
|
||||
struct walt_task_struct *wts = (struct walt_task_struct *) p->android_vendor_data1;
|
||||
u8 *buckets = wts->busy_buckets;
|
||||
u32 *hist = wts->sum_history;
|
||||
u32 dmin, dmax;
|
||||
u64 cur_freq_runtime = 0;
|
||||
int first = NUM_BUSY_BUCKETS, final;
|
||||
|
|
@ -1232,24 +1229,11 @@ static u32 get_pred_busy(struct task_struct *p,
|
|||
}
|
||||
dmax = mult_frac(final + 1, max_task_load(), NUM_BUSY_BUCKETS);
|
||||
|
||||
/*
|
||||
* search through runtime history and return first runtime that falls
|
||||
* into the range of predicted bucket.
|
||||
*/
|
||||
for (i = 0; i < sched_ravg_hist_size; i++) {
|
||||
if (hist[i] >= dmin && hist[i] < dmax) {
|
||||
ret = hist[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
/* no historical runtime within bucket found, use average of the bin */
|
||||
if (ret < dmin)
|
||||
ret = (dmin + dmax) / 2;
|
||||
/*
|
||||
* when updating in middle of a window, runtime could be higher
|
||||
* than all recorded history. Always predict at least runtime.
|
||||
*/
|
||||
ret = max(runtime, ret);
|
||||
ret = max(runtime, (dmin + dmax) / 2);
|
||||
out:
|
||||
trace_sched_update_pred_demand(p, runtime,
|
||||
mult_frac((unsigned int)cur_freq_runtime, 100,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user