Re: [patch v6 13/21] sched: using avg_idle to detect bursty wakeup

From: Alex Shi
Date: Wed Apr 03 2013 - 01:41:37 EST


struct rq *rq = cpu_rq(i);
>> +
>> + if (burst && rq->nr_running > 1)
>> + /* use nr_running as instant utilization */
>> + sgs->group_util += rq->nr_running;
>
> I guess multiplying FULL_UTIL to rq->nr_running here will remove
> special-casing the burst in is_sd_full(). Also moving this logic to
> max_rq_util() looks better IMHO.

Yes, right! Thanks a lot!
>
>

>> + if (cpu_rq(cpu)->avg_idle < sysctl_sched_burst_threshold)
>> + burst = 1;
>
> Sorry, I don't understand this.
>
> Given that sysctl_sched_burst_threshold is twice of
> sysctl_sched_migration_cost which is max value of rq->avg_idle, the
> avg_idle will be almost always less than the threshold, right?

In fact, lots of time we have avg_idle at the max value. so won't always
have burst.
>
> So how does it find out the burst case? I thought it's the case of a
> cpu is in idle for a while and then wakes number of tasks at once.

Yes.
If
> so, shouldn't it check whether the avg_idle is *longer* than certain
> threshold? What am I missing?

avg_idle is smaller when many wakeup happens. update_avg() is not always
increase it.
>
> Thanks,
> Namhyung
>

--
Thanks Alex
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/