[GHC] #15768: Using oneshot kqueue() on macOS

GHC ghc-devs at haskell.org
Thu Oct 18 01:38:15 UTC 2018


#15768: Using oneshot kqueue() on macOS
-------------------------------------+-------------------------------------
           Reporter:  kazu-yamamoto  |             Owner:  (none)
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Core           |           Version:  8.6.1
  Libraries                          |
           Keywords:  KQueue,        |  Operating System:  MacOS X
  oneshot, parallel build            |
       Architecture:                 |   Type of failure:  Other
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 Oneshot kqueue() is disabled on macOS due to
 https://ghc.haskell.org/trac/ghc/ticket/7651

 Recall that the paper "Mio: A High-Performance Multicore IO Manager for
 GHC" says:

 "Mio also uses
 kqueue
 on OS X, since Darwin, the foundation
 for Apple’s OS X, is a variant of BSD. However, we encountered
 problems running parallel builds of the GHC compiler using Mio
 as described above. We have been unable to uncover the underlying
 source of the problem to our satisfaction. However, several Internet
 discussions suggest that the implementation of
 kqueue
 and
 pipe
 on OS X are unstable. We were able to resolve the observed prob-
 lems  on  OS  X  by  avoiding  the  use  of  one-shot  mode  on  OS  X,
 instead unregistering events after they are delivered, and by send-
 ing wakeup writes to a pipe monitored by the dispatcher threads’
 kqueue instances on every event registration. With these changes,
 the behavior on OS X, including parallel builds of GHC, has been
 stable."

 Now the serious bug on KQueue has been fixed:
 - https://ghc.haskell.org/trac/ghc/ticket/13903
 - https://phabricator.haskell.org/D3692

 So, I guess it's time to use oneshot on macOS. A patch is attached.

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15768>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list