Avoid deadlock in freeTask (called by forkProcess)

Summary: Documented in more detail inline with the change.

Test Plan: validate

Reviewers: austin, simonmar, duncan

Reviewed By: austin, simonmar, duncan

Subscribers: simonmar, relrod, carter

Differential Revision: https://phabricator.haskell.org/D59

(cherry picked from commit 39630ab15cc0607103dc4ef3d9089de44ef17c2d)
Acquire all_tasks_mutex in forkProcess

Summary: (for the same reason that we acquire all the other mutexes)

Test Plan: validate

Reviewers: simonmar, austin, duncan

Reviewed By: simonmar, austin, duncan

Subscribers: simonmar, relrod, carter

Differential Revision: https://phabricator.haskell.org/D60

(cherry picked from commit 16403f0d182d2d3d0b1fbe5ad778ead4bfcb7e16)
Allow multiple entry points when allocating recursive groups (#9303)

Summary:
In this example we ended up with some code that was only reachable via
an info table, because a branch had been optimised away by the native
code generator.  The register allocator then got confused because it
was only considering the first block of the proc to be an entry point,
when actually any of the info tables are entry points.

Test Plan: validate

Reviewers: simonpj, austin

Subscribers: simonmar, relrod, carter

Differential Revision: https://phabricator.haskell.org/D88

(cherry picked from commit da70f9ef49a545707dc32db9662441b9c8845fba)
A panic in CmmBuildInfoTables.bundle shouldn't be a panic (#9329)

Summary:
This code needs more comments, but I believe this is safe.  By
definition I can't have broken anything that was working by turning a
panic into a non-panic anyway.

Test Plan: validate

Reviewers: hvr, simonpj, austin

Subscribers: simonmar, relrod, ezyang, carter

Differential Revision: https://phabricator.haskell.org/D105

GHC Trac Issues: #9329

(cherry picked from commit 2989ffdcb88ab24e8a4e8b3d0454497a0db2652c)
interruptible() was not returning true for BlockedOnSTM (#9379)

Summary:
There's an knock-on fix in HeapStackCheck.c which is potentially
scary, but I'm pretty confident is OK.  See comment for details.

Test Plan:
I've run all the STM
tests I can find, including libraries/stm/tests/stm049 with +RTS -N8
and some of the constants bumped to make it more of a stress test.

Reviewers: hvr, rwbarton, austin

Subscribers: simonmar, relrod, ezyang, carter

Differential Revision: https://phabricator.haskell.org/D104

GHC Trac Issues: #9379

(cherry picked from commit 9d9a55469719908bbd5cd3277e0ac79c0588dc55)