diff options
| author | Lai Jiangshan <[email protected]> | 2012-09-01 16:28:19 +0000 |
|---|---|---|
| committer | Tejun Heo <[email protected]> | 2012-09-05 00:04:45 +0000 |
| commit | 96e65306b81351b656835c15931d1d237b252f27 (patch) | |
| tree | af06187bebae44b48ca8e68a639a4ddc6b0a3509 /lib/mpi/generic_mpih-rshift.c | |
| parent | Linux 3.6-rc1 (diff) | |
| download | kernel-96e65306b81351b656835c15931d1d237b252f27.tar.gz kernel-96e65306b81351b656835c15931d1d237b252f27.zip | |
workqueue: UNBOUND -> REBIND morphing in rebind_workers() should be atomic
The compiler may compile the following code into TWO write/modify
instructions.
worker->flags &= ~WORKER_UNBOUND;
worker->flags |= WORKER_REBIND;
so the other CPU may temporarily see worker->flags which doesn't have
either WORKER_UNBOUND or WORKER_REBIND set and perform local wakeup
prematurely.
Fix it by using single explicit assignment via ACCESS_ONCE().
Because idle workers have another WORKER_NOT_RUNNING flag, this bug
doesn't exist for them; however, update it to use the same pattern for
consistency.
tj: Applied the change to idle workers too and updated comments and
patch description a bit.
Signed-off-by: Lai Jiangshan <[email protected]>
Signed-off-by: Tejun Heo <[email protected]>
Cc: [email protected]
Diffstat (limited to 'lib/mpi/generic_mpih-rshift.c')
0 files changed, 0 insertions, 0 deletions
