-
由 Tejun Heo 提交于
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: NTejun Heo <tj@kernel.org> Reported-and-tested-by: NAlexei Starovoitov <alexei.starovoitov@gmail.com> Reported-by: NVlastimil Babka <vbabka@suse.cz> Reported-by: NSasha Levin <sasha.levin@oracle.com> Cc: stable@vger.kernel.org # v3.18+ Fixes: 1a4d7607 ("percpu: implement asynchronous chunk population")
6710e594