Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1573653

Re: [PATCH] sched: Update unlikely to now likely in sched_move_task()

From Peter Zijlstra <peterz@infradead.org>
Newsgroups linux.kernel
Subject Re: [PATCH] sched: Update unlikely to now likely in sched_move_task()
Date 2017-02-04 12:10 +0100
Message-ID <t76oa-82L-9@gated-at.bofh.it> (permalink)
References <t6SOe-6J7-19@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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 :/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] sched: Update unlikely to now likely in sched_move_task() "Steven Rostedt (VMware)" <rostedt@goodmis.org> - 2017-02-03 21:40 +0100
  Re: [PATCH] sched: Update unlikely to now likely in sched_move_task() Peter Zijlstra <peterz@infradead.org> - 2017-02-04 12:10 +0100
    Re: [PATCH] sched: Update unlikely to now likely in  sched_move_task() Steven Rostedt <rostedt@goodmis.org> - 2017-02-04 20:30 +0100

csiph-web