[GHC] #15555: Finish separating the stable name and stable pointer tables

#15555: Finish separating the stable name and stable pointer tables -------------------------------------+------------------------------------- Reporter: dfeuer | Owner: (none) Type: task | Status: new Priority: normal | Milestone: 8.8.1 Component: Runtime | Version: 8.4.3 System | Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- The stable name table and stable pointer table are both implemented in `rts/Stable.c`, with their code interleaved. As far as I can tell, they basically don't share ''anything''—or at least anything that they actually ''should''. They ''do'' share a mutex, which smells like a terrible idea. Doesn't that just introduce contention between `StableName` and `StablePtr` operations in different threads? They also share an initialization function, `initStableTables`, that appears to allocate both a stable name table and a stable pointer table as soon as either of them is needed. Unless I'm missing something, there's no point whatsoever in doing that. So I think we should actually divide `Stable.c` into `StableName.c` and `StablePtr.c` and give each its own mutex. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15555 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15555: Finish separating the stable name and stable pointer tables -------------------------------------+------------------------------------- Reporter: dfeuer | Owner: (none) Type: task | Status: new Priority: normal | Milestone: 8.8.1 Component: Runtime System | Version: 8.4.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by dfeuer): One question: we currently expose `hs_lock_stable_tables` and `hs_unlock_stable_tables` from `includes/HsFFI.h`. As far as I can tell, these aren't documented in the user's guide, and aren't used as FFI imports in any packages that ship with GHC. Are these exposed intentionally? If so, they should be documented (and I'll have to implement versions that lock both the stable name table and the stable pointer table). Otherwise, I'd like to be rid of them. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15555#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15555: Finish separating the stable name and stable pointer tables -------------------------------------+------------------------------------- Reporter: dfeuer | Owner: (none) Type: task | Status: new Priority: normal | Milestone: 8.8.1 Component: Runtime System | Version: 8.4.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Description changed by dfeuer: Old description:
The stable name table and stable pointer table are both implemented in `rts/Stable.c`, with their code interleaved. As far as I can tell, they basically don't share ''anything''—or at least anything that they actually ''should''. They ''do'' share a mutex, which smells like a terrible idea. Doesn't that just introduce contention between `StableName` and `StablePtr` operations in different threads? They also share an initialization function, `initStableTables`, that appears to allocate both a stable name table and a stable pointer table as soon as either of them is needed. Unless I'm missing something, there's no point whatsoever in doing that. So I think we should actually divide `Stable.c` into `StableName.c` and `StablePtr.c` and give each its own mutex.
New description: The stable name table and stable pointer table are both implemented in `rts/Stable.c`, with their code interleaved. Presumably this is for historical reasons; they were once one table, and they were split for performance reasons (see #7674). As far as I can tell, they basically don't share ''anything''—or at least anything that they actually ''should''. They ''do'' share a mutex, which smells like a terrible idea. Doesn't that just introduce contention between `StableName` and `StablePtr` operations in different threads? They also share an initialization function, `initStableTables`, that appears to allocate both a stable name table and a stable pointer table as soon as either of them is needed. Unless I'm missing something, there's no point whatsoever in doing that. So I think we should actually divide `Stable.c` into `StableName.c` and `StablePtr.c` and give each its own mutex. -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15555#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15555: Finish separating the stable name and stable pointer tables -------------------------------------+------------------------------------- Reporter: dfeuer | Owner: (none) Type: task | Status: patch Priority: normal | Milestone: 8.8.1 Component: Runtime System | Version: 8.4.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5084 Wiki Page: | -------------------------------------+------------------------------------- Changes (by dfeuer): * status: new => patch * differential: => Phab:D5084 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15555#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15555: Finish separating the stable name and stable pointer tables -------------------------------------+------------------------------------- Reporter: dfeuer | Owner: (none) Type: task | Status: patch Priority: normal | Milestone: 8.8.1 Component: Runtime System | Version: 8.4.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #7674 | Differential Rev(s): Phab:D5084 Wiki Page: | -------------------------------------+------------------------------------- Changes (by dfeuer): * related: => #7674 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15555#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15555: Finish separating the stable name and stable pointer tables -------------------------------------+------------------------------------- Reporter: dfeuer | Owner: (none) Type: task | Status: patch Priority: normal | Milestone: 8.8.1 Component: Runtime System | Version: 8.4.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #7674 | Differential Rev(s): Phab:D5084 Wiki Page: | -------------------------------------+------------------------------------- Changes (by osa1): * cc: osa1 (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15555#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15555: Finish separating the stable name and stable pointer tables
-------------------------------------+-------------------------------------
Reporter: dfeuer | Owner: (none)
Type: task | Status: patch
Priority: normal | Milestone: 8.8.1
Component: Runtime System | Version: 8.4.3
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: #7674 | Differential Rev(s): Phab:D5084
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by David Feuer

#15555: Finish separating the stable name and stable pointer tables -------------------------------------+------------------------------------- Reporter: dfeuer | Owner: (none) Type: task | Status: closed Priority: normal | Milestone: 8.8.1 Component: Runtime System | Version: 8.4.3 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #7674 | Differential Rev(s): Phab:D5084 Wiki Page: | -------------------------------------+------------------------------------- Changes (by dfeuer): * status: patch => closed * resolution: => fixed -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15555#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC