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]
Date:	Tue, 29 Sep 2015 12:40:22 -0400
From:	Linus Torvalds <torvalds@...ux-foundation.org>
To:	Peter Zijlstra <peterz@...radead.org>
Cc:	Ingo Molnar <mingo@...nel.org>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Thomas Gleixner <tglx@...utronix.de>,
	Manfred Spraul <manfred@...orfullife.com>,
	Oleg Nesterov <oleg@...hat.com>,
	Will Deacon <will.deacon@....com>
Subject: Re: [RFC][PATCH] sched: Fix TASK_DEAD race in finish_task_switch()

On Tue, Sep 29, 2015 at 8:45 AM, Peter Zijlstra <peterz@...radead.org> wrote:
>
> +        *
> +        * Pairs with the control dependency and rmb in try_to_wake_up().
>          */

So this comment makes me nervous. A control dependency doesn't
actually do anything on powerpc and ARM (or alpha, or MIPS, or any
number of other architectures. Basically, a conditional branch ends up
not being the usual kind of data dependency (which works on everything
but alpha), because conditional branches are predicted and loads after
them are speculated.

Also, using smp_store_release() instead of a wmb() is going to be very
expensive on old ARM and a number of other not-so-great architectures.
On x86, both end up being just a scheduling thing. On other modern
architectures, store releases are fairly cheap, but wmb() is cheap
too.

So long-term, the wmb->store_release conversion probably makes sense,
but it's at least debatable for now.

The one advantage that release/acquire do have is that particularly
when they pair up, they have much nicer semantics (ie you get the same
ordering guarantees as if you had a lock). But if they don't pair up,
there are actually some advantages to smp_wmb() over the alternatives.

               Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists