mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/
synced 2026-10-24 19:10:26 +00:00
percpu: fix synchronization between synchronous map extension and chunk destruction
[ Upstream commit6710e594f7] 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:1a4d76076c("percpu: implement asynchronous chunk population") Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
This commit is contained in:
parent
d273823dc6
commit
62f7175fa6
1 changed files with 8 additions and 8 deletions
16
mm/percpu.c
16
mm/percpu.c
Loading…
Add table
Add a link
Reference in a new issue