Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit aefc8c03 authored by Tejun Heo's avatar Tejun Heo Committed by Dennis Cagle
Browse files

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.

Change-Id: I79e7a5ebca297f69e562649edc41ccfa4c6de3bd
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
Reported-and-tested-by: default avatarAlexei Starovoitov <alexei.starovoitov@gmail.com>
Reported-by: default avatarVlastimil Babka <vbabka@suse.cz>
Reported-by: default avatarSasha Levin <sasha.levin@oracle.com>
Cc: stable@vger.kernel.org # v3.18+
Fixes: 1a4d7607 ("percpu: implement asynchronous chunk population")
Git-repo: http://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git


Git-commit: 6710e594f71ccaad8101bc64321152af7cd9ea28
Signed-off-by: default avatarDennis Cagle <d-cagle@codeaurora.org>
parent fcbbe260
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment