[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAKfTPtBs28LqUL908U7=ae82+mAV7ba1bj1Kt9PnizdLTo3EwA@mail.gmail.com>
Date: Fri, 21 Dec 2012 09:53:48 +0100
From: Vincent Guittot <vincent.guittot@...aro.org>
To: Namhyung Kim <namhyung@...nel.org>
Cc: Alex Shi <alex.shi@...el.com>, len.brown@...el.com,
tony.luck@...el.com, linux@....linux.org.uk, peterz@...radead.org,
arjan@...ux.intel.com, linux-kernel@...r.kernel.org,
cmetcalf@...era.com, viresh.kumar@...aro.org,
preeti@...ux.vnet.ibm.com, linaro-dev@...ts.linaro.org,
tglx@...utronix.de, chander.kashyap@...aro.org, pjt@...gle.com,
mingo@...nel.org, linux-arm-kernel@...ts.infradead.org
Subject: Re: [RFC PATCH v2 3/6] sched: pack small tasks
On 21 December 2012 06:47, Namhyung Kim <namhyung@...nel.org> wrote:
> Hi Vincent,
>
> On Thu, Dec 13, 2012 at 11:11:11AM +0100, Vincent Guittot wrote:
>> On 13 December 2012 03:17, Alex Shi <alex.shi@...el.com> wrote:
>> > On 12/12/2012 09:31 PM, Vincent Guittot wrote:
>> >> +static bool is_buddy_busy(int cpu)
>> >> +{
>> >> + struct rq *rq = cpu_rq(cpu);
>> >> +
>> >> + /*
>> >> + * A busy buddy is a CPU with a high load or a small load with a lot of
>> >> + * running tasks.
>> >> + */
>> >> + return ((rq->avg.runnable_avg_sum << rq->nr_running) >
>> >
>> > If nr_running a bit big, rq->avg.runnable_avg_sum << rq->nr_running is
>> > zero. you will get the wrong decision.
>>
>> yes, I'm going to do that like below instead:
>> return (rq->avg.runnable_avg_sum > (rq->avg.runnable_avg_period >>
>> rq->nr_running));
>
> Doesn't it consider nr_running too much? It seems current is_buddy_busy
> returns false on a cpu that has 1 task runs 40% cputime, but returns true
> on a cpu that has 3 tasks runs 10% cputime each or for 2 tasks of 15%
> cputime each, right?
Yes it's right.
>
> I don't know what is correct, but just guessing that in a cpu's point
> of view it'd be busier if it has a higher runnable_avg_sum than a
> higher nr_running IMHO.
The nr_running is used to point out how many tasks are running
simultaneously and the potential scheduling latency of adding
>
>
>>
>> >
>> >> + rq->avg.runnable_avg_period);
>> >> +}
>> >> +
>> >> +static bool is_light_task(struct task_struct *p)
>> >> +{
>> >> + /* A light task runs less than 25% in average */
>> >> + return ((p->se.avg.runnable_avg_sum << 1) <
>> >> + p->se.avg.runnable_avg_period);
>> >
>> > 25% may not suitable for big machine.
>>
>> Threshold is always an issue, which threshold should be suitable for
>> big machine ?
>>
>> I'm wondering if i should use the imbalance_pct value for computing
>> the threshold
>
> Anyway, I wonder how 'sum << 1' computes 25%. Shouldn't it be << 2 ?
The 1st version of the patch was using << 2 but I received a comment
saying that it was may be not enough aggressive so I have updated the
formula with << 1 but forgot to update the comment. I will align
comment and formula in the next version.
Thanks for pointing this
Vincent
>
> Thanks,
> Namhyung
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists