[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170204110645.GE6515@twins.programming.kicks-ass.net>
Date: Sat, 4 Feb 2017 12:06:45 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: "Steven Rostedt (VMware)" <rostedt@...dmis.org>
Cc: LKML <linux-kernel@...r.kernel.org>,
Ingo Molnar <mingo@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Oleg Nesterov <oleg@...hat.com>,
Vincent Guittot <vincent.guittot@...aro.org>
Subject: Re: [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 :/
Powered by blists - more mailing lists