Bug 740336 - gcc may not inline arch_local_irq_save
Summary: gcc may not inline arch_local_irq_save
Alias: None
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: realtime-kernel
Version: 2.0
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
: ---
Assignee: Red Hat Real Time Maintenance
QA Contact: David Sommerseth
Depends On:
TreeView+ depends on / blocked
Reported: 2011-09-21 16:58 UTC by Steven Rostedt
Modified: 2016-05-22 23:33 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2014-09-25 19:37:18 UTC

Attachments (Terms of Use)
patch to fix the bug (1.89 KB, patch)
2011-09-21 16:58 UTC, Steven Rostedt
no flags Details | Diff

Description Steven Rostedt 2011-09-21 16:58:02 UTC
Created attachment 524246 [details]
patch to fix the bug

Description of problem:

Compiling the MRG kernel myself, the kernel would crash on the rttrace version.
The reason was that it was calling the wakeup tracer in the self tests that
happened to have function tracing enabled which traced arch_local_irq_save().
arch_local_irq_save() is suppose to be inlined, but because CC_OPTIMIZE_INLINING is enabled in the MRG config, my gcc decided it was best not to inline it causing ftrace to trace that function.

The problem arises when we enter the scheduler due to preemption. The preempt scheduler calls local_irq_save() which calls arch_local_irq_save() which gets traced. The wakeup function tracer disables preemption and then enables it later, which happens to notice the NEED_RESCHED flag set and calls back into the preempt_scheduler() code which again calls arch_local_irq_save() which gets traced again and then we continue this loop until we crash.

The simple answer is to not trace arch_local_irq_save(). In fact, we should not trace any of the arch_* functions. A simple patch is attached that makes these functions not traced.

Comment 1 Beth Uptagrafft 2014-09-25 19:37:18 UTC
This issue has not been updated in a while and will be closed WONTFIX.  If you believe this is still an issue on our most recent MRG-2.5 3.10 Realtime release, please file a new issue for further investigation.

Note You need to log in before you can comment on or make changes to this bug.