Re: [PATCH v4] sched/deadline: fix earliest_dl.next logic
From: Wanpeng Li
Date: Wed Dec 02 2015 - 06:49:50 EST
2015-12-02 19:33 GMT+08:00 Luca Abeni <luca.abeni@xxxxxxxx>:
> Hi,
>
> On 12/01/2015 01:10 PM, Wanpeng Li wrote:
>>
>> earliest_dl.next should cache deadline of the earliest ready task that
>> is also enqueued in the pushable rbtree, as pull algorithm uses this
>> information to find candidates for migration: if the earliest_dl.next
>> deadline of source rq is earlier than the earliest_dl.curr deadline of
>> destination rq, the task from the source rq can be pulled.
>>
>> However, current implementation only guarantees that earliest_dl.next is
>> the deadline of the next ready task instead of the next pushable task;
>> which will result in potentially holding both rqs' lock and find nothing
>> to migrate because of affinity constraints. In addition, current logic
>> doesn't update the next candidate for pushing in pick_next_task_dl(),
>> even if the running task is never eligible.
>>
>> This patch fixes both problems by updating earliest_dl.next when
>> pushable dl task is enqueued/dequeued, similar to what we already do for
>> RT.
>>
>> Signed-off-by: Wanpeng Li <wanpeng.li@xxxxxxxxxxx>
>
> I ran some tests with this patch, and I found no issues; so, you can add
> Tested-by: luca abeni <luca.abeni@xxxxxxxx>
>
> I just have one minor comment on the patch:
> [...]
>>
>> diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
>> index 8b0a15e..8ac17c7 100644
>> --- a/kernel/sched/deadline.c
>> +++ b/kernel/sched/deadline.c
>> @@ -87,6 +87,8 @@ void init_dl_rq(struct dl_rq *dl_rq)
>>
>> #ifdef CONFIG_SMP
>>
>> +static struct task_struct *pick_next_pushable_dl_task(struct rq *rq);
>> +
>
> I think with the new version of the patch the addition of these 2 lines
> becomes useless.
Thanks for your time, just send out v5. :-)
Regards,
Wanpeng Li
--
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/