mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Ingo Molnar <mingo@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Oleg Nesterov <oleg@redhat.com>,
	Vincent Guittot <vincent.guittot@linaro.org>
Subject: Re: [PATCH] sched: Update unlikely to now likely in sched_move_task()
Date: Sat, 4 Feb 2017 12:06:45 +0100	[thread overview]
Message-ID: <20170204110645.GE6515@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <20170203153019.49b5b979@gandalf.local.home>

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

  reply	other threads:[~2017-02-04 11:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-03 20:30 Steven Rostedt (VMware)
2017-02-04 11:06 ` Peter Zijlstra [this message]
2017-02-04 19:27   ` Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170204110645.GE6515@twins.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=oleg@redhat.com \
    --cc=rostedt@goodmis.org \
    --cc=vincent.guittot@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®