Skip to content

Commit

Permalink
sh: unwinder: Convert frame allocations to GFP_ATOMIC.
Browse files Browse the repository at this point in the history
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: Paul Mundt <lethal@linux-sh.org>
  • Loading branch information
Paul Mundt committed Aug 14, 2009
1 parent 718dbf3 commit 0fc11e3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/sh/kernel/dwarf.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ static void dwarf_frame_alloc_regs(struct dwarf_frame *frame,
if (frame->num_regs >= num_regs)
return;

regs = kzalloc(new_size, GFP_KERNEL);
regs = kzalloc(new_size, GFP_ATOMIC);
if (!regs) {
printk(KERN_WARNING "Unable to allocate DWARF registers\n");
/*
Expand Down Expand Up @@ -531,7 +531,7 @@ struct dwarf_frame *dwarf_unwind_stack(unsigned long pc,
define_ra = true;
}

frame = kzalloc(sizeof(*frame), GFP_KERNEL);
frame = kzalloc(sizeof(*frame), GFP_ATOMIC);
if (!frame)
return NULL;

Expand Down

0 comments on commit 0fc11e3

Please sign in to comment.