[rt] Update to 3.8.4-rt2 and reenable

svn path=/dists/trunk/linux/; revision=19956
This commit is contained in:
Ben Hutchings 2013-03-31 03:53:40 +00:00
parent 0fd3db57d9
commit 91831f762f
316 changed files with 7133 additions and 5744 deletions

1
debian/changelog vendored
View File

@ -10,6 +10,7 @@ linux (3.8.5-1~experimental.1) UNRELEASED; urgency=low
* udeb: Add hid-generic, hid-holtek-kbd, hid-lenovo-tpkbd,
hid-roccat-isku, hid-roccat-lua, hid-roccat-savu to input-modules
* cdc_ncm,cdc_mbim: Use NCM by default
* [rt] Update to 3.8.4-rt2 and reenable
-- Ben Hutchings <ben@decadent.org.uk> Wed, 20 Mar 2013 23:32:20 +0000

View File

@ -28,7 +28,7 @@ featuresets:
rt
[featureset-rt_base]
enabled: false
enabled: true
[description]
part-long-up: This kernel is not suitable for SMP (multi-processor,

View File

@ -0,0 +1,36 @@
From db28051c97688cfceaa9a2cea0202af74bb64fdc Mon Sep 17 00:00:00 2001
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date: Tue, 19 Mar 2013 14:41:04 +0100
Subject: [PATCH 1/2] kernel/srcu: merge common code into a macro
DEFINE_SRCU() and DEFINE_STATIC_SRCU() does the same thing except for
the "static" attribute. This patch moves the common pieces into
_DEFINE_SRCU() which is used by the the former macros either adding the
static attribute or not.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
include/linux/srcu.h | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
--- a/include/linux/srcu.h
+++ b/include/linux/srcu.h
@@ -102,13 +102,13 @@ void process_srcu(struct work_struct *wo
* define and init a srcu struct at build time.
* dont't call init_srcu_struct() nor cleanup_srcu_struct() on it.
*/
-#define DEFINE_SRCU(name) \
+#define _DEFINE_SRCU(name, mod) \
static DEFINE_PER_CPU(struct srcu_struct_array, name##_srcu_array);\
- struct srcu_struct name = __SRCU_STRUCT_INIT(name);
+ mod struct srcu_struct name = \
+ __SRCU_STRUCT_INIT(name);
-#define DEFINE_STATIC_SRCU(name) \
- static DEFINE_PER_CPU(struct srcu_struct_array, name##_srcu_array);\
- static struct srcu_struct name = __SRCU_STRUCT_INIT(name);
+#define DEFINE_SRCU(name) _DEFINE_SRCU(name, )
+#define DEFINE_STATIC_SRCU(name) _DEFINE_SRCU(name, static)
/**
* call_srcu() - Queue a callback for invocation after an SRCU grace period

View File

@ -0,0 +1,83 @@
From c31a0c052205e3ec24efc3fe18ef70c3e913f2d4 Mon Sep 17 00:00:00 2001
From: Stephen Warren <swarren@nvidia.com>
Date: Mon, 11 Feb 2013 14:15:32 -0700
Subject: [PATCH] of: fix recursive locking in of_get_next_available_child()
of_get_next_available_child() acquires devtree_lock, then calls
of_device_is_available() which calls of_get_property() which calls
of_find_property() which tries to re-acquire devtree_lock, thus causing
deadlock.
To avoid this, create a new __of_device_is_available() which calls
__of_get_property() instead, which calls __of_find_property(), which
does not take the lock,. Update of_get_next_available_child() to call
the new __of_device_is_available() since it already owns the lock.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
---
drivers/of/base.c | 30 +++++++++++++++++++++++++-----
1 file changed, 25 insertions(+), 5 deletions(-)
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -307,19 +307,19 @@ int of_machine_is_compatible(const char
EXPORT_SYMBOL(of_machine_is_compatible);
/**
- * of_device_is_available - check if a device is available for use
+ * __of_device_is_available - check if a device is available for use
*
- * @device: Node to check for availability
+ * @device: Node to check for availability, with locks already held
*
* Returns 1 if the status property is absent or set to "okay" or "ok",
* 0 otherwise
*/
-int of_device_is_available(const struct device_node *device)
+static int __of_device_is_available(const struct device_node *device)
{
const char *status;
int statlen;
- status = of_get_property(device, "status", &statlen);
+ status = __of_get_property(device, "status", &statlen);
if (status == NULL)
return 1;
@@ -330,6 +330,26 @@ int of_device_is_available(const struct
return 0;
}
+
+/**
+ * of_device_is_available - check if a device is available for use
+ *
+ * @device: Node to check for availability
+ *
+ * Returns 1 if the status property is absent or set to "okay" or "ok",
+ * 0 otherwise
+ */
+int of_device_is_available(const struct device_node *device)
+{
+ unsigned long flags;
+ int res;
+
+ raw_spin_lock_irqsave(&devtree_lock, flags);
+ res = __of_device_is_available(device);
+ raw_spin_unlock_irqrestore(&devtree_lock, flags);
+ return res;
+
+}
EXPORT_SYMBOL(of_device_is_available);
/**
@@ -421,7 +441,7 @@ struct device_node *of_get_next_availabl
raw_spin_lock(&devtree_lock);
next = prev ? prev->sibling : node->child;
for (; next; next = next->sibling) {
- if (!of_device_is_available(next))
+ if (!__of_device_is_available(next))
continue;
if (of_node_get(next))
break;

View File

@ -0,0 +1,100 @@
From 3f09905a6a65ed4fcf8e664abf044c91b2ce7b27 Mon Sep 17 00:00:00 2001
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date: Tue, 19 Mar 2013 14:44:30 +0100
Subject: [PATCH 2/2] kernel/SRCU: provide a static initializer
There are macros for static initializer for the three out of four
possible notifier types, that are:
ATOMIC_NOTIFIER_HEAD()
BLOCKING_NOTIFIER_HEAD()
RAW_NOTIFIER_HEAD()
This patch provides a static initilizer for the forth type to make it
complete.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
include/linux/notifier.h | 26 +++++++++++++++++++++-----
include/linux/srcu.h | 6 +++---
2 files changed, 24 insertions(+), 8 deletions(-)
--- a/include/linux/notifier.h
+++ b/include/linux/notifier.h
@@ -42,9 +42,7 @@
* in srcu_notifier_call_chain(): no cache bounces and no memory barriers.
* As compensation, srcu_notifier_chain_unregister() is rather expensive.
* SRCU notifier chains should be used when the chain will be called very
- * often but notifier_blocks will seldom be removed. Also, SRCU notifier
- * chains are slightly more difficult to use because they require special
- * runtime initialization.
+ * often but notifier_blocks will seldom be removed.
*/
struct notifier_block {
@@ -85,7 +83,7 @@ struct srcu_notifier_head {
(name)->head = NULL; \
} while (0)
-/* srcu_notifier_heads must be initialized and cleaned up dynamically */
+/* srcu_notifier_heads must be cleaned up dynamically */
extern void srcu_init_notifier_head(struct srcu_notifier_head *nh);
#define srcu_cleanup_notifier_head(name) \
cleanup_srcu_struct(&(name)->srcu);
@@ -98,7 +96,13 @@ extern void srcu_init_notifier_head(stru
.head = NULL }
#define RAW_NOTIFIER_INIT(name) { \
.head = NULL }
-/* srcu_notifier_heads cannot be initialized statically */
+
+#define SRCU_NOTIFIER_INIT(name, pcpu) \
+ { \
+ .mutex = __MUTEX_INITIALIZER(name.mutex), \
+ .head = NULL, \
+ .srcu = __SRCU_STRUCT_INIT(name.srcu, pcpu), \
+ }
#define ATOMIC_NOTIFIER_HEAD(name) \
struct atomic_notifier_head name = \
@@ -110,6 +114,18 @@ extern void srcu_init_notifier_head(stru
struct raw_notifier_head name = \
RAW_NOTIFIER_INIT(name)
+#define _SRCU_NOTIFIER_HEAD(name, mod) \
+ static DEFINE_PER_CPU(struct srcu_struct_array, \
+ name##_head_srcu_array); \
+ mod struct srcu_notifier_head name = \
+ SRCU_NOTIFIER_INIT(name, name##_head_srcu_array)
+
+#define SRCU_NOTIFIER_HEAD(name) \
+ _SRCU_NOTIFIER_HEAD(name, )
+
+#define SRCU_NOTIFIER_HEAD_STATIC(name) \
+ _SRCU_NOTIFIER_HEAD(name, static)
+
#ifdef __KERNEL__
extern int atomic_notifier_chain_register(struct atomic_notifier_head *nh,
--- a/include/linux/srcu.h
+++ b/include/linux/srcu.h
@@ -84,10 +84,10 @@ int init_srcu_struct(struct srcu_struct
void process_srcu(struct work_struct *work);
-#define __SRCU_STRUCT_INIT(name) \
+#define __SRCU_STRUCT_INIT(name, pcpu_name) \
{ \
.completed = -300, \
- .per_cpu_ref = &name##_srcu_array, \
+ .per_cpu_ref = &pcpu_name, \
.queue_lock = __SPIN_LOCK_UNLOCKED(name.queue_lock), \
.running = false, \
.batch_queue = RCU_BATCH_INIT(name.batch_queue), \
@@ -105,7 +105,7 @@ void process_srcu(struct work_struct *wo
#define _DEFINE_SRCU(name, mod) \
static DEFINE_PER_CPU(struct srcu_struct_array, name##_srcu_array);\
mod struct srcu_struct name = \
- __SRCU_STRUCT_INIT(name);
+ __SRCU_STRUCT_INIT(name, name##_srcu_array);
#define DEFINE_SRCU(name) _DEFINE_SRCU(name, )
#define DEFINE_STATIC_SRCU(name) _DEFINE_SRCU(name, static)

View File

@ -0,0 +1,23 @@
From 65513f34449eedb6b84c24a3583266534c1627e4 Mon Sep 17 00:00:00 2001
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date: Mon, 11 Mar 2013 17:09:55 +0100
Subject: [PATCH 2/6] x86/highmem: add a "already used pte" check
This is a copy from kmap_atomic_prot().
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
arch/x86/mm/iomap_32.c | 2 ++
1 file changed, 2 insertions(+)
--- a/arch/x86/mm/iomap_32.c
+++ b/arch/x86/mm/iomap_32.c
@@ -65,6 +65,8 @@ void *kmap_atomic_prot_pfn(unsigned long
type = kmap_atomic_idx_push();
idx = type + KM_TYPE_NR * smp_processor_id();
vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx);
+ WARN_ON(!pte_none(*(kmap_pte - idx)));
+
#ifdef CONFIG_PREEMPT_RT_FULL
current->kmap_pte[type] = pte;
#endif

View File

@ -0,0 +1,28 @@
From e2ca4d092d9c6e6b07b465b4d81da207bbcc7437 Mon Sep 17 00:00:00 2001
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date: Mon, 11 Mar 2013 21:37:27 +0100
Subject: [PATCH 3/6] arm/highmem: flush tlb on unmap
The tlb should be flushed on unmap and thus make the mapping entry
invalid. This is only done in the non-debug case which does not look
right.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
arch/arm/mm/highmem.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/arch/arm/mm/highmem.c
+++ b/arch/arm/mm/highmem.c
@@ -95,10 +95,10 @@ void __kunmap_atomic(void *kvaddr)
__cpuc_flush_dcache_area((void *)vaddr, PAGE_SIZE);
#ifdef CONFIG_DEBUG_HIGHMEM
BUG_ON(vaddr != __fix_to_virt(FIX_KMAP_BEGIN + idx));
- set_top_pte(vaddr, __pte(0));
#else
(void) idx; /* to kill a warning */
#endif
+ set_top_pte(vaddr, __pte(0));
kmap_atomic_idx_pop();
} else if (vaddr >= PKMAP_ADDR(0) && vaddr < PKMAP_ADDR(LAST_PKMAP)) {
/* this address was obtained through kmap_high_get() */

View File

@ -0,0 +1,44 @@
From eef09918aff670a6162d2ae5fe87b393698ef57d Mon Sep 17 00:00:00 2001
From: Thomas Gleixner <tglx@linutronix.de>
Date: Fri, 1 Mar 2013 11:17:42 +0100
Subject: [PATCH 5/6] futex: Ensure lock/unlock symetry versus pi_lock and
hash bucket lock
In exit_pi_state_list() we have the following locking construct:
spin_lock(&hb->lock);
raw_spin_lock_irq(&curr->pi_lock);
...
spin_unlock(&hb->lock);
In !RT this works, but on RT the migrate_enable() function which is
called from spin_unlock() sees atomic context due to the held pi_lock
and just decrements the migrate_disable_atomic counter of the
task. Now the next call to migrate_disable() sees the counter being
negative and issues a warning. That check should be in
migrate_enable() already.
Fix this by dropping pi_lock before unlocking hb->lock and reaquire
pi_lock after that again. This is safe as the loop code reevaluates
head again under the pi_lock.
Reported-by: Yong Zhang <yong.zhang@windriver.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
kernel/futex.c | 2 ++
1 file changed, 2 insertions(+)
--- a/kernel/futex.c
+++ b/kernel/futex.c
@@ -568,7 +568,9 @@ void exit_pi_state_list(struct task_stru
* task still owns the PI-state:
*/
if (head->next != next) {
+ raw_spin_unlock_irq(&curr->pi_lock);
spin_unlock(&hb->lock);
+ raw_spin_lock_irq(&curr->pi_lock);
continue;
}

View File

@ -0,0 +1,77 @@
From b72b514282ffad0d665ea94932b968f388304079 Mon Sep 17 00:00:00 2001
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date: Thu, 21 Mar 2013 19:01:05 +0100
Subject: [PATCH] HACK: printk: drop the logbuf_lock more often
The lock is hold with irgs off. The latency drops 500us+ on my arm bugs
with a "full" buffer after executing "dmesg" on the shell.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
kernel/printk.c | 27 ++++++++++++++++++++++++++-
1 file changed, 26 insertions(+), 1 deletion(-)
--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -1072,6 +1072,7 @@ static int syslog_print_all(char __user
{
char *text;
int len = 0;
+ int attempts = 0;
text = kmalloc(LOG_LINE_MAX + PREFIX_MAX, GFP_KERNEL);
if (!text)
@@ -1083,7 +1084,14 @@ static int syslog_print_all(char __user
u64 seq;
u32 idx;
enum log_flags prev;
-
+ int num_msg;
+try_again:
+ attempts++;
+ if (attempts > 10) {
+ len = -EBUSY;
+ goto out;
+ }
+ num_msg = 0;
if (clear_seq < log_first_seq) {
/* messages are gone, move to first available one */
clear_seq = log_first_seq;
@@ -1104,6 +1112,14 @@ static int syslog_print_all(char __user
prev = msg->flags;
idx = log_next(idx);
seq++;
+ num_msg++;
+ if (num_msg > 5) {
+ num_msg = 0;
+ raw_spin_unlock_irq(&logbuf_lock);
+ raw_spin_lock_irq(&logbuf_lock);
+ if (clear_seq < log_first_seq)
+ goto try_again;
+ }
}
/* move first record forward until length fits into the buffer */
@@ -1117,6 +1133,14 @@ static int syslog_print_all(char __user
prev = msg->flags;
idx = log_next(idx);
seq++;
+ num_msg++;
+ if (num_msg > 5) {
+ num_msg = 0;
+ raw_spin_unlock_irq(&logbuf_lock);
+ raw_spin_lock_irq(&logbuf_lock);
+ if (clear_seq < log_first_seq)
+ goto try_again;
+ }
}
/* last message fitting into this dump */
@@ -1158,6 +1182,7 @@ static int syslog_print_all(char __user
clear_seq = log_next_seq;
clear_idx = log_next_idx;
}
+out:
raw_spin_unlock_irq(&logbuf_lock);
kfree(text);

View File

@ -10,10 +10,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
arch/x86/include/asm/acpi.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Index: linux-stable/arch/x86/include/asm/acpi.h
===================================================================
--- linux-stable.orig/arch/x86/include/asm/acpi.h
+++ linux-stable/arch/x86/include/asm/acpi.h
--- a/arch/x86/include/asm/acpi.h
+++ b/arch/x86/include/asm/acpi.h
@@ -51,8 +51,8 @@
#define ACPI_ASM_MACROS

View File

@ -30,10 +30,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
arch/xtensa/mm/fault.c | 2 +-
22 files changed, 26 insertions(+), 23 deletions(-)
Index: linux-stable/arch/alpha/mm/fault.c
===================================================================
--- linux-stable.orig/arch/alpha/mm/fault.c
+++ linux-stable/arch/alpha/mm/fault.c
--- a/arch/alpha/mm/fault.c
+++ b/arch/alpha/mm/fault.c
@@ -108,7 +108,7 @@ do_page_fault(unsigned long address, uns
/* If we're in an interrupt context, or have no user context,
@ -43,10 +41,8 @@ Index: linux-stable/arch/alpha/mm/fault.c
goto no_context;
#ifdef CONFIG_ALPHA_LARGE_VMALLOC
Index: linux-stable/arch/arm/mm/fault.c
===================================================================
--- linux-stable.orig/arch/arm/mm/fault.c
+++ linux-stable/arch/arm/mm/fault.c
--- a/arch/arm/mm/fault.c
+++ b/arch/arm/mm/fault.c
@@ -279,7 +279,7 @@ do_page_fault(unsigned long addr, unsign
* If we're in an interrupt or have no user
* context, we must not take the fault..
@ -56,10 +52,8 @@ Index: linux-stable/arch/arm/mm/fault.c
goto no_context;
/*
Index: linux-stable/arch/avr32/mm/fault.c
===================================================================
--- linux-stable.orig/arch/avr32/mm/fault.c
+++ linux-stable/arch/avr32/mm/fault.c
--- a/arch/avr32/mm/fault.c
+++ b/arch/avr32/mm/fault.c
@@ -81,7 +81,8 @@ asmlinkage void do_page_fault(unsigned l
* If we're in an interrupt or have no user context, we must
* not take the fault...
@ -70,10 +64,8 @@ Index: linux-stable/arch/avr32/mm/fault.c
goto no_context;
local_irq_enable();
Index: linux-stable/arch/cris/mm/fault.c
===================================================================
--- linux-stable.orig/arch/cris/mm/fault.c
+++ linux-stable/arch/cris/mm/fault.c
--- a/arch/cris/mm/fault.c
+++ b/arch/cris/mm/fault.c
@@ -114,7 +114,7 @@ do_page_fault(unsigned long address, str
* user context, we must not take the fault.
*/
@ -83,10 +75,8 @@ Index: linux-stable/arch/cris/mm/fault.c
goto no_context;
retry:
Index: linux-stable/arch/frv/mm/fault.c
===================================================================
--- linux-stable.orig/arch/frv/mm/fault.c
+++ linux-stable/arch/frv/mm/fault.c
--- a/arch/frv/mm/fault.c
+++ b/arch/frv/mm/fault.c
@@ -78,7 +78,7 @@ asmlinkage void do_page_fault(int datamm
* If we're in an interrupt or have no user
* context, we must not take the fault..
@ -96,10 +86,8 @@ Index: linux-stable/arch/frv/mm/fault.c
goto no_context;
down_read(&mm->mmap_sem);
Index: linux-stable/arch/ia64/mm/fault.c
===================================================================
--- linux-stable.orig/arch/ia64/mm/fault.c
+++ linux-stable/arch/ia64/mm/fault.c
--- a/arch/ia64/mm/fault.c
+++ b/arch/ia64/mm/fault.c
@@ -98,7 +98,7 @@ ia64_do_page_fault (unsigned long addres
/*
* If we're in an interrupt or have no user context, we must not take the fault..
@ -109,10 +97,8 @@ Index: linux-stable/arch/ia64/mm/fault.c
goto no_context;
#ifdef CONFIG_VIRTUAL_MEM_MAP
Index: linux-stable/arch/m32r/mm/fault.c
===================================================================
--- linux-stable.orig/arch/m32r/mm/fault.c
+++ linux-stable/arch/m32r/mm/fault.c
--- a/arch/m32r/mm/fault.c
+++ b/arch/m32r/mm/fault.c
@@ -114,7 +114,7 @@ asmlinkage void do_page_fault(struct pt_
* If we're in an interrupt or have no user context or are running in an
* atomic region then we must not take the fault..
@ -122,11 +108,9 @@ Index: linux-stable/arch/m32r/mm/fault.c
goto bad_area_nosemaphore;
/* When running in the kernel we expect faults to occur only to
Index: linux-stable/arch/m68k/mm/fault.c
===================================================================
--- linux-stable.orig/arch/m68k/mm/fault.c
+++ linux-stable/arch/m68k/mm/fault.c
@@ -85,7 +85,7 @@ int do_page_fault(struct pt_regs *regs,
--- a/arch/m68k/mm/fault.c
+++ b/arch/m68k/mm/fault.c
@@ -85,7 +85,7 @@ int do_page_fault(struct pt_regs *regs,
* If we're in an interrupt or have no user
* context, we must not take the fault..
*/
@ -135,10 +119,8 @@ Index: linux-stable/arch/m68k/mm/fault.c
goto no_context;
retry:
Index: linux-stable/arch/microblaze/mm/fault.c
===================================================================
--- linux-stable.orig/arch/microblaze/mm/fault.c
+++ linux-stable/arch/microblaze/mm/fault.c
--- a/arch/microblaze/mm/fault.c
+++ b/arch/microblaze/mm/fault.c
@@ -108,7 +108,7 @@ void do_page_fault(struct pt_regs *regs,
if ((error_code & 0x13) == 0x13 || (error_code & 0x11) == 0x11)
is_write = 0;
@ -148,10 +130,8 @@ Index: linux-stable/arch/microblaze/mm/fault.c
if (kernel_mode(regs))
goto bad_area_nosemaphore;
Index: linux-stable/arch/mips/mm/fault.c
===================================================================
--- linux-stable.orig/arch/mips/mm/fault.c
+++ linux-stable/arch/mips/mm/fault.c
--- a/arch/mips/mm/fault.c
+++ b/arch/mips/mm/fault.c
@@ -89,7 +89,7 @@ asmlinkage void __kprobes do_page_fault(
* If we're in an interrupt or have no user
* context, we must not take the fault..
@ -161,11 +141,9 @@ Index: linux-stable/arch/mips/mm/fault.c
goto bad_area_nosemaphore;
retry:
Index: linux-stable/arch/mn10300/mm/fault.c
===================================================================
--- linux-stable.orig/arch/mn10300/mm/fault.c
+++ linux-stable/arch/mn10300/mm/fault.c
@@ -167,7 +167,7 @@ asmlinkage void do_page_fault(struct pt_
--- a/arch/mn10300/mm/fault.c
+++ b/arch/mn10300/mm/fault.c
@@ -168,7 +168,7 @@ asmlinkage void do_page_fault(struct pt_
* If we're in an interrupt or have no user
* context, we must not take the fault..
*/
@ -173,11 +151,9 @@ Index: linux-stable/arch/mn10300/mm/fault.c
+ if (in_atomic() || !mm || current->pagefault_disabled)
goto no_context;
down_read(&mm->mmap_sem);
Index: linux-stable/arch/parisc/mm/fault.c
===================================================================
--- linux-stable.orig/arch/parisc/mm/fault.c
+++ linux-stable/arch/parisc/mm/fault.c
retry:
--- a/arch/parisc/mm/fault.c
+++ b/arch/parisc/mm/fault.c
@@ -176,7 +176,7 @@ void do_page_fault(struct pt_regs *regs,
unsigned long acc_type;
int fault;
@ -187,11 +163,9 @@ Index: linux-stable/arch/parisc/mm/fault.c
goto no_context;
down_read(&mm->mmap_sem);
Index: linux-stable/arch/powerpc/mm/fault.c
===================================================================
--- linux-stable.orig/arch/powerpc/mm/fault.c
+++ linux-stable/arch/powerpc/mm/fault.c
@@ -261,7 +261,7 @@ int __kprobes do_page_fault(struct pt_re
--- a/arch/powerpc/mm/fault.c
+++ b/arch/powerpc/mm/fault.c
@@ -259,7 +259,7 @@ int __kprobes do_page_fault(struct pt_re
if (!arch_irq_disabled_regs(regs))
local_irq_enable();
@ -200,11 +174,9 @@ Index: linux-stable/arch/powerpc/mm/fault.c
if (!user_mode(regs))
return SIGSEGV;
/* in_atomic() in user mode is really bad,
Index: linux-stable/arch/s390/mm/fault.c
===================================================================
--- linux-stable.orig/arch/s390/mm/fault.c
+++ linux-stable/arch/s390/mm/fault.c
@@ -286,7 +286,8 @@ static inline int do_exception(struct pt
--- a/arch/s390/mm/fault.c
+++ b/arch/s390/mm/fault.c
@@ -296,7 +296,8 @@ static inline int do_exception(struct pt
* user context.
*/
fault = VM_FAULT_BADCONTEXT;
@ -214,20 +186,18 @@ Index: linux-stable/arch/s390/mm/fault.c
goto out;
address = trans_exc_code & __FAIL_ADDR_MASK;
@@ -423,7 +424,8 @@ void __kprobes do_asce_exception(struct
unsigned long trans_exc_code;
@@ -435,7 +436,8 @@ void __kprobes do_asce_exception(struct
clear_tsk_thread_flag(current, TIF_PER_TRAP);
trans_exc_code = regs->int_parm_long;
- if (unlikely(!user_space_fault(trans_exc_code) || in_atomic() || !mm))
+ if (unlikely(!user_space_fault(trans_exc_code) || in_atomic() || !mm ||
+ current->pagefault_disabled))
+ current->pagefault_disabled()));
goto no_context;
down_read(&mm->mmap_sem);
Index: linux-stable/arch/score/mm/fault.c
===================================================================
--- linux-stable.orig/arch/score/mm/fault.c
+++ linux-stable/arch/score/mm/fault.c
--- a/arch/score/mm/fault.c
+++ b/arch/score/mm/fault.c
@@ -72,7 +72,7 @@ asmlinkage void do_page_fault(struct pt_
* If we're in an interrupt or have no user
* context, we must not take the fault..
@ -237,11 +207,9 @@ Index: linux-stable/arch/score/mm/fault.c
goto bad_area_nosemaphore;
down_read(&mm->mmap_sem);
Index: linux-stable/arch/sh/mm/fault.c
===================================================================
--- linux-stable.orig/arch/sh/mm/fault.c
+++ linux-stable/arch/sh/mm/fault.c
@@ -445,7 +445,7 @@ asmlinkage void __kprobes do_page_fault(
--- a/arch/sh/mm/fault.c
+++ b/arch/sh/mm/fault.c
@@ -440,7 +440,7 @@ asmlinkage void __kprobes do_page_fault(
* If we're in an interrupt, have no user context or are running
* in an atomic region then we must not take the fault:
*/
@ -250,10 +218,8 @@ Index: linux-stable/arch/sh/mm/fault.c
bad_area_nosemaphore(regs, error_code, address);
return;
}
Index: linux-stable/arch/sparc/mm/fault_32.c
===================================================================
--- linux-stable.orig/arch/sparc/mm/fault_32.c
+++ linux-stable/arch/sparc/mm/fault_32.c
--- a/arch/sparc/mm/fault_32.c
+++ b/arch/sparc/mm/fault_32.c
@@ -200,7 +200,7 @@ asmlinkage void do_sparc_fault(struct pt
* If we're in an interrupt or have no user
* context, we must not take the fault..
@ -263,11 +229,9 @@ Index: linux-stable/arch/sparc/mm/fault_32.c
goto no_context;
perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, regs, address);
Index: linux-stable/arch/sparc/mm/fault_64.c
===================================================================
--- linux-stable.orig/arch/sparc/mm/fault_64.c
+++ linux-stable/arch/sparc/mm/fault_64.c
@@ -323,7 +323,7 @@ asmlinkage void __kprobes do_sparc64_fau
--- a/arch/sparc/mm/fault_64.c
+++ b/arch/sparc/mm/fault_64.c
@@ -321,7 +321,7 @@ asmlinkage void __kprobes do_sparc64_fau
* If we're in an interrupt or have no user
* context, we must not take the fault..
*/
@ -276,11 +240,9 @@ Index: linux-stable/arch/sparc/mm/fault_64.c
goto intr_or_no_mm;
perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, regs, address);
Index: linux-stable/arch/tile/mm/fault.c
===================================================================
--- linux-stable.orig/arch/tile/mm/fault.c
+++ linux-stable/arch/tile/mm/fault.c
@@ -359,7 +359,7 @@ static int handle_page_fault(struct pt_r
--- a/arch/tile/mm/fault.c
+++ b/arch/tile/mm/fault.c
@@ -360,7 +360,7 @@ static int handle_page_fault(struct pt_r
* If we're in an interrupt, have no user context or are running in an
* atomic region then we must not take the fault.
*/
@ -289,10 +251,8 @@ Index: linux-stable/arch/tile/mm/fault.c
vma = NULL; /* happy compiler */
goto bad_area_nosemaphore;
}
Index: linux-stable/arch/um/kernel/trap.c
===================================================================
--- linux-stable.orig/arch/um/kernel/trap.c
+++ linux-stable/arch/um/kernel/trap.c
--- a/arch/um/kernel/trap.c
+++ b/arch/um/kernel/trap.c
@@ -39,7 +39,7 @@ int handle_page_fault(unsigned long addr
* If the fault was during atomic operation, don't take the fault, just
* fail.
@ -302,11 +262,9 @@ Index: linux-stable/arch/um/kernel/trap.c
goto out_nosemaphore;
retry:
Index: linux-stable/arch/x86/mm/fault.c
===================================================================
--- linux-stable.orig/arch/x86/mm/fault.c
+++ linux-stable/arch/x86/mm/fault.c
@@ -1094,7 +1094,7 @@ do_page_fault(struct pt_regs *regs, unsi
--- a/arch/x86/mm/fault.c
+++ b/arch/x86/mm/fault.c
@@ -1108,7 +1108,7 @@ __do_page_fault(struct pt_regs *regs, un
* If we're in an interrupt, have no user context or are running
* in an atomic region then we must not take the fault:
*/
@ -315,10 +273,8 @@ Index: linux-stable/arch/x86/mm/fault.c
bad_area_nosemaphore(regs, error_code, address);
return;
}
Index: linux-stable/arch/xtensa/mm/fault.c
===================================================================
--- linux-stable.orig/arch/xtensa/mm/fault.c
+++ linux-stable/arch/xtensa/mm/fault.c
--- a/arch/xtensa/mm/fault.c
+++ b/arch/xtensa/mm/fault.c
@@ -57,7 +57,7 @@ void do_page_fault(struct pt_regs *regs)
/* If we're in an interrupt or have no user
* context, we must not take the fault..

View File

@ -10,15 +10,13 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
arch/arm/Kconfig | 1 +
1 file changed, 1 insertion(+)
Index: linux-stable/arch/arm/Kconfig
===================================================================
--- linux-stable.orig/arch/arm/Kconfig
+++ linux-stable/arch/arm/Kconfig
@@ -40,6 +40,7 @@ config ARM
select GENERIC_IRQ_SHOW
select ARCH_WANT_IPC_PARSE_VERSION
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -17,6 +17,7 @@ config ARM
select GENERIC_STRNCPY_FROM_USER
select GENERIC_STRNLEN_USER
select HARDIRQS_SW_RESEND
+ select IRQ_FORCED_THREADING
select CPU_PM if (SUSPEND || CPU_IDLE)
select GENERIC_PCI_IOMAP
select HAVE_BPF_JIT
select HAVE_AOUT
select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL
select HAVE_ARCH_KGDB

View File

@ -14,11 +14,9 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
arch/arm/mach-at91/at91sam926x_time.c | 5 ++++-
2 files changed, 5 insertions(+), 1 deletion(-)
Index: linux-stable/arch/arm/mach-at91/at91rm9200_time.c
===================================================================
--- linux-stable.orig/arch/arm/mach-at91/at91rm9200_time.c
+++ linux-stable/arch/arm/mach-at91/at91rm9200_time.c
@@ -130,6 +130,7 @@ clkevt32k_mode(enum clock_event_mode mod
--- a/arch/arm/mach-at91/at91rm9200_time.c
+++ b/arch/arm/mach-at91/at91rm9200_time.c
@@ -134,6 +134,7 @@ clkevt32k_mode(enum clock_event_mode mod
break;
case CLOCK_EVT_MODE_SHUTDOWN:
case CLOCK_EVT_MODE_UNUSED:
@ -26,11 +24,9 @@ Index: linux-stable/arch/arm/mach-at91/at91rm9200_time.c
case CLOCK_EVT_MODE_RESUME:
irqmask = 0;
break;
Index: linux-stable/arch/arm/mach-at91/at91sam926x_time.c
===================================================================
--- linux-stable.orig/arch/arm/mach-at91/at91sam926x_time.c
+++ linux-stable/arch/arm/mach-at91/at91sam926x_time.c
@@ -67,7 +67,7 @@ static struct clocksource pit_clk = {
--- a/arch/arm/mach-at91/at91sam926x_time.c
+++ b/arch/arm/mach-at91/at91sam926x_time.c
@@ -77,7 +77,7 @@ static struct clocksource pit_clk = {
.flags = CLOCK_SOURCE_IS_CONTINUOUS,
};
@ -39,7 +35,7 @@ Index: linux-stable/arch/arm/mach-at91/at91sam926x_time.c
/*
* Clockevent device: interrupts every 1/HZ (== pit_cycles * MCK/16)
*/
@@ -76,6 +76,8 @@ pit_clkevt_mode(enum clock_event_mode mo
@@ -86,6 +86,8 @@ pit_clkevt_mode(enum clock_event_mode mo
{
switch (mode) {
case CLOCK_EVT_MODE_PERIODIC:
@ -48,7 +44,7 @@ Index: linux-stable/arch/arm/mach-at91/at91sam926x_time.c
/* update clocksource counter */
pit_cnt += pit_cycle * PIT_PICNT(pit_read(AT91_PIT_PIVR));
pit_write(AT91_PIT_MR, (pit_cycle - 1) | AT91_PIT_PITEN
@@ -88,6 +90,7 @@ pit_clkevt_mode(enum clock_event_mode mo
@@ -98,6 +100,7 @@ pit_clkevt_mode(enum clock_event_mode mo
case CLOCK_EVT_MODE_UNUSED:
/* disable irq, leaving the clocksource active */
pit_write(AT91_PIT_MR, (pit_cycle - 1) | AT91_PIT_PITEN);

View File

@ -11,11 +11,9 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
drivers/misc/Kconfig | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
Index: linux-stable/drivers/misc/Kconfig
===================================================================
--- linux-stable.orig/drivers/misc/Kconfig
+++ linux-stable/drivers/misc/Kconfig
@@ -73,6 +73,7 @@ config AB8500_PWM
--- a/drivers/misc/Kconfig
+++ b/drivers/misc/Kconfig
@@ -63,6 +63,7 @@ config ATMEL_PWM
config ATMEL_TCLIB
bool "Atmel AT32/AT91 Timer/Counter Library"
depends on (AVR32 || ARCH_AT91)
@ -23,7 +21,7 @@ Index: linux-stable/drivers/misc/Kconfig
help
Select this if you want a library to allocate the Timer/Counter
blocks found on many Atmel processors. This facilitates using
@@ -105,7 +106,7 @@ config ATMEL_TCB_CLKSRC_BLOCK
@@ -95,7 +96,7 @@ config ATMEL_TCB_CLKSRC_BLOCK
config ATMEL_TCB_CLKSRC_USE_SLOW_CLOCK
bool "TC Block use 32 KiHz clock"
depends on ATMEL_TCB_CLKSRC

View File

@ -23,24 +23,23 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
arch/arm/mach-exynos/platsmp.c | 12 ++++++------
arch/arm/mach-msm/platsmp.c | 10 +++++-----
arch/arm/mach-omap2/omap-smp.c | 10 +++++-----
arch/arm/mach-spear13xx/platsmp.c | 10 +++++-----
arch/arm/mach-ux500/platsmp.c | 10 +++++-----
arch/arm/plat-versatile/platsmp.c | 10 +++++-----
5 files changed, 26 insertions(+), 26 deletions(-)
6 files changed, 31 insertions(+), 31 deletions(-)
Index: linux-stable/arch/arm/mach-exynos/platsmp.c
===================================================================
--- linux-stable.orig/arch/arm/mach-exynos/platsmp.c
+++ linux-stable/arch/arm/mach-exynos/platsmp.c
@@ -62,7 +62,7 @@ static void __iomem *scu_base_addr(void)
--- a/arch/arm/mach-exynos/platsmp.c
+++ b/arch/arm/mach-exynos/platsmp.c
@@ -71,7 +71,7 @@ static void __iomem *scu_base_addr(void)
return (void __iomem *)(S5P_VA_SCU);
}
-static DEFINE_SPINLOCK(boot_lock);
+static DEFINE_RAW_SPINLOCK(boot_lock);
void __cpuinit platform_secondary_init(unsigned int cpu)
static void __cpuinit exynos_secondary_init(unsigned int cpu)
{
@@ -82,8 +82,8 @@ void __cpuinit platform_secondary_init(u
@@ -91,8 +91,8 @@ static void __cpuinit exynos_secondary_i
/*
* Synchronise with the boot thread.
*/
@ -50,8 +49,8 @@ Index: linux-stable/arch/arm/mach-exynos/platsmp.c
+ raw_spin_unlock(&boot_lock);
}
int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
@@ -94,7 +94,7 @@ int __cpuinit boot_secondary(unsigned in
static int __cpuinit exynos_boot_secondary(unsigned int cpu, struct task_struct *idle)
@@ -104,7 +104,7 @@ static int __cpuinit exynos_boot_seconda
* Set synchronisation state between this boot processor
* and the secondary one
*/
@ -60,7 +59,7 @@ Index: linux-stable/arch/arm/mach-exynos/platsmp.c
/*
* The secondary processor is waiting to be released from
@@ -123,7 +123,7 @@ int __cpuinit boot_secondary(unsigned in
@@ -133,7 +133,7 @@ static int __cpuinit exynos_boot_seconda
if (timeout == 0) {
printk(KERN_ERR "cpu1 power enable failed");
@ -69,7 +68,7 @@ Index: linux-stable/arch/arm/mach-exynos/platsmp.c
return -ETIMEDOUT;
}
}
@@ -151,7 +151,7 @@ int __cpuinit boot_secondary(unsigned in
@@ -161,7 +161,7 @@ static int __cpuinit exynos_boot_seconda
* now the secondary core is starting up let it run its
* calibrations, then wait for it to finish
*/
@ -78,20 +77,18 @@ Index: linux-stable/arch/arm/mach-exynos/platsmp.c
return pen_release != -1 ? -ENOSYS : 0;
}
Index: linux-stable/arch/arm/mach-msm/platsmp.c
===================================================================
--- linux-stable.orig/arch/arm/mach-msm/platsmp.c
+++ linux-stable/arch/arm/mach-msm/platsmp.c
@@ -40,7 +40,7 @@ extern void msm_secondary_startup(void);
*/
volatile int pen_release = -1;
--- a/arch/arm/mach-msm/platsmp.c
+++ b/arch/arm/mach-msm/platsmp.c
@@ -31,7 +31,7 @@
extern void msm_secondary_startup(void);
-static DEFINE_SPINLOCK(boot_lock);
+static DEFINE_RAW_SPINLOCK(boot_lock);
static inline int get_core_count(void)
{
@@ -70,8 +70,8 @@ void __cpuinit platform_secondary_init(u
@@ -58,8 +58,8 @@ static void __cpuinit msm_secondary_init
/*
* Synchronise with the boot thread.
*/
@ -102,7 +99,7 @@ Index: linux-stable/arch/arm/mach-msm/platsmp.c
}
static __cpuinit void prepare_cold_cpu(unsigned int cpu)
@@ -108,7 +108,7 @@ int __cpuinit boot_secondary(unsigned in
@@ -96,7 +96,7 @@ static int __cpuinit msm_boot_secondary(
* set synchronisation state between this boot processor
* and the secondary one
*/
@ -111,7 +108,7 @@ Index: linux-stable/arch/arm/mach-msm/platsmp.c
/*
* The secondary processor is waiting to be released from
@@ -142,7 +142,7 @@ int __cpuinit boot_secondary(unsigned in
@@ -130,7 +130,7 @@ static int __cpuinit msm_boot_secondary(
* now the secondary core is starting up let it run its
* calibrations, then wait for it to finish
*/
@ -120,11 +117,9 @@ Index: linux-stable/arch/arm/mach-msm/platsmp.c
return pen_release != -1 ? -ENOSYS : 0;
}
Index: linux-stable/arch/arm/mach-omap2/omap-smp.c
===================================================================
--- linux-stable.orig/arch/arm/mach-omap2/omap-smp.c
+++ linux-stable/arch/arm/mach-omap2/omap-smp.c
@@ -42,7 +42,7 @@
--- a/arch/arm/mach-omap2/omap-smp.c
+++ b/arch/arm/mach-omap2/omap-smp.c
@@ -45,7 +45,7 @@ u16 pm44xx_errata;
/* SCU base address */
static void __iomem *scu_base;
@ -133,7 +128,7 @@ Index: linux-stable/arch/arm/mach-omap2/omap-smp.c
void __iomem *omap4_get_scu_base(void)
{
@@ -73,8 +73,8 @@ void __cpuinit platform_secondary_init(u
@@ -76,8 +76,8 @@ static void __cpuinit omap4_secondary_in
/*
* Synchronise with the boot thread.
*/
@ -143,8 +138,8 @@ Index: linux-stable/arch/arm/mach-omap2/omap-smp.c
+ raw_spin_unlock(&boot_lock);
}
int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
@@ -87,7 +87,7 @@ int __cpuinit boot_secondary(unsigned in
static int __cpuinit omap4_boot_secondary(unsigned int cpu, struct task_struct *idle)
@@ -90,7 +90,7 @@ static int __cpuinit omap4_boot_secondar
* Set synchronisation state between this boot processor
* and the secondary one
*/
@ -153,7 +148,7 @@ Index: linux-stable/arch/arm/mach-omap2/omap-smp.c
/*
* Update the AuxCoreBoot0 with boot state for secondary core.
@@ -131,7 +131,7 @@ int __cpuinit boot_secondary(unsigned in
@@ -163,7 +163,7 @@ static int __cpuinit omap4_boot_secondar
* Now the secondary core is starting up let it run its
* calibrations, then wait for it to finish
*/
@ -162,20 +157,18 @@ Index: linux-stable/arch/arm/mach-omap2/omap-smp.c
return 0;
}
Index: linux-stable/arch/arm/mach-ux500/platsmp.c
===================================================================
--- linux-stable.orig/arch/arm/mach-ux500/platsmp.c
+++ linux-stable/arch/arm/mach-ux500/platsmp.c
@@ -56,7 +56,7 @@ static void __iomem *scu_base_addr(void)
return NULL;
}
--- a/arch/arm/mach-spear13xx/platsmp.c
+++ b/arch/arm/mach-spear13xx/platsmp.c
@@ -21,7 +21,7 @@
#include <mach/spear.h>
#include <mach/generic.h>
-static DEFINE_SPINLOCK(boot_lock);
+static DEFINE_RAW_SPINLOCK(boot_lock);
void __cpuinit platform_secondary_init(unsigned int cpu)
{
@@ -76,8 +76,8 @@ void __cpuinit platform_secondary_init(u
static void __iomem *scu_base = IOMEM(VA_SCU_BASE);
@@ -44,8 +44,8 @@ static void __cpuinit spear13xx_secondar
/*
* Synchronise with the boot thread.
*/
@ -185,8 +178,8 @@ Index: linux-stable/arch/arm/mach-ux500/platsmp.c
+ raw_spin_unlock(&boot_lock);
}
int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
@@ -88,7 +88,7 @@ int __cpuinit boot_secondary(unsigned in
static int __cpuinit spear13xx_boot_secondary(unsigned int cpu, struct task_struct *idle)
@@ -56,7 +56,7 @@ static int __cpuinit spear13xx_boot_seco
* set synchronisation state between this boot processor
* and the secondary one
*/
@ -195,7 +188,7 @@ Index: linux-stable/arch/arm/mach-ux500/platsmp.c
/*
* The secondary processor is waiting to be released from
@@ -109,7 +109,7 @@ int __cpuinit boot_secondary(unsigned in
@@ -83,7 +83,7 @@ static int __cpuinit spear13xx_boot_seco
* now the secondary core is starting up let it run its
* calibrations, then wait for it to finish
*/
@ -204,20 +197,18 @@ Index: linux-stable/arch/arm/mach-ux500/platsmp.c
return pen_release != -1 ? -ENOSYS : 0;
}
Index: linux-stable/arch/arm/plat-versatile/platsmp.c
===================================================================
--- linux-stable.orig/arch/arm/plat-versatile/platsmp.c
+++ linux-stable/arch/arm/plat-versatile/platsmp.c
@@ -38,7 +38,7 @@ static void __cpuinit write_pen_release(
outer_clean_range(__pa(&pen_release), __pa(&pen_release + 1));
--- a/arch/arm/mach-ux500/platsmp.c
+++ b/arch/arm/mach-ux500/platsmp.c
@@ -50,7 +50,7 @@ static void __iomem *scu_base_addr(void)
return NULL;
}
-static DEFINE_SPINLOCK(boot_lock);
+static DEFINE_RAW_SPINLOCK(boot_lock);
void __cpuinit platform_secondary_init(unsigned int cpu)
static void __cpuinit ux500_secondary_init(unsigned int cpu)
{
@@ -58,8 +58,8 @@ void __cpuinit platform_secondary_init(u
@@ -70,8 +70,8 @@ static void __cpuinit ux500_secondary_in
/*
* Synchronise with the boot thread.
*/
@ -227,17 +218,57 @@ Index: linux-stable/arch/arm/plat-versatile/platsmp.c
+ raw_spin_unlock(&boot_lock);
}
int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
@@ -70,7 +70,7 @@ int __cpuinit boot_secondary(unsigned in
* Set synchronisation state between this boot processor
static int __cpuinit ux500_boot_secondary(unsigned int cpu, struct task_struct *idle)
@@ -82,7 +82,7 @@ static int __cpuinit ux500_boot_secondar
* set synchronisation state between this boot processor
* and the secondary one
*/
- spin_lock(&boot_lock);
+ raw_spin_lock(&boot_lock);
/*
* This is really belt and braces; we hold unintended secondary
@@ -100,7 +100,7 @@ int __cpuinit boot_secondary(unsigned in
* The secondary processor is waiting to be released from
@@ -103,7 +103,7 @@ static int __cpuinit ux500_boot_secondar
* now the secondary core is starting up let it run its
* calibrations, then wait for it to finish
*/
- spin_unlock(&boot_lock);
+ raw_spin_unlock(&boot_lock);
return pen_release != -1 ? -ENOSYS : 0;
}
--- a/arch/arm/plat-versatile/platsmp.c
+++ b/arch/arm/plat-versatile/platsmp.c
@@ -32,7 +32,7 @@ static void __cpuinit write_pen_release(
outer_clean_range(__pa(&pen_release), __pa(&pen_release + 1));
}
-static DEFINE_SPINLOCK(boot_lock);
+static DEFINE_RAW_SPINLOCK(boot_lock);
void __cpuinit versatile_secondary_init(unsigned int cpu)
{
@@ -52,8 +52,8 @@ void __cpuinit versatile_secondary_init(
/*
* Synchronise with the boot thread.
*/
- spin_lock(&boot_lock);
- spin_unlock(&boot_lock);
+ raw_spin_lock(&boot_lock);
+ raw_spin_unlock(&boot_lock);
}
int __cpuinit versatile_boot_secondary(unsigned int cpu, struct task_struct *idle)
@@ -64,7 +64,7 @@ int __cpuinit versatile_boot_secondary(u
* Set synchronisation state between this boot processor
* and the secondary one
*/
- spin_lock(&boot_lock);
+ raw_spin_lock(&boot_lock);
/*
* This is really belt and braces; we hold unintended secondary
@@ -94,7 +94,7 @@ int __cpuinit versatile_boot_secondary(u
* now the secondary core is starting up let it run its
* calibrations, then wait for it to finish
*/

View File

@ -7,11 +7,9 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
arch/arm/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: linux-stable/arch/arm/Kconfig
===================================================================
--- linux-stable.orig/arch/arm/Kconfig
+++ linux-stable/arch/arm/Kconfig
@@ -1747,7 +1747,7 @@ config HAVE_ARCH_PFN_VALID
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1752,7 +1752,7 @@ config HAVE_ARCH_PFN_VALID
config HIGHMEM
bool "High Memory Support"

View File

@ -0,0 +1,140 @@
Subject: arm-enable-highmem-for-rt.patch
From: Thomas Gleixner <tglx@linutronix.de>
Date: Wed, 13 Feb 2013 11:03:11 +0100
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
arch/arm/Kconfig | 2 -
arch/arm/include/asm/switch_to.h | 9 ++++++++
arch/arm/mm/highmem.c | 41 +++++++++++++++++++++++++++++++++++++--
include/linux/highmem.h | 1
4 files changed, 50 insertions(+), 3 deletions(-)
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1752,7 +1752,7 @@ config HAVE_ARCH_PFN_VALID
config HIGHMEM
bool "High Memory Support"
- depends on MMU && !PREEMPT_RT_FULL
+ depends on MMU
help
The address space of ARM processors is only 4 Gigabytes large
and it has to accommodate user address space, kernel address
--- a/arch/arm/include/asm/switch_to.h
+++ b/arch/arm/include/asm/switch_to.h
@@ -3,6 +3,14 @@
#include <linux/thread_info.h>
+#if defined CONFIG_PREEMPT_RT_FULL && defined CONFIG_HIGHMEM
+void switch_kmaps(struct task_struct *prev_p, struct task_struct *next_p);
+#else
+static inline void
+switch_kmaps(struct task_struct *prev_p, struct task_struct *next_p) { }
+#endif
+
+
/*
* switch_to(prev, next) should switch from task `prev' to `next'
* `prev' will never be the same as `next'. schedule() itself
@@ -12,6 +20,7 @@ extern struct task_struct *__switch_to(s
#define switch_to(prev,next,last) \
do { \
+ switch_kmaps(prev, next); \
last = __switch_to(prev,task_thread_info(prev), task_thread_info(next)); \
} while (0)
--- a/arch/arm/mm/highmem.c
+++ b/arch/arm/mm/highmem.c
@@ -38,6 +38,7 @@ EXPORT_SYMBOL(kunmap);
void *kmap_atomic(struct page *page)
{
+ pte_t pte = mk_pte(page, kmap_prot);
unsigned int idx;
unsigned long vaddr;
void *kmap;
@@ -76,7 +77,10 @@ void *kmap_atomic(struct page *page)
* in place, so the contained TLB flush ensures the TLB is updated
* with the new mapping.
*/
- set_top_pte(vaddr, mk_pte(page, kmap_prot));
+#ifdef CONFIG_PREEMPT_RT_FULL
+ current->kmap_pte[type] = pte;
+#endif
+ set_top_pte(vaddr, pte);
return (void *)vaddr;
}
@@ -93,6 +97,9 @@ void __kunmap_atomic(void *kvaddr)
if (cache_is_vivt())
__cpuc_flush_dcache_area((void *)vaddr, PAGE_SIZE);
+#ifdef CONFIG_PREEMPT_RT_FULL
+ current->kmap_pte[type] = __pte(0);
+#endif
#ifdef CONFIG_DEBUG_HIGHMEM
BUG_ON(vaddr != __fix_to_virt(FIX_KMAP_BEGIN + idx));
#else
@@ -110,6 +117,7 @@ EXPORT_SYMBOL(__kunmap_atomic);
void *kmap_atomic_pfn(unsigned long pfn)
{
+ pte_t pte = pfn_pte(pfn, kmap_prot);
unsigned long vaddr;
int idx, type;
@@ -121,7 +129,10 @@ void *kmap_atomic_pfn(unsigned long pfn)
#ifdef CONFIG_DEBUG_HIGHMEM
BUG_ON(!pte_none(get_top_pte(vaddr)));
#endif
- set_top_pte(vaddr, pfn_pte(pfn, kmap_prot));
+#ifdef CONFIG_PREEMPT_RT_FULL
+ current->kmap_pte[type] = pte;
+#endif
+ set_top_pte(vaddr, pte);
return (void *)vaddr;
}
@@ -135,3 +146,29 @@ struct page *kmap_atomic_to_page(const v
return pte_page(get_top_pte(vaddr));
}
+
+#if defined CONFIG_PREEMPT_RT_FULL
+void switch_kmaps(struct task_struct *prev_p, struct task_struct *next_p)
+{
+ int i;
+
+ /*
+ * Clear @prev's kmap_atomic mappings
+ */
+ for (i = 0; i < prev_p->kmap_idx; i++) {
+ int idx = i + KM_TYPE_NR * smp_processor_id();
+
+ set_top_pte(__fix_to_virt(FIX_KMAP_BEGIN + idx), __pte(0));
+ }
+ /*
+ * Restore @next_p's kmap_atomic mappings
+ */
+ for (i = 0; i < next_p->kmap_idx; i++) {
+ int idx = i + KM_TYPE_NR * smp_processor_id();
+
+ if (!pte_none(next_p->kmap_pte[i]))
+ set_top_pte(__fix_to_virt(FIX_KMAP_BEGIN + idx),
+ next_p->kmap_pte[i]);
+ }
+}
+#endif
--- a/include/linux/highmem.h
+++ b/include/linux/highmem.h
@@ -7,6 +7,7 @@
#include <linux/mm.h>
#include <linux/uaccess.h>
#include <linux/hardirq.h>
+#include <linux/sched.h>
#include <asm/cacheflush.h>

View File

@ -2,24 +2,22 @@ Subject: arm: Mark pmu interupt IRQF_NO_THREAD
From: Thomas Gleixner <tglx@linutronix.de>
Date: Wed, 16 Mar 2011 14:45:31 +0100
PMU interrupt must not be threaded. Remove IRQF_DISABLED while at it
as we run all handlers with interrupts disabled anyway.
PMU interrupts must not be threaded.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
arch/arm/kernel/perf_event.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/kernel/perf_event_cpu.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
Index: linux-stable/arch/arm/kernel/perf_event.c
===================================================================
--- linux-stable.orig/arch/arm/kernel/perf_event.c
+++ linux-stable/arch/arm/kernel/perf_event.c
@@ -430,7 +430,7 @@ armpmu_reserve_hardware(struct arm_pmu *
--- a/arch/arm/kernel/perf_event_cpu.c
+++ b/arch/arm/kernel/perf_event_cpu.c
@@ -118,7 +118,8 @@ static int cpu_pmu_request_irq(struct ar
continue;
}
err = request_irq(irq, handle_irq,
- IRQF_DISABLED | IRQF_NOBALANCING,
+ IRQF_NOBALANCING | IRQF_NO_THREAD,
"arm-pmu", armpmu);
- err = request_irq(irq, handler, IRQF_NOBALANCING, "arm-pmu",
+ err = request_irq(irq, handler,
+ IRQF_NOBALANCING | IRQF_NO_THREAD, "arm-pmu",
cpu_pmu);
if (err) {
pr_err("unable to request IRQ%d for ARM PMU counters\n",

View File

@ -7,11 +7,9 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
arch/arm/mach-omap2/omap-wakeupgen.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
Index: linux-stable/arch/arm/mach-omap2/omap-wakeupgen.c
===================================================================
--- linux-stable.orig/arch/arm/mach-omap2/omap-wakeupgen.c
+++ linux-stable/arch/arm/mach-omap2/omap-wakeupgen.c
@@ -45,7 +45,7 @@
--- a/arch/arm/mach-omap2/omap-wakeupgen.c
+++ b/arch/arm/mach-omap2/omap-wakeupgen.c
@@ -46,7 +46,7 @@
static void __iomem *wakeupgen_base;
static void __iomem *sar_base;
@ -20,7 +18,7 @@ Index: linux-stable/arch/arm/mach-omap2/omap-wakeupgen.c
static unsigned int irq_target_cpu[MAX_IRQS];
static unsigned int irq_banks = MAX_NR_REG_BANKS;
static unsigned int max_irqs = MAX_IRQS;
@@ -133,9 +133,9 @@ static void wakeupgen_mask(struct irq_da
@@ -134,9 +134,9 @@ static void wakeupgen_mask(struct irq_da
{
unsigned long flags;
@ -32,7 +30,7 @@ Index: linux-stable/arch/arm/mach-omap2/omap-wakeupgen.c
}
/*
@@ -145,9 +145,9 @@ static void wakeupgen_unmask(struct irq_
@@ -146,9 +146,9 @@ static void wakeupgen_unmask(struct irq_
{
unsigned long flags;
@ -44,7 +42,7 @@ Index: linux-stable/arch/arm/mach-omap2/omap-wakeupgen.c
}
#ifdef CONFIG_HOTPLUG_CPU
@@ -188,7 +188,7 @@ static void wakeupgen_irqmask_all(unsign
@@ -189,7 +189,7 @@ static void wakeupgen_irqmask_all(unsign
{
unsigned long flags;
@ -53,7 +51,7 @@ Index: linux-stable/arch/arm/mach-omap2/omap-wakeupgen.c
if (set) {
_wakeupgen_save_masks(cpu);
_wakeupgen_set_all(cpu, WKG_MASK_ALL);
@@ -196,7 +196,7 @@ static void wakeupgen_irqmask_all(unsign
@@ -197,7 +197,7 @@ static void wakeupgen_irqmask_all(unsign
_wakeupgen_set_all(cpu, WKG_UNMASK_ALL);
_wakeupgen_restore_masks(cpu);
}

View File

@ -7,26 +7,22 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
arch/arm/Kconfig | 1 +
arch/arm/include/asm/thread_info.h | 3 +++
arch/arm/kernel/asm-offsets.c | 1 +
arch/arm/kernel/entry-armv.S | 8 ++++++++
arch/arm/kernel/entry-armv.S | 13 +++++++++++--
arch/arm/kernel/signal.c | 3 ++-
5 files changed, 15 insertions(+), 1 deletion(-)
5 files changed, 18 insertions(+), 3 deletions(-)
Index: linux-stable/arch/arm/Kconfig
===================================================================
--- linux-stable.orig/arch/arm/Kconfig
+++ linux-stable/arch/arm/Kconfig
@@ -50,6 +50,7 @@ config ARM
select GENERIC_STRNCPY_FROM_USER
select GENERIC_STRNLEN_USER
select DCACHE_WORD_ACCESS if (CPU_V6 || CPU_V6K || CPU_V7) && !CPU_BIG_ENDIAN
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -47,6 +47,7 @@ config ARM
select HAVE_MEMBLOCK
select HAVE_OPROFILE if (HAVE_PERF_EVENTS)
select HAVE_PERF_EVENTS
+ select HAVE_PREEMPT_LAZY
help
The ARM series is a line of low-power-consumption RISC chip designs
licensed by ARM Ltd and targeted at embedded applications and
Index: linux-stable/arch/arm/include/asm/thread_info.h
===================================================================
--- linux-stable.orig/arch/arm/include/asm/thread_info.h
+++ linux-stable/arch/arm/include/asm/thread_info.h
select HAVE_REGS_AND_STACK_ACCESS_API
select HAVE_SYSCALL_TRACEPOINTS
select HAVE_UID16
--- a/arch/arm/include/asm/thread_info.h
+++ b/arch/arm/include/asm/thread_info.h
@@ -50,6 +50,7 @@ struct cpu_context_save {
struct thread_info {
unsigned long flags; /* low level flags */
@ -35,26 +31,24 @@ Index: linux-stable/arch/arm/include/asm/thread_info.h
mm_segment_t addr_limit; /* address limit */
struct task_struct *task; /* main task structure */
struct exec_domain *exec_domain; /* execution domain */
@@ -146,6 +147,7 @@ extern int vfp_restore_user_hwstate(stru
@@ -148,6 +149,7 @@ extern int vfp_restore_user_hwstate(stru
#define TIF_SIGPENDING 0
#define TIF_NEED_RESCHED 1
#define TIF_NOTIFY_RESUME 2 /* callback before returning to user */
+#define TIF_NEED_RESCHED_LAZY 3
#define TIF_SYSCALL_TRACE 8
#define TIF_SYSCALL_AUDIT 9
#define TIF_POLLING_NRFLAG 16
@@ -158,6 +160,7 @@ extern int vfp_restore_user_hwstate(stru
#define TIF_SYSCALL_TRACEPOINT 10
@@ -160,6 +162,7 @@ extern int vfp_restore_user_hwstate(stru
#define _TIF_SIGPENDING (1 << TIF_SIGPENDING)
#define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED)
#define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME)
+#define _TIF_NEED_RESCHED_LAZY (1 << TIF_NEED_RESCHED_LAZY)
#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)
#define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT)
#define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG)
Index: linux-stable/arch/arm/kernel/asm-offsets.c
===================================================================
--- linux-stable.orig/arch/arm/kernel/asm-offsets.c
+++ linux-stable/arch/arm/kernel/asm-offsets.c
#define _TIF_SYSCALL_TRACEPOINT (1 << TIF_SYSCALL_TRACEPOINT)
--- a/arch/arm/kernel/asm-offsets.c
+++ b/arch/arm/kernel/asm-offsets.c
@@ -50,6 +50,7 @@ int main(void)
BLANK();
DEFINE(TI_FLAGS, offsetof(struct thread_info, flags));
@ -63,24 +57,30 @@ Index: linux-stable/arch/arm/kernel/asm-offsets.c
DEFINE(TI_ADDR_LIMIT, offsetof(struct thread_info, addr_limit));
DEFINE(TI_TASK, offsetof(struct thread_info, task));
DEFINE(TI_EXEC_DOMAIN, offsetof(struct thread_info, exec_domain));
Index: linux-stable/arch/arm/kernel/entry-armv.S
===================================================================
--- linux-stable.orig/arch/arm/kernel/entry-armv.S
+++ linux-stable/arch/arm/kernel/entry-armv.S
@@ -221,6 +221,12 @@ __irq_svc:
movne r0, #0 @ force flags to 0
tst r0, #_TIF_NEED_RESCHED
blne svc_preempt
+ ldr r8, [tsk, #TI_PREEMPT_LAZY] @ get preempt lazy count
--- a/arch/arm/kernel/entry-armv.S
+++ b/arch/arm/kernel/entry-armv.S
@@ -216,11 +216,18 @@ __irq_svc:
#ifdef CONFIG_PREEMPT
get_thread_info tsk
ldr r8, [tsk, #TI_PREEMPT] @ get preempt count
- ldr r0, [tsk, #TI_FLAGS] @ get flags
teq r8, #0 @ if preempt count != 0
+ bne 1f @ return from exeption
+ ldr r0, [tsk, #TI_FLAGS] @ get flags
+ tst r0, #_TIF_NEED_RESCHED @ if NEED_RESCHED is set
+ blne svc_preempt @ preempt!
+
+ ldr r8, [tsk, #TI_PREEMPT_LAZY] @ get preempt lazy count
+ teq r8, #0 @ if preempt lazy count != 0
+ movne r0, #0 @ force flags to 0
movne r0, #0 @ force flags to 0
- tst r0, #_TIF_NEED_RESCHED
+ tst r0, #_TIF_NEED_RESCHED_LAZY
+ blne svc_preempt
blne svc_preempt
+1:
#endif
#ifdef CONFIG_TRACE_IRQFLAGS
@@ -240,6 +246,8 @@ svc_preempt:
@@ -240,6 +247,8 @@ svc_preempt:
1: bl preempt_schedule_irq @ irq en/disable is done inside
ldr r0, [tsk, #TI_FLAGS] @ get new tasks TI_FLAGS
tst r0, #_TIF_NEED_RESCHED
@ -89,11 +89,9 @@ Index: linux-stable/arch/arm/kernel/entry-armv.S
moveq pc, r8 @ go again
b 1b
#endif
Index: linux-stable/arch/arm/kernel/signal.c
===================================================================
--- linux-stable.orig/arch/arm/kernel/signal.c
+++ linux-stable/arch/arm/kernel/signal.c
@@ -639,7 +639,8 @@ asmlinkage int
--- a/arch/arm/kernel/signal.c
+++ b/arch/arm/kernel/signal.c
@@ -638,7 +638,8 @@ asmlinkage int
do_work_pending(struct pt_regs *regs, unsigned int thread_flags, int syscall)
{
do {

View File

@ -12,10 +12,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
drivers/ata/libata-sff.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
Index: linux-stable/drivers/ata/libata-sff.c
===================================================================
--- linux-stable.orig/drivers/ata/libata-sff.c
+++ linux-stable/drivers/ata/libata-sff.c
--- a/drivers/ata/libata-sff.c
+++ b/drivers/ata/libata-sff.c
@@ -678,9 +678,9 @@ unsigned int ata_sff_data_xfer_noirq(str
unsigned long flags;
unsigned int consumed;

View File

@ -43,41 +43,21 @@ Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: http://lkml.kernel.org/r/20110622174919.025446432@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
block/blk-core.c | 20 ++++++++------------
1 file changed, 8 insertions(+), 12 deletions(-)
block/blk-core.c | 12 ++----------
1 file changed, 2 insertions(+), 10 deletions(-)
Index: linux-stable/block/blk-core.c
===================================================================
--- linux-stable.orig/block/blk-core.c
+++ linux-stable/block/blk-core.c
@@ -304,7 +304,11 @@ void __blk_run_queue(struct request_queu
{
if (unlikely(blk_queue_stopped(q)))
return;
-
+ /*
+ * q->request_fn() can drop q->queue_lock and reenable
+ * interrupts, but must return with q->queue_lock held and
+ * interrupts disabled.
+ */
q->request_fn(q);
}
EXPORT_SYMBOL(__blk_run_queue);
@@ -2902,11 +2906,11 @@ static void queue_unplugged(struct reque
* this lock).
*/
if (from_schedule) {
- spin_unlock(q->queue_lock);
+ spin_unlock_irq(q->queue_lock);
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -2929,7 +2929,7 @@ static void queue_unplugged(struct reque
blk_run_queue_async(q);
} else {
else
__blk_run_queue(q);
- spin_unlock(q->queue_lock);
+ spin_unlock_irq(q->queue_lock);
}
- spin_unlock(q->queue_lock);
+ spin_unlock_irq(q->queue_lock);
}
@@ -2956,7 +2960,6 @@ EXPORT_SYMBOL(blk_check_plugged);
static void flush_plug_callbacks(struct blk_plug *plug, bool from_schedule)
@@ -2977,7 +2977,6 @@ EXPORT_SYMBOL(blk_check_plugged);
void blk_flush_plug_list(struct blk_plug *plug, bool from_schedule)
{
struct request_queue *q;
@ -85,7 +65,7 @@ Index: linux-stable/block/blk-core.c
struct request *rq;
LIST_HEAD(list);
unsigned int depth;
@@ -2977,11 +2980,6 @@ void blk_flush_plug_list(struct blk_plug
@@ -2998,11 +2997,6 @@ void blk_flush_plug_list(struct blk_plug
q = NULL;
depth = 0;
@ -97,7 +77,7 @@ Index: linux-stable/block/blk-core.c
while (!list_empty(&list)) {
rq = list_entry_rq(list.next);
list_del_init(&rq->queuelist);
@@ -2994,7 +2992,7 @@ void blk_flush_plug_list(struct blk_plug
@@ -3015,7 +3009,7 @@ void blk_flush_plug_list(struct blk_plug
queue_unplugged(q, depth, from_schedule);
q = rq->q;
depth = 0;
@ -106,7 +86,7 @@ Index: linux-stable/block/blk-core.c
}
/*
@@ -3021,8 +3019,6 @@ void blk_flush_plug_list(struct blk_plug
@@ -3042,8 +3036,6 @@ void blk_flush_plug_list(struct blk_plug
*/
if (q)
queue_unplugged(q, depth, from_schedule);

View File

@ -0,0 +1,45 @@
Subject: block: Use cpu_chill() for retry loops
From: Thomas Gleixner <tglx@linutronix.de>
Date: Thu, 20 Dec 2012 18:28:26 +0100
Retry loops on RT might loop forever when the modifying side was
preempted. Steven also observed a live lock when there was a
concurrent priority boosting going on.
Use cpu_chill() instead of cpu_relax() to let the system
make progress.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: stable-rt@vger.kernel.org
---
block/blk-ioc.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
--- a/block/blk-ioc.c
+++ b/block/blk-ioc.c
@@ -8,6 +8,7 @@
#include <linux/blkdev.h>
#include <linux/bootmem.h> /* for max_pfn/max_low_pfn */
#include <linux/slab.h>
+#include <linux/delay.h>
#include "blk.h"
@@ -110,7 +111,7 @@ static void ioc_release_fn(struct work_s
spin_unlock(q->queue_lock);
} else {
spin_unlock_irqrestore(&ioc->lock, flags);
- cpu_relax();
+ cpu_chill();
spin_lock_irqsave_nested(&ioc->lock, flags, 1);
}
}
@@ -188,7 +189,7 @@ retry:
spin_unlock(icq->q->queue_lock);
} else {
spin_unlock_irqrestore(&ioc->lock, flags);
- cpu_relax();
+ cpu_chill();
goto retry;
}
}

View File

@ -9,10 +9,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
include/asm-generic/bug.h | 14 ++++++++++++++
1 file changed, 14 insertions(+)
Index: linux-stable/include/asm-generic/bug.h
===================================================================
--- linux-stable.orig/include/asm-generic/bug.h
+++ linux-stable/include/asm-generic/bug.h
--- a/include/asm-generic/bug.h
+++ b/include/asm-generic/bug.h
@@ -202,6 +202,20 @@ extern void warn_slowpath_null(const cha
# define WARN_ON_SMP(x) ({0;})
#endif

View File

@ -13,10 +13,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
drivers/misc/Kconfig | 11 +++++++--
2 files changed, 35 insertions(+), 20 deletions(-)
Index: linux-stable/drivers/clocksource/tcb_clksrc.c
===================================================================
--- linux-stable.orig/drivers/clocksource/tcb_clksrc.c
+++ linux-stable/drivers/clocksource/tcb_clksrc.c
--- a/drivers/clocksource/tcb_clksrc.c
+++ b/drivers/clocksource/tcb_clksrc.c
@@ -23,8 +23,7 @@
* this 32 bit free-running counter. the second channel is not used.
*
@ -73,7 +71,7 @@ Index: linux-stable/drivers/clocksource/tcb_clksrc.c
__raw_writel(timer_clock | ATMEL_TC_CPCSTOP
| ATMEL_TC_WAVE | ATMEL_TC_WAVESEL_UP_AUTO,
regs + ATMEL_TC_REG(2, CMR));
@@ -158,8 +152,12 @@ static struct tc_clkevt_device clkevt =
@@ -158,8 +152,12 @@ static struct tc_clkevt_device clkevt =
.features = CLOCK_EVT_FEAT_PERIODIC
| CLOCK_EVT_FEAT_ONESHOT,
.shift = 32,
@ -132,11 +130,9 @@ Index: linux-stable/drivers/clocksource/tcb_clksrc.c
return 0;
}
arch_initcall(tcb_clksrc_init);
Index: linux-stable/drivers/misc/Kconfig
===================================================================
--- linux-stable.orig/drivers/misc/Kconfig
+++ linux-stable/drivers/misc/Kconfig
@@ -88,8 +88,7 @@ config ATMEL_TCB_CLKSRC
--- a/drivers/misc/Kconfig
+++ b/drivers/misc/Kconfig
@@ -78,8 +78,7 @@ config ATMEL_TCB_CLKSRC
are combined to make a single 32-bit timer.
When GENERIC_CLOCKEVENTS is defined, the third timer channel
@ -146,7 +142,7 @@ Index: linux-stable/drivers/misc/Kconfig
config ATMEL_TCB_CLKSRC_BLOCK
int
@@ -103,6 +102,14 @@ config ATMEL_TCB_CLKSRC_BLOCK
@@ -93,6 +92,14 @@ config ATMEL_TCB_CLKSRC_BLOCK
TC can be used for other purposes, such as PWM generation and
interval timing.
@ -160,4 +156,4 @@ Index: linux-stable/drivers/misc/Kconfig
+
config IBM_ASM
tristate "Device driver for IBM RSA service processor"
depends on X86 && PCI && INPUT && EXPERIMENTAL
depends on X86 && PCI && INPUT

View File

@ -0,0 +1,155 @@
Subject: completion: Use simple wait queues
From: Thomas Gleixner <tglx@linutronix.de>
Date: Fri, 11 Jan 2013 11:23:51 +0100
Completions have no long lasting callbacks and therefor do not need
the complex waitqueue variant. Use simple waitqueues which reduces the
contention on the waitqueue lock.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
include/linux/completion.h | 8 ++++----
include/linux/uprobes.h | 1 +
kernel/sched/core.c | 34 +++++++++++++++++-----------------
3 files changed, 22 insertions(+), 21 deletions(-)
--- a/include/linux/completion.h
+++ b/include/linux/completion.h
@@ -8,7 +8,7 @@
* See kernel/sched.c for details.
*/
-#include <linux/wait.h>
+#include <linux/wait-simple.h>
/*
* struct completion - structure used to maintain state for a "completion"
@@ -24,11 +24,11 @@
*/
struct completion {
unsigned int done;
- wait_queue_head_t wait;
+ struct swait_head wait;
};
#define COMPLETION_INITIALIZER(work) \
- { 0, __WAIT_QUEUE_HEAD_INITIALIZER((work).wait) }
+ { 0, SWAIT_HEAD_INITIALIZER((work).wait) }
#define COMPLETION_INITIALIZER_ONSTACK(work) \
({ init_completion(&work); work; })
@@ -73,7 +73,7 @@ struct completion {
static inline void init_completion(struct completion *x)
{
x->done = 0;
- init_waitqueue_head(&x->wait);
+ init_swait_head(&x->wait);
}
extern void wait_for_completion(struct completion *);
--- a/include/linux/uprobes.h
+++ b/include/linux/uprobes.h
@@ -26,6 +26,7 @@
#include <linux/errno.h>
#include <linux/rbtree.h>
+#include <linux/wait.h>
struct vm_area_struct;
struct mm_struct;
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -3487,10 +3487,10 @@ void complete(struct completion *x)
{
unsigned long flags;
- spin_lock_irqsave(&x->wait.lock, flags);
+ raw_spin_lock_irqsave(&x->wait.lock, flags);
x->done++;
- __wake_up_common(&x->wait, TASK_NORMAL, 1, 0, NULL);
- spin_unlock_irqrestore(&x->wait.lock, flags);
+ __swait_wake_locked(&x->wait, TASK_NORMAL, 1);
+ raw_spin_unlock_irqrestore(&x->wait.lock, flags);
}
EXPORT_SYMBOL(complete);
@@ -3507,10 +3507,10 @@ void complete_all(struct completion *x)
{
unsigned long flags;
- spin_lock_irqsave(&x->wait.lock, flags);
+ raw_spin_lock_irqsave(&x->wait.lock, flags);
x->done += UINT_MAX/2;
- __wake_up_common(&x->wait, TASK_NORMAL, 0, 0, NULL);
- spin_unlock_irqrestore(&x->wait.lock, flags);
+ __swait_wake_locked(&x->wait, TASK_NORMAL, 0);
+ raw_spin_unlock_irqrestore(&x->wait.lock, flags);
}
EXPORT_SYMBOL(complete_all);
@@ -3518,20 +3518,20 @@ static inline long __sched
do_wait_for_common(struct completion *x, long timeout, int state)
{
if (!x->done) {
- DECLARE_WAITQUEUE(wait, current);
+ DEFINE_SWAITER(wait);
- __add_wait_queue_tail_exclusive(&x->wait, &wait);
+ swait_prepare_locked(&x->wait, &wait);
do {
if (signal_pending_state(state, current)) {
timeout = -ERESTARTSYS;
break;
}
__set_current_state(state);
- spin_unlock_irq(&x->wait.lock);
+ raw_spin_unlock_irq(&x->wait.lock);
timeout = schedule_timeout(timeout);
- spin_lock_irq(&x->wait.lock);
+ raw_spin_lock_irq(&x->wait.lock);
} while (!x->done && timeout);
- __remove_wait_queue(&x->wait, &wait);
+ swait_finish_locked(&x->wait, &wait);
if (!x->done)
return timeout;
}
@@ -3544,9 +3544,9 @@ wait_for_common(struct completion *x, lo
{
might_sleep();
- spin_lock_irq(&x->wait.lock);
+ raw_spin_lock_irq(&x->wait.lock);
timeout = do_wait_for_common(x, timeout, state);
- spin_unlock_irq(&x->wait.lock);
+ raw_spin_unlock_irq(&x->wait.lock);
return timeout;
}
@@ -3677,12 +3677,12 @@ bool try_wait_for_completion(struct comp
unsigned long flags;
int ret = 1;
- spin_lock_irqsave(&x->wait.lock, flags);
+ raw_spin_lock_irqsave(&x->wait.lock, flags);
if (!x->done)
ret = 0;
else
x->done--;
- spin_unlock_irqrestore(&x->wait.lock, flags);
+ raw_spin_unlock_irqrestore(&x->wait.lock, flags);
return ret;
}
EXPORT_SYMBOL(try_wait_for_completion);
@@ -3700,10 +3700,10 @@ bool completion_done(struct completion *
unsigned long flags;
int ret = 1;
- spin_lock_irqsave(&x->wait.lock, flags);
+ raw_spin_lock_irqsave(&x->wait.lock, flags);
if (!x->done)
ret = 0;
- spin_unlock_irqrestore(&x->wait.lock, flags);
+ raw_spin_unlock_irqrestore(&x->wait.lock, flags);
return ret;
}
EXPORT_SYMBOL(completion_done);

View File

@ -7,11 +7,9 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
include/linux/sched.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: linux-stable/include/linux/sched.h
===================================================================
--- linux-stable.orig/include/linux/sched.h
+++ linux-stable/include/linux/sched.h
@@ -2689,7 +2689,7 @@ extern int _cond_resched(void);
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -2719,7 +2719,7 @@ extern int _cond_resched(void);
extern int __cond_resched_lock(spinlock_t *lock);

View File

@ -8,11 +8,9 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
kernel/sched/core.c | 2 ++
2 files changed, 6 insertions(+)
Index: linux-stable/include/linux/sched.h
===================================================================
--- linux-stable.orig/include/linux/sched.h
+++ linux-stable/include/linux/sched.h
@@ -2700,12 +2700,16 @@ extern int __cond_resched_lock(spinlock_
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -2730,12 +2730,16 @@ extern int __cond_resched_lock(spinlock_
__cond_resched_lock(lock); \
})
@ -29,11 +27,9 @@ Index: linux-stable/include/linux/sched.h
/*
* Does a critical section need to be broken due to another
Index: linux-stable/kernel/sched/core.c
===================================================================
--- linux-stable.orig/kernel/sched/core.c
+++ linux-stable/kernel/sched/core.c
@@ -4832,6 +4832,7 @@ int __cond_resched_lock(spinlock_t *lock
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -4366,6 +4366,7 @@ int __cond_resched_lock(spinlock_t *lock
}
EXPORT_SYMBOL(__cond_resched_lock);
@ -41,7 +37,7 @@ Index: linux-stable/kernel/sched/core.c
int __sched __cond_resched_softirq(void)
{
BUG_ON(!in_softirq());
@@ -4845,6 +4846,7 @@ int __sched __cond_resched_softirq(void)
@@ -4379,6 +4380,7 @@ int __sched __cond_resched_softirq(void)
return 0;
}
EXPORT_SYMBOL(__cond_resched_softirq);

View File

@ -22,10 +22,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
kernel/cpu.c | 35 ++++++++++++++++++++++++++---------
1 file changed, 26 insertions(+), 9 deletions(-)
Index: linux-stable/kernel/cpu.c
===================================================================
--- linux-stable.orig/kernel/cpu.c
+++ linux-stable/kernel/cpu.c
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -51,7 +51,12 @@ static int cpu_hotplug_disabled;
static struct {
@ -85,12 +83,16 @@ Index: linux-stable/kernel/cpu.c
}
EXPORT_SYMBOL_GPL(get_online_cpus);
@@ -177,10 +194,10 @@ void put_online_cpus(void)
@@ -177,14 +194,14 @@ void put_online_cpus(void)
{
if (cpu_hotplug.active_writer == current)
return;
- mutex_lock(&cpu_hotplug.lock);
+ hotplug_lock();
if (WARN_ON(!cpu_hotplug.refcount))
cpu_hotplug.refcount++; /* try to fix things up */
if (!--cpu_hotplug.refcount && unlikely(cpu_hotplug.active_writer))
wake_up_process(cpu_hotplug.active_writer);
- mutex_unlock(&cpu_hotplug.lock);
@ -98,7 +100,7 @@ Index: linux-stable/kernel/cpu.c
}
EXPORT_SYMBOL_GPL(put_online_cpus);
@@ -212,11 +229,11 @@ static void cpu_hotplug_begin(void)
@@ -216,11 +233,11 @@ static void cpu_hotplug_begin(void)
cpu_hotplug.active_writer = current;
for (;;) {
@ -112,7 +114,7 @@ Index: linux-stable/kernel/cpu.c
schedule();
}
}
@@ -224,7 +241,7 @@ static void cpu_hotplug_begin(void)
@@ -228,7 +245,7 @@ static void cpu_hotplug_begin(void)
static void cpu_hotplug_done(void)
{
cpu_hotplug.active_writer = NULL;

View File

@ -50,15 +50,13 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
include/linux/sched.h | 7 +
kernel/cpu.c | 240 +++++++++++++++++++++++++++++++++++++++++---------
kernel/cpu.c | 241 +++++++++++++++++++++++++++++++++++++++++---------
kernel/sched/core.c | 82 ++++++++++++++++-
3 files changed, 285 insertions(+), 44 deletions(-)
3 files changed, 285 insertions(+), 45 deletions(-)
Index: linux-stable/include/linux/sched.h
===================================================================
--- linux-stable.orig/include/linux/sched.h
+++ linux-stable/include/linux/sched.h
@@ -1952,6 +1952,10 @@ extern void do_set_cpus_allowed(struct t
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1977,6 +1977,10 @@ extern void do_set_cpus_allowed(struct t
extern int set_cpus_allowed_ptr(struct task_struct *p,
const struct cpumask *new_mask);
@ -69,7 +67,7 @@ Index: linux-stable/include/linux/sched.h
#else
static inline void do_set_cpus_allowed(struct task_struct *p,
const struct cpumask *new_mask)
@@ -1964,6 +1968,9 @@ static inline int set_cpus_allowed_ptr(s
@@ -1989,6 +1993,9 @@ static inline int set_cpus_allowed_ptr(s
return -EINVAL;
return 0;
}
@ -79,10 +77,8 @@ Index: linux-stable/include/linux/sched.h
#endif
#ifdef CONFIG_NO_HZ
Index: linux-stable/kernel/cpu.c
===================================================================
--- linux-stable.orig/kernel/cpu.c
+++ linux-stable/kernel/cpu.c
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -51,12 +51,7 @@ static int cpu_hotplug_disabled;
static struct {
@ -395,20 +391,24 @@ Index: linux-stable/kernel/cpu.c
}
EXPORT_SYMBOL_GPL(get_online_cpus);
@@ -194,10 +347,10 @@ void put_online_cpus(void)
{
@@ -195,14 +348,13 @@ void put_online_cpus(void)
if (cpu_hotplug.active_writer == current)
return;
- hotplug_lock();
+ mutex_lock(&cpu_hotplug.lock);
if (WARN_ON(!cpu_hotplug.refcount))
cpu_hotplug.refcount++; /* try to fix things up */
if (!--cpu_hotplug.refcount && unlikely(cpu_hotplug.active_writer))
wake_up_process(cpu_hotplug.active_writer);
- hotplug_unlock();
-
+ mutex_unlock(&cpu_hotplug.lock);
}
EXPORT_SYMBOL_GPL(put_online_cpus);
@@ -229,11 +382,11 @@ static void cpu_hotplug_begin(void)
@@ -233,11 +385,11 @@ static void cpu_hotplug_begin(void)
cpu_hotplug.active_writer = current;
for (;;) {
@ -422,7 +422,7 @@ Index: linux-stable/kernel/cpu.c
schedule();
}
}
@@ -241,7 +394,7 @@ static void cpu_hotplug_begin(void)
@@ -245,7 +397,7 @@ static void cpu_hotplug_begin(void)
static void cpu_hotplug_done(void)
{
cpu_hotplug.active_writer = NULL;
@ -431,9 +431,9 @@ Index: linux-stable/kernel/cpu.c
}
#else /* #if CONFIG_HOTPLUG_CPU */
@@ -416,6 +569,9 @@ static int __ref _cpu_down(unsigned int
goto out_release;
@@ -421,6 +573,9 @@ static int __ref _cpu_down(unsigned int
}
smpboot_park_threads(cpu);
+ /* Notifiers are done. Don't let any more tasks pin this CPU. */
+ cpu_unplug_sync(cpu);
@ -441,11 +441,9 @@ Index: linux-stable/kernel/cpu.c
err = __stop_machine(take_cpu_down, &tcd_param, cpumask_of(cpu));
if (err) {
/* CPU didn't die: tell everyone. Can't complain. */
Index: linux-stable/kernel/sched/core.c
===================================================================
--- linux-stable.orig/kernel/sched/core.c
+++ linux-stable/kernel/sched/core.c
@@ -3418,7 +3418,7 @@ void migrate_disable(void)
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -2896,7 +2896,7 @@ void migrate_disable(void)
{
struct task_struct *p = current;
@ -454,7 +452,7 @@ Index: linux-stable/kernel/sched/core.c
#ifdef CONFIG_SCHED_DEBUG
p->migrate_disable_atomic++;
#endif
@@ -3449,7 +3449,7 @@ void migrate_enable(void)
@@ -2927,7 +2927,7 @@ void migrate_enable(void)
unsigned long flags;
struct rq *rq;
@ -463,7 +461,7 @@ Index: linux-stable/kernel/sched/core.c
#ifdef CONFIG_SCHED_DEBUG
p->migrate_disable_atomic--;
#endif
@@ -5341,6 +5341,84 @@ void do_set_cpus_allowed(struct task_str
@@ -4872,6 +4872,84 @@ void do_set_cpus_allowed(struct task_str
cpumask_copy(&p->cpus_allowed, new_mask);
}

View File

@ -7,10 +7,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
include/linux/smp.h | 8 ++++++++
1 file changed, 8 insertions(+)
Index: linux-stable/include/linux/smp.h
===================================================================
--- linux-stable.orig/include/linux/smp.h
+++ linux-stable/include/linux/smp.h
--- a/include/linux/smp.h
+++ b/include/linux/smp.h
@@ -218,6 +218,14 @@ static inline void kick_all_cpus_sync(vo
#define get_cpu() ({ preempt_disable(); smp_processor_id(); })
#define put_cpu() preempt_enable()

View File

@ -11,11 +11,9 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
lib/Kconfig | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
Index: linux-stable/arch/x86/Kconfig
===================================================================
--- linux-stable.orig/arch/x86/Kconfig
+++ linux-stable/arch/x86/Kconfig
@@ -757,7 +757,7 @@ config IOMMU_HELPER
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -775,7 +775,7 @@ config IOMMU_HELPER
config MAXSMP
bool "Enable Maximum number of SMP Processors and NUMA Nodes"
depends on X86_64 && SMP && DEBUG_KERNEL && EXPERIMENTAL
@ -24,11 +22,9 @@ Index: linux-stable/arch/x86/Kconfig
---help---
Enable maximum number of CPUS and NUMA Nodes for this architecture.
If unsure, say N.
Index: linux-stable/lib/Kconfig
===================================================================
--- linux-stable.orig/lib/Kconfig
+++ linux-stable/lib/Kconfig
@@ -312,6 +312,7 @@ config CHECK_SIGNATURE
--- a/lib/Kconfig
+++ b/lib/Kconfig
@@ -315,6 +315,7 @@ config CHECK_SIGNATURE
config CPUMASK_OFFSTACK
bool "Force CPU masks off stack" if DEBUG_PER_CPU_MAPS

View File

@ -1,51 +0,0 @@
Subject: crypto: Make core builtin and init srcu early
From: Thomas Gleixner <tglx@linutronix.de>
Date: Fri, 12 Oct 2012 11:09:19 +0100
When the scru notifier is not initialized before the first user we
crash.
[ 0.281119] BUG: unable to handle kernel NULL pointer dereference at (null)
[ 0.281124] IP: [<ffffffff8108ee6d>] __srcu_read_lock+0x2f/0x79
Make the core code built-in for now and enfore early init.
FIXME: Create a static initializer for this.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
crypto/Kconfig | 2 +-
crypto/api.c | 7 +++++++
2 files changed, 8 insertions(+), 1 deletion(-)
Index: linux-stable/crypto/Kconfig
===================================================================
--- linux-stable.orig/crypto/Kconfig
+++ linux-stable/crypto/Kconfig
@@ -13,7 +13,7 @@ source "crypto/async_tx/Kconfig"
# Cryptographic API Configuration
#
menuconfig CRYPTO
- tristate "Cryptographic API"
+ bool "Cryptographic API"
help
This option provides the core Cryptographic API.
Index: linux-stable/crypto/api.c
===================================================================
--- linux-stable.orig/crypto/api.c
+++ linux-stable/crypto/api.c
@@ -34,6 +34,13 @@ EXPORT_SYMBOL_GPL(crypto_alg_sem);
struct srcu_notifier_head crypto_chain;
EXPORT_SYMBOL_GPL(crypto_chain);
+static int __init crypto_api_init(void)
+{
+ srcu_init_notifier_head(&crypto_chain);
+ return 0;
+}
+core_initcall(crypto_api_init);
+
static inline struct crypto_alg *crypto_alg_get(struct crypto_alg *alg)
{
atomic_inc(&alg->cra_refcnt);

View File

@ -7,10 +7,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
lib/debugobjects.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
Index: linux-stable/lib/debugobjects.c
===================================================================
--- linux-stable.orig/lib/debugobjects.c
+++ linux-stable/lib/debugobjects.c
--- a/lib/debugobjects.c
+++ b/lib/debugobjects.c
@@ -309,7 +309,10 @@ __debug_object_init(void *addr, struct d
struct debug_obj *obj;
unsigned long flags;

View File

@ -13,11 +13,9 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
drivers/md/dm.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Index: linux-stable/drivers/md/dm.c
===================================================================
--- linux-stable.orig/drivers/md/dm.c
+++ linux-stable/drivers/md/dm.c
@@ -1692,14 +1692,14 @@ static void dm_request_fn(struct request
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -1677,14 +1677,14 @@ static void dm_request_fn(struct request
if (map_request(ti, clone, md))
goto requeued;

View File

@ -12,10 +12,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
drivers/net/ethernet/realtek/8139too.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: linux-stable/drivers/net/ethernet/realtek/8139too.c
===================================================================
--- linux-stable.orig/drivers/net/ethernet/realtek/8139too.c
+++ linux-stable/drivers/net/ethernet/realtek/8139too.c
--- a/drivers/net/ethernet/realtek/8139too.c
+++ b/drivers/net/ethernet/realtek/8139too.c
@@ -2216,7 +2216,7 @@ static void rtl8139_poll_controller(stru
struct rtl8139_private *tp = netdev_priv(dev);
const int irq = tp->pci_dev->irq;

View File

@ -1,54 +0,0 @@
From: Thomas Gleixner <tglx@linutronix.de>
Date: Tue, 17 Nov 2009 12:02:43 +0100
Subject: drivers: net: at91_ether: Make mdio protection -rt safe
Neither the phy interrupt nor the timer callback which updates the
link status in absense of a phy interrupt are taking lp->lock which
serializes the MDIO access. This works on mainline as at91 is an UP
machine. On preempt-rt the timer callback can run even in the
spin_lock_irq(&lp->lock) protected code pathes because spin_lock_irq
is neither disabling interrupts nor disabling preemption.
Fix this by adding proper locking to at91ether_phy_interrupt() and
at91_check_ether() which serializes the access on -rt.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
drivers/net/ethernet/cadence/at91_ether.c | 5 +++++
1 file changed, 5 insertions(+)
Index: linux-stable/drivers/net/ethernet/cadence/at91_ether.c
===================================================================
--- linux-stable.orig/drivers/net/ethernet/cadence/at91_ether.c
+++ linux-stable/drivers/net/ethernet/cadence/at91_ether.c
@@ -199,7 +199,9 @@ static irqreturn_t at91ether_phy_interru
struct net_device *dev = (struct net_device *) dev_id;
struct at91_private *lp = netdev_priv(dev);
unsigned int phy;
+ unsigned long flags;
+ spin_lock_irqsave(&lp->lock, flags);
/*
* This hander is triggered on both edges, but the PHY chips expect
* level-triggering. We therefore have to check if the PHY actually has
@@ -241,6 +243,7 @@ static irqreturn_t at91ether_phy_interru
done:
disable_mdi(lp);
+ spin_unlock_irqrestore(&lp->lock, flags);
return IRQ_HANDLED;
}
@@ -397,9 +400,11 @@ static void at91ether_check_link(unsigne
struct net_device *dev = (struct net_device *) dev_id;
struct at91_private *lp = netdev_priv(dev);
+ spin_lock_irq(&lp->lock);
enable_mdi(lp);
update_linkspeed(dev, 1);
disable_mdi(lp);
+ spin_unlock_irq(&lp->lock);
mod_timer(&lp->check_timer, jiffies + LINK_POLL_INTERVAL);
}

View File

@ -1,53 +0,0 @@
From: Darren Hart <dvhltc@us.ibm.com>
Date: Tue, 18 May 2010 14:33:07 -0700
Subject: drivers: net: ehea: Make rx irq handler non-threaded (IRQF_NO_THREAD)
The underlying hardware is edge triggered but presented by XICS as level
triggered. The edge triggered interrupts are not reissued after masking. This
is not a problem in mainline which does not mask the interrupt (relying on the
EOI mechanism instead). The threaded interrupts in PREEMPT_RT do mask the
interrupt, and can lose interrupts that occurred while masked, resulting in a
hung ethernet interface.
The receive handler simply calls napi_schedule(), as such, there is no
significant additional overhead in making this non-threaded, since we either
wakeup the threaded irq handler to call napi_schedule(), or just call
napi_schedule() directly to wakeup the softirqs. As the receive handler is
lockless, there is no need to convert any of the ehea spinlock_t's to
raw_spinlock_t's.
Without this patch, a simple scp file copy loop would fail quickly (usually
seconds). We have over two hours of sustained scp activity with the patch
applied.
Credit goes to Will Schmidt for lots of instrumentation and tracing which
clarified the scenario and to Thomas Gleixner for the incredibly simple
solution.
Signed-off-by: Darren Hart <dvhltc@us.ibm.com>
Acked-by: Will Schmidt <will_schmidt@vnet.ibm.com>
Cc: Jan-Bernd Themann <themann@de.ibm.com>
Cc: Nivedita Singhvi <niv@us.ibm.com>
Cc: Brian King <bjking1@us.ibm.com>
Cc: Michael Ellerman <ellerman@au1.ibm.com>
Cc: Doug Maxey <doug.maxey@us.ibm.com>
LKML-Reference: <4BF30793.5070300@us.ibm.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
drivers/net/ethernet/ibm/ehea/ehea_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: linux-stable/drivers/net/ethernet/ibm/ehea/ehea_main.c
===================================================================
--- linux-stable.orig/drivers/net/ethernet/ibm/ehea/ehea_main.c
+++ linux-stable/drivers/net/ethernet/ibm/ehea/ehea_main.c
@@ -1308,7 +1308,7 @@ static int ehea_reg_interrupts(struct ne
"%s-queue%d", dev->name, i);
ret = ibmebus_request_irq(pr->eq->attr.ist1,
ehea_recv_irq_handler,
- IRQF_DISABLED, pr->int_send_name,
+ IRQF_NO_THREAD, pr->int_send_name,
pr);
if (ret) {
netdev_err(dev, "failed registering irq for ehea_queue port_res_nr:%d, ist=%X\n",

View File

@ -21,11 +21,9 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
drivers/net/rionet.c | 6 +-----
7 files changed, 9 insertions(+), 31 deletions(-)
Index: linux-stable/drivers/net/ethernet/atheros/atl1c/atl1c_main.c
===================================================================
--- linux-stable.orig/drivers/net/ethernet/atheros/atl1c/atl1c_main.c
+++ linux-stable/drivers/net/ethernet/atheros/atl1c/atl1c_main.c
@@ -2122,11 +2122,7 @@ static netdev_tx_t atl1c_xmit_frame(stru
--- a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c
+++ b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c
@@ -2171,11 +2171,7 @@ static netdev_tx_t atl1c_xmit_frame(stru
}
tpd_req = atl1c_cal_tpd_req(skb);
@ -38,10 +36,8 @@ Index: linux-stable/drivers/net/ethernet/atheros/atl1c/atl1c_main.c
if (atl1c_tpd_avail(adapter, type) < tpd_req) {
/* no enough descriptor, just stop queue */
Index: linux-stable/drivers/net/ethernet/atheros/atl1e/atl1e_main.c
===================================================================
--- linux-stable.orig/drivers/net/ethernet/atheros/atl1e/atl1e_main.c
+++ linux-stable/drivers/net/ethernet/atheros/atl1e/atl1e_main.c
--- a/drivers/net/ethernet/atheros/atl1e/atl1e_main.c
+++ b/drivers/net/ethernet/atheros/atl1e/atl1e_main.c
@@ -1803,8 +1803,7 @@ static netdev_tx_t atl1e_xmit_frame(stru
return NETDEV_TX_OK;
}
@ -52,11 +48,9 @@ Index: linux-stable/drivers/net/ethernet/atheros/atl1e/atl1e_main.c
if (atl1e_tpd_avail(adapter) < tpd_req) {
/* no enough descriptor, just stop queue */
Index: linux-stable/drivers/net/ethernet/chelsio/cxgb/sge.c
===================================================================
--- linux-stable.orig/drivers/net/ethernet/chelsio/cxgb/sge.c
+++ linux-stable/drivers/net/ethernet/chelsio/cxgb/sge.c
@@ -1678,8 +1678,7 @@ static int t1_sge_tx(struct sk_buff *skb
--- a/drivers/net/ethernet/chelsio/cxgb/sge.c
+++ b/drivers/net/ethernet/chelsio/cxgb/sge.c
@@ -1666,8 +1666,7 @@ static int t1_sge_tx(struct sk_buff *skb
struct cmdQ *q = &sge->cmdQ[qid];
unsigned int credits, pidx, genbit, count, use_sched_skb = 0;
@ -66,10 +60,8 @@ Index: linux-stable/drivers/net/ethernet/chelsio/cxgb/sge.c
reclaim_completed_tx(sge, q);
Index: linux-stable/drivers/net/ethernet/neterion/s2io.c
===================================================================
--- linux-stable.orig/drivers/net/ethernet/neterion/s2io.c
+++ linux-stable/drivers/net/ethernet/neterion/s2io.c
--- a/drivers/net/ethernet/neterion/s2io.c
+++ b/drivers/net/ethernet/neterion/s2io.c
@@ -4088,12 +4088,7 @@ static netdev_tx_t s2io_xmit(struct sk_b
[skb->priority & (MAX_TX_FIFOS - 1)];
fifo = &mac_control->fifos[queue];
@ -84,11 +76,9 @@ Index: linux-stable/drivers/net/ethernet/neterion/s2io.c
if (sp->config.multiq) {
if (__netif_subqueue_stopped(dev, fifo->fifo_no)) {
Index: linux-stable/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
===================================================================
--- linux-stable.orig/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
+++ linux-stable/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
@@ -2159,10 +2159,8 @@ static int pch_gbe_xmit_frame(struct sk_
--- a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
+++ b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
@@ -2114,10 +2114,8 @@ static int pch_gbe_xmit_frame(struct sk_
struct pch_gbe_tx_ring *tx_ring = adapter->tx_ring;
unsigned long flags;
@ -101,10 +91,8 @@ Index: linux-stable/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
if (unlikely(!PCH_GBE_DESC_UNUSED(tx_ring))) {
netif_stop_queue(netdev);
spin_unlock_irqrestore(&tx_ring->tx_lock, flags);
Index: linux-stable/drivers/net/ethernet/tehuti/tehuti.c
===================================================================
--- linux-stable.orig/drivers/net/ethernet/tehuti/tehuti.c
+++ linux-stable/drivers/net/ethernet/tehuti/tehuti.c
--- a/drivers/net/ethernet/tehuti/tehuti.c
+++ b/drivers/net/ethernet/tehuti/tehuti.c
@@ -1630,13 +1630,8 @@ static netdev_tx_t bdx_tx_transmit(struc
unsigned long flags;
@ -121,11 +109,9 @@ Index: linux-stable/drivers/net/ethernet/tehuti/tehuti.c
/* build tx descriptor */
BDX_ASSERT(f->m.wptr >= f->m.memsz); /* started with valid wptr */
Index: linux-stable/drivers/net/rionet.c
===================================================================
--- linux-stable.orig/drivers/net/rionet.c
+++ linux-stable/drivers/net/rionet.c
@@ -178,11 +178,7 @@ static int rionet_start_xmit(struct sk_b
--- a/drivers/net/rionet.c
+++ b/drivers/net/rionet.c
@@ -174,11 +174,7 @@ static int rionet_start_xmit(struct sk_b
unsigned long flags;
int add_num = 1;
@ -137,4 +123,4 @@ Index: linux-stable/drivers/net/rionet.c
+ spin_lock_irqsave(&rnet->tx_lock, flags);
if (is_multicast_ether_addr(eth->h_dest))
add_num = nact;
add_num = nets[rnet->mport->id].nact;

View File

@ -15,11 +15,9 @@ Tested-by: Xianghua Xiao <xiaoxianghua@gmail.com>
drivers/net/ethernet/freescale/gianfar.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
Index: linux-stable/drivers/net/ethernet/freescale/gianfar.c
===================================================================
--- linux-stable.orig/drivers/net/ethernet/freescale/gianfar.c
+++ linux-stable/drivers/net/ethernet/freescale/gianfar.c
@@ -1652,7 +1652,7 @@ void stop_gfar(struct net_device *dev)
--- a/drivers/net/ethernet/freescale/gianfar.c
+++ b/drivers/net/ethernet/freescale/gianfar.c
@@ -1663,7 +1663,7 @@ void stop_gfar(struct net_device *dev)
/* Lock it down */
@ -28,7 +26,7 @@ Index: linux-stable/drivers/net/ethernet/freescale/gianfar.c
lock_tx_qs(priv);
lock_rx_qs(priv);
@@ -1660,7 +1660,7 @@ void stop_gfar(struct net_device *dev)
@@ -1671,7 +1671,7 @@ void stop_gfar(struct net_device *dev)
unlock_rx_qs(priv);
unlock_tx_qs(priv);
@ -37,7 +35,7 @@ Index: linux-stable/drivers/net/ethernet/freescale/gianfar.c
/* Free the IRQs */
if (priv->device_flags & FSL_GIANFAR_DEV_HAS_MULTI_INTR) {
@@ -2938,7 +2938,7 @@ static void adjust_link(struct net_devic
@@ -2951,7 +2951,7 @@ static void adjust_link(struct net_devic
struct phy_device *phydev = priv->phydev;
int new_state = 0;
@ -46,7 +44,7 @@ Index: linux-stable/drivers/net/ethernet/freescale/gianfar.c
lock_tx_qs(priv);
if (phydev->link) {
@@ -3007,7 +3007,7 @@ static void adjust_link(struct net_devic
@@ -3020,7 +3020,7 @@ static void adjust_link(struct net_devic
if (new_state && netif_msg_link(priv))
phy_print_status(phydev);
unlock_tx_qs(priv);

View File

@ -11,11 +11,9 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
drivers/net/ethernet/dec/tulip/tulip_core.c | 1 +
1 file changed, 1 insertion(+)
Index: linux-stable/drivers/net/ethernet/dec/tulip/tulip_core.c
===================================================================
--- linux-stable.orig/drivers/net/ethernet/dec/tulip/tulip_core.c
+++ linux-stable/drivers/net/ethernet/dec/tulip/tulip_core.c
@@ -1948,6 +1948,7 @@ static void __devexit tulip_remove_one (
--- a/drivers/net/ethernet/dec/tulip/tulip_core.c
+++ b/drivers/net/ethernet/dec/tulip/tulip_core.c
@@ -1943,6 +1943,7 @@ static void tulip_remove_one(struct pci_
pci_iounmap(pdev, tp->base_addr);
free_netdev (dev);
pci_release_regions (pdev);

View File

@ -17,10 +17,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Index: linux-stable/drivers/net/ethernet/3com/3c59x.c
===================================================================
--- linux-stable.orig/drivers/net/ethernet/3com/3c59x.c
+++ linux-stable/drivers/net/ethernet/3com/3c59x.c
--- a/drivers/net/ethernet/3com/3c59x.c
+++ b/drivers/net/ethernet/3com/3c59x.c
@@ -843,9 +843,9 @@ static void poll_vortex(struct net_devic
{
struct vortex_private *vp = netdev_priv(dev);
@ -33,7 +31,7 @@ Index: linux-stable/drivers/net/ethernet/3com/3c59x.c
}
#endif
@@ -1920,12 +1920,12 @@ static void vortex_tx_timeout(struct net
@@ -1919,12 +1919,12 @@ static void vortex_tx_timeout(struct net
* Block interrupts because vortex_interrupt does a bare spin_lock()
*/
unsigned long flags;

View File

@ -11,11 +11,9 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
drivers/char/random.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
Index: linux-stable/drivers/char/random.c
===================================================================
--- linux-stable.orig/drivers/char/random.c
+++ linux-stable/drivers/char/random.c
@@ -679,9 +679,12 @@ static void add_timer_randomness(struct
--- a/drivers/char/random.c
+++ b/drivers/char/random.c
@@ -676,9 +676,12 @@ static void add_timer_randomness(struct
preempt_disable();
/* if over the trickle threshold, use only 1 in 4096 samples */
if (input_pool.entropy_count > trickle_thresh &&
@ -30,7 +28,7 @@ Index: linux-stable/drivers/char/random.c
sample.jiffies = jiffies;
sample.cycles = get_cycles();
sample.num = num;
@@ -722,8 +725,6 @@ static void add_timer_randomness(struct
@@ -719,8 +722,6 @@ static void add_timer_randomness(struct
credit_entropy_bits(&input_pool,
min_t(int, fls(delta>>1), 11));
}

View File

@ -5,45 +5,24 @@ Subject: serial: 8250: Call flush_to_ldisc when the irq is threaded
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
drivers/tty/serial/8250/8250.c | 2 ++
drivers/tty/tty_buffer.c | 4 ++++
2 files changed, 6 insertions(+)
drivers/tty/tty_buffer.c | 5 +++++
1 file changed, 5 insertions(+)
Index: linux-stable/drivers/tty/serial/8250/8250.c
===================================================================
--- linux-stable.orig/drivers/tty/serial/8250/8250.c
+++ linux-stable/drivers/tty/serial/8250/8250.c
@@ -1549,12 +1549,14 @@ static irqreturn_t serial8250_interrupt(
l = l->next;
+#ifndef CONFIG_PREEMPT_RT_FULL
if (l == i->head && pass_counter++ > PASS_LIMIT) {
/* If we hit this, we're dead. */
printk_ratelimited(KERN_ERR
"serial8250: too much work for irq%d\n", irq);
break;
}
+#endif
} while (l != end);
spin_unlock(&i->lock);
Index: linux-stable/drivers/tty/tty_buffer.c
===================================================================
--- linux-stable.orig/drivers/tty/tty_buffer.c
+++ linux-stable/drivers/tty/tty_buffer.c
@@ -538,10 +538,14 @@ void tty_flip_buffer_push(struct tty_str
tty->buf.tail->commit = tty->buf.tail->used;
spin_unlock_irqrestore(&tty->buf.lock, flags);
--- a/drivers/tty/tty_buffer.c
+++ b/drivers/tty/tty_buffer.c
@@ -566,10 +566,15 @@ void tty_flip_buffer_push(struct tty_str
buf->tail->commit = buf->tail->used;
spin_unlock_irqrestore(&buf->lock, flags);
+#ifndef CONFIG_PREEMPT_RT_FULL
if (tty->low_latency)
flush_to_ldisc(&tty->buf.work);
flush_to_ldisc(&buf->work);
else
schedule_work(&tty->buf.work);
schedule_work(&buf->work);
+#else
+ flush_to_ldisc(&tty->buf.work);
+ flush_to_ldisc(&buf->work);
+#endif
+
}
EXPORT_SYMBOL(tty_flip_buffer_push);

View File

@ -9,11 +9,9 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
drivers/tty/serial/8250/8250.c | 15 +++++----------
1 file changed, 5 insertions(+), 10 deletions(-)
Index: linux-stable/drivers/tty/serial/8250/8250.c
===================================================================
--- linux-stable.orig/drivers/tty/serial/8250/8250.c
+++ linux-stable/drivers/tty/serial/8250/8250.c
@@ -2773,14 +2773,10 @@ serial8250_console_write(struct console
--- a/drivers/tty/serial/8250/8250.c
+++ b/drivers/tty/serial/8250/8250.c
@@ -2900,14 +2900,10 @@ serial8250_console_write(struct console
touch_nmi_watchdog();
@ -32,7 +30,7 @@ Index: linux-stable/drivers/tty/serial/8250/8250.c
/*
* First save the IER then disable the interrupts
@@ -2812,8 +2808,7 @@ serial8250_console_write(struct console
@@ -2939,8 +2935,7 @@ serial8250_console_write(struct console
serial8250_modem_status(up);
if (locked)

View File

@ -7,13 +7,11 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
drivers/tty/serial/omap-serial.c | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
Index: linux-stable/drivers/tty/serial/omap-serial.c
===================================================================
--- linux-stable.orig/drivers/tty/serial/omap-serial.c
+++ linux-stable/drivers/tty/serial/omap-serial.c
@@ -1082,13 +1082,10 @@ serial_omap_console_write(struct console
--- a/drivers/tty/serial/omap-serial.c
+++ b/drivers/tty/serial/omap-serial.c
@@ -1166,13 +1166,10 @@ serial_omap_console_write(struct console
pm_runtime_get_sync(&up->pdev->dev);
pm_runtime_get_sync(up->dev);
- local_irq_save(flags);
- if (up->port.sysrq)
@ -28,9 +26,9 @@ Index: linux-stable/drivers/tty/serial/omap-serial.c
/*
* First save the IER then disable the interrupts
@@ -1117,8 +1114,7 @@ serial_omap_console_write(struct console
pm_runtime_mark_last_busy(&up->pdev->dev);
pm_runtime_put_autosuspend(&up->pdev->dev);
@@ -1201,8 +1198,7 @@ serial_omap_console_write(struct console
pm_runtime_mark_last_busy(up->dev);
pm_runtime_put_autosuspend(up->dev);
if (locked)
- spin_unlock(&up->port.lock);
- local_irq_restore(flags);

View File

@ -0,0 +1,44 @@
Subject: drivers-tty-pl011-irq-disable-madness.patch
From: Thomas Gleixner <tglx@linutronix.de>
Date: Tue, 08 Jan 2013 21:36:51 +0100
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
drivers/tty/serial/amba-pl011.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
--- a/drivers/tty/serial/amba-pl011.c
+++ b/drivers/tty/serial/amba-pl011.c
@@ -1779,13 +1779,19 @@ pl011_console_write(struct console *co,
clk_enable(uap->clk);
- local_irq_save(flags);
+ /*
+ * local_irq_save(flags);
+ *
+ * This local_irq_save() is nonsense. If we come in via sysrq
+ * handling then interrupts are already disabled. Aside of
+ * that the port.sysrq check is racy on SMP regardless.
+ */
if (uap->port.sysrq)
locked = 0;
else if (oops_in_progress)
- locked = spin_trylock(&uap->port.lock);
+ locked = spin_trylock_irqsave(&uap->port.lock, flags);
else
- spin_lock(&uap->port.lock);
+ spin_lock_irqsave(&uap->port.lock, flags);
/*
* First save the CR then disable the interrupts
@@ -1807,8 +1813,7 @@ pl011_console_write(struct console *co,
writew(old_cr, uap->port.membase + UART011_CR);
if (locked)
- spin_unlock(&uap->port.lock);
- local_irq_restore(flags);
+ spin_unlock_irqrestore(&uap->port.lock, flags);
clk_disable(uap->clk);
}

View File

@ -21,10 +21,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
kernel/printk.c | 30 +++++++++++++++++++++++-------
15 files changed, 68 insertions(+), 110 deletions(-)
Index: linux-stable/arch/arm/kernel/early_printk.c
===================================================================
--- linux-stable.orig/arch/arm/kernel/early_printk.c
+++ linux-stable/arch/arm/kernel/early_printk.c
--- a/arch/arm/kernel/early_printk.c
+++ b/arch/arm/kernel/early_printk.c
@@ -29,28 +29,17 @@ static void early_console_write(struct c
early_write(s, n);
}
@ -57,10 +55,8 @@ Index: linux-stable/arch/arm/kernel/early_printk.c
return 0;
}
Index: linux-stable/arch/blackfin/kernel/early_printk.c
===================================================================
--- linux-stable.orig/arch/blackfin/kernel/early_printk.c
+++ linux-stable/arch/blackfin/kernel/early_printk.c
--- a/arch/blackfin/kernel/early_printk.c
+++ b/arch/blackfin/kernel/early_printk.c
@@ -25,8 +25,6 @@ extern struct console *bfin_earlyserial_
extern struct console *bfin_jc_early_init(void);
#endif
@ -70,10 +66,8 @@ Index: linux-stable/arch/blackfin/kernel/early_printk.c
/* Default console */
#define DEFAULT_PORT 0
#define DEFAULT_CFLAG CS8|B57600
Index: linux-stable/arch/microblaze/kernel/early_printk.c
===================================================================
--- linux-stable.orig/arch/microblaze/kernel/early_printk.c
+++ linux-stable/arch/microblaze/kernel/early_printk.c
--- a/arch/microblaze/kernel/early_printk.c
+++ b/arch/microblaze/kernel/early_printk.c
@@ -21,7 +21,6 @@
#include <asm/setup.h>
#include <asm/prom.h>
@ -140,10 +134,8 @@ Index: linux-stable/arch/microblaze/kernel/early_printk.c
- early_console_initialized = 0;
+ early_console = NULL;
}
Index: linux-stable/arch/mips/kernel/early_printk.c
===================================================================
--- linux-stable.orig/arch/mips/kernel/early_printk.c
+++ linux-stable/arch/mips/kernel/early_printk.c
--- a/arch/mips/kernel/early_printk.c
+++ b/arch/mips/kernel/early_printk.c
@@ -8,6 +8,7 @@
* written by Ralf Baechle (ralf@linux-mips.org)
*/
@ -177,11 +169,9 @@ Index: linux-stable/arch/mips/kernel/early_printk.c
- register_console(&early_console);
+ register_console(&early_console_prom);
}
Index: linux-stable/arch/powerpc/kernel/udbg.c
===================================================================
--- linux-stable.orig/arch/powerpc/kernel/udbg.c
+++ linux-stable/arch/powerpc/kernel/udbg.c
@@ -179,15 +179,13 @@ static struct console udbg_console = {
--- a/arch/powerpc/kernel/udbg.c
+++ b/arch/powerpc/kernel/udbg.c
@@ -156,15 +156,13 @@ static struct console udbg_console = {
.index = 0,
};
@ -198,7 +188,7 @@ Index: linux-stable/arch/powerpc/kernel/udbg.c
return;
if (!udbg_putc)
@@ -197,7 +195,7 @@ void __init register_early_udbg_console(
@@ -174,7 +172,7 @@ void __init register_early_udbg_console(
printk(KERN_INFO "early console immortal !\n");
udbg_console.flags &= ~CON_BOOT;
}
@ -207,10 +197,8 @@ Index: linux-stable/arch/powerpc/kernel/udbg.c
register_console(&udbg_console);
}
Index: linux-stable/arch/sh/kernel/sh_bios.c
===================================================================
--- linux-stable.orig/arch/sh/kernel/sh_bios.c
+++ linux-stable/arch/sh/kernel/sh_bios.c
--- a/arch/sh/kernel/sh_bios.c
+++ b/arch/sh/kernel/sh_bios.c
@@ -144,8 +144,6 @@ static struct console bios_console = {
.index = -1,
};
@ -220,10 +208,8 @@ Index: linux-stable/arch/sh/kernel/sh_bios.c
static int __init setup_early_printk(char *buf)
{
int keep_early = 0;
Index: linux-stable/arch/sparc/kernel/setup_32.c
===================================================================
--- linux-stable.orig/arch/sparc/kernel/setup_32.c
+++ linux-stable/arch/sparc/kernel/setup_32.c
--- a/arch/sparc/kernel/setup_32.c
+++ b/arch/sparc/kernel/setup_32.c
@@ -309,6 +309,7 @@ void __init setup_arch(char **cmdline_p)
boot_flags_init(*cmdline_p);
@ -232,12 +218,10 @@ Index: linux-stable/arch/sparc/kernel/setup_32.c
register_console(&prom_early_console);
printk("ARCH: ");
Index: linux-stable/arch/sparc/kernel/setup_64.c
===================================================================
--- linux-stable.orig/arch/sparc/kernel/setup_64.c
+++ linux-stable/arch/sparc/kernel/setup_64.c
@@ -487,6 +487,12 @@ static void __init init_sparc64_elf_hwca
popc_patch();
--- a/arch/sparc/kernel/setup_64.c
+++ b/arch/sparc/kernel/setup_64.c
@@ -551,6 +551,12 @@ static void __init init_sparc64_elf_hwca
pause_patch();
}
+static inline void register_prom_console(void)
@ -249,7 +233,7 @@ Index: linux-stable/arch/sparc/kernel/setup_64.c
void __init setup_arch(char **cmdline_p)
{
/* Initialize PROM console and command line. */
@@ -498,7 +504,7 @@ void __init setup_arch(char **cmdline_p)
@@ -562,7 +568,7 @@ void __init setup_arch(char **cmdline_p)
#ifdef CONFIG_EARLYFB
if (btext_find_display())
#endif
@ -258,10 +242,8 @@ Index: linux-stable/arch/sparc/kernel/setup_64.c
if (tlb_type == hypervisor)
printk("ARCH: SUN4V\n");
Index: linux-stable/arch/tile/kernel/early_printk.c
===================================================================
--- linux-stable.orig/arch/tile/kernel/early_printk.c
+++ linux-stable/arch/tile/kernel/early_printk.c
--- a/arch/tile/kernel/early_printk.c
+++ b/arch/tile/kernel/early_printk.c
@@ -17,6 +17,7 @@
#include <linux/init.h>
#include <linux/string.h>
@ -336,10 +318,8 @@ Index: linux-stable/arch/tile/kernel/early_printk.c
return;
early_printk("\
Machine shutting down before console output is fully initialized.\n\
Index: linux-stable/arch/um/kernel/early_printk.c
===================================================================
--- linux-stable.orig/arch/um/kernel/early_printk.c
+++ linux-stable/arch/um/kernel/early_printk.c
--- a/arch/um/kernel/early_printk.c
+++ b/arch/um/kernel/early_printk.c
@@ -16,7 +16,7 @@ static void early_console_write(struct c
um_early_printk(s, n);
}
@ -362,11 +342,9 @@ Index: linux-stable/arch/um/kernel/early_printk.c
return 0;
}
Index: linux-stable/arch/unicore32/kernel/early_printk.c
===================================================================
--- linux-stable.orig/arch/unicore32/kernel/early_printk.c
+++ linux-stable/arch/unicore32/kernel/early_printk.c
@@ -33,21 +33,17 @@ static struct console early_ocd_console
--- a/arch/unicore32/kernel/early_printk.c
+++ b/arch/unicore32/kernel/early_printk.c
@@ -33,21 +33,17 @@ static struct console early_ocd_console
.index = -1,
};
@ -392,10 +370,8 @@ Index: linux-stable/arch/unicore32/kernel/early_printk.c
if (keep_early)
early_console->flags &= ~CON_BOOT;
Index: linux-stable/arch/x86/kernel/early_printk.c
===================================================================
--- linux-stable.orig/arch/x86/kernel/early_printk.c
+++ linux-stable/arch/x86/kernel/early_printk.c
--- a/arch/x86/kernel/early_printk.c
+++ b/arch/x86/kernel/early_printk.c
@@ -169,25 +169,9 @@ static struct console early_serial_conso
.index = -1,
};
@ -434,11 +410,9 @@ Index: linux-stable/arch/x86/kernel/early_printk.c
keep = (strstr(buf, "keep") != NULL);
Index: linux-stable/include/linux/console.h
===================================================================
--- linux-stable.orig/include/linux/console.h
+++ linux-stable/include/linux/console.h
@@ -133,6 +133,7 @@ struct console {
--- a/include/linux/console.h
+++ b/include/linux/console.h
@@ -141,6 +141,7 @@ struct console {
for (con = console_drivers; con != NULL; con = con->next)
extern int console_set_on_cmdline;
@ -446,10 +420,8 @@ Index: linux-stable/include/linux/console.h
extern int add_preferred_console(char *name, int idx, char *options);
extern int update_console_cmdline(char *name, int idx, char *name_new, int idx_new, char *options);
Index: linux-stable/include/linux/printk.h
===================================================================
--- linux-stable.orig/include/linux/printk.h
+++ linux-stable/include/linux/printk.h
--- a/include/linux/printk.h
+++ b/include/linux/printk.h
@@ -95,8 +95,14 @@ int no_printk(const char *fmt, ...)
return 0;
}
@ -465,10 +437,8 @@ Index: linux-stable/include/linux/printk.h
extern int printk_needs_cpu(int cpu);
extern void printk_tick(void);
Index: linux-stable/kernel/printk.c
===================================================================
--- linux-stable.orig/kernel/printk.c
+++ linux-stable/kernel/printk.c
--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -48,13 +48,6 @@
#define CREATE_TRACE_POINTS
#include <trace/events/printk.h>
@ -483,9 +453,9 @@ Index: linux-stable/kernel/printk.c
/* printk's without a loglevel use this.. */
#define DEFAULT_MESSAGE_LOGLEVEL CONFIG_DEFAULT_MESSAGE_LOGLEVEL
@@ -1232,6 +1225,29 @@ SYSCALL_DEFINE3(syslog, int, type, char
return do_syslog(type, buf, len, SYSLOG_FROM_CALL);
}
@@ -756,6 +749,29 @@ module_param(ignore_loglevel, bool, S_IR
MODULE_PARM_DESC(ignore_loglevel, "ignore loglevel setting, to"
"print all kernel messages to the console.");
+#ifdef CONFIG_EARLY_PRINTK
+struct console *early_console;
@ -510,6 +480,6 @@ Index: linux-stable/kernel/printk.c
+}
+#endif
+
static bool __read_mostly ignore_loglevel;
#ifdef CONFIG_BOOT_PRINTK_DELAY
static int __init ignore_loglevel_setup(char *str)
static int boot_delay; /* msecs delay after each printk during bootup */

View File

@ -7,11 +7,9 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
fs/eventpoll.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Index: linux-stable/fs/eventpoll.c
===================================================================
--- linux-stable.orig/fs/eventpoll.c
+++ linux-stable/fs/eventpoll.c
@@ -495,12 +495,12 @@ static int ep_poll_wakeup_proc(void *pri
--- a/fs/eventpoll.c
+++ b/fs/eventpoll.c
@@ -497,12 +497,12 @@ static int ep_poll_wakeup_proc(void *pri
*/
static void ep_poll_safewake(wait_queue_head_t *wq)
{

View File

@ -9,10 +9,8 @@ Link: http://lkml.kernel.org/n/tip-m6yuzd6ul717hlnl2gj6p3ou@git.kernel.org
mm/filemap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: linux-stable/mm/filemap.c
===================================================================
--- linux-stable.orig/mm/filemap.c
+++ linux-stable/mm/filemap.c
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -1955,7 +1955,7 @@ size_t iov_iter_copy_from_user_atomic(st
char *kaddr;
size_t copied;

View File

@ -0,0 +1,34 @@
Subject: FIX [1/2] slub: Do not dereference NULL pointer in node_match
From: Christoph Lameter <cl@linux.com>
Date: Wed, 23 Jan 2013 21:45:47 +0000
The variables accessed in slab_alloc are volatile and therefore
the page pointer passed to node_match can be NULL. The processing
of data in slab_alloc is tentative until either the cmpxhchg
succeeds or the __slab_alloc slowpath is invoked. Both are
able to perform the same allocation from the freelist.
Check for the NULL pointer in node_match.
A false positive will lead to a retry of the loop in __slab_alloc.
Signed-off-by: Christoph Lameter <cl@linux.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Pekka Enberg <penberg@kernel.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
mm/slub.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -2041,7 +2041,7 @@ static void flush_all(struct kmem_cache
static inline int node_match(struct page *page, int node)
{
#ifdef CONFIG_NUMA
- if (node != NUMA_NO_NODE && page_to_nid(page) != node)
+ if (!page || (node != NUMA_NO_NODE && page_to_nid(page) != node))
return 0;
#endif
return 1;

View File

@ -0,0 +1,65 @@
Subject: FIX [2/2] slub: Tid must be retrieved from the percpu area of the current processor
From: Christoph Lameter <cl@linux.com>
Date: Wed, 23 Jan 2013 21:45:48 +0000
As Steven Rostedt has pointer out: Rescheduling could occur on a differnet processor
after the determination of the per cpu pointer and before the tid is retrieved.
This could result in allocation from the wrong node in slab_alloc.
The effect is much more severe in slab_free() where we could free to the freelist
of the wrong page.
The window for something like that occurring is pretty small but it is possible.
Signed-off-by: Christoph Lameter <cl@linux.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Pekka Enberg <penberg@kernel.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
mm/slub.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -2331,13 +2331,13 @@ static __always_inline void *slab_alloc_
s = memcg_kmem_get_cache(s, gfpflags);
redo:
-
/*
- * Must read kmem_cache cpu data via this cpu ptr. Preemption is
- * enabled. We may switch back and forth between cpus while
- * reading from one cpu area. That does not matter as long
- * as we end up on the original cpu again when doing the cmpxchg.
+ * Preemption is disabled for the retrieval of the tid because that
+ * must occur from the current processor. We cannot allow rescheduling
+ * on a different processor between the determination of the pointer
+ * and the retrieval of the tid.
*/
+ preempt_disable();
c = __this_cpu_ptr(s->cpu_slab);
/*
@@ -2347,7 +2347,7 @@ redo:
* linked list in between.
*/
tid = c->tid;
- barrier();
+ preempt_enable();
object = c->freelist;
page = c->page;
@@ -2594,10 +2594,11 @@ redo:
* data is retrieved via this pointer. If we are on the same cpu
* during the cmpxchg then the free will succedd.
*/
+ preempt_disable();
c = __this_cpu_ptr(s->cpu_slab);
tid = c->tid;
- barrier();
+ preempt_enable();
if (likely(page == c->page)) {
set_freepointer(s, object, c->freelist);

View File

@ -1,38 +0,0 @@
Subject: crypto: Remove duplicate srcu init
From: Milan Broz <mbroz@redhat.com>
Date: Tue, 30 Oct 2012 16:27:18 +0100
In peterz-srcu-crypto-chain.patch the blocking notifier is changed to
srcu notifier and added initialization to module init fucntion.
Later, in crypto-make-core-static-and-init-scru-early.patch, is that
initialization added also to core_initcall(), but not removed from
Peter's patch. So the initializer is called twice which can wipe out
already registered notifiers. This cause a failure in initialization
of larval algorithms, like e.g. cbc(aes).
Remove the old one.
Signed-off-by: Milan Broz <mbroz@redhat.com>
Cc: Tvrtko Ursulin <tvrtko@ursulin.net>
Cc: dm-crypt@saout.de
Cc: okozina@redhat.com
Cc: u.kleine-koenig@pengutronix.de
Link: http://lkml.kernel.org/r/508FF1D6.3030900@redhat.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
crypto/algapi.c | 1 -
1 file changed, 1 deletion(-)
Index: linux-stable/crypto/algapi.c
===================================================================
--- linux-stable.orig/crypto/algapi.c
+++ linux-stable/crypto/algapi.c
@@ -956,7 +956,6 @@ EXPORT_SYMBOL_GPL(crypto_xor);
static int __init crypto_algapi_init(void)
{
- srcu_init_notifier_head(&crypto_chain);
crypto_init_proc();
return 0;
}

View File

@ -1,27 +0,0 @@
Subject: genirq: Fix 32bit random changes fallout
From: Thomas Gleixner <tglx@linutronix.de>
Date: Wed, 31 Oct 2012 17:06:19 +0100
On 32bit sytems pointers are surprisingly 32bit wide. So gcc complains
correctly about a cast to a different size. Use an cast to unsigned
long instead which handles this correctly for bioth 32 and 64 bit.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: stable-rt@vger.kernel.org
---
kernel/irq/manage.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: linux-stable/kernel/irq/manage.c
===================================================================
--- linux-stable.orig/kernel/irq/manage.c
+++ linux-stable/kernel/irq/manage.c
@@ -855,7 +855,7 @@ static int irq_thread(void *data)
#ifdef CONFIG_PREEMPT_RT_FULL
migrate_disable();
add_interrupt_randomness(action->irq, 0,
- desc->random_ip ^ (u64) action);
+ desc->random_ip ^ (unsigned long) action);
migrate_enable();
#endif
wake_threads_waitq(desc);

View File

@ -0,0 +1,34 @@
Subject: printk: Fix rq->lock vs logbuf_lock unlock lock inversion
From: "Bu, Yitian" <ybu@qti.qualcomm.com>
Date: Mon, 18 Feb 2013 12:53:37 +0000
commit 07354eb1a74d1 ("locking printk: Annotate logbuf_lock as raw")
reintroduced a lock inversion problem which was fixed in commit
0b5e1c5255 ("printk: Release console_sem after logbuf_lock"). This
happened probably when fixing up patch rejects.
Restore the ordering and unlock logbuf_lock before releasing
console_sem.
Signed-off-by: ybu <ybu@qti.qualcomm.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: stable@vger.kernel.org
Link: http://lkml.kernel.org/r/E807E903FE6CBE4D95E420FBFCC273B827413C@nasanexd01h.na.qualcomm.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
kernel/printk.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -1358,9 +1358,9 @@ static int console_trylock_for_printk(un
}
}
logbuf_cpu = UINT_MAX;
+ raw_spin_unlock(&logbuf_lock);
if (wake)
up(&console_sem);
- raw_spin_unlock(&logbuf_lock);
return retval;
}

View File

@ -22,11 +22,9 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
arch/x86/kernel/traps.c | 32 +++++++++++++++++++++++---------
1 file changed, 23 insertions(+), 9 deletions(-)
Index: linux-stable/arch/x86/kernel/traps.c
===================================================================
--- linux-stable.orig/arch/x86/kernel/traps.c
+++ linux-stable/arch/x86/kernel/traps.c
@@ -87,9 +87,21 @@ static inline void conditional_sti(struc
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
@@ -85,9 +85,21 @@ static inline void conditional_sti(struc
local_irq_enable();
}
@ -49,7 +47,7 @@ Index: linux-stable/arch/x86/kernel/traps.c
if (regs->flags & X86_EFLAGS_IF)
local_irq_enable();
}
@@ -100,11 +112,13 @@ static inline void conditional_cli(struc
@@ -98,11 +110,13 @@ static inline void conditional_cli(struc
local_irq_disable();
}
@ -63,20 +61,20 @@ Index: linux-stable/arch/x86/kernel/traps.c
+#endif
}
static void __kprobes
@@ -225,9 +239,9 @@ dotraplinkage void do_stack_segment(stru
static int __kprobes
@@ -229,9 +243,9 @@ dotraplinkage void do_stack_segment(stru
exception_enter(regs);
if (notify_die(DIE_TRAP, "stack segment", regs, error_code,
X86_TRAP_SS, SIGBUS) == NOTIFY_STOP)
return;
- preempt_conditional_sti(regs);
+ conditional_sti_ist(regs);
do_trap(X86_TRAP_SS, SIGBUS, "stack segment", regs, error_code, NULL);
- preempt_conditional_cli(regs);
+ conditional_cli_ist(regs);
X86_TRAP_SS, SIGBUS) != NOTIFY_STOP) {
- preempt_conditional_sti(regs);
+ conditional_sti_ist(regs);
do_trap(X86_TRAP_SS, SIGBUS, "stack segment", regs, error_code, NULL);
- preempt_conditional_cli(regs);
+ conditional_cli_ist(regs);
}
exception_exit(regs);
}
dotraplinkage void do_double_fault(struct pt_regs *regs, long error_code)
@@ -327,9 +341,9 @@ dotraplinkage void __kprobes notrace do_
@@ -331,9 +345,9 @@ dotraplinkage void __kprobes notrace do_
* as we may switch to the interrupt stack.
*/
debug_stack_usage_inc();
@ -86,9 +84,9 @@ Index: linux-stable/arch/x86/kernel/traps.c
- preempt_conditional_cli(regs);
+ conditional_cli_ist(regs);
debug_stack_usage_dec();
}
@@ -430,12 +444,12 @@ dotraplinkage void __kprobes do_debug(st
exit:
exception_exit(regs);
@@ -438,12 +452,12 @@ dotraplinkage void __kprobes do_debug(st
debug_stack_usage_inc();
/* It's safe to allow irq's after DR6 has been saved */
@ -101,9 +99,9 @@ Index: linux-stable/arch/x86/kernel/traps.c
- preempt_conditional_cli(regs);
+ conditional_cli_ist(regs);
debug_stack_usage_dec();
return;
goto exit;
}
@@ -455,7 +469,7 @@ dotraplinkage void __kprobes do_debug(st
@@ -463,7 +477,7 @@ dotraplinkage void __kprobes do_debug(st
si_code = get_si_code(tsk->thread.debugreg6);
if (tsk->thread.debugreg6 & (DR_STEP | DR_TRAP_BITS) || user_icebp)
send_sigtrap(tsk, regs, error_code, si_code);
@ -111,4 +109,4 @@ Index: linux-stable/arch/x86/kernel/traps.c
+ conditional_cli_ist(regs);
debug_stack_usage_dec();
return;
exit:

View File

@ -8,11 +8,9 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
fs/file.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
Index: linux-stable/block/blk-core.c
===================================================================
--- linux-stable.orig/block/blk-core.c
+++ linux-stable/block/blk-core.c
@@ -239,7 +239,7 @@ EXPORT_SYMBOL(blk_delay_queue);
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -241,7 +241,7 @@ EXPORT_SYMBOL(blk_delay_queue);
**/
void blk_start_queue(struct request_queue *q)
{
@ -21,11 +19,9 @@ Index: linux-stable/block/blk-core.c
queue_flag_clear(QUEUE_FLAG_STOPPED, q);
__blk_run_queue(q);
Index: linux-stable/fs/file.c
===================================================================
--- linux-stable.orig/fs/file.c
+++ linux-stable/fs/file.c
@@ -105,14 +105,14 @@ void free_fdtable_rcu(struct rcu_head *r
--- a/fs/file.c
+++ b/fs/file.c
@@ -98,14 +98,14 @@ static void free_fdtable_rcu(struct rcu_
kfree(fdt->open_fds);
kfree(fdt);
} else {

View File

@ -15,10 +15,8 @@ Cc: stable-rt@vger.kernel.org
fs/namespace.c | 3 ++-
4 files changed, 8 insertions(+), 5 deletions(-)
Index: linux-stable/fs/autofs4/autofs_i.h
===================================================================
--- linux-stable.orig/fs/autofs4/autofs_i.h
+++ linux-stable/fs/autofs4/autofs_i.h
--- a/fs/autofs4/autofs_i.h
+++ b/fs/autofs4/autofs_i.h
@@ -34,6 +34,7 @@
#include <linux/sched.h>
#include <linux/mount.h>
@ -27,10 +25,8 @@ Index: linux-stable/fs/autofs4/autofs_i.h
#include <asm/current.h>
#include <asm/uaccess.h>
Index: linux-stable/fs/autofs4/expire.c
===================================================================
--- linux-stable.orig/fs/autofs4/expire.c
+++ linux-stable/fs/autofs4/expire.c
--- a/fs/autofs4/expire.c
+++ b/fs/autofs4/expire.c
@@ -166,7 +166,7 @@ again:
parent = p->d_parent;
if (!spin_trylock(&parent->d_lock)) {
@ -40,10 +36,8 @@ Index: linux-stable/fs/autofs4/expire.c
goto relock;
}
spin_unlock(&p->d_lock);
Index: linux-stable/fs/dcache.c
===================================================================
--- linux-stable.orig/fs/dcache.c
+++ linux-stable/fs/dcache.c
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -37,6 +37,7 @@
#include <linux/rculist_bl.h>
#include <linux/prefetch.h>
@ -52,7 +46,7 @@ Index: linux-stable/fs/dcache.c
#include "internal.h"
#include "mount.h"
@@ -488,7 +489,7 @@ static inline struct dentry *dentry_kill
@@ -470,7 +471,7 @@ static inline struct dentry *dentry_kill
if (inode && !spin_trylock(&inode->i_lock)) {
relock:
spin_unlock(&dentry->d_lock);
@ -61,7 +55,7 @@ Index: linux-stable/fs/dcache.c
return dentry; /* try again with same dentry */
}
if (IS_ROOT(dentry))
@@ -876,7 +877,7 @@ relock:
@@ -852,7 +853,7 @@ relock:
if (!spin_trylock(&dentry->d_lock)) {
spin_unlock(&dcache_lru_lock);
@ -70,30 +64,28 @@ Index: linux-stable/fs/dcache.c
goto relock;
}
@@ -2115,7 +2116,7 @@ again:
@@ -2084,7 +2085,7 @@ again:
if (dentry->d_count == 1) {
if (inode && !spin_trylock(&inode->i_lock)) {
if (!spin_trylock(&inode->i_lock)) {
spin_unlock(&dentry->d_lock);
- cpu_relax();
+ cpu_chill();
goto again;
}
dentry->d_flags &= ~DCACHE_CANT_MOUNT;
Index: linux-stable/fs/namespace.c
===================================================================
--- linux-stable.orig/fs/namespace.c
+++ linux-stable/fs/namespace.c
@@ -20,6 +20,7 @@
#include <linux/fs_struct.h> /* get_fs_root et.al. */
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -22,6 +22,7 @@
#include <linux/fsnotify.h> /* fsnotify_vfsmount_delete */
#include <linux/uaccess.h>
#include <linux/proc_fs.h>
+#include <linux/delay.h>
#include "pnode.h"
#include "internal.h"
@@ -313,7 +314,7 @@ int __mnt_want_write(struct vfsmount *m)
@@ -315,7 +316,7 @@ int __mnt_want_write(struct vfsmount *m)
smp_mb();
while (mnt->mnt.mnt_flags & MNT_WRITE_HOLD) {
while (ACCESS_ONCE(mnt->mnt.mnt_flags) & MNT_WRITE_HOLD) {
preempt_enable();
- cpu_relax();
+ cpu_chill();

View File

@ -16,10 +16,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
fs/jbd/checkpoint.c | 2 ++
1 file changed, 2 insertions(+)
Index: linux-stable/fs/jbd/checkpoint.c
===================================================================
--- linux-stable.orig/fs/jbd/checkpoint.c
+++ linux-stable/fs/jbd/checkpoint.c
--- a/fs/jbd/checkpoint.c
+++ b/fs/jbd/checkpoint.c
@@ -129,6 +129,8 @@ void __log_wait_for_space(journal_t *jou
if (journal->j_flags & JFS_ABORT)
return;

View File

@ -13,10 +13,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
include/linux/jbd_common.h | 24 ++++++++++++++++++++++++
2 files changed, 34 insertions(+)
Index: linux-stable/include/linux/buffer_head.h
===================================================================
--- linux-stable.orig/include/linux/buffer_head.h
+++ linux-stable/include/linux/buffer_head.h
--- a/include/linux/buffer_head.h
+++ b/include/linux/buffer_head.h
@@ -74,6 +74,11 @@ struct buffer_head {
atomic_t b_count; /* users using this buffer_head */
#ifdef CONFIG_PREEMPT_RT_BASE
@ -41,10 +39,8 @@ Index: linux-stable/include/linux/buffer_head.h
#endif
}
Index: linux-stable/include/linux/jbd_common.h
===================================================================
--- linux-stable.orig/include/linux/jbd_common.h
+++ linux-stable/include/linux/jbd_common.h
--- a/include/linux/jbd_common.h
+++ b/include/linux/jbd_common.h
@@ -39,32 +39,56 @@ static inline struct journal_head *bh2jh
static inline void jbd_lock_bh_state(struct buffer_head *bh)

View File

@ -13,16 +13,14 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
fs/namespace.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
Index: linux-stable/fs/namespace.c
===================================================================
--- linux-stable.orig/fs/namespace.c
+++ linux-stable/fs/namespace.c
@@ -311,8 +311,11 @@ int __mnt_want_write(struct vfsmount *m)
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -313,8 +313,11 @@ int __mnt_want_write(struct vfsmount *m)
* incremented count after it has set MNT_WRITE_HOLD.
*/
smp_mb();
- while (mnt->mnt.mnt_flags & MNT_WRITE_HOLD)
+ while (mnt->mnt.mnt_flags & MNT_WRITE_HOLD) {
- while (ACCESS_ONCE(mnt->mnt.mnt_flags) & MNT_WRITE_HOLD)
+ while (ACCESS_ONCE(mnt->mnt.mnt_flags) & MNT_WRITE_HOLD) {
+ preempt_enable();
cpu_relax();
+ preempt_disable();

View File

@ -39,10 +39,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
fs/ntfs/aops.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Index: linux-stable/fs/ntfs/aops.c
===================================================================
--- linux-stable.orig/fs/ntfs/aops.c
+++ linux-stable/fs/ntfs/aops.c
--- a/fs/ntfs/aops.c
+++ b/fs/ntfs/aops.c
@@ -144,13 +144,13 @@ static void ntfs_end_buffer_async_read(s
recs = PAGE_CACHE_SIZE / rec_size;
/* Should have been verified before we got here... */

View File

@ -12,11 +12,9 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
include/linux/buffer_head.h | 34 ++++++++++++++++++++++++++++++++++
3 files changed, 44 insertions(+), 21 deletions(-)
Index: linux-stable/fs/buffer.c
===================================================================
--- linux-stable.orig/fs/buffer.c
+++ linux-stable/fs/buffer.c
@@ -281,8 +281,7 @@ static void end_buffer_async_read(struct
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -280,8 +280,7 @@ static void end_buffer_async_read(struct
* decide that the page is now completely done.
*/
first = page_buffers(page);
@ -26,7 +24,7 @@ Index: linux-stable/fs/buffer.c
clear_buffer_async_read(bh);
unlock_buffer(bh);
tmp = bh;
@@ -295,8 +294,7 @@ static void end_buffer_async_read(struct
@@ -294,8 +293,7 @@ static void end_buffer_async_read(struct
}
tmp = tmp->b_this_page;
} while (tmp != bh);
@ -36,7 +34,7 @@ Index: linux-stable/fs/buffer.c
/*
* If none of the buffers had errors and they are all
@@ -308,9 +306,7 @@ static void end_buffer_async_read(struct
@@ -307,9 +305,7 @@ static void end_buffer_async_read(struct
return;
still_busy:
@ -47,7 +45,7 @@ Index: linux-stable/fs/buffer.c
}
/*
@@ -344,8 +340,7 @@ void end_buffer_async_write(struct buffe
@@ -343,8 +339,7 @@ void end_buffer_async_write(struct buffe
}
first = page_buffers(page);
@ -57,7 +55,7 @@ Index: linux-stable/fs/buffer.c
clear_buffer_async_write(bh);
unlock_buffer(bh);
@@ -357,15 +352,12 @@ void end_buffer_async_write(struct buffe
@@ -356,15 +351,12 @@ void end_buffer_async_write(struct buffe
}
tmp = tmp->b_this_page;
}
@ -75,7 +73,7 @@ Index: linux-stable/fs/buffer.c
}
EXPORT_SYMBOL(end_buffer_async_write);
@@ -3178,6 +3170,7 @@ struct buffer_head *alloc_buffer_head(gf
@@ -3256,6 +3248,7 @@ struct buffer_head *alloc_buffer_head(gf
struct buffer_head *ret = kmem_cache_zalloc(bh_cachep, gfp_flags);
if (ret) {
INIT_LIST_HEAD(&ret->b_assoc_buffers);
@ -83,10 +81,8 @@ Index: linux-stable/fs/buffer.c
preempt_disable();
__this_cpu_inc(bh_accounting.nr);
recalc_bh_state();
Index: linux-stable/fs/ntfs/aops.c
===================================================================
--- linux-stable.orig/fs/ntfs/aops.c
+++ linux-stable/fs/ntfs/aops.c
--- a/fs/ntfs/aops.c
+++ b/fs/ntfs/aops.c
@@ -108,8 +108,7 @@ static void ntfs_end_buffer_async_read(s
"0x%llx.", (unsigned long long)bh->b_blocknr);
}
@ -118,10 +114,8 @@ Index: linux-stable/fs/ntfs/aops.c
}
/**
Index: linux-stable/include/linux/buffer_head.h
===================================================================
--- linux-stable.orig/include/linux/buffer_head.h
+++ linux-stable/include/linux/buffer_head.h
--- a/include/linux/buffer_head.h
+++ b/include/linux/buffer_head.h
@@ -72,8 +72,42 @@ struct buffer_head {
struct address_space *b_assoc_map; /* mapping this buffer is
associated with */

View File

@ -0,0 +1,34 @@
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Subject: fs/fscache: done merge spin_lock() in while()
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
--- a/fs/fscache/page.c
+++ b/fs/fscache/page.c
@@ -796,11 +796,13 @@ void fscache_invalidate_writes(struct fs
_enter("");
- while (spin_lock(&cookie->stores_lock),
- n = radix_tree_gang_lookup_tag(&cookie->stores, results, 0,
- ARRAY_SIZE(results),
- FSCACHE_COOKIE_PENDING_TAG),
- n > 0) {
+ do {
+ spin_lock(&cookie->stores_lock);
+ n = radix_tree_gang_lookup_tag(&cookie->stores, results, 0,
+ ARRAY_SIZE(results),
+ FSCACHE_COOKIE_PENDING_TAG);
+ if (n == 0)
+ break;
for (i = n - 1; i >= 0; i--) {
page = results[i];
radix_tree_delete(&cookie->stores, page->index);
@@ -810,7 +812,7 @@ void fscache_invalidate_writes(struct fs
for (i = n - 1; i >= 0; i--)
page_cache_release(results[i]);
- }
+ } while (1);
spin_unlock(&cookie->stores_lock);
_leave("");

View File

@ -1,92 +0,0 @@
Subject: ftrace-crap.patch
From: Thomas Gleixner <tglx@linutronix.de>
Date: Fri, 09 Sep 2011 16:55:53 +0200
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
kernel/trace/trace.c | 26 ++++++++++++++++++++++++--
kernel/trace/trace.h | 1 -
2 files changed, 24 insertions(+), 3 deletions(-)
Index: linux-stable/kernel/trace/trace.c
===================================================================
--- linux-stable.orig/kernel/trace/trace.c
+++ linux-stable/kernel/trace/trace.c
@@ -402,11 +402,13 @@ EXPORT_SYMBOL_GPL(tracing_is_on);
*/
void trace_wake_up(void)
{
+#ifndef CONFIG_PREEMPT_RT_FULL
const unsigned long delay = msecs_to_jiffies(2);
if (trace_flags & TRACE_ITER_BLOCK)
return;
schedule_delayed_work(&wakeup_work, delay);
+#endif
}
static int __init set_buf_size(char *str)
@@ -756,6 +758,12 @@ update_max_tr_single(struct trace_array
}
#endif /* CONFIG_TRACER_MAX_TRACE */
+#ifndef CONFIG_PREEMPT_RT_FULL
+static void default_wait_pipe(struct trace_iterator *iter);
+#else
+#define default_wait_pipe poll_wait_pipe
+#endif
+
/**
* register_tracer - register a tracer with the ftrace system.
* @type - the plugin for the tracer
@@ -3365,6 +3373,7 @@ static int tracing_release_pipe(struct i
return 0;
}
+#ifndef CONFIG_PREEMPT_RT_FULL
static unsigned int
tracing_poll_pipe(struct file *filp, poll_table *poll_table)
{
@@ -3386,8 +3395,7 @@ tracing_poll_pipe(struct file *filp, pol
}
}
-
-void default_wait_pipe(struct trace_iterator *iter)
+static void default_wait_pipe(struct trace_iterator *iter)
{
DEFINE_WAIT(wait);
@@ -3398,6 +3406,20 @@ void default_wait_pipe(struct trace_iter
finish_wait(&trace_wait, &wait);
}
+#else
+static unsigned int
+tracing_poll_pipe(struct file *filp, poll_table *poll_table)
+{
+ struct trace_iterator *iter = filp->private_data;
+
+ if ((trace_flags & TRACE_ITER_BLOCK) || !trace_empty(iter))
+ return POLLIN | POLLRDNORM;
+ poll_wait_pipe(iter);
+ if (!trace_empty(iter))
+ return POLLIN | POLLRDNORM;
+ return 0;
+}
+#endif
/*
* This is a make-shift waitqueue.
Index: linux-stable/kernel/trace/trace.h
===================================================================
--- linux-stable.orig/kernel/trace/trace.h
+++ linux-stable/kernel/trace/trace.h
@@ -367,7 +367,6 @@ void trace_init_global_iter(struct trace
void tracing_iter_reset(struct trace_iterator *iter, int cpu);
-void default_wait_pipe(struct trace_iterator *iter);
void poll_wait_pipe(struct trace_iterator *iter);
void ftrace(struct trace_array *tr,

View File

@ -10,10 +10,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
kernel/trace/trace_output.c | 5 +++++
4 files changed, 14 insertions(+), 4 deletions(-)
Index: linux-stable/include/linux/ftrace_event.h
===================================================================
--- linux-stable.orig/include/linux/ftrace_event.h
+++ linux-stable/include/linux/ftrace_event.h
--- a/include/linux/ftrace_event.h
+++ b/include/linux/ftrace_event.h
@@ -49,7 +49,8 @@ struct trace_entry {
unsigned char flags;
unsigned char preempt_count;
@ -24,11 +22,9 @@ Index: linux-stable/include/linux/ftrace_event.h
};
#define FTRACE_MAX_EVENT \
Index: linux-stable/kernel/trace/trace.c
===================================================================
--- linux-stable.orig/kernel/trace/trace.c
+++ linux-stable/kernel/trace/trace.c
@@ -1155,6 +1155,8 @@ tracing_generic_entry_update(struct trac
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -1177,6 +1177,8 @@ tracing_generic_entry_update(struct trac
((pc & HARDIRQ_MASK) ? TRACE_FLAG_HARDIRQ : 0) |
((pc & SOFTIRQ_MASK) ? TRACE_FLAG_SOFTIRQ : 0) |
(need_resched() ? TRACE_FLAG_NEED_RESCHED : 0);
@ -37,7 +33,7 @@ Index: linux-stable/kernel/trace/trace.c
}
EXPORT_SYMBOL_GPL(tracing_generic_entry_update);
@@ -1980,9 +1982,10 @@ static void print_lat_help_header(struct
@@ -2034,9 +2036,10 @@ static void print_lat_help_header(struct
seq_puts(m, "# | / _----=> need-resched \n");
seq_puts(m, "# || / _---=> hardirq/softirq \n");
seq_puts(m, "# ||| / _--=> preempt-depth \n");
@ -51,10 +47,8 @@ Index: linux-stable/kernel/trace/trace.c
}
static void print_event_info(struct trace_array *tr, struct seq_file *m)
Index: linux-stable/kernel/trace/trace_events.c
===================================================================
--- linux-stable.orig/kernel/trace/trace_events.c
+++ linux-stable/kernel/trace/trace_events.c
--- a/kernel/trace/trace_events.c
+++ b/kernel/trace/trace_events.c
@@ -116,6 +116,7 @@ static int trace_define_common_fields(vo
__common_field(unsigned char, flags);
__common_field(unsigned char, preempt_count);
@ -63,10 +57,8 @@ Index: linux-stable/kernel/trace/trace_events.c
__common_field(int, padding);
return ret;
Index: linux-stable/kernel/trace/trace_output.c
===================================================================
--- linux-stable.orig/kernel/trace/trace_output.c
+++ linux-stable/kernel/trace/trace_output.c
--- a/kernel/trace/trace_output.c
+++ b/kernel/trace/trace_output.c
@@ -593,6 +593,11 @@ int trace_print_lat_fmt(struct trace_seq
else
ret = trace_seq_putc(s, '.');

View File

@ -54,10 +54,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
kernel/rtmutex_common.h | 1 +
2 files changed, 32 insertions(+), 1 deletion(-)
Index: linux-stable/kernel/rtmutex.c
===================================================================
--- linux-stable.orig/kernel/rtmutex.c
+++ linux-stable/kernel/rtmutex.c
--- a/kernel/rtmutex.c
+++ b/kernel/rtmutex.c
@@ -69,7 +69,8 @@ static void fixup_rt_mutex_waiters(struc
static int rt_mutex_real_waiter(struct rt_mutex_waiter *waiter)
@ -68,7 +66,7 @@ Index: linux-stable/kernel/rtmutex.c
}
/*
@@ -1002,6 +1003,35 @@ int rt_mutex_start_proxy_lock(struct rt_
@@ -981,6 +982,35 @@ int rt_mutex_start_proxy_lock(struct rt_
return 1;
}
@ -104,10 +102,8 @@ Index: linux-stable/kernel/rtmutex.c
ret = task_blocks_on_rt_mutex(lock, waiter, task, detect_deadlock);
if (ret && !rt_mutex_owner(lock)) {
Index: linux-stable/kernel/rtmutex_common.h
===================================================================
--- linux-stable.orig/kernel/rtmutex_common.h
+++ linux-stable/kernel/rtmutex_common.h
--- a/kernel/rtmutex_common.h
+++ b/kernel/rtmutex_common.h
@@ -104,6 +104,7 @@ static inline struct task_struct *rt_mut
* PI-futex support (proxy locking functions, etc.):
*/

View File

@ -11,10 +11,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
include/asm-generic/cmpxchg-local.h | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
Index: linux-stable/include/asm-generic/cmpxchg-local.h
===================================================================
--- linux-stable.orig/include/asm-generic/cmpxchg-local.h
+++ linux-stable/include/asm-generic/cmpxchg-local.h
--- a/include/asm-generic/cmpxchg-local.h
+++ b/include/asm-generic/cmpxchg-local.h
@@ -21,7 +21,7 @@ static inline unsigned long __cmpxchg_lo
if (size == 8 && sizeof(unsigned long) != 8)
wrong_size_cmpxchg(ptr);

View File

@ -14,11 +14,9 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
kernel/irq/irqdesc.c | 21 +++++++++++++++++++--
2 files changed, 28 insertions(+), 2 deletions(-)
Index: linux-stable/Documentation/kernel-parameters.txt
===================================================================
--- linux-stable.orig/Documentation/kernel-parameters.txt
+++ linux-stable/Documentation/kernel-parameters.txt
@@ -1157,6 +1157,15 @@ bytes respectively. Such letter suffixes
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -1182,6 +1182,15 @@ bytes respectively. Such letter suffixes
See comment before ip2_setup() in
drivers/char/ip2/ip2base.c.
@ -34,10 +32,8 @@ Index: linux-stable/Documentation/kernel-parameters.txt
irqfixup [HW]
When an interrupt is not handled search all handlers
for it. Intended to get systems with badly broken
Index: linux-stable/kernel/irq/irqdesc.c
===================================================================
--- linux-stable.orig/kernel/irq/irqdesc.c
+++ linux-stable/kernel/irq/irqdesc.c
--- a/kernel/irq/irqdesc.c
+++ b/kernel/irq/irqdesc.c
@@ -23,10 +23,27 @@
static struct lock_class_key irq_desc_lock_class;

View File

@ -11,29 +11,27 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
kernel/irq/spurious.c | 10 ++++++++++
1 file changed, 10 insertions(+)
Index: linux-stable/kernel/irq/spurious.c
===================================================================
--- linux-stable.orig/kernel/irq/spurious.c
+++ linux-stable/kernel/irq/spurious.c
@@ -341,6 +341,11 @@ MODULE_PARM_DESC(noirqdebug, "Disable ir
--- a/kernel/irq/spurious.c
+++ b/kernel/irq/spurious.c
@@ -340,6 +340,11 @@ MODULE_PARM_DESC(noirqdebug, "Disable ir
static int __init irqfixup_setup(char *str)
{
+#ifdef CONFIG_PREEMPT_RT_BASE
+ printk(KERN_WARNING "irqfixup boot option not supported "
+ "w/ CONFIG_PREEMPT_RT\n");
+ "w/ CONFIG_PREEMPT_RT_BASE\n");
+ return 1;
+#endif
irqfixup = 1;
printk(KERN_WARNING "Misrouted IRQ fixup support enabled.\n");
printk(KERN_WARNING "This may impact system performance.\n");
@@ -353,6 +358,11 @@ module_param(irqfixup, int, 0644);
@@ -352,6 +357,11 @@ module_param(irqfixup, int, 0644);
static int __init irqpoll_setup(char *str)
{
+#ifdef CONFIG_PREEMPT_RT_BASE
+ printk(KERN_WARNING "irqpoll boot option not supported "
+ "w/ CONFIG_PREEMPT_RT\n");
+ "w/ CONFIG_PREEMPT_RT_BASE\n");
+ return 1;
+#endif
irqfixup = 2;

View File

@ -8,11 +8,9 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
kernel/irq/manage.c | 2 ++
2 files changed, 8 insertions(+), 2 deletions(-)
Index: linux-stable/include/linux/interrupt.h
===================================================================
--- linux-stable.orig/include/linux/interrupt.h
+++ linux-stable/include/linux/interrupt.h
@@ -388,9 +388,13 @@ static inline int disable_irq_wake(unsig
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -383,9 +383,13 @@ static inline int disable_irq_wake(unsig
#ifdef CONFIG_IRQ_FORCED_THREADING
@ -28,10 +26,8 @@ Index: linux-stable/include/linux/interrupt.h
#endif
#ifndef __ARCH_SET_SOFTIRQ_PENDING
Index: linux-stable/kernel/irq/manage.c
===================================================================
--- linux-stable.orig/kernel/irq/manage.c
+++ linux-stable/kernel/irq/manage.c
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -21,6 +21,7 @@
#include "internals.h"

View File

@ -7,10 +7,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
lib/Kconfig.debug | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: linux-stable/lib/Kconfig.debug
===================================================================
--- linux-stable.orig/lib/Kconfig.debug
+++ linux-stable/lib/Kconfig.debug
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -164,7 +164,7 @@ config DEBUG_KERNEL
config DEBUG_SHIRQ

View File

@ -22,11 +22,9 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
include/linux/hardirq.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: linux-stable/include/linux/hardirq.h
===================================================================
--- linux-stable.orig/include/linux/hardirq.h
+++ linux-stable/include/linux/hardirq.h
@@ -84,7 +84,7 @@
--- a/include/linux/hardirq.h
+++ b/include/linux/hardirq.h
@@ -85,7 +85,7 @@
# define softirq_count() (preempt_count() & SOFTIRQ_MASK)
# define in_serving_softirq() (softirq_count() & SOFTIRQ_OFFSET)
#else

View File

@ -25,11 +25,9 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
kernel/cpu.c | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
Index: linux-stable/kernel/cpu.c
===================================================================
--- linux-stable.orig/kernel/cpu.c
+++ linux-stable/kernel/cpu.c
@@ -383,22 +383,20 @@ static int __ref _cpu_down(unsigned int
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -387,22 +387,20 @@ static int __ref _cpu_down(unsigned int
return -EBUSY;
}
@ -57,5 +55,5 @@ Index: linux-stable/kernel/cpu.c
+ __func__, cpu);
+ goto out_release;
}
smpboot_park_threads(cpu);
err = __stop_machine(take_cpu_down, &tcd_param, cpumask_of(cpu));

View File

@ -16,10 +16,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
kernel/cpu.c | 127 ++++++++++++++++++++++++++++++++++++++++++++++++++--
2 files changed, 128 insertions(+), 3 deletions(-)
Index: linux-stable/include/linux/cpu.h
===================================================================
--- linux-stable.orig/include/linux/cpu.h
+++ linux-stable/include/linux/cpu.h
--- a/include/linux/cpu.h
+++ b/include/linux/cpu.h
@@ -175,6 +175,8 @@ extern struct bus_type cpu_subsys;
extern void get_online_cpus(void);
@ -38,10 +36,8 @@ Index: linux-stable/include/linux/cpu.h
#define hotcpu_notifier(fn, pri) do { (void)(fn); } while (0)
/* These aren't inline functions due to a GCC bug. */
#define register_hotcpu_notifier(nb) ({ (void)(nb); 0; })
Index: linux-stable/kernel/cpu.c
===================================================================
--- linux-stable.orig/kernel/cpu.c
+++ linux-stable/kernel/cpu.c
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -63,6 +63,102 @@ static struct {
.refcount = 0,
};
@ -145,7 +141,7 @@ Index: linux-stable/kernel/cpu.c
void get_online_cpus(void)
{
might_sleep();
@@ -256,13 +352,14 @@ static int __ref take_cpu_down(void *_pa
@@ -260,13 +356,14 @@ static int __ref take_cpu_down(void *_pa
/* Requires cpu_add_remove_lock to be held */
static int __ref _cpu_down(unsigned int cpu, int tasks_frozen)
{
@ -161,7 +157,7 @@ Index: linux-stable/kernel/cpu.c
if (num_online_cpus() == 1)
return -EBUSY;
@@ -270,7 +367,20 @@ static int __ref _cpu_down(unsigned int
@@ -274,7 +371,20 @@ static int __ref _cpu_down(unsigned int
if (!cpu_online(cpu))
return -EINVAL;
@ -183,7 +179,7 @@ Index: linux-stable/kernel/cpu.c
err = __cpu_notify(CPU_DOWN_PREPARE | mod, hcpu, -1, &nr_calls);
if (err) {
@@ -278,7 +388,16 @@ static int __ref _cpu_down(unsigned int
@@ -282,7 +392,16 @@ static int __ref _cpu_down(unsigned int
__cpu_notify(CPU_DOWN_FAILED | mod, hcpu, nr_calls, NULL);
printk("%s: attempt to take down CPU %u failed\n",
__func__, cpu);
@ -199,9 +195,9 @@ Index: linux-stable/kernel/cpu.c
+ printk("cpu_unplug_begin(%d) failed\n", cpu);
+ goto out_cancel;
}
smpboot_park_threads(cpu);
err = __stop_machine(take_cpu_down, &tcd_param, cpumask_of(cpu));
@@ -309,6 +428,8 @@ static int __ref _cpu_down(unsigned int
@@ -314,6 +433,8 @@ static int __ref _cpu_down(unsigned int
check_for_tasks(cpu);
out_release:

View File

@ -11,10 +11,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
kernel/cpu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: linux-stable/kernel/cpu.c
===================================================================
--- linux-stable.orig/kernel/cpu.c
+++ linux-stable/kernel/cpu.c
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -143,7 +143,7 @@ static int cpu_unplug_begin(unsigned int
struct task_struct *tsk;

View File

@ -7,11 +7,9 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
kernel/cpu.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
Index: linux-stable/kernel/cpu.c
===================================================================
--- linux-stable.orig/kernel/cpu.c
+++ linux-stable/kernel/cpu.c
@@ -375,14 +375,13 @@ static int __ref _cpu_down(unsigned int
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -379,14 +379,13 @@ static int __ref _cpu_down(unsigned int
cpumask_andnot(cpumask, cpu_online_mask, cpumask_of(cpu));
set_cpus_allowed_ptr(current, cpumask);
free_cpumask_var(cpumask);
@ -28,7 +26,7 @@ Index: linux-stable/kernel/cpu.c
err = __cpu_notify(CPU_DOWN_PREPARE | mod, hcpu, -1, &nr_calls);
if (err) {
@@ -432,6 +431,7 @@ static int __ref _cpu_down(unsigned int
@@ -437,6 +436,7 @@ static int __ref _cpu_down(unsigned int
out_release:
cpu_unplug_done(cpu);
out_cancel:

View File

@ -1,49 +0,0 @@
From: Yong Zhang <yong.zhang0@gmail.com>
Subject: hrtimer: Add missing debug_activate() aid
Date: Thu, 13 Oct 2011 15:52:30 +0800
It will fix below warning, which is also reported by Fernando:
[ 7.616090] ------------[ cut here ]------------
[ 7.616093] WARNING: at kernel/hrtimer.c:391 hrtimer_fixup_activate+0x27/0x50()
[ 7.616094] Hardware name: OptiPlex 755
[ 7.616096] Modules linked in:
[ 7.616099] Pid: 0, comm: kworker/0:0 Tainted: G W 3.0.6-rt17-00284-g9d73a61 #15
[ 7.616100] Call Trace:
[ 7.616103] [<c014d9a2>] warn_slowpath_common+0x72/0xa0
[ 7.616106] [<c0175417>] ? hrtimer_fixup_activate+0x27/0x50
[ 7.616109] [<c0175417>] ? hrtimer_fixup_activate+0x27/0x50
[ 7.616112] [<c014d9f2>] warn_slowpath_null+0x22/0x30
[ 7.616115] [<c0175417>] hrtimer_fixup_activate+0x27/0x50
[ 7.616118] [<c03b3ab0>] debug_object_activate+0x100/0x130
[ 7.616121] [<c0176b96>] ? hrtimer_start_range_ns+0x26/0x30
[ 7.616123] [<c0175a59>] enqueue_hrtimer+0x19/0x100
[ 7.616126] [<c0176b96>] ? hrtimer_start_range_ns+0x26/0x30
[ 7.616129] [<c0176744>] __hrtimer_start_range_ns+0x144/0x540
[ 7.616132] [<c072705a>] ? _raw_spin_unlock_irqrestore+0x3a/0x80
[ 7.616136] [<c0176b96>] hrtimer_start_range_ns+0x26/0x30
[ 7.616139] [<c01852b5>] tick_nohz_restart_sched_tick+0x185/0x1b0
[ 7.616142] [<c0101878>] cpu_idle+0x98/0xc0
[ 7.616146] [<c071fcd8>] start_secondary+0x1d3/0x1da
[ 7.616148] ---[ end trace 0000000000000003 ]---
Reported-by: Fernando Lopez-Lezcano <nando@ccrma.stanford.edu>
Signed-off-by: Yong Zhang <yong.zhang0@gmail.com>
Link: http://lkml.kernel.org/r/20111013075230.GA2740@zhy
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
kernel/hrtimer.c | 1 +
1 file changed, 1 insertion(+)
Index: linux-stable/kernel/hrtimer.c
===================================================================
--- linux-stable.orig/kernel/hrtimer.c
+++ linux-stable/kernel/hrtimer.c
@@ -1063,6 +1063,7 @@ int __hrtimer_start_range_ns(struct hrti
* remove it again and report a failure. This avoids
* stale base->first entries.
*/
+ debug_deactivate(timer);
__remove_hrtimer(timer, new_base,
timer->state & HRTIMER_STATE_CALLBACK, 0);
}

View File

@ -1,42 +0,0 @@
Subject: hrtimer-fix-reprogram-madness.patch
From: Thomas Gleixner <tglx@linutronix.de>
Date: Wed, 14 Sep 2011 14:48:43 +0200
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
kernel/hrtimer.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
Index: linux-stable/kernel/hrtimer.c
===================================================================
--- linux-stable.orig/kernel/hrtimer.c
+++ linux-stable/kernel/hrtimer.c
@@ -1338,7 +1338,11 @@ static void hrtimer_rt_reprogram(int res
if (!enqueue_hrtimer(timer, base))
return;
- if (hrtimer_reprogram(timer, base))
+#ifndef CONFIG_HIGH_RES_TIMERS
+ }
+#else
+ if (base->cpu_base->hres_active &&
+ hrtimer_reprogram(timer, base))
goto requeue;
} else if (hrtimer_active(timer)) {
@@ -1347,6 +1351,7 @@ static void hrtimer_rt_reprogram(int res
* the event device.
*/
if (&timer->node == base->active.next &&
+ base->cpu_base->hres_active &&
hrtimer_reprogram(timer, base))
goto requeue;
}
@@ -1359,6 +1364,7 @@ requeue:
*/
__remove_hrtimer(timer, base, timer->state, 0);
list_add_tail(&timer->cb_entry, &base->expired);
+#endif
}
/*

View File

@ -13,17 +13,15 @@ Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
include/linux/hrtimer.h | 3
kernel/hrtimer.c | 196 ++++++++++++++++++++++++++++++++++++++++++-----
kernel/hrtimer.c | 220 ++++++++++++++++++++++++++++++++++++++++-------
kernel/sched/core.c | 1
kernel/sched/rt.c | 1
kernel/time/tick-sched.c | 1
kernel/watchdog.c | 1
6 files changed, 183 insertions(+), 20 deletions(-)
6 files changed, 198 insertions(+), 29 deletions(-)
Index: linux-stable/include/linux/hrtimer.h
===================================================================
--- linux-stable.orig/include/linux/hrtimer.h
+++ linux-stable/include/linux/hrtimer.h
--- a/include/linux/hrtimer.h
+++ b/include/linux/hrtimer.h
@@ -111,6 +111,8 @@ struct hrtimer {
enum hrtimer_restart (*function)(struct hrtimer *);
struct hrtimer_clock_base *base;
@ -41,10 +39,8 @@ Index: linux-stable/include/linux/hrtimer.h
ktime_t resolution;
ktime_t (*get_time)(void);
ktime_t softirq_time;
Index: linux-stable/kernel/hrtimer.c
===================================================================
--- linux-stable.orig/kernel/hrtimer.c
+++ linux-stable/kernel/hrtimer.c
--- a/kernel/hrtimer.c
+++ b/kernel/hrtimer.c
@@ -589,8 +589,7 @@ static int hrtimer_reprogram(struct hrti
* When the callback is running, we do not reprogram the clock event
* device. The timer callback is either running on a different CPU or
@ -65,37 +61,36 @@ Index: linux-stable/kernel/hrtimer.c
/*
* Initialize the high resolution related parts of cpu_base
*/
@@ -644,7 +646,29 @@ static inline int hrtimer_enqueue_reprog
struct hrtimer_clock_base *base,
int wakeup)
@@ -641,9 +643,18 @@ static inline void hrtimer_init_hres(str
* and expiry check is done in the hrtimer_interrupt or in the softirq.
*/
static inline int hrtimer_enqueue_reprogram(struct hrtimer *timer,
- struct hrtimer_clock_base *base)
+ struct hrtimer_clock_base *base,
+ int wakeup)
{
- return base->cpu_base->hres_active && hrtimer_reprogram(timer, base);
+ if (!(base->cpu_base->hres_active && hrtimer_reprogram(timer, base)))
+ return 0;
+ if (!wakeup)
+ return -ETIME;
+#ifdef CONFIG_PREEMPT_RT_BASE
+again:
if (base->cpu_base->hres_active && hrtimer_reprogram(timer, base)) {
+ /*
+ * Move softirq based timers away from the rbtree in
+ * case it expired already. Otherwise we would have a
+ * stale base->first entry until the softirq runs.
+ */
+ if (!hrtimer_rt_defer(timer)) {
+ ktime_t now = ktime_get();
+
+ __run_hrtimer(timer, &now);
+ /*
+ * __run_hrtimer might have requeued timer and
+ * it could be base->first again.
+ */
+ if (&timer->node == base->active.next)
+ goto again;
+ return 1;
+ }
+#else
+ if (base->cpu_base->hres_active && hrtimer_reprogram(timer, base)) {
+ if (!hrtimer_rt_defer(timer))
+ return -ETIME;
+#endif
if (wakeup) {
raw_spin_unlock(&base->cpu_base->lock);
raise_softirq_irqoff(HRTIMER_SOFTIRQ);
@@ -743,6 +767,11 @@ static inline int hrtimer_enqueue_reprog
+ return 1;
}
static inline ktime_t hrtimer_update_base(struct hrtimer_cpu_base *base)
@@ -724,12 +735,18 @@ static inline int hrtimer_switch_to_hres
static inline void
hrtimer_force_reprogram(struct hrtimer_cpu_base *base, int skip_equal) { }
static inline int hrtimer_enqueue_reprogram(struct hrtimer *timer,
- struct hrtimer_clock_base *base)
+ struct hrtimer_clock_base *base,
+ int wakeup)
{
return 0;
}
static inline void hrtimer_init_hres(struct hrtimer_cpu_base *base) { }
static inline void retrigger_next_event(void *arg) { }
@ -107,7 +102,7 @@ Index: linux-stable/kernel/hrtimer.c
#endif /* CONFIG_HIGH_RES_TIMERS */
@@ -874,9 +903,9 @@ void hrtimer_wait_for_timer(const struct
@@ -861,9 +878,9 @@ void hrtimer_wait_for_timer(const struct
{
struct hrtimer_clock_base *base = timer->base;
@ -119,7 +114,7 @@ Index: linux-stable/kernel/hrtimer.c
}
#else
@@ -926,6 +955,11 @@ static void __remove_hrtimer(struct hrti
@@ -913,6 +930,11 @@ static void __remove_hrtimer(struct hrti
if (!(timer->state & HRTIMER_STATE_ENQUEUED))
goto out;
@ -131,7 +126,41 @@ Index: linux-stable/kernel/hrtimer.c
next_timer = timerqueue_getnext(&base->active);
timerqueue_del(&base->active, &timer->node);
if (&timer->node == next_timer) {
@@ -1199,6 +1233,7 @@ static void __hrtimer_init(struct hrtime
@@ -1020,9 +1042,19 @@ int __hrtimer_start_range_ns(struct hrti
*
* XXX send_remote_softirq() ?
*/
- if (leftmost && new_base->cpu_base == &__get_cpu_var(hrtimer_bases)
- && hrtimer_enqueue_reprogram(timer, new_base)) {
- if (wakeup) {
+ if (leftmost && new_base->cpu_base == &__get_cpu_var(hrtimer_bases)) {
+ ret = hrtimer_enqueue_reprogram(timer, new_base, wakeup);
+ if (ret < 0) {
+ /*
+ * In case we failed to reprogram the timer (mostly
+ * because out current timer is already elapsed),
+ * remove it again and report a failure. This avoids
+ * stale base->first entries.
+ */
+ debug_deactivate(timer);
+ __remove_hrtimer(timer, new_base,
+ timer->state & HRTIMER_STATE_CALLBACK, 0);
+ } else if (ret > 0) {
/*
* We need to drop cpu_base->lock to avoid a
* lock ordering issue vs. rq->lock.
@@ -1030,9 +1062,7 @@ int __hrtimer_start_range_ns(struct hrti
raw_spin_unlock(&new_base->cpu_base->lock);
raise_softirq_irqoff(HRTIMER_SOFTIRQ);
local_irq_restore(flags);
- return ret;
- } else {
- __raise_softirq_irqoff(HRTIMER_SOFTIRQ);
+ return 0;
}
}
@@ -1199,6 +1229,7 @@ static void __hrtimer_init(struct hrtime
base = hrtimer_clockid_to_base(clock_id);
timer->base = &cpu_base->clock_base[base];
@ -139,7 +168,7 @@ Index: linux-stable/kernel/hrtimer.c
timerqueue_init(&timer->node);
#ifdef CONFIG_TIMER_STATS
@@ -1282,10 +1317,118 @@ static void __run_hrtimer(struct hrtimer
@@ -1282,10 +1313,128 @@ static void __run_hrtimer(struct hrtimer
timer->state &= ~HRTIMER_STATE_CALLBACK;
}
@ -167,7 +196,11 @@ Index: linux-stable/kernel/hrtimer.c
+ if (!enqueue_hrtimer(timer, base))
+ return;
+
+ if (hrtimer_reprogram(timer, base))
+#ifndef CONFIG_HIGH_RES_TIMERS
+ }
+#else
+ if (base->cpu_base->hres_active &&
+ hrtimer_reprogram(timer, base))
+ goto requeue;
+
+ } else if (hrtimer_active(timer)) {
@ -176,6 +209,7 @@ Index: linux-stable/kernel/hrtimer.c
+ * the event device.
+ */
+ if (&timer->node == base->active.next &&
+ base->cpu_base->hres_active &&
+ hrtimer_reprogram(timer, base))
+ goto requeue;
+ }
@ -188,6 +222,7 @@ Index: linux-stable/kernel/hrtimer.c
+ */
+ __remove_hrtimer(timer, base, timer->state, 0);
+ list_add_tail(&timer->cb_entry, &base->expired);
+#endif
+}
+
+/*
@ -250,7 +285,11 @@ Index: linux-stable/kernel/hrtimer.c
+
+#else
+
+static inline void hrtimer_rt_run_pending(void) { }
+static inline void hrtimer_rt_run_pending(void)
+{
+ hrtimer_peek_ahead_timers();
+}
+
+static inline int hrtimer_rt_defer(struct hrtimer *timer) { return 0; }
+
+#endif
@ -260,7 +299,7 @@ Index: linux-stable/kernel/hrtimer.c
/*
* High resolution timer interrupt
* Called with interrupts disabled
@@ -1294,7 +1437,7 @@ void hrtimer_interrupt(struct clock_even
@@ -1294,7 +1443,7 @@ void hrtimer_interrupt(struct clock_even
{
struct hrtimer_cpu_base *cpu_base = &__get_cpu_var(hrtimer_bases);
ktime_t expires_next, now, entry_time, delta;
@ -269,7 +308,7 @@ Index: linux-stable/kernel/hrtimer.c
BUG_ON(!cpu_base->hres_active);
cpu_base->nr_events++;
@@ -1361,7 +1504,10 @@ retry:
@@ -1361,7 +1510,10 @@ retry:
break;
}
@ -281,7 +320,7 @@ Index: linux-stable/kernel/hrtimer.c
}
}
@@ -1376,6 +1522,10 @@ retry:
@@ -1376,6 +1528,10 @@ retry:
if (expires_next.tv64 == KTIME_MAX ||
!tick_program_event(expires_next, 0)) {
cpu_base->hang_detected = 0;
@ -292,7 +331,7 @@ Index: linux-stable/kernel/hrtimer.c
return;
}
@@ -1456,24 +1606,26 @@ void hrtimer_peek_ahead_timers(void)
@@ -1456,24 +1612,26 @@ void hrtimer_peek_ahead_timers(void)
local_irq_restore(flags);
}
@ -326,7 +365,7 @@ Index: linux-stable/kernel/hrtimer.c
/*
* Called from timer softirq every jiffy, expire hrtimers:
*
@@ -1506,7 +1658,7 @@ void hrtimer_run_queues(void)
@@ -1506,7 +1664,7 @@ void hrtimer_run_queues(void)
struct timerqueue_node *node;
struct hrtimer_cpu_base *cpu_base = &__get_cpu_var(hrtimer_bases);
struct hrtimer_clock_base *base;
@ -335,7 +374,7 @@ Index: linux-stable/kernel/hrtimer.c
if (hrtimer_hres_active())
return;
@@ -1531,12 +1683,16 @@ void hrtimer_run_queues(void)
@@ -1531,12 +1689,16 @@ void hrtimer_run_queues(void)
hrtimer_get_expires_tv64(timer))
break;
@ -354,7 +393,7 @@ Index: linux-stable/kernel/hrtimer.c
}
/*
@@ -1558,6 +1714,7 @@ static enum hrtimer_restart hrtimer_wake
@@ -1558,6 +1720,7 @@ static enum hrtimer_restart hrtimer_wake
void hrtimer_init_sleeper(struct hrtimer_sleeper *sl, struct task_struct *task)
{
sl->timer.function = hrtimer_wakeup;
@ -362,7 +401,7 @@ Index: linux-stable/kernel/hrtimer.c
sl->task = task;
}
EXPORT_SYMBOL_GPL(hrtimer_init_sleeper);
@@ -1696,6 +1853,7 @@ static void __cpuinit init_hrtimers_cpu(
@@ -1696,6 +1859,7 @@ static void __cpuinit init_hrtimers_cpu(
for (i = 0; i < HRTIMER_MAX_CLOCK_BASES; i++) {
cpu_base->clock_base[i].cpu_base = cpu_base;
timerqueue_init_head(&cpu_base->clock_base[i].active);
@ -370,7 +409,7 @@ Index: linux-stable/kernel/hrtimer.c
}
hrtimer_init_hres(cpu_base);
@@ -1814,9 +1972,7 @@ void __init hrtimers_init(void)
@@ -1814,9 +1978,7 @@ void __init hrtimers_init(void)
hrtimer_cpu_notify(&hrtimers_nb, (unsigned long)CPU_UP_PREPARE,
(void *)(long)smp_processor_id());
register_cpu_notifier(&hrtimers_nb);
@ -380,11 +419,9 @@ Index: linux-stable/kernel/hrtimer.c
}
/**
Index: linux-stable/kernel/sched/core.c
===================================================================
--- linux-stable.orig/kernel/sched/core.c
+++ linux-stable/kernel/sched/core.c
@@ -480,6 +480,7 @@ static void init_rq_hrtick(struct rq *rq
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -489,6 +489,7 @@ static void init_rq_hrtick(struct rq *rq
hrtimer_init(&rq->hrtick_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
rq->hrtick_timer.function = hrtick;
@ -392,10 +429,8 @@ Index: linux-stable/kernel/sched/core.c
}
#else /* CONFIG_SCHED_HRTICK */
static inline void hrtick_clear(struct rq *rq)
Index: linux-stable/kernel/sched/rt.c
===================================================================
--- linux-stable.orig/kernel/sched/rt.c
+++ linux-stable/kernel/sched/rt.c
--- a/kernel/sched/rt.c
+++ b/kernel/sched/rt.c
@@ -41,6 +41,7 @@ void init_rt_bandwidth(struct rt_bandwid
hrtimer_init(&rt_b->rt_period_timer,
@ -404,11 +439,9 @@ Index: linux-stable/kernel/sched/rt.c
rt_b->rt_period_timer.function = sched_rt_period_timer;
}
Index: linux-stable/kernel/time/tick-sched.c
===================================================================
--- linux-stable.orig/kernel/time/tick-sched.c
+++ linux-stable/kernel/time/tick-sched.c
@@ -873,6 +873,7 @@ void tick_setup_sched_timer(void)
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
@@ -867,6 +867,7 @@ void tick_setup_sched_timer(void)
* Emulate tick processing via per-CPU hrtimers:
*/
hrtimer_init(&ts->sched_timer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS);
@ -416,15 +449,13 @@ Index: linux-stable/kernel/time/tick-sched.c
ts->sched_timer.function = tick_sched_timer;
/* Get the next period (per cpu) */
Index: linux-stable/kernel/watchdog.c
===================================================================
--- linux-stable.orig/kernel/watchdog.c
+++ linux-stable/kernel/watchdog.c
@@ -470,6 +470,7 @@ static void watchdog_prepare_cpu(int cpu
WARN_ON(per_cpu(softlockup_watchdog, cpu));
--- a/kernel/watchdog.c
+++ b/kernel/watchdog.c
@@ -358,6 +358,7 @@ static void watchdog_enable(unsigned int
/* kick off the timer for the hardlockup detector */
hrtimer_init(hrtimer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
hrtimer->function = watchdog_timer_fn;
+ hrtimer->irqsafe = 1;
}
static int watchdog_enable(int cpu)
if (!watchdog_enabled) {
kthread_park(current);

View File

@ -10,11 +10,9 @@ Cc: stable-rt@vger.kernel.org
kernel/hrtimer.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
Index: linux-stable/kernel/hrtimer.c
===================================================================
--- linux-stable.orig/kernel/hrtimer.c
+++ linux-stable/kernel/hrtimer.c
@@ -1527,11 +1527,7 @@ retry:
--- a/kernel/hrtimer.c
+++ b/kernel/hrtimer.c
@@ -1528,11 +1528,7 @@ retry:
if (expires_next.tv64 == KTIME_MAX ||
!tick_program_event(expires_next, 0)) {
cpu_base->hang_detected = 0;
@ -27,7 +25,7 @@ Index: linux-stable/kernel/hrtimer.c
}
/*
@@ -1575,6 +1571,9 @@ retry:
@@ -1576,6 +1572,9 @@ retry:
tick_program_event(expires_next, 1);
printk_once(KERN_WARNING "hrtimer: interrupt took %llu ns\n",
ktime_to_ns(delta));

View File

@ -15,10 +15,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
kernel/posix-timers.c | 33 +++++++++++++++++++++++++++++++++
4 files changed, 76 insertions(+), 1 deletion(-)
Index: linux-stable/include/linux/hrtimer.h
===================================================================
--- linux-stable.orig/include/linux/hrtimer.h
+++ linux-stable/include/linux/hrtimer.h
--- a/include/linux/hrtimer.h
+++ b/include/linux/hrtimer.h
@@ -192,6 +192,9 @@ struct hrtimer_cpu_base {
unsigned long nr_hangs;
ktime_t max_hang_time;
@ -43,11 +41,9 @@ Index: linux-stable/include/linux/hrtimer.h
/* Query timers: */
extern ktime_t hrtimer_get_remaining(const struct hrtimer *timer);
extern int hrtimer_get_res(const clockid_t which_clock, struct timespec *tp);
Index: linux-stable/kernel/hrtimer.c
===================================================================
--- linux-stable.orig/kernel/hrtimer.c
+++ linux-stable/kernel/hrtimer.c
@@ -857,6 +857,32 @@ u64 hrtimer_forward(struct hrtimer *time
--- a/kernel/hrtimer.c
+++ b/kernel/hrtimer.c
@@ -844,6 +844,32 @@ u64 hrtimer_forward(struct hrtimer *time
}
EXPORT_SYMBOL_GPL(hrtimer_forward);
@ -108,10 +104,8 @@ Index: linux-stable/kernel/hrtimer.c
}
#ifdef CONFIG_HOTPLUG_CPU
Index: linux-stable/kernel/itimer.c
===================================================================
--- linux-stable.orig/kernel/itimer.c
+++ linux-stable/kernel/itimer.c
--- a/kernel/itimer.c
+++ b/kernel/itimer.c
@@ -213,6 +213,7 @@ again:
/* We are sharing ->siglock with it_real_fn() */
if (hrtimer_try_to_cancel(timer) < 0) {
@ -120,11 +114,9 @@ Index: linux-stable/kernel/itimer.c
goto again;
}
expires = timeval_to_ktime(value->it_value);
Index: linux-stable/kernel/posix-timers.c
===================================================================
--- linux-stable.orig/kernel/posix-timers.c
+++ linux-stable/kernel/posix-timers.c
@@ -766,6 +766,20 @@ SYSCALL_DEFINE1(timer_getoverrun, timer_
--- a/kernel/posix-timers.c
+++ b/kernel/posix-timers.c
@@ -773,6 +773,20 @@ SYSCALL_DEFINE1(timer_getoverrun, timer_
return overrun;
}
@ -145,7 +137,7 @@ Index: linux-stable/kernel/posix-timers.c
/* Set a POSIX.1b interval timer. */
/* timr->it_lock is taken. */
static int
@@ -843,6 +857,7 @@ retry:
@@ -850,6 +864,7 @@ retry:
if (!timr)
return -EINVAL;
@ -153,7 +145,7 @@ Index: linux-stable/kernel/posix-timers.c
kc = clockid_to_kclock(timr->it_clock);
if (WARN_ON_ONCE(!kc || !kc->timer_set))
error = -EINVAL;
@@ -851,9 +866,12 @@ retry:
@@ -858,9 +873,12 @@ retry:
unlock_timer(timr, flag);
if (error == TIMER_RETRY) {
@ -166,7 +158,7 @@ Index: linux-stable/kernel/posix-timers.c
if (old_setting && !error &&
copy_to_user(old_setting, &old_spec, sizeof (old_spec)))
@@ -891,10 +909,15 @@ retry_delete:
@@ -898,10 +916,15 @@ retry_delete:
if (!timer)
return -EINVAL;
@ -182,7 +174,7 @@ Index: linux-stable/kernel/posix-timers.c
spin_lock(&current->sighand->siglock);
list_del(&timer->list);
@@ -920,8 +943,18 @@ static void itimer_delete(struct k_itime
@@ -927,8 +950,18 @@ static void itimer_delete(struct k_itime
retry_delete:
spin_lock_irqsave(&timer->it_lock, flags);

View File

@ -15,10 +15,8 @@ Signed-off-by: Carsten Emde <C.Emde@osadl.org>
drivers/misc/hwlat_detector.c | 1212 +++++++++++++++++++++++++++++++++++++++
4 files changed, 1306 insertions(+)
Index: linux-stable/Documentation/hwlat_detector.txt
===================================================================
--- /dev/null
+++ linux-stable/Documentation/hwlat_detector.txt
+++ b/Documentation/hwlat_detector.txt
@@ -0,0 +1,64 @@
+Introduction:
+-------------
@ -84,11 +82,9 @@ Index: linux-stable/Documentation/hwlat_detector.txt
+observe any latencies that exceed the threshold (initially 100 usecs),
+then we write to a global sample ring buffer of 8K samples, which is
+consumed by reading from the "sample" (pipe) debugfs file interface.
Index: linux-stable/drivers/misc/Kconfig
===================================================================
--- linux-stable.orig/drivers/misc/Kconfig
+++ linux-stable/drivers/misc/Kconfig
@@ -131,6 +131,35 @@ config IBM_ASM
--- a/drivers/misc/Kconfig
+++ b/drivers/misc/Kconfig
@@ -121,6 +121,35 @@ config IBM_ASM
for information on the specific driver level and support statement
for your IBM server.
@ -124,19 +120,15 @@ Index: linux-stable/drivers/misc/Kconfig
config PHANTOM
tristate "Sensable PHANToM (PCI)"
depends on PCI
Index: linux-stable/drivers/misc/Makefile
===================================================================
--- linux-stable.orig/drivers/misc/Makefile
+++ linux-stable/drivers/misc/Makefile
@@ -50,3 +50,4 @@ obj-y += carma/
--- a/drivers/misc/Makefile
+++ b/drivers/misc/Makefile
@@ -49,3 +49,4 @@ obj-y += carma/
obj-$(CONFIG_USB_SWITCH_FSA9480) += fsa9480.o
obj-$(CONFIG_ALTERA_STAPL) +=altera-stapl/
obj-$(CONFIG_INTEL_MEI) += mei/
+obj-$(CONFIG_HWLAT_DETECTOR) += hwlat_detector.o
Index: linux-stable/drivers/misc/hwlat_detector.c
===================================================================
--- /dev/null
+++ linux-stable/drivers/misc/hwlat_detector.c
+++ b/drivers/misc/hwlat_detector.c
@@ -0,0 +1,1212 @@
+/*
+ * hwlat_detector.c - A simple Hardware Latency detector.

View File

@ -0,0 +1,34 @@
From 5145351047b216cca13aaca99f939a9a594c6c4d Mon Sep 17 00:00:00 2001
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date: Thu, 21 Mar 2013 11:35:49 +0100
Subject: [PATCH 2/3] i2c/omap: drop the lock hard irq context
The lock is taken while reading two registers. On RT the first lock is
taken in hard irq where it might sleep and in the threaded irq.
The threaded irq runs in oneshot mode so the hard irq does not run until
the thread the completes so there is no reason to grab the lock.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
drivers/i2c/busses/i2c-omap.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
--- a/drivers/i2c/busses/i2c-omap.c
+++ b/drivers/i2c/busses/i2c-omap.c
@@ -881,15 +881,12 @@ omap_i2c_isr(int irq, void *dev_id)
u16 mask;
u16 stat;
- spin_lock(&dev->lock);
- mask = omap_i2c_read_reg(dev, OMAP_I2C_IE_REG);
stat = omap_i2c_read_reg(dev, OMAP_I2C_STAT_REG);
+ mask = omap_i2c_read_reg(dev, OMAP_I2C_IE_REG);
if (stat & mask)
ret = IRQ_WAKE_THREAD;
- spin_unlock(&dev->lock);
-
return ret;
}

View File

@ -0,0 +1,48 @@
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Subject: gpu/i915: don't open code these things
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -91,7 +91,6 @@ i915_gem_wait_for_error(struct drm_devic
{
struct drm_i915_private *dev_priv = dev->dev_private;
struct completion *x = &dev_priv->error_completion;
- unsigned long flags;
int ret;
if (!atomic_read(&dev_priv->mm.wedged))
@@ -116,9 +115,7 @@ i915_gem_wait_for_error(struct drm_devic
* end up waiting upon a subsequent completion event that
* will never happen.
*/
- spin_lock_irqsave(&x->wait.lock, flags);
- x->done++;
- spin_unlock_irqrestore(&x->wait.lock, flags);
+ complete(x);
}
return 0;
}
@@ -946,12 +943,9 @@ i915_gem_check_wedge(struct drm_i915_pri
if (atomic_read(&dev_priv->mm.wedged)) {
struct completion *x = &dev_priv->error_completion;
bool recovery_complete;
- unsigned long flags;
/* Give the error handler a chance to run. */
- spin_lock_irqsave(&x->wait.lock, flags);
- recovery_complete = x->done > 0;
- spin_unlock_irqrestore(&x->wait.lock, flags);
+ recovery_complete = completion_done(x);
/* Non-interruptible callers can't handle -EAGAIN, hence return
* -EIO unconditionally for these. */
@@ -4366,7 +4360,7 @@ static bool mutex_is_locked_by(struct mu
if (!mutex_is_locked(mutex))
return false;
-#if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_MUTEXES)
+#if (defined(CONFIG_SMP) || defined(CONFIG_DEBUG_MUTEXES)) && !defined(CONFIG_PREEMPT_RT_BASE)
return mutex->owner == task;
#else
/* Since UP may be pre-empted, we cannot assume that we own the lock */

View File

@ -17,10 +17,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
drivers/ide/ide-taskfile.c | 6 +++---
7 files changed, 16 insertions(+), 16 deletions(-)
Index: linux-stable/drivers/ide/alim15x3.c
===================================================================
--- linux-stable.orig/drivers/ide/alim15x3.c
+++ linux-stable/drivers/ide/alim15x3.c
--- a/drivers/ide/alim15x3.c
+++ b/drivers/ide/alim15x3.c
@@ -234,7 +234,7 @@ static int init_chipset_ali15x3(struct p
isa_dev = pci_get_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1533, NULL);
@ -39,11 +37,9 @@ Index: linux-stable/drivers/ide/alim15x3.c
return 0;
}
Index: linux-stable/drivers/ide/hpt366.c
===================================================================
--- linux-stable.orig/drivers/ide/hpt366.c
+++ linux-stable/drivers/ide/hpt366.c
@@ -1241,7 +1241,7 @@ static int __devinit init_dma_hpt366(ide
--- a/drivers/ide/hpt366.c
+++ b/drivers/ide/hpt366.c
@@ -1241,7 +1241,7 @@ static int init_dma_hpt366(ide_hwif_t *h
dma_old = inb(base + 2);
@ -52,7 +48,7 @@ Index: linux-stable/drivers/ide/hpt366.c
dma_new = dma_old;
pci_read_config_byte(dev, hwif->channel ? 0x4b : 0x43, &masterdma);
@@ -1252,7 +1252,7 @@ static int __devinit init_dma_hpt366(ide
@@ -1252,7 +1252,7 @@ static int init_dma_hpt366(ide_hwif_t *h
if (dma_new != dma_old)
outb(dma_new, base + 2);
@ -61,11 +57,9 @@ Index: linux-stable/drivers/ide/hpt366.c
printk(KERN_INFO " %s: BM-DMA at 0x%04lx-0x%04lx\n",
hwif->name, base, base + 7);
Index: linux-stable/drivers/ide/ide-io-std.c
===================================================================
--- linux-stable.orig/drivers/ide/ide-io-std.c
+++ linux-stable/drivers/ide/ide-io-std.c
@@ -175,7 +175,7 @@ void ide_input_data(ide_drive_t *drive,
--- a/drivers/ide/ide-io-std.c
+++ b/drivers/ide/ide-io-std.c
@@ -175,7 +175,7 @@ void ide_input_data(ide_drive_t *drive,
unsigned long uninitialized_var(flags);
if ((io_32bit & 2) && !mmio) {
@ -74,7 +68,7 @@ Index: linux-stable/drivers/ide/ide-io-std.c
ata_vlb_sync(io_ports->nsect_addr);
}
@@ -186,7 +186,7 @@ void ide_input_data(ide_drive_t *drive,
@@ -186,7 +186,7 @@ void ide_input_data(ide_drive_t *drive,
insl(data_addr, buf, words);
if ((io_32bit & 2) && !mmio)
@ -101,10 +95,8 @@ Index: linux-stable/drivers/ide/ide-io-std.c
if (((len + 1) & 3) < 2)
return;
Index: linux-stable/drivers/ide/ide-io.c
===================================================================
--- linux-stable.orig/drivers/ide/ide-io.c
+++ linux-stable/drivers/ide/ide-io.c
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -659,7 +659,7 @@ void ide_timer_expiry (unsigned long dat
/* disable_irq_nosync ?? */
disable_irq(hwif->irq);
@ -114,11 +106,9 @@ Index: linux-stable/drivers/ide/ide-io.c
if (hwif->polling) {
startstop = handler(drive);
} else if (drive_is_ready(drive)) {
Index: linux-stable/drivers/ide/ide-iops.c
===================================================================
--- linux-stable.orig/drivers/ide/ide-iops.c
+++ linux-stable/drivers/ide/ide-iops.c
@@ -129,12 +129,12 @@ int __ide_wait_stat(ide_drive_t *drive,
--- a/drivers/ide/ide-iops.c
+++ b/drivers/ide/ide-iops.c
@@ -129,12 +129,12 @@ int __ide_wait_stat(ide_drive_t *drive,
if ((stat & ATA_BUSY) == 0)
break;
@ -133,10 +123,8 @@ Index: linux-stable/drivers/ide/ide-iops.c
}
/*
* Allow status to settle, then read it again.
Index: linux-stable/drivers/ide/ide-probe.c
===================================================================
--- linux-stable.orig/drivers/ide/ide-probe.c
+++ linux-stable/drivers/ide/ide-probe.c
--- a/drivers/ide/ide-probe.c
+++ b/drivers/ide/ide-probe.c
@@ -196,10 +196,10 @@ static void do_identify(ide_drive_t *dri
int bswap = 1;
@ -150,10 +138,8 @@ Index: linux-stable/drivers/ide/ide-probe.c
drive->dev_flags |= IDE_DFLAG_ID_READ;
#ifdef DEBUG
Index: linux-stable/drivers/ide/ide-taskfile.c
===================================================================
--- linux-stable.orig/drivers/ide/ide-taskfile.c
+++ linux-stable/drivers/ide/ide-taskfile.c
--- a/drivers/ide/ide-taskfile.c
+++ b/drivers/ide/ide-taskfile.c
@@ -251,7 +251,7 @@ void ide_pio_bytes(ide_drive_t *drive, s
page_is_high = PageHighMem(page);

View File

@ -0,0 +1,19 @@
Subject: sched: Init idle->on_rq in init_idle()
From: Thomas Gleixner <tglx@linutronix.de>
Date: Wed, 09 Jan 2013 23:03:29 +0100
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
kernel/sched/core.c | 1 +
1 file changed, 1 insertion(+)
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -4941,6 +4941,7 @@ void __cpuinit init_idle(struct task_str
rcu_read_unlock();
rq->curr = rq->idle = idle;
+ idle->on_rq = 1;
#if defined(CONFIG_SMP)
idle->on_cpu = 1;
#endif

View File

@ -18,10 +18,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
drivers/infiniband/ulp/ipoib/ipoib_multicast.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Index: linux-stable/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
===================================================================
--- linux-stable.orig/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
+++ linux-stable/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
--- a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
@@ -783,7 +783,7 @@ void ipoib_mcast_restart_task(struct wor
ipoib_mcast_stop_thread(dev, 0);

View File

@ -11,10 +11,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
drivers/input/gameport/gameport.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
Index: linux-stable/drivers/input/gameport/gameport.c
===================================================================
--- linux-stable.orig/drivers/input/gameport/gameport.c
+++ linux-stable/drivers/input/gameport/gameport.c
--- a/drivers/input/gameport/gameport.c
+++ b/drivers/input/gameport/gameport.c
@@ -87,12 +87,12 @@ static int gameport_measure_speed(struct
tx = 1 << 30;

View File

@ -27,10 +27,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
drivers/idle/i7300_idle.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
Index: linux-stable/drivers/idle/i7300_idle.c
===================================================================
--- linux-stable.orig/drivers/idle/i7300_idle.c
+++ linux-stable/drivers/idle/i7300_idle.c
--- a/drivers/idle/i7300_idle.c
+++ b/drivers/idle/i7300_idle.c
@@ -75,7 +75,7 @@ static unsigned long past_skip;
static struct pci_dev *fbd_dev;

View File

@ -15,10 +15,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
ipc/msg.c | 16 ++++++++++++++++
2 files changed, 21 insertions(+)
Index: linux-stable/ipc/mqueue.c
===================================================================
--- linux-stable.orig/ipc/mqueue.c
+++ linux-stable/ipc/mqueue.c
--- a/ipc/mqueue.c
+++ b/ipc/mqueue.c
@@ -912,12 +912,17 @@ static inline void pipelined_send(struct
struct msg_msg *message,
struct ext_wait_queue *receiver)
@ -37,10 +35,8 @@ Index: linux-stable/ipc/mqueue.c
}
/* pipelined_receive() - if there is task waiting in sys_mq_timedsend()
Index: linux-stable/ipc/msg.c
===================================================================
--- linux-stable.orig/ipc/msg.c
+++ linux-stable/ipc/msg.c
--- a/ipc/msg.c
+++ b/ipc/msg.c
@@ -259,12 +259,20 @@ static void expunge_all(struct msg_queue
while (tmp != &msq->q_receivers) {
struct msg_receiver *msr;
@ -62,7 +58,7 @@ Index: linux-stable/ipc/msg.c
}
}
@@ -611,6 +619,12 @@ static inline int pipelined_send(struct
@@ -614,6 +622,12 @@ static inline int pipelined_send(struct
!security_msg_queue_msgrcv(msq, msg, msr->r_tsk,
msr->r_msgtype, msr->r_mode)) {
@ -75,7 +71,7 @@ Index: linux-stable/ipc/msg.c
list_del(&msr->r_list);
if (msr->r_maxsize < msg->m_ts) {
msr->r_msg = NULL;
@@ -624,9 +638,11 @@ static inline int pipelined_send(struct
@@ -627,9 +641,11 @@ static inline int pipelined_send(struct
wake_up_process(msr->r_tsk);
smp_mb();
msr->r_msg = msg;

View File

@ -34,10 +34,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
ipc/mqueue.c | 19 ++++++++++++-------
1 file changed, 12 insertions(+), 7 deletions(-)
Index: linux-stable/ipc/mqueue.c
===================================================================
--- linux-stable.orig/ipc/mqueue.c
+++ linux-stable/ipc/mqueue.c
--- a/ipc/mqueue.c
+++ b/ipc/mqueue.c
@@ -936,13 +936,18 @@ static inline void pipelined_receive(str
wake_up_interruptible(&info->wait_q);
return;

View File

@ -31,10 +31,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
ipc/sem.c | 10 ++++++++++
1 file changed, 10 insertions(+)
Index: linux-stable/ipc/sem.c
===================================================================
--- linux-stable.orig/ipc/sem.c
+++ linux-stable/ipc/sem.c
--- a/ipc/sem.c
+++ b/ipc/sem.c
@@ -461,6 +461,13 @@ undo:
static void wake_up_sem_queue_prepare(struct list_head *pt,
struct sem_queue *q, int error)
@ -65,7 +63,7 @@ Index: linux-stable/ipc/sem.c
struct sem_queue *q, *t;
int did_something;
@@ -497,6 +506,7 @@ static void wake_up_sem_queue_do(struct
@@ -497,6 +506,7 @@ static void wake_up_sem_queue_do(struct
}
if (did_something)
preempt_enable();

View File

@ -18,10 +18,8 @@ Cc: stable-rt@vger.kernel.org
kernel/softirq.c | 7 +++++++
5 files changed, 37 insertions(+), 2 deletions(-)
Index: linux-stable/include/linux/interrupt.h
===================================================================
--- linux-stable.orig/include/linux/interrupt.h
+++ linux-stable/include/linux/interrupt.h
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -58,6 +58,7 @@
* IRQF_NO_THREAD - Interrupt cannot be threaded
* IRQF_EARLY_RESUME - Resume IRQ early during syscore instead of at device
@ -38,11 +36,9 @@ Index: linux-stable/include/linux/interrupt.h
#define IRQF_TIMER (__IRQF_TIMER | IRQF_NO_SUSPEND | IRQF_NO_THREAD)
Index: linux-stable/include/linux/irq.h
===================================================================
--- linux-stable.orig/include/linux/irq.h
+++ linux-stable/include/linux/irq.h
@@ -73,6 +73,7 @@ typedef void (*irq_preflow_handler_t)(st
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -70,6 +70,7 @@ typedef void (*irq_preflow_handler_t)(st
* IRQ_MOVE_PCNTXT - Interrupt can be migrated from process context
* IRQ_NESTED_TRHEAD - Interrupt nests into another thread
* IRQ_PER_CPU_DEVID - Dev_id is a per-cpu variable
@ -50,7 +46,7 @@ Index: linux-stable/include/linux/irq.h
*/
enum {
IRQ_TYPE_NONE = 0x00000000,
@@ -97,12 +98,14 @@ enum {
@@ -94,12 +95,14 @@ enum {
IRQ_NESTED_THREAD = (1 << 15),
IRQ_NOTHREAD = (1 << 16),
IRQ_PER_CPU_DEVID = (1 << 17),
@ -66,11 +62,9 @@ Index: linux-stable/include/linux/irq.h
#define IRQ_NO_BALANCING_MASK (IRQ_PER_CPU | IRQ_NO_BALANCING)
Index: linux-stable/kernel/irq/manage.c
===================================================================
--- linux-stable.orig/kernel/irq/manage.c
+++ linux-stable/kernel/irq/manage.c
@@ -757,7 +757,15 @@ irq_forced_thread_fn(struct irq_desc *de
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -782,7 +782,15 @@ irq_forced_thread_fn(struct irq_desc *de
local_bh_disable();
ret = action->thread_fn(action->irq, action->dev_id);
irq_finalize_oneshot(desc, action);
@ -87,7 +81,7 @@ Index: linux-stable/kernel/irq/manage.c
return ret;
}
@@ -1090,6 +1098,9 @@ __setup_irq(unsigned int irq, struct irq
@@ -1127,6 +1135,9 @@ __setup_irq(unsigned int irq, struct irq
irqd_set(&desc->irq_data, IRQD_NO_BALANCING);
}
@ -97,10 +91,8 @@ Index: linux-stable/kernel/irq/manage.c
/* Set default affinity mask once everything is setup */
setup_affinity(irq, desc, mask);
Index: linux-stable/kernel/irq/settings.h
===================================================================
--- linux-stable.orig/kernel/irq/settings.h
+++ linux-stable/kernel/irq/settings.h
--- a/kernel/irq/settings.h
+++ b/kernel/irq/settings.h
@@ -14,6 +14,7 @@ enum {
_IRQ_NO_BALANCING = IRQ_NO_BALANCING,
_IRQ_NESTED_THREAD = IRQ_NESTED_THREAD,
@ -134,11 +126,9 @@ Index: linux-stable/kernel/irq/settings.h
static inline bool irq_settings_is_per_cpu(struct irq_desc *desc)
{
return desc->status_use_accessors & _IRQ_PER_CPU;
Index: linux-stable/kernel/softirq.c
===================================================================
--- linux-stable.orig/kernel/softirq.c
+++ linux-stable/kernel/softirq.c
@@ -434,6 +434,13 @@ void local_bh_enable_ip(unsigned long ip
--- a/kernel/softirq.c
+++ b/kernel/softirq.c
@@ -417,6 +417,13 @@ void local_bh_enable_ip(unsigned long ip
}
EXPORT_SYMBOL(local_bh_enable_ip);

View File

@ -7,10 +7,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
include/linux/jump_label.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
Index: linux-stable/include/linux/jump_label.h
===================================================================
--- linux-stable.orig/include/linux/jump_label.h
+++ linux-stable/include/linux/jump_label.h
--- a/include/linux/jump_label.h
+++ b/include/linux/jump_label.h
@@ -50,7 +50,8 @@
#include <linux/compiler.h>
#include <linux/workqueue.h>

View File

@ -11,10 +11,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
mm/Kconfig | 2 +-
3 files changed, 3 insertions(+), 1 deletion(-)
Index: linux-stable/arch/Kconfig
===================================================================
--- linux-stable.orig/arch/Kconfig
+++ linux-stable/arch/Kconfig
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -6,6 +6,7 @@ config OPROFILE
tristate "OProfile system profiling"
depends on PROFILING
@ -23,11 +21,9 @@ Index: linux-stable/arch/Kconfig
select RING_BUFFER
select RING_BUFFER_ALLOW_SWAP
help
Index: linux-stable/drivers/net/Kconfig
===================================================================
--- linux-stable.orig/drivers/net/Kconfig
+++ linux-stable/drivers/net/Kconfig
@@ -153,6 +153,7 @@ config MACVTAP
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -164,6 +164,7 @@ config VXLAN
config NETCONSOLE
tristate "Network console logging support"
@ -35,16 +31,14 @@ Index: linux-stable/drivers/net/Kconfig
---help---
If you want to log kernel messages over the network, enable this.
See <file:Documentation/networking/netconsole.txt> for details.
Index: linux-stable/mm/Kconfig
===================================================================
--- linux-stable.orig/mm/Kconfig
+++ linux-stable/mm/Kconfig
@@ -318,7 +318,7 @@ config NOMMU_INITIAL_TRIM_EXCESS
--- a/mm/Kconfig
+++ b/mm/Kconfig
@@ -353,7 +353,7 @@ config NOMMU_INITIAL_TRIM_EXCESS
config TRANSPARENT_HUGEPAGE
bool "Transparent Hugepage Support"
- depends on X86 && MMU
+ depends on X86 && MMU && !PREEMPT_RT_FULL
- depends on HAVE_ARCH_TRANSPARENT_HUGEPAGE
+ depends on HAVE_ARCH_TRANSPARENT_HUGEPAGE && !PREEMPT_RT_FULL
select COMPACTION
help
Transparent Hugepages allows the kernel to use huge pages and

View File

@ -5,25 +5,21 @@ Date: Wed, 29 Jun 2011 14:58:57 +0200
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
init/Makefile | 2 +-
kernel/Kconfig.preempt | 7 +++++++
kernel/Kconfig.preempt | 8 ++++++++
scripts/mkcompile_h | 4 +++-
3 files changed, 11 insertions(+), 2 deletions(-)
3 files changed, 12 insertions(+), 2 deletions(-)
Index: linux-stable/init/Makefile
===================================================================
--- linux-stable.orig/init/Makefile
+++ linux-stable/init/Makefile
--- a/init/Makefile
+++ b/init/Makefile
@@ -33,4 +33,4 @@ silent_chk_compile.h = :
include/generated/compile.h: FORCE
@$($(quiet)chk_compile.h)
$(Q)$(CONFIG_SHELL) $(srctree)/scripts/mkcompile_h $@ \
- "$(UTS_MACHINE)" "$(CONFIG_SMP)" "$(CONFIG_PREEMPT)" "$(CC) $(KBUILD_CFLAGS)"
+ "$(UTS_MACHINE)" "$(CONFIG_SMP)" "$(CONFIG_PREEMPT)" "$(CONFIG_PREEMPT_RT_FULL)" "$(CC) $(KBUILD_CFLAGS)"
Index: linux-stable/kernel/Kconfig.preempt
===================================================================
--- linux-stable.orig/kernel/Kconfig.preempt
+++ linux-stable/kernel/Kconfig.preempt
@@ -73,6 +73,13 @@ config PREEMPT_RTB
--- a/kernel/Kconfig.preempt
+++ b/kernel/Kconfig.preempt
@@ -73,6 +73,14 @@ config PREEMPT_RTB
enables changes which are preliminary for the full preemptiple
RT kernel.
@ -31,16 +27,15 @@ Index: linux-stable/kernel/Kconfig.preempt
+ bool "Fully Preemptible Kernel (RT)"
+ depends on IRQ_FORCED_THREADING
+ select PREEMPT_RT_BASE
+ select PREEMPT_RCU
+ help
+ All and everything
+
endchoice
config PREEMPT_COUNT
Index: linux-stable/scripts/mkcompile_h
===================================================================
--- linux-stable.orig/scripts/mkcompile_h
+++ linux-stable/scripts/mkcompile_h
--- a/scripts/mkcompile_h
+++ b/scripts/mkcompile_h
@@ -4,7 +4,8 @@ TARGET=$1
ARCH=$2
SMP=$3

View File

@ -19,14 +19,12 @@ Jason.
---
drivers/tty/serial/8250/8250.c | 3 ++-
include/linux/kdb.h | 2 ++
include/linux/kdb.h | 3 ++-
kernel/debug/kdb/kdb_io.c | 6 ++----
3 files changed, 6 insertions(+), 5 deletions(-)
3 files changed, 6 insertions(+), 6 deletions(-)
Index: linux-stable/drivers/tty/serial/8250/8250.c
===================================================================
--- linux-stable.orig/drivers/tty/serial/8250/8250.c
+++ linux-stable/drivers/tty/serial/8250/8250.c
--- a/drivers/tty/serial/8250/8250.c
+++ b/drivers/tty/serial/8250/8250.c
@@ -38,6 +38,7 @@
#include <linux/nmi.h>
#include <linux/mutex.h>
@ -35,7 +33,7 @@ Index: linux-stable/drivers/tty/serial/8250/8250.c
#ifdef CONFIG_SPARC
#include <linux/sunserialcore.h>
#endif
@@ -2782,7 +2783,7 @@ serial8250_console_write(struct console
@@ -2909,7 +2910,7 @@ serial8250_console_write(struct console
touch_nmi_watchdog();
@ -44,29 +42,27 @@ Index: linux-stable/drivers/tty/serial/8250/8250.c
locked = spin_trylock_irqsave(&port->lock, flags);
else
spin_lock_irqsave(&port->lock, flags);
Index: linux-stable/include/linux/kdb.h
===================================================================
--- linux-stable.orig/include/linux/kdb.h
+++ linux-stable/include/linux/kdb.h
@@ -148,12 +148,14 @@ extern int kdb_register(char *, kdb_func
extern int kdb_register_repeat(char *, kdb_func_t, char *, char *,
short, kdb_repeat_t);
extern int kdb_unregister(char *);
--- a/include/linux/kdb.h
+++ b/include/linux/kdb.h
@@ -115,7 +115,7 @@ extern int kdb_trap_printk;
extern __printf(1, 0) int vkdb_printf(const char *fmt, va_list args);
extern __printf(1, 2) int kdb_printf(const char *, ...);
typedef __printf(1, 2) int (*kdb_printf_t)(const char *, ...);
-
+#define in_kdb_printk() (kdb_trap_printk)
extern void kdb_init(int level);
/* Access to kdb specific polling devices */
@@ -150,6 +150,7 @@ extern int kdb_register_repeat(char *, k
extern int kdb_unregister(char *);
#else /* ! CONFIG_KGDB_KDB */
#define kdb_printf(...)
#define kdb_init(x)
#define kdb_register(...)
#define kdb_register_repeat(...)
#define kdb_uregister(x)
static inline __printf(1, 2) int kdb_printf(const char *fmt, ...) { return 0; }
+#define in_kdb_printk() (0)
#endif /* CONFIG_KGDB_KDB */
enum {
KDB_NOT_INITIALIZED,
Index: linux-stable/kernel/debug/kdb/kdb_io.c
===================================================================
--- linux-stable.orig/kernel/debug/kdb/kdb_io.c
+++ linux-stable/kernel/debug/kdb/kdb_io.c
static inline void kdb_init(int level) {}
static inline int kdb_register(char *cmd, kdb_func_t func, char *usage,
char *help, short minlen) { return 0; }
--- a/kernel/debug/kdb/kdb_io.c
+++ b/kernel/debug/kdb/kdb_io.c
@@ -554,7 +554,6 @@ int vkdb_printf(const char *fmt, va_list
int linecount;
int colcount;

View File

@ -25,10 +25,8 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
kernel/trace/trace_irqsoff.c | 11
10 files changed, 1611 insertions(+)
Index: linux-stable/Documentation/trace/histograms.txt
===================================================================
--- /dev/null
+++ linux-stable/Documentation/trace/histograms.txt
+++ b/Documentation/trace/histograms.txt
@@ -0,0 +1,186 @@
+ Using the Linux Kernel Latency Histograms
+
@ -216,10 +214,8 @@ Index: linux-stable/Documentation/trace/histograms.txt
+is provided.
+
+These data are also reset when the wakeup histogram is reset.
Index: linux-stable/include/linux/hrtimer.h
===================================================================
--- linux-stable.orig/include/linux/hrtimer.h
+++ linux-stable/include/linux/hrtimer.h
--- a/include/linux/hrtimer.h
+++ b/include/linux/hrtimer.h
@@ -111,6 +111,9 @@ struct hrtimer {
enum hrtimer_restart (*function)(struct hrtimer *);
struct hrtimer_clock_base *base;
@ -230,11 +226,9 @@ Index: linux-stable/include/linux/hrtimer.h
#ifdef CONFIG_TIMER_STATS
int start_pid;
void *start_site;
Index: linux-stable/include/linux/sched.h
===================================================================
--- linux-stable.orig/include/linux/sched.h
+++ linux-stable/include/linux/sched.h
@@ -1583,6 +1583,12 @@ struct task_struct {
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1598,6 +1598,12 @@ struct task_struct {
unsigned long trace;
/* bitmask and counter of trace recursion */
unsigned long trace_recursion;
@ -247,10 +241,8 @@ Index: linux-stable/include/linux/sched.h
#endif /* CONFIG_TRACING */
#ifdef CONFIG_MEMCG /* memcg uses this to do batch job */
struct memcg_batch_info {
Index: linux-stable/include/trace/events/hist.h
===================================================================
--- /dev/null
+++ linux-stable/include/trace/events/hist.h
+++ b/include/trace/events/hist.h
@@ -0,0 +1,69 @@
+#undef TRACE_SYSTEM
+#define TRACE_SYSTEM hist
@ -321,10 +313,8 @@ Index: linux-stable/include/trace/events/hist.h
+
+/* This part must be outside protection */
+#include <trace/define_trace.h>
Index: linux-stable/include/trace/events/latency_hist.h
===================================================================
--- /dev/null
+++ linux-stable/include/trace/events/latency_hist.h
+++ b/include/trace/events/latency_hist.h
@@ -0,0 +1,29 @@
+#ifndef _LATENCY_HIST_H
+#define _LATENCY_HIST_H
@ -355,10 +345,8 @@ Index: linux-stable/include/trace/events/latency_hist.h
+}
+
+#endif /* _LATENCY_HIST_H */
Index: linux-stable/kernel/hrtimer.c
===================================================================
--- linux-stable.orig/kernel/hrtimer.c
+++ linux-stable/kernel/hrtimer.c
--- a/kernel/hrtimer.c
+++ b/kernel/hrtimer.c
@@ -49,6 +49,7 @@
#include <asm/uaccess.h>
@ -367,7 +355,7 @@ Index: linux-stable/kernel/hrtimer.c
/*
* The timer bases:
@@ -983,6 +984,17 @@ int __hrtimer_start_range_ns(struct hrti
@@ -970,6 +971,17 @@ int __hrtimer_start_range_ns(struct hrti
#endif
}
@ -410,11 +398,9 @@ Index: linux-stable/kernel/hrtimer.c
/*
* The immediate goal for using the softexpires is
* minimizing wakeups, not running timers at the
Index: linux-stable/kernel/trace/Kconfig
===================================================================
--- linux-stable.orig/kernel/trace/Kconfig
+++ linux-stable/kernel/trace/Kconfig
@@ -191,6 +191,24 @@ config IRQSOFF_TRACER
--- a/kernel/trace/Kconfig
+++ b/kernel/trace/Kconfig
@@ -202,6 +202,24 @@ config IRQSOFF_TRACER
enabled. This option and the preempt-off timing option can be
used together or separately.)
@ -439,7 +425,7 @@ Index: linux-stable/kernel/trace/Kconfig
config PREEMPT_TRACER
bool "Preemption-off Latency Tracer"
default n
@@ -213,6 +231,24 @@ config PREEMPT_TRACER
@@ -224,6 +242,24 @@ config PREEMPT_TRACER
enabled. This option and the irqs-off timing option can be
used together or separately.)
@ -464,7 +450,7 @@ Index: linux-stable/kernel/trace/Kconfig
config SCHED_TRACER
bool "Scheduling Latency Tracer"
select GENERIC_TRACER
@@ -222,6 +258,74 @@ config SCHED_TRACER
@@ -233,6 +269,74 @@ config SCHED_TRACER
This tracer tracks the latency of the highest priority task
to be scheduled in, starting from the point it has woken up.
@ -539,11 +525,9 @@ Index: linux-stable/kernel/trace/Kconfig
config ENABLE_DEFAULT_TRACERS
bool "Trace process context switches and events"
depends on !GENERIC_TRACER
Index: linux-stable/kernel/trace/Makefile
===================================================================
--- linux-stable.orig/kernel/trace/Makefile
+++ linux-stable/kernel/trace/Makefile
@@ -36,6 +36,10 @@ obj-$(CONFIG_FUNCTION_TRACER) += trace_f
--- a/kernel/trace/Makefile
+++ b/kernel/trace/Makefile
@@ -34,6 +34,10 @@ obj-$(CONFIG_FUNCTION_TRACER) += trace_f
obj-$(CONFIG_IRQSOFF_TRACER) += trace_irqsoff.o
obj-$(CONFIG_PREEMPT_TRACER) += trace_irqsoff.o
obj-$(CONFIG_SCHED_TRACER) += trace_sched_wakeup.o
@ -554,10 +538,8 @@ Index: linux-stable/kernel/trace/Makefile
obj-$(CONFIG_NOP_TRACER) += trace_nop.o
obj-$(CONFIG_STACK_TRACER) += trace_stack.o
obj-$(CONFIG_MMIOTRACE) += trace_mmiotrace.o
Index: linux-stable/kernel/trace/latency_hist.c
===================================================================
--- /dev/null
+++ linux-stable/kernel/trace/latency_hist.c
+++ b/kernel/trace/latency_hist.c
@@ -0,0 +1,1176 @@
+/*
+ * kernel/trace/latency_hist.c
@ -1735,10 +1717,8 @@ Index: linux-stable/kernel/trace/latency_hist.c
+}
+
+__initcall(latency_hist_init);
Index: linux-stable/kernel/trace/trace_irqsoff.c
===================================================================
--- linux-stable.orig/kernel/trace/trace_irqsoff.c
+++ linux-stable/kernel/trace/trace_irqsoff.c
--- a/kernel/trace/trace_irqsoff.c
+++ b/kernel/trace/trace_irqsoff.c
@@ -17,6 +17,7 @@
#include <linux/fs.h>
@ -1747,7 +1727,7 @@ Index: linux-stable/kernel/trace/trace_irqsoff.c
static struct trace_array *irqsoff_trace __read_mostly;
static int tracer_enabled __read_mostly;
@@ -437,11 +438,13 @@ void start_critical_timings(void)
@@ -438,11 +439,13 @@ void start_critical_timings(void)
{
if (preempt_trace() || irq_trace())
start_critical_timing(CALLER_ADDR0, CALLER_ADDR1);
@ -1761,7 +1741,7 @@ Index: linux-stable/kernel/trace/trace_irqsoff.c
if (preempt_trace() || irq_trace())
stop_critical_timing(CALLER_ADDR0, CALLER_ADDR1);
}
@@ -451,6 +454,7 @@ EXPORT_SYMBOL_GPL(stop_critical_timings)
@@ -452,6 +455,7 @@ EXPORT_SYMBOL_GPL(stop_critical_timings)
#ifdef CONFIG_PROVE_LOCKING
void time_hardirqs_on(unsigned long a0, unsigned long a1)
{
@ -1769,7 +1749,7 @@ Index: linux-stable/kernel/trace/trace_irqsoff.c
if (!preempt_trace() && irq_trace())
stop_critical_timing(a0, a1);
}
@@ -459,6 +463,7 @@ void time_hardirqs_off(unsigned long a0,
@@ -460,6 +464,7 @@ void time_hardirqs_off(unsigned long a0,
{
if (!preempt_trace() && irq_trace())
start_critical_timing(a0, a1);
@ -1777,7 +1757,7 @@ Index: linux-stable/kernel/trace/trace_irqsoff.c
}
#else /* !CONFIG_PROVE_LOCKING */
@@ -484,6 +489,7 @@ inline void print_irqtrace_events(struct
@@ -485,6 +490,7 @@ inline void print_irqtrace_events(struct
*/
void trace_hardirqs_on(void)
{
@ -1785,7 +1765,7 @@ Index: linux-stable/kernel/trace/trace_irqsoff.c
if (!preempt_trace() && irq_trace())
stop_critical_timing(CALLER_ADDR0, CALLER_ADDR1);
}
@@ -493,11 +499,13 @@ void trace_hardirqs_off(void)
@@ -494,11 +500,13 @@ void trace_hardirqs_off(void)
{
if (!preempt_trace() && irq_trace())
start_critical_timing(CALLER_ADDR0, CALLER_ADDR1);
@ -1799,7 +1779,7 @@ Index: linux-stable/kernel/trace/trace_irqsoff.c
if (!preempt_trace() && irq_trace())
stop_critical_timing(CALLER_ADDR0, caller_addr);
}
@@ -507,6 +515,7 @@ void trace_hardirqs_off_caller(unsigned
@@ -508,6 +516,7 @@ void trace_hardirqs_off_caller(unsigned
{
if (!preempt_trace() && irq_trace())
start_critical_timing(CALLER_ADDR0, caller_addr);
@ -1807,7 +1787,7 @@ Index: linux-stable/kernel/trace/trace_irqsoff.c
}
EXPORT_SYMBOL(trace_hardirqs_off_caller);
@@ -516,12 +525,14 @@ EXPORT_SYMBOL(trace_hardirqs_off_caller)
@@ -517,12 +526,14 @@ EXPORT_SYMBOL(trace_hardirqs_off_caller)
#ifdef CONFIG_PREEMPT_TRACER
void trace_preempt_on(unsigned long a0, unsigned long a1)
{

View File

@ -4,15 +4,13 @@ Date: Wed, 15 Jun 2011 11:02:21 +0200
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
include/linux/lglock.h | 13 ++++++++++-
include/linux/lglock.h | 19 +++++++++++++++--
kernel/lglock.c | 54 ++++++++++++++++++++++++++++++++-----------------
2 files changed, 48 insertions(+), 19 deletions(-)
2 files changed, 53 insertions(+), 20 deletions(-)
Index: linux-stable/include/linux/lglock.h
===================================================================
--- linux-stable.orig/include/linux/lglock.h
+++ linux-stable/include/linux/lglock.h
@@ -49,18 +49,29 @@
--- a/include/linux/lglock.h
+++ b/include/linux/lglock.h
@@ -42,22 +42,37 @@
#endif
struct lglock {
@ -30,23 +28,30 @@ Index: linux-stable/include/linux/lglock.h
-#define DEFINE_LGLOCK(name) \
+#ifndef CONFIG_PREEMPT_RT_FULL
+# define DEFINE_LGLOCK(name) \
DEFINE_LGLOCK_LOCKDEP(name); \
DEFINE_PER_CPU(arch_spinlock_t, name ## _lock) \
static DEFINE_PER_CPU(arch_spinlock_t, name ## _lock) \
= __ARCH_SPIN_LOCK_UNLOCKED; \
struct lglock name = { .lock = &name ## _lock }
-#define DEFINE_STATIC_LGLOCK(name) \
+# define DEFINE_STATIC_LGLOCK(name) \
static DEFINE_PER_CPU(arch_spinlock_t, name ## _lock) \
= __ARCH_SPIN_LOCK_UNLOCKED; \
static struct lglock name = { .lock = &name ## _lock }
+#else
+
+# define DEFINE_LGLOCK(name) \
+ DEFINE_LGLOCK_LOCKDEP(name); \
+ DEFINE_PER_CPU(struct rt_mutex, name ## _lock); \
+ static DEFINE_PER_CPU(struct rt_mutex, name ## _lock); \
+ struct lglock name = { .lock = &name ## _lock }
+
+# define DEFINE_STATIC_LGLOCK(name) \
+ static DEFINE_PER_CPU(struct rt_mutex, name ## _lock); \
+ static struct lglock name = { .lock = &name ## _lock }
+#endif
void lg_lock_init(struct lglock *lg, char *name);
void lg_local_lock(struct lglock *lg);
Index: linux-stable/kernel/lglock.c
===================================================================
--- linux-stable.orig/kernel/lglock.c
+++ linux-stable/kernel/lglock.c
--- a/kernel/lglock.c
+++ b/kernel/lglock.c
@@ -4,6 +4,15 @@
#include <linux/cpu.h>
#include <linux/string.h>

Some files were not shown because too many files have changed in this diff Show More