Skip to content

Commit 7dc8361

Browse files
LeviYeoReumrostedt
authored andcommitted
trace/pid_list: Change gfp flags in pid_list_fill_irq()
pid_list_fill_irq() runs via irq_work. When CONFIG_PREEMPT_RT is disabled, it would run in irq_context. so it shouldn't sleep while memory allocation. Change gfp flags from GFP_KERNEL to GFP_NOWAIT to prevent sleep in irq_work. This change wouldn't impact functionality in practice because the worst-size is 2K. Cc: [email protected] Fixes: 8d6e909 ("tracing: Create a sparse bitmask for pid filtering") Link: https://lore.kernel.org/[email protected] Acked-by: Masami Hiramatsu (Google) <[email protected]> Signed-off-by: levi.yun <[email protected]> Signed-off-by: Steven Rostedt (Google) <[email protected]>
1 parent a325742 commit 7dc8361

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

kernel/trace/pid_list.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ static void pid_list_refill_irq(struct irq_work *iwork)
354354
while (upper_count-- > 0) {
355355
union upper_chunk *chunk;
356356

357-
chunk = kzalloc(sizeof(*chunk), GFP_KERNEL);
357+
chunk = kzalloc(sizeof(*chunk), GFP_NOWAIT);
358358
if (!chunk)
359359
break;
360360
*upper_next = chunk;
@@ -365,7 +365,7 @@ static void pid_list_refill_irq(struct irq_work *iwork)
365365
while (lower_count-- > 0) {
366366
union lower_chunk *chunk;
367367

368-
chunk = kzalloc(sizeof(*chunk), GFP_KERNEL);
368+
chunk = kzalloc(sizeof(*chunk), GFP_NOWAIT);
369369
if (!chunk)
370370
break;
371371
*lower_next = chunk;

0 commit comments

Comments
 (0)