lkml.org 
[lkml]   [2011]   [Jul]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: sched: fix/optimise some issues
From
Date
On Wed, 2011-07-20 at 15:42 +0200, Stephan Bärwolf wrote:
> "entity_key()" is only used in "__enqueue_entity()" and
> its only function is to subtract a tasks vruntime by
> its groups minvruntime.
> Before this patch a rbtree enqueue-decision is done by
> comparing two tasks in the style:
>
> "if (entity_key(cfs_rq, se) < entity_key(cfs_rq, entry))"
>
> which would be
>
> "if (se->vruntime-cfs_rq->min_vruntime < entry->vruntime-cfs_rq->min_vruntime)"
>
> or (if reducing cfs_rq->min_vruntime out)
>
> "if (se->vruntime < entry->vruntime)"
>
> which is
>
> "if (entity_before(se, entry))"
>
> So we do not need "entity_key()".
> If "entity_before()" is inline we will also save one subtraction (only one,
> because "entity_key(cfs_rq, se)" was cached in "key")

Indeed, thanks!
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2011-07-20 21:15    [W:0.072 / U:0.452 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site