All of lore.kernel.org
 help / color / mirror / Atom feed
* mod_timer in interrupt context
@ 2013-11-12 16:39 Drew Richardson
  2013-11-13 21:53 ` Thomas Gleixner
  0 siblings, 1 reply; 2+ messages in thread
From: Drew Richardson @ 2013-11-12 16:39 UTC (permalink / raw)
  To: linux-rt-users; +Cc: Pawel Moll, Wade Cherry

I am using a 16 core ARM Cortex-A15 dev board with a PREEMPT_RT patched kernel. When I call mod_timer in the sched_switch tracepoint from a kernel module the board locks up. Here's the stack trace I get

BUG: sleeping function called from invalid context at kernel/rtmutex.c:659
in_atomic(): 1, irqs_disabled(): 128, pid: 0, name: swapper/7
INFO: lockdep is turned off.
irq event stamp: 0
hardirqs last  enabled at (0): [<  (null)>]   (null)
hardirqs last disabled at (0): [<c0432358>] copy_process.part.49+0x414/0x11bc
softirqs last  enabled at (0): [<c0432358>] copy_process.part.49+0x414/0x11bc
softirqs last disabled at (0): [<  (null)>]   (null)
Preemption disabled at:[<  (null)>]   (null)

CPU: 7 PID: 0 Comm: swapper/7 Tainted: G        W  O 3.10.14-rt9 #3
[<c0424f38>] (unwind_backtrace+0x0/0xf4) from [<c0421750>] (show_stack+0x10/0x14)
[<c0421750>] (show_stack+0x10/0x14) from [<c08f2cac>] (rt_spin_lock+0x24/0x58)
[<c08f2cac>] (rt_spin_lock+0x24/0x58) from [<c0443f48>] (lock_timer_base.isra.38+0x2c/0x50)
[<c0443f48>] (lock_timer_base.isra.38+0x2c/0x50) from [<c04441a8>] (mod_timer+0x60/0x240)
[<c04441a8>] (mod_timer+0x60/0x240) from [<bf000038>] (probe_sched_switch+0x2c/0x3c [gator])
[<bf000038>] (probe_sched_switch+0x2c/0x3c [gator]) from [<c08f1a08>] (__schedule+0x618/0x678)
[<c08f1a08>] (__schedule+0x618/0x678) from [<c08f1a9c>] (schedule+0x34/0xa4)
[<c08f1a9c>] (schedule+0x34/0xa4) from [<c08f2040>] (schedule_preempt_disabled+0x14/0x20)
[<c08f2040>] (schedule_preempt_disabled+0x14/0x20) from [<c0473560>] (cpu_startup_entry+0x114/0x2b4)
[<c0473560>] (cpu_startup_entry+0x114/0x2b4) from [<00af9aa4>] (0xaf9aa4)

The mod_timer function calls lock_timer_base which calls spin_lock. This is fine in non-RT kernels, but in RT_FULL it's a mutex which could block. Is it illegal to call mod_timer in this context?

Thanks,

Drew

-- IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium.  Thank you.

ARM Limited, Registered office 110 Fulbourn Road, Cambridge CB1 9NJ, Registered in England & Wales, Company No:  2557590
ARM Holdings plc, Registered office 110 Fulbourn Road, Cambridge CB1 9NJ, Registered in England & Wales, Company No:  2548782


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: mod_timer in interrupt context
  2013-11-12 16:39 mod_timer in interrupt context Drew Richardson
@ 2013-11-13 21:53 ` Thomas Gleixner
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Gleixner @ 2013-11-13 21:53 UTC (permalink / raw)
  To: Drew Richardson; +Cc: linux-rt-users, Pawel Moll, Wade Cherry

On Tue, 12 Nov 2013, Drew Richardson wrote:
> I am using a 16 core ARM Cortex-A15 dev board with a PREEMPT_RT
> patched kernel. When I call mod_timer in the sched_switch tracepoint
> from a kernel module the board locks up.

This sounds ass backwards to begin with. Why on earth are you calling
mod_timer from a tracepoint in the guts of the scheduler core?

> The mod_timer function calls lock_timer_base which calls
> spin_lock. This is fine in non-RT kernels, but in RT_FULL it's a
> mutex which could block. Is it illegal to call mod_timer in this
> context?

It's not illegal in any jurisdiction AFAICT, but it's a nono on
RT. And no, we are not going to change this.

Thanks,

	tglx


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-11-13 21:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-12 16:39 mod_timer in interrupt context Drew Richardson
2013-11-13 21:53 ` Thomas Gleixner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.