lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<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

Powered by Openwall GNU/*/Linux Powered by OpenVZ