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] [day] [month] [year] [list]
Date:	Wed, 31 Oct 2007 18:10:20 -0400
From:	Phillip Susi <psusi@....rr.com>
To:	Nick Piggin <nickpiggin@...oo.com.au>
CC:	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	"Kleen, Andi" <ak@...e.de>
Subject: Re: Is gcc thread-unsafe?

>             pushl   %ebp
>             movl    %esp, %ebp
>             cmpl    $0, 8(%ebp)
>             movl    $1, %eax
>             cmove   v, %eax        ; load (maybe)
>             movl    %eax, v        ; store (always)
>             popl    %ebp
>             ret

How is this even an optimization?  It looks SLOWER to me.  The 
conditional read wastes memory bandwidth sometimes, if the condition is 
true, and v isn't already in the cache.  The unconditional write wastes 
memory bandwidth ALL the time, and dirties/flushes caches, in addition 
to not being thread safe.

This SHOULD be using a conditional write instead of a conditional read 
and an unconditional write.


-
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ