* [PATCH RT 1/6] rcutree/rcu_bh_qs: disable irq while calling rcu_preempt_qs()
2014-03-05 0:33 [PATCH RT 0/6] Linux 3.2.55-rt79-rc1 Steven Rostedt
@ 2014-03-05 0:33 ` Steven Rostedt
2014-03-05 0:33 ` [PATCH RT 2/6] Revert "x86: Disable IST stacks for debug/int 3/stack fault for PREEMPT_RT" Steven Rostedt
` (4 subsequent siblings)
5 siblings, 0 replies; 10+ messages in thread
From: Steven Rostedt @ 2014-03-05 0:33 UTC (permalink / raw)
To: linux-kernel, linux-rt-users
Cc: Thomas Gleixner, Carsten Emde, Sebastian Andrzej Siewior,
John Kacur, Paul Gortmaker, stable-rt, Tiejun Chen, Bin Jiang
[-- Attachment #1: 0001-rcutree-rcu_bh_qs-disable-irq-while-calling-rcu_pree.patch --]
[-- Type: text/plain, Size: 1594 bytes --]
3.2.55-rt79-rc1 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Tiejun Chen <tiejun.chen@windriver.com>
Any callers to the function rcu_preempt_qs() must disable irqs in
order to protect the assignment to ->rcu_read_unlock_special. In
RT case, rcu_bh_qs() as the wrapper of rcu_preempt_qs() is called
in some scenarios where irq is enabled, like this path,
do_single_softirq()
|
+ local_irq_enable();
+ handle_softirq()
| |
| + rcu_bh_qs()
| |
| + rcu_preempt_qs()
|
+ local_irq_disable()
So here we'd better disable irq directly inside of rcu_bh_qs() to
fix this, otherwise the kernel may be freezable sometimes as
observed. And especially this way is also kind and safe for the
potential rcu_bh_qs() usage elsewhere in the future.
Cc: stable-rt@vger.kernel.org
Signed-off-by: Tiejun Chen <tiejun.chen@windriver.com>
Signed-off-by: Bin Jiang <bin.jiang@windriver.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
kernel/rcutree.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/kernel/rcutree.c b/kernel/rcutree.c
index 82c2224..6c2ec2d 100644
--- a/kernel/rcutree.c
+++ b/kernel/rcutree.c
@@ -175,7 +175,12 @@ static void rcu_preempt_qs(int cpu);
void rcu_bh_qs(int cpu)
{
+ unsigned long flags;
+
+ /* Callers to this function, rcu_preempt_qs(), must disable irqs. */
+ local_irq_save(flags);
rcu_preempt_qs(cpu);
+ local_irq_restore(flags);
}
#else
void rcu_bh_qs(int cpu)
--
1.8.5.3
^ permalink raw reply related [flat|nested] 10+ messages in thread* [PATCH RT 2/6] Revert "x86: Disable IST stacks for debug/int 3/stack fault for PREEMPT_RT"
2014-03-05 0:33 [PATCH RT 0/6] Linux 3.2.55-rt79-rc1 Steven Rostedt
2014-03-05 0:33 ` [PATCH RT 1/6] rcutree/rcu_bh_qs: disable irq while calling rcu_preempt_qs() Steven Rostedt
@ 2014-03-05 0:33 ` Steven Rostedt
2014-03-05 0:33 ` [PATCH RT 3/6] rt: Make cpu_chill() use hrtimer instead of msleep() Steven Rostedt
` (3 subsequent siblings)
5 siblings, 0 replies; 10+ messages in thread
From: Steven Rostedt @ 2014-03-05 0:33 UTC (permalink / raw)
To: linux-kernel, linux-rt-users
Cc: Thomas Gleixner, Carsten Emde, Sebastian Andrzej Siewior,
John Kacur, Paul Gortmaker, stable-rt, Brian Silverman,
Andi Kleen
[-- Attachment #1: 0002-Revert-x86-Disable-IST-stacks-for-debug-int-3-stack-.patch --]
[-- Type: text/plain, Size: 4368 bytes --]
3.2.55-rt79-rc1 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
where do I start. Let me explain what is going on here. The code
sequence
| pushf
| pop %edx
| or $0x1,%dh
| push %edx
| mov $0xe0,%eax
| popf
| sysenter
triggers the bug. On 64bit kernel we see the double fault (with 32bit and
64bit userland) and on 32bit kernel there is no problem. The reporter said
that double fault does not happen on 64bit kernel with 64bit userland and
this is because in that case the VDSO uses the "syscall" interface instead
of "sysenter".
The bug. "popf" loads the flags with the TF bit set which enables
"single stepping" and this leads to a debug exception. Usually on 64bit
we have a special IST stack for the debug exception. Due to patch [0] we
do not use the IST stack but the kernel stack instead. On 64bit the
sysenter instruction starts in kernel with the stack address NULL. The
code sequence above enters the debug exception (TF flag) after the
sysenter instruction was executed which sets the stack pointer to NULL
and we have a fault (it seems that the debug exception saves some bytes
on the stack).
To fix the double fault I'm going to drop patch [0]. It is completely
pointless. In do_debug() and do_stack_segment() we disable preemption
which means the task can't leave the CPU. So it does not matter if we run
on IST or on kernel stack.
There is a patch [1] which drops preempt_disable() call for a 32bit
kernel but not for 64bit so there should be no regression.
And [1] seems valid even for this code sequence. We enter the debug
exception with a 256bytes long per cpu stack and migrate to the kernel
stack before calling do_debug().
[0] x86-disable-debug-stack.patch
[1] fix-rt-int3-x86_32-3.2-rt.patch
Cc: stable-rt@vger.kernel.org
Reported-by: Brian Silverman <bsilver16384@gmail.com>
Cc: Andi Kleen <andi@firstfloor.org>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
arch/x86/include/asm/page_64_types.h | 21 ++++++---------------
arch/x86/kernel/cpu/common.c | 2 --
arch/x86/kernel/dumpstack_64.c | 4 ----
3 files changed, 6 insertions(+), 21 deletions(-)
diff --git a/arch/x86/include/asm/page_64_types.h b/arch/x86/include/asm/page_64_types.h
index 0883ecd..7639dbf 100644
--- a/arch/x86/include/asm/page_64_types.h
+++ b/arch/x86/include/asm/page_64_types.h
@@ -14,21 +14,12 @@
#define IRQ_STACK_ORDER 2
#define IRQ_STACK_SIZE (PAGE_SIZE << IRQ_STACK_ORDER)
-#ifdef CONFIG_PREEMPT_RT_FULL
-# define STACKFAULT_STACK 0
-# define DOUBLEFAULT_STACK 1
-# define NMI_STACK 2
-# define DEBUG_STACK 0
-# define MCE_STACK 3
-# define N_EXCEPTION_STACKS 3 /* hw limit: 7 */
-#else
-# define STACKFAULT_STACK 1
-# define DOUBLEFAULT_STACK 2
-# define NMI_STACK 3
-# define DEBUG_STACK 4
-# define MCE_STACK 5
-# define N_EXCEPTION_STACKS 5 /* hw limit: 7 */
-#endif
+#define STACKFAULT_STACK 1
+#define DOUBLEFAULT_STACK 2
+#define NMI_STACK 3
+#define DEBUG_STACK 4
+#define MCE_STACK 5
+#define N_EXCEPTION_STACKS 5 /* hw limit: 7 */
#define PUD_PAGE_SIZE (_AC(1, UL) << PUD_SHIFT)
#define PUD_PAGE_MASK (~(PUD_PAGE_SIZE-1))
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index edc013e..ca93cc7 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -1050,9 +1050,7 @@ DEFINE_PER_CPU(unsigned int, irq_count) = -1;
*/
static const unsigned int exception_stack_sizes[N_EXCEPTION_STACKS] = {
[0 ... N_EXCEPTION_STACKS - 1] = EXCEPTION_STKSZ,
-#if DEBUG_STACK > 0
[DEBUG_STACK - 1] = DEBUG_STKSZ
-#endif
};
static DEFINE_PER_CPU_PAGE_ALIGNED(char, exception_stacks
diff --git a/arch/x86/kernel/dumpstack_64.c b/arch/x86/kernel/dumpstack_64.c
index 352beb7..6d728d9 100644
--- a/arch/x86/kernel/dumpstack_64.c
+++ b/arch/x86/kernel/dumpstack_64.c
@@ -21,14 +21,10 @@
(N_EXCEPTION_STACKS + DEBUG_STKSZ/EXCEPTION_STKSZ - 2)
static char x86_stack_ids[][8] = {
-#if DEBUG_STACK > 0
[ DEBUG_STACK-1 ] = "#DB",
-#endif
[ NMI_STACK-1 ] = "NMI",
[ DOUBLEFAULT_STACK-1 ] = "#DF",
-#if STACKFAULT_STACK > 0
[ STACKFAULT_STACK-1 ] = "#SS",
-#endif
[ MCE_STACK-1 ] = "#MC",
#if DEBUG_STKSZ > EXCEPTION_STKSZ
[ N_EXCEPTION_STACKS ...
--
1.8.5.3
^ permalink raw reply related [flat|nested] 10+ messages in thread* [PATCH RT 3/6] rt: Make cpu_chill() use hrtimer instead of msleep()
2014-03-05 0:33 [PATCH RT 0/6] Linux 3.2.55-rt79-rc1 Steven Rostedt
2014-03-05 0:33 ` [PATCH RT 1/6] rcutree/rcu_bh_qs: disable irq while calling rcu_preempt_qs() Steven Rostedt
2014-03-05 0:33 ` [PATCH RT 2/6] Revert "x86: Disable IST stacks for debug/int 3/stack fault for PREEMPT_RT" Steven Rostedt
@ 2014-03-05 0:33 ` Steven Rostedt
2014-03-07 9:51 ` Sebastian Andrzej Siewior
2014-03-05 0:33 ` [PATCH RT 4/6] kernel/hrtimer: be non-freezeable in cpu_chill() Steven Rostedt
` (2 subsequent siblings)
5 siblings, 1 reply; 10+ messages in thread
From: Steven Rostedt @ 2014-03-05 0:33 UTC (permalink / raw)
To: linux-kernel, linux-rt-users
Cc: Thomas Gleixner, Carsten Emde, Sebastian Andrzej Siewior,
John Kacur, Paul Gortmaker, stable-rt
[-- Attachment #1: 0003-rt-Make-cpu_chill-use-hrtimer-instead-of-msleep.patch --]
[-- Type: text/plain, Size: 3757 bytes --]
3.2.55-rt79-rc1 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Steven Rostedt <rostedt@goodmis.org>
Ulrich Obergfell pointed out that cpu_chill() calls msleep() which is woken
up by the ksoftirqd running the TIMER softirq. But as the cpu_chill() is
called from softirq context, it may block the ksoftirqd() from running, in
which case, it may never wake up the msleep() causing the deadlock.
I checked the vmcore, and irq/74-qla2xxx is stuck in the msleep() call,
running on CPU 8. The one ksoftirqd that is stuck, happens to be the one that
runs on CPU 8, and it is blocked on a lock held by irq/74-qla2xxx. As that
ksoftirqd is the one that will wake up irq/74-qla2xxx, and it happens to be
blocked on a lock that irq/74-qla2xxx holds, we have our deadlock.
The solution is not to convert the cpu_chill() back to a cpu_relax() as that
will re-create a possible live lock that the cpu_chill() fixed earlier, and may
also leave this bug open on other softirqs. The fix is to remove the
dependency on ksoftirqd from cpu_chill(). That is, instead of calling
msleep() that requires ksoftirqd to wake it up, use the
hrtimer_nanosleep() code that does the wakeup from hard irq context.
|Looks to be the lock of the block softirq. I don't have the core dump
|anymore, but from what I could tell the ksoftirqd was blocked on the
|block softirq lock, where the block softirq handler did a msleep
|(called by the qla2xxx interrupt handler).
|
|Looking at trigger_softirq() in block/blk-softirq.c, it can do a
|smp_callfunction() to another cpu to run the block softirq. If that
|happens to be the cpu where the qla2xx irq handler is doing the block
|softirq and is in a middle of a msleep(), I believe the ksoftirqd will
|try to run the softirq. If it does that, then BOOM, it's deadlocked
|because the ksoftirqd will never run the timer softirq either.
|I should have also stated that it was only one lock that was involved.
|But the lock owner was doing a msleep() that requires a wakeup by
|ksoftirqd to continue. If ksoftirqd happens to be blocked on a lock
|held by the msleep() caller, then you have your deadlock.
|
|It's best not to have any softirqs going to sleep requiring another
|softirq to wake it up. Note, if we ever require a timer softirq to do a
|cpu_chill() it will most definitely hit this deadlock.
Cc: stable-rt@vger.kernel.org
Found-by: Ulrich Obergfell <uobergfe@redhat.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
[bigeasy: add the 4 | chapters from email]
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
include/linux/delay.h | 2 +-
kernel/hrtimer.c | 15 +++++++++++++++
2 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/include/linux/delay.h b/include/linux/delay.h
index e23a7c0..37caab3 100644
--- a/include/linux/delay.h
+++ b/include/linux/delay.h
@@ -53,7 +53,7 @@ static inline void ssleep(unsigned int seconds)
}
#ifdef CONFIG_PREEMPT_RT_FULL
-# define cpu_chill() msleep(1)
+extern void cpu_chill(void);
#else
# define cpu_chill() cpu_relax()
#endif
diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c
index ed0f3a1..a9f8842 100644
--- a/kernel/hrtimer.c
+++ b/kernel/hrtimer.c
@@ -1847,6 +1847,21 @@ SYSCALL_DEFINE2(nanosleep, struct timespec __user *, rqtp,
return hrtimer_nanosleep(&tu, rmtp, HRTIMER_MODE_REL, CLOCK_MONOTONIC);
}
+#ifdef CONFIG_PREEMPT_RT_FULL
+/*
+ * Sleep for 1 ms in hope whoever holds what we want will let it go.
+ */
+void cpu_chill(void)
+{
+ struct timespec tu = {
+ .tv_nsec = NSEC_PER_MSEC,
+ };
+
+ hrtimer_nanosleep(&tu, NULL, HRTIMER_MODE_REL, CLOCK_MONOTONIC);
+}
+EXPORT_SYMBOL(cpu_chill);
+#endif
+
/*
* Functions related to boot-time initialization:
*/
--
1.8.5.3
^ permalink raw reply related [flat|nested] 10+ messages in thread* Re: [PATCH RT 3/6] rt: Make cpu_chill() use hrtimer instead of msleep()
2014-03-05 0:33 ` [PATCH RT 3/6] rt: Make cpu_chill() use hrtimer instead of msleep() Steven Rostedt
@ 2014-03-07 9:51 ` Sebastian Andrzej Siewior
2014-03-07 14:52 ` Steven Rostedt
0 siblings, 1 reply; 10+ messages in thread
From: Sebastian Andrzej Siewior @ 2014-03-07 9:51 UTC (permalink / raw)
To: Steven Rostedt, linux-kernel, linux-rt-users
Cc: Thomas Gleixner, Carsten Emde, John Kacur, Paul Gortmaker,
stable-rt
On 03/05/2014 01:33 AM, Steven Rostedt wrote:
> 3.2.55-rt79-rc1 stable review patch.
> If anyone has any objections, please let me know.
Now that you posted "cpu_chill: Add a UNINTERRUPTIBLE
hrtimer_nanosleep" wouldn't it make sense to delay this patches from
the stable series until we get them all in one go?
Sebastian
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH RT 3/6] rt: Make cpu_chill() use hrtimer instead of msleep()
2014-03-07 9:51 ` Sebastian Andrzej Siewior
@ 2014-03-07 14:52 ` Steven Rostedt
2014-03-07 15:23 ` Sebastian Andrzej Siewior
0 siblings, 1 reply; 10+ messages in thread
From: Steven Rostedt @ 2014-03-07 14:52 UTC (permalink / raw)
To: Sebastian Andrzej Siewior
Cc: linux-kernel, linux-rt-users, Thomas Gleixner, Carsten Emde,
John Kacur, Paul Gortmaker, stable-rt
On Fri, 07 Mar 2014 10:51:55 +0100
Sebastian Andrzej Siewior <bigeasy@linutronix.de> wrote:
> On 03/05/2014 01:33 AM, Steven Rostedt wrote:
> > 3.2.55-rt79-rc1 stable review patch.
> > If anyone has any objections, please let me know.
>
> Now that you posted "cpu_chill: Add a UNINTERRUPTIBLE
> hrtimer_nanosleep" wouldn't it make sense to delay this patches from
> the stable series until we get them all in one go?
Sure, say this on the day I'm about to release ;-)
Nah, I'll release these today anyway. Otherwise I can't update to the
mainline stables. When the rc candidates are out, it holds up any new
updates to the versions.
Also, the stable 3.10 has this bug already. Might as well update all
the stables with the same fix. It makes it easier on my side, as the
way I do the updates is to use the same quilt queue for all releases. I
start with 3.10, and get them working, and then apply the same queue to
3.8. Any conflicts in the patch I do a quilt fork, with a -v3.8
appended, and then after getting that working I go to 3.4, and so on.
This also lets me drop patches that are not applicable for earlier
releases.
If I delay this for a new update, then 3.10 will be out of sync. I'm
just going to release these, and then we can start a new one right away.
Thanks!
-- Steve
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH RT 3/6] rt: Make cpu_chill() use hrtimer instead of msleep()
2014-03-07 14:52 ` Steven Rostedt
@ 2014-03-07 15:23 ` Sebastian Andrzej Siewior
0 siblings, 0 replies; 10+ messages in thread
From: Sebastian Andrzej Siewior @ 2014-03-07 15:23 UTC (permalink / raw)
To: Steven Rostedt
Cc: linux-kernel, linux-rt-users, Thomas Gleixner, Carsten Emde,
John Kacur, Paul Gortmaker, stable-rt
On 03/07/2014 03:52 PM, Steven Rostedt wrote:
>> Now that you posted "cpu_chill: Add a UNINTERRUPTIBLE
>> hrtimer_nanosleep" wouldn't it make sense to delay this patches from
>> the stable series until we get them all in one go?
>
> Sure, say this on the day I'm about to release ;-)
Haven't noticed that earlier.
> Nah, I'll release these today anyway. Otherwise I can't update to the
> mainline stables. When the rc candidates are out, it holds up any new
> updates to the versions.
>
> Also, the stable 3.10 has this bug already. Might as well update all
> the stables with the same fix. It makes it easier on my side, as the
> way I do the updates is to use the same quilt queue for all releases. I
> start with 3.10, and get them working, and then apply the same queue to
> 3.8. Any conflicts in the patch I do a quilt fork, with a -v3.8
> appended, and then after getting that working I go to 3.4, and so on.
> This also lets me drop patches that are not applicable for earlier
> releases.
>
> If I delay this for a new update, then 3.10 will be out of sync. I'm
> just going to release these, and then we can start a new one right away.
No worries. Do as it is easier for you.
>
> Thanks!
>
> -- Steve
>
Sebastian
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH RT 4/6] kernel/hrtimer: be non-freezeable in cpu_chill()
2014-03-05 0:33 [PATCH RT 0/6] Linux 3.2.55-rt79-rc1 Steven Rostedt
` (2 preceding siblings ...)
2014-03-05 0:33 ` [PATCH RT 3/6] rt: Make cpu_chill() use hrtimer instead of msleep() Steven Rostedt
@ 2014-03-05 0:33 ` Steven Rostedt
2014-03-05 0:33 ` [PATCH RT 5/6] arm/unwind: use a raw_spin_lock Steven Rostedt
2014-03-05 0:33 ` [PATCH RT 6/6] Linux 3.2.55-rt79-rc1 Steven Rostedt
5 siblings, 0 replies; 10+ messages in thread
From: Steven Rostedt @ 2014-03-05 0:33 UTC (permalink / raw)
To: linux-kernel, linux-rt-users
Cc: Thomas Gleixner, Carsten Emde, Sebastian Andrzej Siewior,
John Kacur, Paul Gortmaker, stable-rt
[-- Attachment #1: 0004-kernel-hrtimer-be-non-freezeable-in-cpu_chill.patch --]
[-- Type: text/plain, Size: 2389 bytes --]
3.2.55-rt79-rc1 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Since we replaced msleep() by hrtimer I see now and then (rarely) this:
| [....] Waiting for /dev to be fully populated...
| =====================================
| [ BUG: udevd/229 still has locks held! ]
| 3.12.11-rt17 #23 Not tainted
| -------------------------------------
| 1 lock held by udevd/229:
| #0: (&type->i_mutex_dir_key#2){+.+.+.}, at: lookup_slow+0x28/0x98
|
| stack backtrace:
| CPU: 0 PID: 229 Comm: udevd Not tainted 3.12.11-rt17 #23
| (unwind_backtrace+0x0/0xf8) from (show_stack+0x10/0x14)
| (show_stack+0x10/0x14) from (dump_stack+0x74/0xbc)
| (dump_stack+0x74/0xbc) from (do_nanosleep+0x120/0x160)
| (do_nanosleep+0x120/0x160) from (hrtimer_nanosleep+0x90/0x110)
| (hrtimer_nanosleep+0x90/0x110) from (cpu_chill+0x30/0x38)
| (cpu_chill+0x30/0x38) from (dentry_kill+0x158/0x1ec)
| (dentry_kill+0x158/0x1ec) from (dput+0x74/0x15c)
| (dput+0x74/0x15c) from (lookup_real+0x4c/0x50)
| (lookup_real+0x4c/0x50) from (__lookup_hash+0x34/0x44)
| (__lookup_hash+0x34/0x44) from (lookup_slow+0x38/0x98)
| (lookup_slow+0x38/0x98) from (path_lookupat+0x208/0x7fc)
| (path_lookupat+0x208/0x7fc) from (filename_lookup+0x20/0x60)
| (filename_lookup+0x20/0x60) from (user_path_at_empty+0x50/0x7c)
| (user_path_at_empty+0x50/0x7c) from (user_path_at+0x14/0x1c)
| (user_path_at+0x14/0x1c) from (vfs_fstatat+0x48/0x94)
| (vfs_fstatat+0x48/0x94) from (SyS_stat64+0x14/0x30)
| (SyS_stat64+0x14/0x30) from (ret_fast_syscall+0x0/0x48)
For now I see no better way but to disable the freezer the sleep the period.
Cc: stable-rt@vger.kernel.org
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
kernel/hrtimer.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c
index a9f8842..71acc21 100644
--- a/kernel/hrtimer.c
+++ b/kernel/hrtimer.c
@@ -1856,8 +1856,12 @@ void cpu_chill(void)
struct timespec tu = {
.tv_nsec = NSEC_PER_MSEC,
};
+ unsigned int freeze_flag = current->flags & PF_NOFREEZE;
+ current->flags |= PF_NOFREEZE;
hrtimer_nanosleep(&tu, NULL, HRTIMER_MODE_REL, CLOCK_MONOTONIC);
+ if (!freeze_flag)
+ current->flags &= ~PF_NOFREEZE;
}
EXPORT_SYMBOL(cpu_chill);
#endif
--
1.8.5.3
^ permalink raw reply related [flat|nested] 10+ messages in thread* [PATCH RT 5/6] arm/unwind: use a raw_spin_lock
2014-03-05 0:33 [PATCH RT 0/6] Linux 3.2.55-rt79-rc1 Steven Rostedt
` (3 preceding siblings ...)
2014-03-05 0:33 ` [PATCH RT 4/6] kernel/hrtimer: be non-freezeable in cpu_chill() Steven Rostedt
@ 2014-03-05 0:33 ` Steven Rostedt
2014-03-05 0:33 ` [PATCH RT 6/6] Linux 3.2.55-rt79-rc1 Steven Rostedt
5 siblings, 0 replies; 10+ messages in thread
From: Steven Rostedt @ 2014-03-05 0:33 UTC (permalink / raw)
To: linux-kernel, linux-rt-users
Cc: Thomas Gleixner, Carsten Emde, Sebastian Andrzej Siewior,
John Kacur, Paul Gortmaker, stable-rt
[-- Attachment #1: 0005-arm-unwind-use-a-raw_spin_lock.patch --]
[-- Type: text/plain, Size: 2883 bytes --]
3.2.55-rt79-rc1 stable review patch.
If anyone has any objections, please let me know.
------------------
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Mostly unwind is done with irqs enabled however SLUB may call it with
irqs disabled while creating a new SLUB cache.
I had system freeze while loading a module which called
kmem_cache_create() on init. That means SLUB's __slab_alloc() disabled
interrupts and then
->new_slab_objects()
->new_slab()
->setup_object()
->setup_object_debug()
->init_tracking()
->set_track()
->save_stack_trace()
->save_stack_trace_tsk()
->walk_stackframe()
->unwind_frame()
->unwind_find_idx()
=>spin_lock_irqsave(&unwind_lock);
Cc: stable-rt@vger.kernel.org
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
arch/arm/kernel/unwind.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/arch/arm/kernel/unwind.c b/arch/arm/kernel/unwind.c
index 00df012..bbafc67 100644
--- a/arch/arm/kernel/unwind.c
+++ b/arch/arm/kernel/unwind.c
@@ -87,7 +87,7 @@ extern const struct unwind_idx __start_unwind_idx[];
static const struct unwind_idx *__origin_unwind_idx;
extern const struct unwind_idx __stop_unwind_idx[];
-static DEFINE_SPINLOCK(unwind_lock);
+static DEFINE_RAW_SPINLOCK(unwind_lock);
static LIST_HEAD(unwind_tables);
/* Convert a prel31 symbol to an absolute address */
@@ -195,7 +195,7 @@ static const struct unwind_idx *unwind_find_idx(unsigned long addr)
/* module unwind tables */
struct unwind_table *table;
- spin_lock_irqsave(&unwind_lock, flags);
+ raw_spin_lock_irqsave(&unwind_lock, flags);
list_for_each_entry(table, &unwind_tables, list) {
if (addr >= table->begin_addr &&
addr < table->end_addr) {
@@ -207,7 +207,7 @@ static const struct unwind_idx *unwind_find_idx(unsigned long addr)
break;
}
}
- spin_unlock_irqrestore(&unwind_lock, flags);
+ raw_spin_unlock_irqrestore(&unwind_lock, flags);
}
pr_debug("%s: idx = %p\n", __func__, idx);
@@ -469,9 +469,9 @@ struct unwind_table *unwind_table_add(unsigned long start, unsigned long size,
tab->begin_addr = text_addr;
tab->end_addr = text_addr + text_size;
- spin_lock_irqsave(&unwind_lock, flags);
+ raw_spin_lock_irqsave(&unwind_lock, flags);
list_add_tail(&tab->list, &unwind_tables);
- spin_unlock_irqrestore(&unwind_lock, flags);
+ raw_spin_unlock_irqrestore(&unwind_lock, flags);
return tab;
}
@@ -483,9 +483,9 @@ void unwind_table_del(struct unwind_table *tab)
if (!tab)
return;
- spin_lock_irqsave(&unwind_lock, flags);
+ raw_spin_lock_irqsave(&unwind_lock, flags);
list_del(&tab->list);
- spin_unlock_irqrestore(&unwind_lock, flags);
+ raw_spin_unlock_irqrestore(&unwind_lock, flags);
kfree(tab);
}
--
1.8.5.3
^ permalink raw reply related [flat|nested] 10+ messages in thread* [PATCH RT 6/6] Linux 3.2.55-rt79-rc1
2014-03-05 0:33 [PATCH RT 0/6] Linux 3.2.55-rt79-rc1 Steven Rostedt
` (4 preceding siblings ...)
2014-03-05 0:33 ` [PATCH RT 5/6] arm/unwind: use a raw_spin_lock Steven Rostedt
@ 2014-03-05 0:33 ` Steven Rostedt
5 siblings, 0 replies; 10+ messages in thread
From: Steven Rostedt @ 2014-03-05 0:33 UTC (permalink / raw)
To: linux-kernel, linux-rt-users
Cc: Thomas Gleixner, Carsten Emde, Sebastian Andrzej Siewior,
John Kacur, Paul Gortmaker
[-- Attachment #1: 0006-Linux-3.2.55-rt79-rc1.patch --]
[-- Type: text/plain, Size: 405 bytes --]
3.2.55-rt79-rc1 stable review patch.
If anyone has any objections, please let me know.
------------------
From: "Steven Rostedt (Red Hat)" <rostedt@goodmis.org>
---
localversion-rt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/localversion-rt b/localversion-rt
index 30758e0..cf494ca 100644
--- a/localversion-rt
+++ b/localversion-rt
@@ -1 +1 @@
--rt78
+-rt79-rc1
--
1.8.5.3
^ permalink raw reply related [flat|nested] 10+ messages in thread