mirror of
https://github.com/torvalds/linux.git
synced 2026-11-20 13:03:48 +00:00
powerpc/perf/vpa-dtl: use GFP_ATOMIC for DTL buffer allocation
The DTL buffer is allocated while holding dtl_global_lock, which
is spinlock.
GFP_KERNEL allow direct memory reclaim and may sleep. Combining
GFP_KERNEL with GFP_ATOMIC does not remove the direct reclaim.
Use GFP_ATOMIC alone to ensure the allocation does not sleep
while the spinlock is held.
The issue is reported by script coccinelle call_kern.cocci.
Signed-off-by: Mohammad Shahid <[email protected]>
Fixes: 4708fba19a ("powerpc/vpa_dtl: Add interface to expose vpa dtl counters via perf")
Reviewed-by: Ritesh Harjani (IBM) <[email protected]>
Signed-off-by: Madhavan Srinivasan <[email protected]>
Link: https://patch.msgid.link/[email protected]
This commit is contained in:
committed by
Madhavan Srinivasan
parent
dc6eb6f08b
commit
9500416c8a
@@ -338,7 +338,7 @@ static int vpa_dtl_mem_alloc(int cpu)
|
||||
if (!dtl_cache)
|
||||
return -ENOMEM;
|
||||
|
||||
buf = kmem_cache_alloc_node(dtl_cache, GFP_KERNEL | GFP_ATOMIC, cpu_to_node(cpu));
|
||||
buf = kmem_cache_alloc_node(dtl_cache, GFP_ATOMIC, cpu_to_node(cpu));
|
||||
if (!buf) {
|
||||
pr_warn("buffer allocation failed for cpu %d\n", cpu);
|
||||
return -ENOMEM;
|
||||
|
||||
Reference in New Issue
Block a user