[Git][ghc/ghc][wip/memory-barriers] 3 commits: Threads: Shuffle barrier

Ben Gamari gitlab at gitlab.haskell.org
Sat Jun 8 20:26:11 UTC 2019



Ben Gamari pushed to branch wip/memory-barriers at Glasgow Haskell Compiler / GHC


Commits:
42cf1ff8 by Ben Gamari at 2019-06-08T20:25:17Z
Threads: Shuffle barrier

It seems clearer if it's closer to its use site

- - - - -
c9f87556 by Ben Gamari at 2019-06-08T20:25:44Z
Evac: Drop redundant barrier in serial path

- - - - -
088044ba by Ben Gamari at 2019-06-08T20:26:05Z
Merge branch 'wip/memory-barriers' of gitlab.haskell.org:ghc/ghc into wip/memory-barriers

- - - - -


2 changed files:

- rts/Threads.c
- rts/sm/Evac.c


Changes:

=====================================
rts/Threads.c
=====================================
@@ -765,8 +765,6 @@ bool performTryPutMVar(Capability *cap, StgMVar *mvar, StgClosure *value)
 
     q = mvar->head;
 loop:
-    qinfo = q->header.info;
-    load_load_barrier();
     if (q == (StgMVarTSOQueue*)&stg_END_TSO_QUEUE_closure) {
         /* No further takes, the MVar is now full. */
         if (info == &stg_MVAR_CLEAN_info) {
@@ -777,6 +775,9 @@ loop:
         unlockClosure((StgClosure*)mvar, &stg_MVAR_DIRTY_info);
         return true;
     }
+
+    qinfo = q->header.info;
+    load_load_barrier();
     if (qinfo == &stg_IND_info ||
         qinfo == &stg_MSG_NULL_info) {
         q = (StgMVarTSOQueue*)((StgInd*)q)->indirectee;


=====================================
rts/sm/Evac.c
=====================================
@@ -130,12 +130,9 @@ copy_tag(StgClosure **p, const StgInfoTable *info,
         }
     }
 #else
-    // if somebody else reads the forwarding pointer, we better make
-    // sure there's a closure at the end of it.
-    write_barrier();
-    *p = TAG_CLOSURE(tag,(StgClosure*)to);
     src->header.info = (const StgInfoTable *)MK_FORWARDING_PTR(to);
-#endif
+    *p = TAG_CLOSURE(tag,(StgClosure*)to);
+#endif  /* defined(PARALLEL_GC) */
 
 #if defined(PROFILING)
     // We store the size of the just evacuated object in the LDV word so that



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/compare/37fb6754b2d9bbe752114f02f942cf8be990ef1f...088044baf5965f72331cee8fbd813e63f38905c6

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/compare/37fb6754b2d9bbe752114f02f942cf8be990ef1f...088044baf5965f72331cee8fbd813e63f38905c6
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20190608/95c80b21/attachment-0001.html>


More information about the ghc-commits mailing list