Re: [PATCH] sched: Remove WAKEUP_PREEMPT feature check in entity_tick

From: Yong Zhang
Date: Fri Jul 29 2011 - 02:24:54 EST


On Fri, Jul 29, 2011 at 2:21 PM, Yong Zhang <yong.zhang0@xxxxxxxxx> wrote:
> On Thu, Jul 28, 2011 at 05:43:23PM +0800, Lin Ming wrote:
>> Currently, entity_tick calls check_preempt_tick if WAKEUP_PREEMPT feature is
>> disabled. That's wrong. It should do that if the feature is enabled.
>
> Why is it wrong?
> check_preempt_wakeup() is used for wakeup.
>
>>
>> And actually the check is duplicate because check_preempt_tick will do
>> that. So just remove it from entity_tick.
>
> It's not exactly duplicated. entity_tick() will resched_task(*p)

s/entity_tick/check_preempt_tick

> if p's slice is over. So if there is an following wakeup(say X),
> then there is an opportunity for X to schedule quickly.
>
> Thanks,
> Yong
>
>>
>> Signed-off-by: Lin Ming <ming.m.lin@xxxxxxxxx>
>> ---
>> Âkernel/sched_fair.c | Â Â2 +-
>> Â1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c
>> index bc8ee99..af2fe9d 100644
>> --- a/kernel/sched_fair.c
>> +++ b/kernel/sched_fair.c
>> @@ -1233,7 +1233,7 @@ entity_tick(struct cfs_rq *cfs_rq, struct sched_entity *curr, int queued)
>> Â Â Â Â Â Â Â return;
>> Â#endif
>>
>> - Â Â if (cfs_rq->nr_running > 1 || !sched_feat(WAKEUP_PREEMPT))
>> + Â Â if (cfs_rq->nr_running > 1)
>> Â Â Â Â Â Â Â check_preempt_tick(cfs_rq, curr);
>> Â}
>>
>> --
>> 1.7.2.3
>>
>>
>>
>> --
>> 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/
>
> --
> Only stand for myself
>



--
Only stand for myself
--
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/