[Git][ghc/ghc][wip/dcoutts/posix-ticker] 13 commits: Bump default language edition to GHC2024
Duncan Coutts pushed to branch wip/dcoutts/posix-ticker at Glasgow Haskell Compiler / GHC Commits: 7fbb4fcb by Rodrigo Mesquita at 2026-04-01T12:16:33+00:00 Bump default language edition to GHC2024 As per the accepted ghc-proposal#632 Fixes #26039 - - - - - 5ae43275 by Peng Fan at 2026-04-01T19:01:06-04:00 NCG/LA64: add cmpxchg and xchg primops And append some new instructions for LA664 uarch. Apply fix to cmpxchg-prim by Andreas Klebinger. Suggestions in https://gitlab.haskell.org/ghc/ghc/-/merge_requests/15515 - - - - - 8f95534a by Duncan Coutts at 2026-04-01T19:01:52-04:00 Remove signal-based ticker implementations Fixes issue #27073 All supported platforms should work with the pthreads + nanosleep based ticker implementation. This avoids all the problems with using signals. In practice, all supported platforms were probably using the non-signal tickers already, which is probably why we do not get lots of reports about deadlocks and other weirdness: we were definately using functions that are not async signal safe in the tick handler (such as fflush to flussh the eventlog). Only Solaris was explicitly using the timer_create ticker impl, and even Solaris could probably use the pthreads one (if anyone cared: Solaris is no longer a Teir 3 supported platform). Plausibly the only supported platform that this will change will be AIX, which should now use the pthreads impl. - - - - - 51b32b0d by Duncan Coutts at 2026-04-01T19:01:52-04:00 Tidy up some timer/ticker comments elsewhere - - - - - 7562bcd7 by Duncan Coutts at 2026-04-01T19:01:52-04:00 Remove now-unused install_vtalrm_handler Support function used by both of the signal-based ticker implementations. - - - - - 6da127c7 by Duncan Coutts at 2026-04-01T19:01:52-04:00 No longer probe for timer_create in rts/configure It was only used by the TimerCreate.c ticker impl. - - - - - 3fd490fa by Duncan Coutts at 2026-04-01T19:01:53-04:00 Note that rtsTimerSignal is deprecated. - - - - - 63099b0f by Simon Jakobi at 2026-04-01T19:02:39-04:00 Add perf test for #13960 Closes #13960. - - - - - af3acc89 by Duncan Coutts at 2026-04-02T08:19:39+01:00 Add a rts posix FdWakup utility module This will be used to implement wakeupIOManager for in-RTS I/O managers. It provides a notification/wakeup mechanism using FDs, suitable for situations when a thread is blocked on a set of fds anyway. It uses the classic self-pipe trick, or equivalently eventfd on supported platforms. This will initially be used to implement prompt interrupt or shutdown of the posix ticker thread. - - - - - 0d466c40 by Duncan Coutts at 2026-04-02T08:19:39+01:00 Add prompt shutdown to the pthread ticker implementation. The Linux timerfd ticker monitors a pipe which is used by exitTicker to ensure a prompt wakeup and shutdown. The pthread ticker lacked this and so would only exit at the next ticker wakeup (10ms by default). This patch adds the same mechanism to the pthread ticker. This changes the pthread ticker from waiting by using nanosleep() to waiting using either ppoll() or select(), so that it can wait on both a time and a file descriptor. On Linux at least, a test program to compare the timing jitter of these APIs shows that using nanpsleep, ppoll or select makes no statistical difference to the maximum or average jitter. This is a step towards unifying the posix ticker implementations, so that we can have just one portable one (albeit with some limited cpp). It is also a step towards using the ticker as part of a more general implementation of wakeUpRts, since this will require a method to wake the rts from a signal handler context (ctl-c handler). - - - - - 3e158b1e by Duncan Coutts at 2026-04-02T08:19:39+01:00 Update ticker header commentary It was antique and didn't apply even to the previous implementation, and certainly not to the updated one. - - - - - ebbfdf15 by Duncan Coutts at 2026-04-02T08:19:39+01:00 Remove the timerfd-based ticker implementation There does not appear to be any remaining advantage on Linux to using the timerfd ticker implementation over the portable one (using ppoll on Linux for precise timing). The eventfd implementation was originally added at a time when Linux was still using a signal based implementation. So it made sense at the time. See (closed) issue #10840. - - - - - c6f8847c by Duncan Coutts at 2026-04-02T08:19:39+01:00 Consolidate to a single posix ticker implementation Previously we had four implementations, two using signals and two using threads. Having just one should make behaviour more consistent between platforms, and should make maintenance easier. - - - - - 142 changed files: - .gitlab/ci.sh - compiler/GHC/CmmToAsm/LA64/CodeGen.hs - compiler/GHC/CmmToAsm/LA64/Instr.hs - compiler/GHC/CmmToAsm/LA64/Ppr.hs - compiler/GHC/Driver/Flags.hs - docs/users_guide/exts/control.rst - − m4/fp_check_timer_create.m4 - rts/Timer.c - rts/configure.ac - rts/include/rts/Timer.h - rts/include/stg/SMP.h - + rts/posix/FdWakeup.c - + rts/posix/FdWakeup.h - rts/posix/Signals.c - rts/posix/Signals.h - rts/posix/Ticker.c - − rts/posix/ticker/Pthread.c - − rts/posix/ticker/Setitimer.c - − rts/posix/ticker/TimerCreate.c - − rts/posix/ticker/TimerFd.c - rts/rts.cabal - testsuite/tests/ado/ado004.hs - testsuite/tests/annotations/should_fail/annfail02.hs - testsuite/tests/annotations/should_fail/annfail02.stderr - testsuite/tests/array/should_run/arr020.hs - testsuite/tests/core-to-stg/T19700.hs - testsuite/tests/deSugar/should_fail/DsStrictFail.hs - testsuite/tests/deriving/should_compile/T15798b.hs - testsuite/tests/deriving/should_compile/T15798c.hs - testsuite/tests/deriving/should_compile/T15798c.stderr - testsuite/tests/deriving/should_compile/T24955a.hs - testsuite/tests/deriving/should_compile/T24955a.stderr - testsuite/tests/deriving/should_compile/T24955b.hs - testsuite/tests/deriving/should_compile/T24955c.hs - testsuite/tests/deriving/should_fail/T10598_fail4.hs - testsuite/tests/deriving/should_fail/T10598_fail4.stderr - testsuite/tests/deriving/should_fail/T10598_fail5.hs - testsuite/tests/deriving/should_fail/T10598_fail5.stderr - testsuite/tests/dmdanal/sigs/T22241.hs - testsuite/tests/gadt/T20485.hs - testsuite/tests/ghci.debugger/scripts/all.T - testsuite/tests/ghci.debugger/scripts/break012.hs - testsuite/tests/ghci.debugger/scripts/break012.stdout - testsuite/tests/ghci/prog-mhu002/all.T - testsuite/tests/ghci/scripts/Makefile - testsuite/tests/ghci/should_run/all.T - testsuite/tests/indexed-types/should_compile/T15322.hs - testsuite/tests/indexed-types/should_compile/T15322.stderr - testsuite/tests/linear/should_fail/T18888.hs - testsuite/tests/module/T20007.hs - testsuite/tests/module/T20007.stderr - testsuite/tests/module/mod90.hs - testsuite/tests/module/mod90.stderr - testsuite/tests/overloadedrecflds/should_fail/NoFieldSelectorsFail.hs - testsuite/tests/overloadedrecflds/should_fail/T18999_NoDisambiguateRecordFields.hs - testsuite/tests/overloadedrecflds/should_fail/all.T - testsuite/tests/parser/should_fail/ParserNoLambdaCase.hs - testsuite/tests/parser/should_fail/ParserNoLambdaCase.stderr - testsuite/tests/parser/should_fail/T16270h.hs - testsuite/tests/parser/should_fail/T16270h.stderr - testsuite/tests/parser/should_fail/readFail001.hs - testsuite/tests/parser/should_fail/readFail001.stderr - testsuite/tests/partial-sigs/should_compile/SomethingShowable.hs - + testsuite/tests/perf/compiler/T13960.hs - testsuite/tests/perf/compiler/all.T - testsuite/tests/plugins/late-plugin/LatePlugin.hs - testsuite/tests/polykinds/T7151.hs - testsuite/tests/polykinds/T7151.stderr - testsuite/tests/polykinds/T7433.hs - testsuite/tests/polykinds/T7433.stderr - testsuite/tests/programs/andy_cherry/test.T - testsuite/tests/rename/should_fail/T10668.hs - testsuite/tests/rename/should_fail/T10668.stderr - testsuite/tests/rename/should_fail/T12681.hs - testsuite/tests/rename/should_fail/T12681.stderr - testsuite/tests/rename/should_fail/T13568.hs - testsuite/tests/rename/should_fail/T13568.stderr - testsuite/tests/rename/should_fail/T13644.hs - testsuite/tests/rename/should_fail/T13644.stderr - testsuite/tests/rename/should_fail/T13847.hs - testsuite/tests/rename/should_fail/T13847.stderr - testsuite/tests/rename/should_fail/T14032c.hs - testsuite/tests/rename/should_fail/T19843l.hs - testsuite/tests/rename/should_fail/T19843l.stderr - testsuite/tests/rename/should_fail/T25901_imp_hq_fail_5.stderr - testsuite/tests/rename/should_fail/T25901_imp_sq_fail_2.stderr - testsuite/tests/rename/should_fail/T5385.hs - testsuite/tests/rename/should_fail/T5385.stderr - testsuite/tests/roles/should_fail/Roles5.hs - testsuite/tests/roles/should_fail/Roles5.stderr - testsuite/tests/showIface/DocsInHiFile.hs - testsuite/tests/showIface/DocsInHiFile1.stdout - testsuite/tests/showIface/DocsInHiFileTH.hs - testsuite/tests/showIface/DocsInHiFileTH.stdout - testsuite/tests/showIface/DocsInHiFileTHExternal.hs - testsuite/tests/showIface/HaddockIssue849.hs - testsuite/tests/showIface/HaddockIssue849.stdout - testsuite/tests/showIface/HaddockOpts.hs - testsuite/tests/showIface/HaddockOpts.stdout - testsuite/tests/showIface/HaddockSpanIssueT24378.hs - testsuite/tests/showIface/HaddockSpanIssueT24378.stdout - testsuite/tests/showIface/MagicHashInHaddocks.hs - testsuite/tests/showIface/MagicHashInHaddocks.stdout - testsuite/tests/showIface/Makefile - testsuite/tests/showIface/NoExportList.hs - testsuite/tests/showIface/NoExportList.stdout - testsuite/tests/showIface/PragmaDocs.stdout - testsuite/tests/showIface/ReExports.stdout - testsuite/tests/simplCore/T9646/test.T - testsuite/tests/simplCore/should_compile/T21960.hs - testsuite/tests/simplCore/should_compile/T26709.stderr - testsuite/tests/th/TH_Promoted1Tuple.hs - testsuite/tests/th/TH_Roles1.hs - testsuite/tests/typecheck/should_compile/MutRec.hs - testsuite/tests/typecheck/should_compile/T10770a.hs - testsuite/tests/typecheck/should_compile/T11339.hs - testsuite/tests/typecheck/should_compile/T11397.hs - testsuite/tests/typecheck/should_compile/T13526.hs - testsuite/tests/typecheck/should_compile/T18467.hs - testsuite/tests/typecheck/should_compile/T18467.stderr - testsuite/tests/typecheck/should_compile/tc081.hs - testsuite/tests/typecheck/should_compile/tc141.hs - testsuite/tests/typecheck/should_fail/T23427.hs - testsuite/tests/typecheck/should_fail/T6078.hs - testsuite/tests/typecheck/should_fail/T7453.hs - testsuite/tests/typecheck/should_fail/T7453.stderr - testsuite/tests/typecheck/should_fail/T8570.hs - testsuite/tests/typecheck/should_fail/T8570.stderr - testsuite/tests/typecheck/should_fail/tcfail083.hs - testsuite/tests/typecheck/should_fail/tcfail083.stderr - testsuite/tests/typecheck/should_fail/tcfail084.hs - testsuite/tests/typecheck/should_fail/tcfail084.stderr - testsuite/tests/typecheck/should_fail/tcfail094.hs - testsuite/tests/typecheck/should_fail/tcfail094.stderr - testsuite/tests/typecheck/should_run/T1735.hs - testsuite/tests/typecheck/should_run/T1735_Help/Basics.hs - testsuite/tests/typecheck/should_run/T3731.hs - testsuite/tests/vdq-rta/should_fail/T24159_type_syntax_th_fail.script - testsuite/tests/warnings/should_fail/CaretDiagnostics1.hs - testsuite/tests/warnings/should_fail/CaretDiagnostics1.stderr - testsuite/tests/warnings/should_fail/T24396c.hs - testsuite/tests/warnings/should_fail/T24396c.stderr The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/4f1b216f4b7517ac212fac9bd60e7ae... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/4f1b216f4b7517ac212fac9bd60e7ae... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Duncan Coutts (@dcoutts)