[PATCH 1/7 V6] workqueue: ensure the wq_worker_sleeping() see the right flags

2012-09-08 Thread Lai Jiangshan
The compiler may compile this code into TWO write/modify instructions. worker->flags &= ~WORKER_UNBOUND; worker->flags |= WORKER_REBIND; so the other CPU may see the temporary of worker->flags which has not WORKER_UNBOUND nor WORKER_REBIND, it will wrongly do local

[PATCH 1/7 V6] workqueue: ensure the wq_worker_sleeping() see the right flags

2012-09-08 Thread Lai Jiangshan
The compiler may compile this code into TWO write/modify instructions. worker-flags = ~WORKER_UNBOUND; worker-flags |= WORKER_REBIND; so the other CPU may see the temporary of worker-flags which has not WORKER_UNBOUND nor WORKER_REBIND, it will wrongly do local