[GHC] #7923: Optimization for takeMVar/putMVar when MVar left empty

#7923: Optimization for takeMVar/putMVar when MVar left empty ------------------------------------+--------------------------------------- Reporter: ezyang | Owner: ezyang Type: task | Status: new Priority: normal | Component: Runtime System Version: 7.7 | Keywords: Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: Runtime performance bug | Blockedby: Blocking: | Related: ------------------------------------+--------------------------------------- Right now, we always add an MVar to the mutable list when we takeMVar/putMVar. However, this is unnecessary when the MVar is left empty. This patch arranges that we don't add the MVar to the mutable list in those cases. I've validated the patch but haven't checked performance changes yet. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7923 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7923: Optimization for takeMVar/putMVar when MVar left empty ---------------------------------+------------------------------------------ Reporter: ezyang | Owner: ezyang Type: task | Status: patch Priority: normal | Milestone: Component: Runtime System | Version: 7.7 Keywords: | Os: Unknown/Multiple Architecture: Unknown/Multiple | Failure: Runtime performance bug Difficulty: Unknown | Testcase: Blockedby: | Blocking: Related: | ---------------------------------+------------------------------------------ Changes (by igloo): * status: new => patch * difficulty: => Unknown -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7923#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7923: Optimization for takeMVar/putMVar when MVar left empty ---------------------------------+------------------------------------------ Reporter: ezyang | Owner: ezyang Type: task | Status: patch Priority: normal | Milestone: Component: Runtime System | Version: 7.7 Keywords: | Os: Unknown/Multiple Architecture: Unknown/Multiple | Failure: Runtime performance bug Difficulty: Unknown | Testcase: Blockedby: | Blocking: Related: | ---------------------------------+------------------------------------------ Comment(by igloo): Shouldn't this hunk: {{{ - unlockClosure(mvar, stg_MVAR_DIRTY_info); + unlockClosure(mvar, info); + // escape without dirty_MVar! }}} use `stg_MVAR_CLEAN_info` instead of `info`? And likewise in `stg_tryTakeMVarzh`. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7923#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7923: Optimization for takeMVar/putMVar when MVar left empty ---------------------------------+------------------------------------------ Reporter: ezyang | Owner: ezyang Type: task | Status: patch Priority: normal | Milestone: Component: Runtime System | Version: 7.7 Keywords: | Os: Unknown/Multiple Architecture: Unknown/Multiple | Failure: Runtime performance bug Difficulty: Unknown | Testcase: Blockedby: | Blocking: Related: | ---------------------------------+------------------------------------------ Comment(by igloo): ezyang pointed out that it'll be on a mutable list, so it's not as simple as just marking it clean here. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7923#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7923: Optimization for takeMVar/putMVar when MVar left empty
---------------------------------+------------------------------------------
Reporter: ezyang | Owner: ezyang
Type: task | Status: patch
Priority: normal | Milestone:
Component: Runtime System | Version: 7.7
Keywords: | Os: Unknown/Multiple
Architecture: Unknown/Multiple | Failure: Runtime performance bug
Difficulty: Unknown | Testcase:
Blockedby: | Blocking:
Related: |
---------------------------------+------------------------------------------
Comment(by ian@…):
commit 5d9e686c30a00be08a04d9fd1c860994153a1f7a
{{{
Author: Ian Lynagh

#7923: Optimization for takeMVar/putMVar when MVar left empty --------------------------------------+------------------------------------- Reporter: ezyang | Owner: ezyang Type: task | Status: closed Priority: normal | Milestone: Component: Runtime System | Version: 7.7 Resolution: fixed | Keywords: Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: Runtime performance bug | Difficulty: Unknown Testcase: | Blockedby: Blocking: | Related: --------------------------------------+------------------------------------- Changes (by igloo): * status: patch => closed * resolution: => fixed Comment: Applied, thanks! -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7923#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (2)
-
GHC
-
GHC