/* NOTE: we use *nr_running to scale with load, this nicely matches the degrading latency on load.  */
static unsigned long adaptive_gran(struct sched_entity *curr, struct sched_entity *se)
/* NOTE: we use *nr_running to scale with load, this nicely matches the degrading latency on load.  */
static unsigned long adaptive_gran(struct sched_entity *curr, struct sched_entity *se)
{
	u64 this_run = curr->sum_exec_runtime - curr->prev_sum_exec_runtime;
	u64 expected_wakeup = 2*se->avg_wakeup * cfs_rq_of(se)->nr_running;
	u64 gran = 0;
	if (this_run < expected_wakeup)
		gran = expected_wakeup - this_run;
	return min_t(s64, gran, sysctl_sched_wakeup_granularity);
}