Commit 0fc11e36 authored by Paul Mundt's avatar Paul Mundt

sh: unwinder: Convert frame allocations to GFP_ATOMIC.

save_stack_trace_tsk() and friends can be called from atomic context (as
triggered by latencytop), and subsequently hit two problematic allocation
points that were using GFP_KERNEL (these were dwarf_unwind_stack() and
dwarf_frame_alloc_regs()). Convert these over to GFP_ATOMIC and get
latencytop working with the DWARF unwinder.
Signed-off-by: default avatarPaul Mundt <lethal@linux-sh.org>
parent 718dbf37
...@@ -57,7 +57,7 @@ static void dwarf_frame_alloc_regs(struct dwarf_frame *frame, ...@@ -57,7 +57,7 @@ static void dwarf_frame_alloc_regs(struct dwarf_frame *frame,
if (frame->num_regs >= num_regs) if (frame->num_regs >= num_regs)
return; return;
regs = kzalloc(new_size, GFP_KERNEL); regs = kzalloc(new_size, GFP_ATOMIC);
if (!regs) { if (!regs) {
printk(KERN_WARNING "Unable to allocate DWARF registers\n"); printk(KERN_WARNING "Unable to allocate DWARF registers\n");
/* /*
...@@ -531,7 +531,7 @@ struct dwarf_frame *dwarf_unwind_stack(unsigned long pc, ...@@ -531,7 +531,7 @@ struct dwarf_frame *dwarf_unwind_stack(unsigned long pc,
define_ra = true; define_ra = true;
} }
frame = kzalloc(sizeof(*frame), GFP_KERNEL); frame = kzalloc(sizeof(*frame), GFP_ATOMIC);
if (!frame) if (!frame)
return NULL; return NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment