lkml.org 
[lkml]   [2018]   [Apr]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectA question of sleeping with interrupts are disabled in start_kernel()
Date
Hello,

I have a question of the call path init/main.c:
init/main.c: start_kernel() ->
kernel/events/core.c: perf_pmu_register() ->
kernel/events/core.c: perf_event_init() ->
kernel/events/core.c: pmu_dev_alloc()

In this call path, start_kernel() calls local_irq_disable() to disable
the interrupt;
perf_pmu_register() calls mutex_lock() and idr_alloc(GFP_KERNEL), and
they can sleep;
pmu_dev_alloc() calls kzalloc(GFP_KERNEL), and it can sleep.

In my opinion, this code may sleep with interrupts are disabled.
I wonder why this code is okay?


Best wishes,
Jia-Ju Bai

\
 
 \ /
  Last update: 2018-04-06 11:54    [W:0.033 / U:0.172 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site