lkml.org 
[lkml]   [2017]   [Feb]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] sched: Update unlikely to now likely in sched_move_task()
On Fri, Feb 03, 2017 at 03:30:19PM -0500, Steven Rostedt (VMware) wrote:
> diff --git a/kernel/sched/core.c b/kernel/sched/core.c
> index c56fb57..669f23d 100644
> --- a/kernel/sched/core.c
> +++ b/kernel/sched/core.c
> @@ -7989,14 +7989,14 @@ void sched_move_task(struct task_struct *tsk)
>
> if (queued)
> dequeue_task(rq, tsk, DEQUEUE_SAVE | DEQUEUE_MOVE);
> - if (unlikely(running))
> + if (likely(running))
> put_prev_task(rq, tsk);
>
> sched_change_group(tsk, TASK_MOVE_GROUP);
>
> if (queued)
> enqueue_task(rq, tsk, ENQUEUE_RESTORE | ENQUEUE_MOVE);
> - if (unlikely(running))
> + if (likely(running))
> set_curr_task(rq, tsk);
>
> task_rq_unlock(rq, tsk, &rf);


I prefer to simply remove the hint entirely and match all the other
instances of this pattern.

Now if only C wouldn't stink and have a sensible way to express this
pattern without having to copy/paste it all over :/

\
 
 \ /
  Last update: 2017-02-04 12:07    [W:0.078 / U:0.316 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site