Re: [PATCH 06/16] sched: SCHED_DEADLINE push and pull logic

From: Hillf Danton
Date: Fri Apr 06 2012 - 22:32:14 EST


On Sat, Apr 7, 2012 at 1:31 AM, Juri Lelli <juri.lelli@xxxxxxxxx> wrote:
>>>
>>> Âkernel/sched_dl.c | Â912
>>> Âkernel/sched_rt.c | Â Â2 +-

You are working on 2.6.3x, x <= 8 ?
If so, what is the reason(just curious)?
Already planned to add in 3.3 and above?

>>> + Â Â Â Â Â Â Â if (!dl_entity_preempt(&entry->dl,&p->dl))
>>
>> Â Â Â Â Â Â Â Âif (dl_entity_preempt(&p->dl,&entry->dl))
>>
>
> Any specific reason to reverse the condition?
>
Just for easing readers.

>>> +select_task_rq_dl(struct task_struct *p, int sd_flag, int flags)
>>> +{
>>> + Â Â Â struct task_struct *curr;
>>> + Â Â Â struct rq *rq;
>>> + Â Â Â int cpu;
>>> +
>>> + Â Â Â if (sd_flag != SD_BALANCE_WAKE)
>>
>> Â Â Â Â Â Â Â Âwhy is task_cpu(p) not eligible?
>>
>
> Right, I'll change this.
>
No, you will first IMO sort out clear answer to the question.

>>> + Â Â Â Â Â (rq->curr->dl.nr_cpus_allowed< Â2 ||
>>> + Â Â Â Â Â Âdl_entity_preempt(&rq->curr->dl,&p->dl))&&
>>
>> Â Â Â Â Â Â Â Â!dl_entity_preempt(&p->dl,&rq->curr->dl))&&
>
> As above?
>
Just for easing reader.

>>> +#ifdef CONFIG_SMP
>>> + Â Â Â /*
>>> + Â Â Â Â* In the unlikely case current and p have the same deadline
>>> + Â Â Â Â* let us try to decide what's the best thing to do...
>>> + Â Â Â Â*/
>>> + Â Â Â if ((s64)(p->dl.deadline - rq->curr->dl.deadline) == 0&&
>>> + Â Â Â Â Â !need_resched())
>>
>> please recheck !need_resched(), say rq->curr need reschedule?
>
> Sorry, I don't get this..
>
Perhaps smp_processor_id() != rq->cpu

>>
>> Â Â Â Âif (task_running(rq, p))
>> Â Â Â Â Â Â Â Âreturn 0;
>> Â Â Â Âreturn cpumask_test_cpu(cpu, &p->cpus_allowed);
>
> We use this inside pull_dl_task. Since we are searching for a task to
> pull, you must be sure that the found task can actually migrate checking
> nr_cpus_allowed > 1.
>
If cpu is certainly allowed for task to run, but nr_cpus_allowed is no more
than one, which is corrupted?

>
> Well, ok with this and above. Anyway this code is completely removed in
> 15/16.
>
Yup, another reason for monolith.

>>> +
>>> +static DEFINE_PER_CPU(cpumask_var_t, local_cpu_mask_dl);
>>> +
>>> +static int find_later_rq(struct task_struct *task)
>>> +{
>>> + Â Â Â struct sched_domain *sd;
>>> + Â Â Â struct cpumask *later_mask = __get_cpu_var(local_cpu_mask_dl);
>>
>> Â Â Â Âplease check is local_cpu_mask_dl valid
>>
>
> Could you explain more why should I check for validity?
>
Only for the case that something comes in before it is initialized,
IIRC encountered by Steven.

>
> Ok, I'll prepare the monolithic patch and probably store it somewhere so
> that it can be downloaded also by others.
>
Info Hillf once it is ready, thanks.

Good Weekend
-hd
--
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/