Re: [PATCH] sched: Add SCHED_BGND (background) scheduling policy

Peter Williams
2006-07-05T03:06:06Z

Con Kolivas wrote:
> some quick comments within code below.
>
> On Wednesday 05 July 2006 09:35, Peter Williams wrote:
>> @@ -761,8 +770,18 @@ static void set_load_weight(struct task_
>> else
>> #endif
>> p->load_weight = RTPRIO_TO_LOAD_WEIGHT(p->rt_priority);
>> - } else
>> - p->load_weight = PRIO_TO_LOAD_WEIGHT(p->static_prio);
>> + } else {
>> + /*
>> + * Reduce the probability of a task escaping the background
>> + * due to load balancing leaving it on a lighly used CPU
>> + * Can't use zero as that would kill load balancing when only
>> + * background tasks are running.
>> + */
>> + if (bgnd_task(p))
>> + p->load_weight = LOAD_WEIGHT(MIN_TIMESLICE / 2 ? : 1);
>
> Why not just set it to 1 for all idleprio tasks? The granularity will be lost
> at anything lower anyway and it avoids a more complex calculation.

I missed this one in my previous reply. I agree, what you say makes
sense. I was in my "think too hard" mode and probably thinking
(unnecessarily) about how it might effect the smoothed load calculations.

Peter
--
Peter Williams pwil3058@bigpond.net.au

"Learning, n. The kind of ignorance distinguishing the studious."
-- Ambrose Bierce