Fix to thread migration
authorSimon Marlow <marlowsd@gmail.com>
Wed, 27 Jul 2016 15:00:08 +0000 (16:00 +0100)
committerSimon Marlow <marlowsd@gmail.com>
Wed, 3 Aug 2016 07:07:34 +0000 (08:07 +0100)
commit988ad8ba8e709eff3cea59728e481bb269fa6185
tree1a977f33b53ad1188900c077b4970cce3f078127
parent55f5aed756cd5d464942dddcb33e0bd19b05f2a4
Fix to thread migration

Summary:
If we had 2 threads on the run queue, say [A,B], and B is bound to the
current Task, then we would fail to migrate any threads.  This fixes it
so that we would migrate A in that case.

This will help parallelism a bit in programs that have lots of bound
threads.

Test Plan:
Test program in #12419, which is actually not a great program but it
does behave a bit better after this change.

Reviewers: ezyang, niteria, bgamari, austin, erikd

Subscribers: thomie

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

GHC Trac Issues: #12419
rts/Schedule.c