Linux 3.4.110-rt140-rc1
Subsystems (4)
Steven Rostedt
maintainercover Linux 3.4.110-rt140-rc1
Dear RT Folks,
This is the RT stable review cycle of patch 3.4.110-rt140-rc1.
Please scream at me if I messed something up. Please test the patches too.
The -rc release will be uploaded to kernel.org and will be deleted when the final release is out. This is just a review release (or release candidate).
The pre-releases will not be pushed to the git repository, only the final release is.
If all goes well, this patch will be converted to the next main release on 3/7/2016.
Enjoy,
-- Steve
To build 3.4.110-rt140-rc1 directly, the following patches should be applied:
http://www.kernel.org/pub/linux/kernel/v3.x/linux-3.4.tar.xz
http://www.kernel.org/pub/linux/kernel/v3.x/patch-3.4.110.xz
http://www.kernel.org/pub/linux/kernel/projects/rt/3.4/patch-3.4.110-rt140-rc1.patch.xz
You can also build from 3.4.110-rt139 by applying the incremental patch:
http://www.kernel.org/pub/linux/kernel/projects/rt/3.4/incr/patch-3.4.110-rt139-rt140-rc1.patch.xz
Changes from 3.4.110-rt139:
---
Clark Williams (1):
rcu/torture: Comment out rcu_bh ops on PREEMPT_RT_FULL
Sebastian Andrzej Siewior (4):
latencyhist: disable jump-labels
kernel: migrate_disable() do fastpath in atomic & irqs-off
kernel: softirq: unlock with irqs on
kernel: sched: Fix preempt_disable_ip recodring for preempt_disable()
Steven Rostedt (Red Hat) (1):
Linux 3.4.110-rt140-rc1
Yang Shi (1):
trace: Use rcuidle version for preemptoff_hist trace point
----
arch/Kconfig | 1 + include/linux/ftrace.h | 12 ++++++++++++ include/linux/sched.h | 2 -- include/trace/events/hist.h | 1 + kernel/rcutorture.c | 7 +++++++ kernel/sched/core.c | 18 ++++-------------- kernel/softirq.c | 6 +++--- kernel/trace/trace_irqsoff.c | 8 ++++---- localversion-rt | 2 +- 9 files changed, 33 insertions(+), 24 deletions(-)
Steven Rostedt
maintainerPATCH 1/7 latencyhist: disable jump-labels
3.4.110-rt140-rc1 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Sebastian Andrzej Siewior <[email protected]>
Atleast on X86 we die a recursive death
|CPU: 3 PID: 585 Comm: bash Not tainted 4.4.1-rt4+ #198 |Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS Debian-1.8.2-1 04/01/2014 |task: ffff88007ab4cd00 ti: ffff88007ab94000 task.ti: ffff88007ab94000 |RIP: 0010:[<ffffffff81684870>] [<ffffffff81684870>] int3+0x0/0x10 |RSP: 0018:ffff88013c107fd8 EFLAGS: 00010082 |RAX: ffff88007ab4cd00 RBX: ffffffff8100ceab RCX: 0000000080202001 |RDX: 0000000000000000 RSI: ffffffff8100ceab RDI: ffffffff810c78b2 |RBP: ffff88007ab97c10 R08: ffffffffff57b000 R09: 0000000000000000 |R10: ffff88013bb64790 R11: ffff88007ab4cd68 R12: ffffffff8100ceab |R13: ffffffff810c78b2 R14: ffffffff810f8158 R15: ffffffff810f9120 |FS: 0000000000000000(0000) GS:ffff88013c100000(0063) knlGS:00000000f74e3940 |CS: 0010 DS: 002b ES: 002b CR0: 000000008005003b |CR2: 0000000008cf6008 CR3: 000000013b169000 CR4: 00000000000006e0 |Call Trace: | <#DB> | [<ffffffff810f8158>] ? trace_preempt_off+0x18/0x170 | <<EOE>> | [<ffffffff81077745>] preempt_count_add+0xa5/0xc0 | [<ffffffff810c78b2>] on_each_cpu+0x22/0x90 | [<ffffffff8100ceab>] text_poke_bp+0x5b/0xc0 | [<ffffffff8100a29c>] arch_jump_label_transform+0x8c/0xf0 | [<ffffffff8111c77c>] __jump_label_update+0x6c/0x80 | [<ffffffff8111c83a>] jump_label_update+0xaa/0xc0 | [<ffffffff8111ca54>] static_key_slow_inc+0x94/0xa0 | [<ffffffff810e0d8d>] tracepoint_probe_register_prio+0x26d/0x2c0 | [<ffffffff810e0df3>] tracepoint_probe_register+0x13/0x20 | [<ffffffff810fca78>] trace_event_reg+0x98/0xd0 | [<ffffffff810fcc8b>] __ftrace_event_enable_disable+0x6b/0x180 | [<ffffffff810fd5b8>] event_enable_write+0x78/0xc0 | [<ffffffff8117a768>] __vfs_write+0x28/0xe0 | [<ffffffff8117b025>] vfs_write+0xa5/0x180 | [<ffffffff8117bb76>] SyS_write+0x46/0xa0 | [<ffffffff81002c91>] do_fast_syscall_32+0xa1/0x1d0 | [<ffffffff81684d57>] sysenter_flags_fixed+0xd/0x17
during
echo 1 > /sys/kernel/debug/tracing/events/hist/preemptirqsoff_hist/enable
--- arch/Kconfig | 1 + 1 file changed, 1 insertion(+)
arch/Kconfig +1 -0
@@ -50,6 +50,7 @@ config KPROBES config JUMP_LABEL bool "Optimize very unlikely/likely branches" depends on HAVE_ARCH_JUMP_LABEL + depends on (!INTERRUPT_OFF_HIST && !PREEMPT_OFF_HIST && !WAKEUP_LATENCY_HIST && !MISSED_TIMER_OFFSETS_HIST) help This option enables a transparent branch optimization that makes certain almost-always-true or almost-always-false branch
Signature · 1 line
2.7.0
Steven Rostedt
maintainerPATCH 2/7 kernel: migrate_disable() do fastpath in atomic & irqs-off
In reply to Steven Rostedt3.4.110-rt140-rc1 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Sebastian Andrzej Siewior <[email protected]>
With interrupts off it makes no sense to do the long path since we can't leave the CPU anyway. Also we might end up in a recursion with lockdep.
--- kernel/sched/core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/sched/core.c +2 -2
@@ -3389,7 +3389,7 @@ void migrate_disable(void) {struct task_struct *p = current; -if (in_atomic ()) { +if (in_atomic () ||irqs_disabled ()) {#ifdef CONFIG_SCHED_DEBUG p->migrate_disable_atomic++;#endif
@@ -3420,7 +3420,7 @@ void migrate_enable(void)unsigned long flags;struct rq *rq; -if (in_atomic ()) { +if (in_atomic () ||irqs_disabled ()) {#ifdef CONFIG_SCHED_DEBUG p->migrate_disable_atomic--;#endif
Signature · 1 line
2.7.0
Steven Rostedt
maintainerPATCH 3/7 kernel: softirq: unlock with irqs on
In reply to Steven Rostedt3.4.110-rt140-rc1 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Sebastian Andrzej Siewior <[email protected]>
We unlock the lock while the interrupts are off. This isn't a problem now but will get because the migrate_disable() + enable are not symmetrical in regard to the status of interrupts.
--- kernel/softirq.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/softirq.c +2 -2
@@ -561,10 +561,10 @@ static int __thread_do_softirq(int cpu)*/ if (local_softirq_pending ())__do_softirq_common (cpu >=0 ); -local_unlock (local_softirq_lock);unpin_current_cpu (); -preempt_disable ();local_irq_enable (); +local_unlock (local_softirq_lock); +preempt_disable ();return 0 ; }
Signature · 1 line
2.7.0
Steven Rostedt
maintainerPATCH 4/7 trace: Use rcuidle version for preemptoff_hist trace point
In reply to Steven Rostedt3.4.110-rt140-rc1 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Yang Shi <[email protected]>
When running -rt kernel with both PREEMPT_OFF_HIST and LOCKDEP enabled, the below error is reported:
[ INFO: suspicious RCU usage. ]
4.4.1-rt6 #1 Not tainted
include/trace/events/hist.h:31 suspicious rcu_dereference_check() usage!
other info that might help us debug this:
RCU used illegally from idle CPU! rcu_scheduler_active = 1, debug_locks = 0 RCU used illegally from extended quiescent state! no locks held by swapper/0/0.
stack backtrace:
CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.4.1-rt6-WR8.0.0.0_standard #1
Stack : 0000000000000006 0000000000000000 ffffffff81ca8c38 ffffffff81c8fc80
ffffffff811bdd68 ffffffff81cb0000 0000000000000000 ffffffff81cb0000
0000000000000000 0000000000000000 0000000000000004 0000000000000000
0000000000000004 ffffffff811bdf50 0000000000000000 ffffffff82b60000
0000000000000000 ffffffff812897ac ffffffff819f0000 000000000000000b
ffffffff811be460 ffffffff81b7c588 ffffffff81c8fc80 0000000000000000
0000000000000000 ffffffff81ec7f88 ffffffff81d70000 ffffffff81b70000
ffffffff81c90000 ffffffff81c3fb00 ffffffff81c3fc28 ffffffff815e6f98
0000000000000000 ffffffff81c8fa87 ffffffff81b70958 ffffffff811bf2c4
0707fe32e8d60ca5 ffffffff81126d60 0000000000000000 0000000000000000
...
Call Trace:
[<ffffffff81126d60>] show_stack+0xe8/0x108
[<ffffffff815e6f98>] dump_stack+0x88/0xb0
[<ffffffff8124b88c>] time_hardirqs_off+0x204/0x300
[<ffffffff811aa5dc>] trace_hardirqs_off_caller+0x24/0xe8
[<ffffffff811a4ec4>] cpu_startup_entry+0x39c/0x508
[<ffffffff81d7dc68>] start_kernel+0x584/0x5a0Replace regular trace_preemptoff_hist to rcuidle version to avoid the error.
--- include/trace/events/hist.h | 1 + kernel/trace/trace_irqsoff.c | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-)
include/trace/events/hist.h +1 -0
@@ -9,6 +9,7 @@#if !defined(CONFIG_PREEMPT_OFF_HIST ) && !defined(CONFIG_INTERRUPT_OFF_HIST )#define trace_preemptirqsoff_hist (a,b) +#define trace_preemptirqsoff_hist_rcuidle (a, b)#else TRACE_EVENT(preemptirqsoff_hist,
kernel/trace/trace_irqsoff.c +4 -4
@@ -438,13 +438,13 @@ void start_critical_timings(void) {if (preempt_trace () ||irq_trace ())start_critical_timing (CALLER_ADDR0 ,CALLER_ADDR1 ); -trace_preemptirqsoff_hist (TRACE_START ,1 ); +trace_preemptirqsoff_hist_rcuidle (TRACE_START ,1 ); }EXPORT_SYMBOL_GPL (start_critical_timings);void stop_critical_timings (void ) { -trace_preemptirqsoff_hist (TRACE_STOP ,0 ); +trace_preemptirqsoff_hist_rcuidle (TRACE_STOP ,0 );if (preempt_trace () ||irq_trace ())stop_critical_timing (CALLER_ADDR0 ,CALLER_ADDR1 ); }
@@ -489,7 +489,7 @@ inline void print_irqtrace_events(struct task_struct *curr)*/ void trace_hardirqs_on (void ) { -trace_preemptirqsoff_hist (IRQS_ON ,0 ); +trace_preemptirqsoff_hist_rcuidle (IRQS_ON ,0 );if (!preempt_trace () &&irq_trace ())stop_critical_timing (CALLER_ADDR0 ,CALLER_ADDR1 ); }
@@ -499,7 +499,7 @@ void trace_hardirqs_off(void) {if (!preempt_trace () &&irq_trace ())start_critical_timing (CALLER_ADDR0 ,CALLER_ADDR1 ); -trace_preemptirqsoff_hist (IRQS_OFF ,1 ); +trace_preemptirqsoff_hist_rcuidle (IRQS_OFF ,1 ); }EXPORT_SYMBOL (trace_hardirqs_off);
Signature · 1 line
2.7.0
Steven Rostedt
maintainerPATCH 5/7 rcu/torture: Comment out rcu_bh ops on PREEMPT_RT_FULL
In reply to Steven Rostedt3.4.110-rt140-rc1 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Clark Williams <[email protected]>
RT has dropped support of rcu_bh, comment out in rcutorture.
--- kernel/rcutorture.c | 7 +++++++ 1 file changed, 7 insertions(+)
kernel/rcutorture.c +7 -0
@@ -485,6 +485,7 @@ static struct rcu_torture_ops rcu_expedited_ops = { .name = "rcu_expedited" }; +#ifndef CONFIG_PREEMPT_RT_FULL /* * Definitions for rcu_bh torture testing. */
@@ -558,6 +559,12 @@ static struct rcu_torture_ops rcu_bh_expedited_ops = { .name = "rcu_bh_expedited" }; +#else +static struct rcu_torture_ops rcu_bh_ops = { + .ttype =INVALID_RCU_FLAVOR , +}; +#endif +/* * Definitions for srcu torture testing. */
Signature · 1 line
2.7.0
Steven Rostedt
maintainerPATCH 6/7 kernel: sched: Fix preempt_disable_ip recodring for preempt_disable()
In reply to Steven Rostedt3.4.110-rt140-rc1 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Sebastian Andrzej Siewior <[email protected]>
preempt_disable() invokes preempt_count_add() which saves the caller in current->preempt_disable_ip. It uses CALLER_ADDR1 which does not look for its caller but for the parent of the caller. Which means we get the correct caller for something like spin_lock() unless the architectures inlines those invocations. It is always wrong for preempt_disable() or local_bh_disable().
This patch makes the function get_parent_ip() which tries CALLER_ADDR0,1,2 if the former is a locking function. This seems to record the preempt_disable() caller properly for preempt_disable() itself as well as for get_cpu_var() or local_bh_disable().
--- include/linux/ftrace.h | 12 ++++++++++++ include/linux/sched.h | 2 -- kernel/sched/core.c | 14 ++------------ kernel/softirq.c | 2 +- 4 files changed, 15 insertions(+), 15 deletions(-)
include/linux/ftrace.h +12 -0
@@ -476,6 +476,18 @@ static inline void __ftrace_enabled_restore(int enabled)# endif #endif /* ifndef HAVE_ARCH_CALLER_ADDR */ +static inline unsigned long get_lock_parent_ip (void ) +{ +unsigned long addr =CALLER_ADDR0 ; + +if (!in_lock_functions (addr)) +return addr; + addr =CALLER_ADDR1 ; +if (!in_lock_functions (addr)) +return addr; +return CALLER_ADDR2 ; +} +#ifdef CONFIG_IRQSOFF_TRACER extern void time_hardirqs_on (unsigned long a0,unsigned long a1);extern void time_hardirqs_off (unsigned long a0,unsigned long a1);
include/linux/sched.h +0 -2
@@ -148,8 +148,6 @@ extern unsigned long this_cpu_load(void);extern void calc_global_load (unsigned long ticks);extern void update_cpu_load_nohz (void ); -extern unsigned long get_parent_ip (unsigned long addr); -struct seq_file ;struct cfs_rq ;struct task_group ;
kernel/sched/core.c +2 -12
@@ -3241,16 +3241,6 @@ void scheduler_tick(void)#endif } -notrace unsigned long get_parent_ip (unsigned long addr) -{ -if (in_lock_functions (addr)) { - addr =CALLER_ADDR2 ; -if (in_lock_functions (addr)) - addr =CALLER_ADDR3 ; - } -return addr; -} -#if defined(CONFIG_PREEMPT ) && (defined(CONFIG_DEBUG_PREEMPT ) || \ defined(CONFIG_PREEMPT_TRACER ))
@@ -3272,7 +3262,7 @@ void __kprobes add_preempt_count(int val) PREEMPT_MASK - 10);#endif if (preempt_count () == val) { -unsigned long ip =get_parent_ip (CALLER_ADDR1 ); +unsigned long ip =get_lock_parent_ip ();#ifdef CONFIG_DEBUG_PREEMPT current->preempt_disable_ip = ip;#endif
@@ -3298,7 +3288,7 @@ void __kprobes sub_preempt_count(int val)#endif if (preempt_count () == val) -trace_preempt_on (CALLER_ADDR0 ,get_parent_ip (CALLER_ADDR1 )); +trace_preempt_on (CALLER_ADDR0 ,get_lock_parent_ip ());preempt_count () -= val; }EXPORT_SYMBOL (sub_preempt_count);
kernel/softirq.c +1 -1
@@ -207,7 +207,7 @@ static void __local_bh_disable(unsigned long ip, unsigned int cnt)raw_local_irq_restore (flags);if (preempt_count () == cnt) - trace_preempt_off(CALLER_ADDR0, get_parent_ip(CALLER_ADDR1)); + trace_preempt_off(CALLER_ADDR0, get_lock_parent_ip()); }#else /* !CONFIG_TRACE_IRQFLAGS */ static inline void __local_bh_disable (unsigned long ip,unsigned int cnt)
Signature · 1 line
2.7.0
Steven Rostedt
maintainerPATCH 7/7 Linux 3.4.110-rt140-rc1
In reply to Steven Rostedt3.4.110-rt140-rc1 stable review patch.
If anyone has any objections, please let me know.
------------------
From: "Steven Rostedt (Red Hat)" <[email protected]>
--- localversion-rt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
localversion-rt +1 -1
@@ -1 +1 @@ --rt139 +-rt140-rc1
Signature · 1 line
2.7.0