[GHC] #8724: CAS and Xchange in SMP.h don't use quadword instructions on x86_64 systems

#8724: CAS and Xchange in SMP.h don't use quadword instructions on x86_64 systems ----------------------------------+------------------------------------- Reporter: carter | Owner: Type: bug | Status: new Priority: highest | Milestone: 7.8.1 Component: Compiler | Version: 7.8.1-rc1 Keywords: | Operating System: Unknown/Multiple Architecture: x86_64 (amd64) | Type of failure: None/Unknown Difficulty: Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | ----------------------------------+------------------------------------- Ryan Newton pointed out on the mailing list that CAS wasn't behaving correctly in his heavy concurrency benchmarks. http://www.haskell.org/pipermail/ghc-devs/2014-February/003944.html upon looking at the inline ASM, it looks like both CAS and Xchng were probably using the 32bit versions of their asm operations, or at least thats my strawman interpretation. https://github.com/cartazio/ghc/compare/ghc:ghc-7.8...fix_64bit_intel_cas is the patch, which should be tested and confirmed to resolve this issue before getting merged in. This patch makes the 64 bit versions of CAS and xchg use the quad word instructions -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8724 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8724: unexpected CAS failures -------------------------------------+---------------------------------- Reporter: carter | Owner: Type: bug | Status: new Priority: normal | Milestone: 7.8.1 Component: Compiler | Version: 7.8.1-rc1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: x86_64 (amd64) Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+---------------------------------- Changes (by carter): * priority: highest => normal Comment: ok, looking at example gcc code, it appears that this patch doesn't change the code generated, so the bug understanding is still afoot. Also remains to be seen to understand the bug more -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8724#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8724: unexpected CAS failures -------------------------------------+---------------------------------- Reporter: carter | Owner: Type: bug | Status: patch Priority: normal | Milestone: 7.8.1 Component: Compiler | Version: 7.8.1-rc1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: x86_64 (amd64) Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+---------------------------------- Changes (by carter): * status: new => patch Comment: ok so my original reason for my exploratory patching in https://github.com/cartazio/ghc/compare/ghc:ghc-7.8...fix_64bit_intel_cas seems to be wrong, but there is a use of unsigned in where it should be StgWord -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8724#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8724: x86_64 cas references unsigned int rather than StgWord -------------------------------------+---------------------------------- Reporter: carter | Owner: Type: bug | Status: patch Priority: normal | Milestone: 7.8.1 Component: Compiler | Version: 7.8.1-rc1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: x86_64 (amd64) Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+---------------------------------- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8724#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8724: x86_64 cas references unsigned int rather than StgWord -------------------------------------+---------------------------------- Reporter: carter | Owner: Type: bug | Status: closed Priority: normal | Milestone: 7.8.1 Component: Compiler | Version: 7.8.1-rc1 Resolution: invalid | Keywords: Operating System: Unknown/Multiple | Architecture: x86_64 (amd64) Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+---------------------------------- Changes (by carter): * status: patch => closed * resolution: => invalid Comment: hrm, looks like ryan's bugs may have been bad cpp (and i can't reproduce the bugs in 7.8 too) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8724#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC