[Git][ghc/ghc][master] rts: Don't hint inlining of appendToRunQueue

Marge Bot (@marge-bot) gitlab at gitlab.haskell.org
Wed Oct 12 12:08:57 UTC 2022



Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
481467a5 by Ben Gamari at 2022-10-12T08:08:37-04:00
rts: Don't hint inlining of appendToRunQueue

These hints have resulted in compile-time warnings due to failed
inlinings for quite some time. Moreover, it's quite unlikely that
inlining them is all that beneficial given that they are rather sizeable
functions.

Resolves #22280.

- - - - -


2 changed files:

- rts/Schedule.c
- rts/Schedule.h


Changes:

=====================================
rts/Schedule.c
=====================================
@@ -2915,6 +2915,61 @@ deleteThread_(StgTSO *tso)
 }
 #endif
 
+/*
+ * Run queue manipulation
+ */
+
+void
+appendToRunQueue (Capability *cap, StgTSO *tso)
+{
+    ASSERT(tso->_link == END_TSO_QUEUE);
+    if (cap->run_queue_hd == END_TSO_QUEUE) {
+        cap->run_queue_hd = tso;
+        tso->block_info.prev = END_TSO_QUEUE;
+    } else {
+        setTSOLink(cap, cap->run_queue_tl, tso);
+        setTSOPrev(cap, tso, cap->run_queue_tl);
+    }
+    cap->run_queue_tl = tso;
+    cap->n_run_queue++;
+}
+
+void
+pushOnRunQueue (Capability *cap, StgTSO *tso)
+{
+    setTSOLink(cap, tso, cap->run_queue_hd);
+    tso->block_info.prev = END_TSO_QUEUE;
+    if (cap->run_queue_hd != END_TSO_QUEUE) {
+        setTSOPrev(cap, cap->run_queue_hd, tso);
+    }
+    cap->run_queue_hd = tso;
+    if (cap->run_queue_tl == END_TSO_QUEUE) {
+        cap->run_queue_tl = tso;
+    }
+    cap->n_run_queue++;
+}
+
+StgTSO *popRunQueue (Capability *cap)
+{
+    ASSERT(cap->n_run_queue > 0);
+    StgTSO *t = cap->run_queue_hd;
+    ASSERT(t != END_TSO_QUEUE);
+    cap->run_queue_hd = t->_link;
+
+    StgTSO *link = RELAXED_LOAD(&t->_link);
+    if (link != END_TSO_QUEUE) {
+        link->block_info.prev = END_TSO_QUEUE;
+    }
+    RELAXED_STORE(&t->_link, END_TSO_QUEUE); // no write barrier req'd
+
+    if (cap->run_queue_hd == END_TSO_QUEUE) {
+        cap->run_queue_tl = END_TSO_QUEUE;
+    }
+    cap->n_run_queue--;
+    return t;
+}
+
+
 /* -----------------------------------------------------------------------------
    raiseExceptionHelper
 


=====================================
rts/Schedule.h
=====================================
@@ -136,67 +136,16 @@ void resurrectThreads (StgTSO *);
  * NOTE: tso->link should be END_TSO_QUEUE before calling this macro.
  * ASSUMES: cap->running_task is the current task.
  */
-EXTERN_INLINE void
-appendToRunQueue (Capability *cap, StgTSO *tso);
-
-EXTERN_INLINE void
-appendToRunQueue (Capability *cap, StgTSO *tso)
-{
-    ASSERT(tso->_link == END_TSO_QUEUE);
-    if (cap->run_queue_hd == END_TSO_QUEUE) {
-        cap->run_queue_hd = tso;
-        tso->block_info.prev = END_TSO_QUEUE;
-    } else {
-        setTSOLink(cap, cap->run_queue_tl, tso);
-        setTSOPrev(cap, tso, cap->run_queue_tl);
-    }
-    cap->run_queue_tl = tso;
-    cap->n_run_queue++;
-}
+void appendToRunQueue (Capability *cap, StgTSO *tso);
 
 /* Push a thread on the beginning of the run queue.
  * ASSUMES: cap->running_task is the current task.
  */
-EXTERN_INLINE void
-pushOnRunQueue (Capability *cap, StgTSO *tso);
-
-EXTERN_INLINE void
-pushOnRunQueue (Capability *cap, StgTSO *tso)
-{
-    setTSOLink(cap, tso, cap->run_queue_hd);
-    tso->block_info.prev = END_TSO_QUEUE;
-    if (cap->run_queue_hd != END_TSO_QUEUE) {
-        setTSOPrev(cap, cap->run_queue_hd, tso);
-    }
-    cap->run_queue_hd = tso;
-    if (cap->run_queue_tl == END_TSO_QUEUE) {
-        cap->run_queue_tl = tso;
-    }
-    cap->n_run_queue++;
-}
+void pushOnRunQueue (Capability *cap, StgTSO *tso);
 
 /* Pop the first thread off the runnable queue.
  */
-INLINE_HEADER StgTSO *
-popRunQueue (Capability *cap)
-{
-    ASSERT(cap->n_run_queue > 0);
-    StgTSO *t = cap->run_queue_hd;
-    ASSERT(t != END_TSO_QUEUE);
-    cap->run_queue_hd = t->_link;
-
-    StgTSO *link = RELAXED_LOAD(&t->_link);
-    if (link != END_TSO_QUEUE) {
-        link->block_info.prev = END_TSO_QUEUE;
-    }
-    RELAXED_STORE(&t->_link, END_TSO_QUEUE); // no write barrier req'd
-
-    if (cap->run_queue_hd == END_TSO_QUEUE) {
-        cap->run_queue_tl = END_TSO_QUEUE;
-    }
-    cap->n_run_queue--;
-    return t;
-}
+StgTSO *popRunQueue (Capability *cap);
 
 INLINE_HEADER StgTSO *
 peekRunQueue (Capability *cap)



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/481467a5ceb07bb28bb6edb1569c86ff3cac315f

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/481467a5ceb07bb28bb6edb1569c86ff3cac315f
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/20221012/ad891d1a/attachment-0001.html>


More information about the ghc-commits mailing list