Tejun Heo 6710e594f7 percpu: fix synchronization between synchronous map extension and chunk destruction
For non-atomic allocations, pcpu_alloc() can try to extend the area
map synchronously after dropping pcpu_lock; however, the extension
wasn't synchronized against chunk destruction and the chunk might get
freed while extension is in progress.

This patch fixes the bug by putting most of non-atomic allocations
under pcpu_alloc_mutex to synchronize against pcpu_balance_work which
is responsible for async chunk management including destruction.

Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-and-tested-by: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Reported-by: Vlastimil Babka <vbabka@suse.cz>
Reported-by: Sasha Levin <sasha.levin@oracle.com>
Cc: stable@vger.kernel.org # v3.18+
Fixes: 1a4d76076cda ("percpu: implement asynchronous chunk population")
2016-05-25 11:48:25 -04:00
..
2015-11-05 19:34:48 -08:00
2016-05-23 11:18:01 -07:00
2016-05-23 11:18:01 -07:00
2016-05-23 17:04:14 -07:00
2016-03-17 15:09:34 -07:00
2015-09-08 15:35:28 -07:00
2016-05-23 17:04:14 -07:00
2016-03-17 15:09:34 -07:00
2015-11-05 19:34:48 -08:00
2016-05-23 17:04:14 -07:00
2016-03-17 15:09:34 -07:00
2016-05-23 17:04:14 -07:00
2016-05-20 17:58:30 -07:00