summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2015-11-04 10:47:15 +0100
committerThomas Gleixner <tglx@linutronix.de>2015-11-04 10:47:15 +0100
commitb3c7938b7046902ca9e3b6922865dcc80ed0c482 (patch)
treeb2e04d4a16145ad074b9dc1c3bda47d640ca2798
parent1909cd47a5513a74456f85e17bf6edc92db04b95 (diff)
download4.9-rt-patches-b3c7938b7046902ca9e3b6922865dcc80ed0c482.tar.gz
v4.1.12-rt12-patches
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r--patches/cond-resched-lock-rt-tweak.patch29
-rw-r--r--patches/inet-fix-potential-deadlock-in-reqsk-queue-unlink35
-rw-r--r--patches/localversion.patch4
-rw-r--r--patches/preempt-lazy-support.patch30
-rw-r--r--patches/series1
-rw-r--r--patches/tracing-fix-rcu-splat-from-idle-cpu-on-boot.patch81
6 files changed, 33 insertions, 147 deletions
diff --git a/patches/cond-resched-lock-rt-tweak.patch b/patches/cond-resched-lock-rt-tweak.patch
index b59f5e447af4e..3aa7dfbf71817 100644
--- a/patches/cond-resched-lock-rt-tweak.patch
+++ b/patches/cond-resched-lock-rt-tweak.patch
@@ -7,19 +7,22 @@ locked. Update PREEMPT_LOCK_OFFSET for that case.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
- include/linux/sched.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
+ include/linux/preempt_mask.h | 4 ++++
+ 1 file changed, 4 insertions(+)
-Index: linux-rt-devel/include/linux/sched.h
+Index: linux-rt-devel/include/linux/preempt_mask.h
===================================================================
---- linux-rt-devel.orig/include/linux/sched.h
-+++ linux-rt-devel/include/linux/sched.h
-@@ -2926,7 +2926,7 @@ extern int _cond_resched(void);
+--- linux-rt-devel.orig/include/linux/preempt_mask.h
++++ linux-rt-devel/include/linux/preempt_mask.h
+@@ -83,7 +83,11 @@
+ /*
+ * The preempt_count offset after spin_lock()
+ */
++#if !defined(CONFIG_PREEMPT_RT_FULL)
+ #define PREEMPT_LOCK_OFFSET PREEMPT_DISABLE_OFFSET
++#else
++#define PREEMPT_LOCK_OFFSET 0
++#endif
- extern int __cond_resched_lock(spinlock_t *lock);
-
--#ifdef CONFIG_PREEMPT_COUNT
-+#if defined(CONFIG_PREEMPT_COUNT) && !defined(CONFIG_PREEMPT_RT_FULL)
- #define PREEMPT_LOCK_OFFSET PREEMPT_OFFSET
- #else
- #define PREEMPT_LOCK_OFFSET 0
+ /*
+ * The preempt_count offset needed for things like:
diff --git a/patches/inet-fix-potential-deadlock-in-reqsk-queue-unlink b/patches/inet-fix-potential-deadlock-in-reqsk-queue-unlink
deleted file mode 100644
index b92455cf2993c..0000000000000
--- a/patches/inet-fix-potential-deadlock-in-reqsk-queue-unlink
+++ /dev/null
@@ -1,35 +0,0 @@
-From: Eric Dumazet <edumazet@google.com>
-Date: Thu Aug 13 15:44:51 2015 -0700
-Subject: inet: fix potential deadlock in reqsk_queue_unlink()
-
-Upstream commit: 83fccfc3940c
-
-When replacing del_timer() with del_timer_sync(), I introduced
-a deadlock condition :
-
-reqsk_queue_unlink() is called from inet_csk_reqsk_queue_drop()
-
-inet_csk_reqsk_queue_drop() can be called from many contexts,
-one being the timer handler itself (reqsk_timer_handler()).
-
-In this case, del_timer_sync() loops forever.
-
-Simple fix is to test if timer is pending.
-
-Fixes: 2235f2ac75fd ("inet: fix races with reqsk timers")
-Signed-off-by: Eric Dumazet <edumazet@google.com>
-Signed-off-by: David S. Miller <davem@davemloft.net>
-Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-diff --git a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c
-index b27fc401c6a9..e664706b350c 100644
---- a/net/ipv4/inet_connection_sock.c
-+++ b/net/ipv4/inet_connection_sock.c
-@@ -584,7 +584,7 @@ static bool reqsk_queue_unlink(struct request_sock_queue *queue,
- }
-
- spin_unlock(&queue->syn_wait_lock);
-- if (del_timer_sync(&req->rsk_timer))
-+ if (timer_pending(&req->rsk_timer) && del_timer_sync(&req->rsk_timer))
- reqsk_put(req);
- return found;
- }
diff --git a/patches/localversion.patch b/patches/localversion.patch
index 113cb973a4825..51430b78045b1 100644
--- a/patches/localversion.patch
+++ b/patches/localversion.patch
@@ -1,4 +1,4 @@
-Subject: v4.1.10-rt11
+Subject: v4.1.12-rt12
From: Thomas Gleixner <tglx@linutronix.de>
Date: Fri, 08 Jul 2011 20:25:16 +0200
@@ -12,4 +12,4 @@ Index: linux-rt-devel/localversion-rt
--- /dev/null
+++ linux-rt-devel/localversion-rt
@@ -0,0 +1 @@
-+-rt11
++-rt12
diff --git a/patches/preempt-lazy-support.patch b/patches/preempt-lazy-support.patch
index 4806ce3d9312e..36ac3daed4109 100644
--- a/patches/preempt-lazy-support.patch
+++ b/patches/preempt-lazy-support.patch
@@ -95,13 +95,13 @@ Index: linux-rt-devel/arch/x86/include/asm/preempt.h
/*
* Returns true when we need to resched and can (barring IRQ state).
*/
- static __always_inline bool should_resched(void)
+ static __always_inline bool should_resched(int preempt_offset)
{
+#ifdef CONFIG_PREEMPT_LAZY
-+ return unlikely(!raw_cpu_read_4(__preempt_count) || \
++ return unlikely(raw_cpu_read_4(__preempt_count) == preempt_offset ||
+ test_thread_flag(TIF_NEED_RESCHED_LAZY));
+#else
- return unlikely(!raw_cpu_read_4(__preempt_count));
+ return unlikely(raw_cpu_read_4(__preempt_count) == preempt_offset);
+#endif
}
@@ -122,7 +122,7 @@ Index: linux-rt-devel/include/linux/preempt.h
===================================================================
--- linux-rt-devel.orig/include/linux/preempt.h
+++ linux-rt-devel/include/linux/preempt.h
-@@ -33,6 +33,20 @@ extern void preempt_count_sub(int val);
+@@ -34,6 +34,20 @@ extern void preempt_count_sub(int val);
#define preempt_count_inc() preempt_count_add(1)
#define preempt_count_dec() preempt_count_sub(1)
@@ -143,7 +143,7 @@ Index: linux-rt-devel/include/linux/preempt.h
#ifdef CONFIG_PREEMPT_COUNT
#define preempt_disable() \
-@@ -41,6 +55,12 @@ do { \
+@@ -42,6 +56,12 @@ do { \
barrier(); \
} while (0)
@@ -156,7 +156,7 @@ Index: linux-rt-devel/include/linux/preempt.h
#define sched_preempt_enable_no_resched() \
do { \
barrier(); \
-@@ -69,6 +89,13 @@ do { \
+@@ -70,6 +90,13 @@ do { \
__preempt_schedule(); \
} while (0)
@@ -170,7 +170,7 @@ Index: linux-rt-devel/include/linux/preempt.h
#else
#define preempt_enable() \
do { \
-@@ -147,7 +174,7 @@ do { \
+@@ -148,7 +175,7 @@ do { \
} while (0)
#define preempt_fold_need_resched() \
do { \
@@ -320,7 +320,7 @@ Index: linux-rt-devel/kernel/sched/core.c
#ifdef CONFIG_SMP
plist_node_init(&p->pushable_tasks, MAX_PRIO);
RB_CLEAR_NODE(&p->pushable_dl_tasks);
-@@ -2774,6 +2809,7 @@ void migrate_disable(void)
+@@ -2781,6 +2816,7 @@ void migrate_disable(void)
}
preempt_disable();
@@ -328,7 +328,7 @@ Index: linux-rt-devel/kernel/sched/core.c
pin_current_cpu();
p->migrate_disable = 1;
preempt_enable();
-@@ -2831,6 +2867,7 @@ void migrate_enable(void)
+@@ -2838,6 +2874,7 @@ void migrate_enable(void)
unpin_current_cpu();
preempt_enable();
@@ -336,7 +336,7 @@ Index: linux-rt-devel/kernel/sched/core.c
}
EXPORT_SYMBOL(migrate_enable);
#else
-@@ -2964,6 +3001,7 @@ static void __sched __schedule(void)
+@@ -2971,6 +3008,7 @@ static void __sched __schedule(void)
next = pick_next_task(rq, prev);
clear_tsk_need_resched(prev);
@@ -344,7 +344,7 @@ Index: linux-rt-devel/kernel/sched/core.c
clear_preempt_need_resched();
rq->clock_skip_update = 0;
-@@ -3108,6 +3146,14 @@ asmlinkage __visible void __sched notrac
+@@ -3115,6 +3153,14 @@ asmlinkage __visible void __sched notrac
if (likely(!preemptible()))
return;
@@ -359,7 +359,7 @@ Index: linux-rt-devel/kernel/sched/core.c
do {
__preempt_count_add(PREEMPT_ACTIVE);
/*
-@@ -4831,7 +4877,9 @@ void init_idle(struct task_struct *idle,
+@@ -4838,7 +4884,9 @@ void init_idle(struct task_struct *idle,
/* Set the preempt count _outside_ the spinlocks! */
init_idle_preempt_count(idle, cpu);
@@ -428,7 +428,7 @@ Index: linux-rt-devel/kernel/sched/fair.c
/*
* Only set the backward buddy when the current task is still
* on the rq. This can happen when a wakeup gets interleaved
-@@ -7866,7 +7866,7 @@ static void task_fork_fair(struct task_s
+@@ -7869,7 +7869,7 @@ static void task_fork_fair(struct task_s
* 'current' within the tree based on its new key value.
*/
swap(curr->vruntime, se->vruntime);
@@ -437,7 +437,7 @@ Index: linux-rt-devel/kernel/sched/fair.c
}
se->vruntime -= cfs_rq->min_vruntime;
-@@ -7891,7 +7891,7 @@ prio_changed_fair(struct rq *rq, struct
+@@ -7894,7 +7894,7 @@ prio_changed_fair(struct rq *rq, struct
*/
if (rq->curr == p) {
if (p->prio > oldprio)
@@ -464,7 +464,7 @@ Index: linux-rt-devel/kernel/sched/sched.h
===================================================================
--- linux-rt-devel.orig/kernel/sched/sched.h
+++ linux-rt-devel/kernel/sched/sched.h
-@@ -1290,6 +1290,15 @@ extern void init_sched_dl_class(void);
+@@ -1291,6 +1291,15 @@ extern void init_sched_dl_class(void);
extern void resched_curr(struct rq *rq);
extern void resched_cpu(int cpu);
diff --git a/patches/series b/patches/series
index aa70e378b0469..ee2fa59aa0107 100644
--- a/patches/series
+++ b/patches/series
@@ -6,7 +6,6 @@
# UPSTREAM changes queued
############################################################
xfs--clean-up-inode-lockdep-annotations
-inet-fix-potential-deadlock-in-reqsk-queue-unlink
############################################################
# UPSTREAM FIXES, patches pending
diff --git a/patches/tracing-fix-rcu-splat-from-idle-cpu-on-boot.patch b/patches/tracing-fix-rcu-splat-from-idle-cpu-on-boot.patch
deleted file mode 100644
index 73f802988e98b..0000000000000
--- a/patches/tracing-fix-rcu-splat-from-idle-cpu-on-boot.patch
+++ /dev/null
@@ -1,81 +0,0 @@
-Subject: tracing: Fix rcu splat from idle CPU on boot
-From: Philipp Schrader <philipp@peloton-tech.com>
-Date: Thu, 3 Sep 2015 14:29:14 -0700
-
-With PREEMPT_RT and most of the lockdep-related options enabled I
-encountered this splat when booting our DRA7 evaluation module:
-
-[ 0.055073]
-[ 0.055076] ===============================
-[ 0.055079] [ INFO: suspicious RCU usage. ]
-[ 0.055084] 4.1.6+ #2 Not tainted
-[ 0.055086] -------------------------------
-[ 0.055090] include/trace/events/hist.h:31 suspicious
-rcu_dereference_check() usage!
-[ 0.055093]
-[ 0.055093] other info that might help us debug this:
-[ 0.055093]
-[ 0.055097]
-[ 0.055097] RCU used illegally from idle CPU!
-[ 0.055097] rcu_scheduler_active = 1, debug_locks = 1
-[ 0.055100] RCU used illegally from extended quiescent state!
-[ 0.055104] no locks held by swapper/0/0.
-[ 0.055106]
-[ 0.055106] stack backtrace:
-[ 0.055112] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.1.6+ #2
-[ 0.055116] Hardware name: Generic DRA74X (Flattened Device Tree)
-[ 0.055130] [<c00196b8>] (unwind_backtrace) from [<c001515c>]
-(show_stack+0x20/0x24)
-[ 0.055146] [<c001515c>] (show_stack) from [<c07bc408>]
-(dump_stack+0x84/0xa0)
-[ 0.055160] [<c07bc408>] (dump_stack) from [<c009bc38>]
-(lockdep_rcu_suspicious+0xb0/0x110)
-[ 0.055172] [<c009bc38>] (lockdep_rcu_suspicious) from [<c01246c4>]
-(time_hardirqs_off+0x2b8/0x3c8)
-[ 0.055184] [<c01246c4>] (time_hardirqs_off) from [<c009a218>]
-(trace_hardirqs_off_caller+0x2c/0xf4)
-[ 0.055194] [<c009a218>] (trace_hardirqs_off_caller) from
-[<c009a2f4>] (trace_hardirqs_off+0x14/0x18)
-[ 0.055204] [<c009a2f4>] (trace_hardirqs_off) from [<c00c7ecc>]
-(rcu_idle_enter+0x78/0xcc)
-[ 0.055213] [<c00c7ecc>] (rcu_idle_enter) from [<c0093eb0>]
-(cpu_startup_entry+0x190/0x518)
-[ 0.055222] [<c0093eb0>] (cpu_startup_entry) from [<c07b95b4>]
-(rest_init+0x13c/0x17c)
-[ 0.055231] [<c07b95b4>] (rest_init) from [<c0b32c74>]
-(start_kernel+0x320/0x380)
-[ 0.055238] [<c0b32c74>] (start_kernel) from [<8000807c>] (0x8000807c)
-
-As per Steve Rotstedt's suggestion I changed the trace_* calls to
-trace_*_rcuidle calls. He pointed out that the trace points were getting
-triggered when rcu wasn't watching.
-
-Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-Cc: Steven Rostedt <rostedt@goodmis.org>
-Cc: stable-rt@vger.kernel.org
----
- kernel/trace/trace_irqsoff.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-Index: linux-rt-devel/kernel/trace/trace_irqsoff.c
-===================================================================
---- linux-rt-devel.orig/kernel/trace/trace_irqsoff.c
-+++ linux-rt-devel/kernel/trace/trace_irqsoff.c
-@@ -450,7 +450,7 @@ EXPORT_SYMBOL_GPL(stop_critical_timings)
- #ifdef CONFIG_PROVE_LOCKING
- void time_hardirqs_on(unsigned long a0, unsigned long a1)
- {
-- trace_preemptirqsoff_hist(IRQS_ON, 0);
-+ trace_preemptirqsoff_hist_rcuidle(IRQS_ON, 0);
- if (!preempt_trace() && irq_trace())
- stop_critical_timing(a0, a1);
- }
-@@ -459,7 +459,7 @@ void time_hardirqs_off(unsigned long a0,
- {
- if (!preempt_trace() && irq_trace())
- start_critical_timing(a0, a1);
-- trace_preemptirqsoff_hist(IRQS_OFF, 1);
-+ trace_preemptirqsoff_hist_rcuidle(IRQS_OFF, 1);
- }
-
- #else /* !CONFIG_PROVE_LOCKING */