This problem is detected on ARM and PowerPC platforms when run "perf top" command after CONFIG_DEBUG_ATOMIC_SLEEP is enabled in rt kernel. Call Trace on ARM: BUG: sleeping function called from invalid context at linux/kernel/rtmutex.c:658 in_atomic(): 1, irqs_disabled(): 128, pid: 1731, name: perf [<80017d6c>] (unwind_backtrace+0x0/0x104) from [<806416c4>] (dump_stack+0x20/0x24) [<806416c4>] (dump_stack+0x20/0x24) from [<80061208>] (__might_sleep+0xf4/0x108) [<80061208>] (__might_sleep+0xf4/0x108) from [<8064a74c>] (rt_spin_lock+0x2c/0x38) [<8064a74c>] (rt_spin_lock+0x2c/0x38) from [<800642e8>] (__wake_up+0x34/0x60) [<800642e8>] (__wake_up+0x34/0x60) from [<800e2610>] (perf_event_wakeup+0x40/0x84) [<800e2610>] (perf_event_wakeup+0x40/0x84) from [<800e2690>] (perf_pending_event+0x3c/0x60) [<800e2690>] (perf_pending_event+0x3c/0x60) from [<800dd36c>] (irq_work_run+0x74/0xa4) [<800dd36c>] (irq_work_run+0x74/0xa4) from [<8001b018>] (armv7pmu_handle_irq+0x12c/0x19c) [<8001b018>] (armv7pmu_handle_irq+0x12c/0x19c) from [<800a87b0>] (handle_irq_event_percpu+0xf0/0x438) [<800a87b0>] (handle_irq_event_percpu+0xf0/0x438) from [<800a8b70>] (handle_irq_event+0x78/0xa0) [<800a8b70>] (handle_irq_event+0x78/0xa0) from [<800abdac>] (handle_fasteoi_irq+0xd4/0x18c) [<800abdac>] (handle_fasteoi_irq+0xd4/0x18c) from [<800a7e70>] (generic_handle_irq+0x40/0x50) [<800a7e70>] (generic_handle_irq+0x40/0x50) from [<8000f7a4>] (handle_IRQ+0x68/0xbc) [<8000f7a4>] (handle_IRQ+0x68/0xbc) from [<800084e8>] (gic_handle_irq+0x38/0x68) [<800084e8>] (gic_handle_irq+0x38/0x68) from [<8064b100>] (__irq_svc+0x40/0x70) Call Trace on PowerPC: BUG: sleeping function called from invalid context at linux/kernel/rtmutex.c:658 in_atomic(): 1, irqs_disabled(): 1, pid: 0, name: swapper/0 Call Trace: [c0c0fd80] [c040a1b4] show_stack+0x10c/0x1c0 (unreliable) [c0c0fdd0] [c09c3c48] dump_stack+0x24/0x34 [c0c0fde0] [c045f728] __might_sleep+0xd8/0xfc [c0c0fdf0] [c09bb750] rt_spin_lock+0x34/0x7c [c0c0fe00] [c0462e44] __wake_up+0x38/0x70 [c0c0fe20] [c04df740] perf_event_wakeup+0x40/0x90 [c0c0fe50] [c04df7d0] perf_pending_event+0x40/0x6c [c0c0fe60] [c04da4d4] irq_work_run+0x84/0xc4 [c0c0fe80] [c040bd54] timer_interrupt+0x1ec/0x3d0 [c0c0fec0] [c0411728] ret_from_except+0x0/0x18 We can run the irq-work under softirq context to resolve this problemjust like x86 does.
Xufeng if you will be working this, please move the status to "Accepted" and review the Target Milestone. For a change like this, an earlier milestone is preferred to a later one.
Patch has already been merged.