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-next>] [day] [month] [year] [list]
Message-ID: <CAPDArR+9Kd+Rzgxj9FgQR0NCayZskXkq4bg3U-GRpCKFP5uC+Q@mail.gmail.com>
Date:	Fri, 28 Sep 2012 16:18:41 +0530
From:	Shantanu Gupta <shans95g@...il.com>
To:	linux-kernel@...r.kernel.org
Subject: xchg in fastpath for mutex unlock [mutex-xchg.h]

Hello,

I am currently studying mutex(es) and was referring to linux sources
for it's implementation. However I noticed one shortcoming, in
"/include/asm-generic/mutex-xchg.h" of the master branch inside
__mutex_fastpath_trylock, Why doesn't the kernel use a cmpxchg instead
of dirtying the value with xchg ?

(The only thing that came to my mind was that x86_x64 implementation
mentioned that all x86_x64 cpu(s) have cmpxchg leading me to
assumption that certain archs can have xchg but not cmpxchg, so is it
this way just to work with architectures without a cmpxchg but with
xchg ?)

Thanks,
Rick
--
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