diff options
author | Tejun Heo <tj@kernel.org> | 2009-03-06 16:44:13 +0100 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2009-03-07 06:46:35 +0100 |
commit | ccea34b5d0fbab081496d1860f31acee99fa8a6d (patch) | |
tree | e7066b5dde0e83a216768569e57cd71cc83fe912 /CREDITS | |
parent | percpu: move fully free chunk reclamation into a work (diff) | |
download | linux-ccea34b5d0fbab081496d1860f31acee99fa8a6d.tar.xz linux-ccea34b5d0fbab081496d1860f31acee99fa8a6d.zip |
percpu: finer grained locking to break deadlock and allow atomic free
Impact: fix deadlock and allow atomic free
Percpu allocation always uses GFP_KERNEL and whole alloc/free paths
were protected by single mutex. All percpu allocations have been from
GFP_KERNEL-safe context and the original allocator had this assumption
too. However, by protecting both alloc and free paths with the same
mutex, the new allocator creates free -> alloc -> GFP_KERNEL
dependency which the original allocator didn't have. This can lead to
deadlock if free is called from FS or IO paths. Also, in general,
allocators are expected to allow free to be called from atomic
context.
This patch implements finer grained locking to break the deadlock and
allow atomic free. For details, please read the "Synchronization
rules" comment.
While at it, also add CONTEXT: to function comments to describe which
context they expect to be called from and what they do to it.
This problem was reported by Thomas Gleixner and Peter Zijlstra.
http://thread.gmane.org/gmane.linux.kernel/802384
Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: Thomas Gleixner <tglx@linutronix.de>
Reported-by: Peter Zijlstra <peterz@infradead.org>
Diffstat (limited to 'CREDITS')
0 files changed, 0 insertions, 0 deletions