Patches contributed by Eötvös Lorand University
commit a60b33cf59d1c9e0e363287fce799cb23d45660c
Merge: 0f476b6d91a1 481c5346d098
Author: Ingo Molnar <mingo@elte.hu>
Date: Mon Jun 23 10:52:59 2008 +0200
Merge branch 'linus' into core/softirq
commit 437a0a54eea7b101e8a5b70688009956f6522ed0
Author: Ingo Molnar <mingo@elte.hu>
Date: Fri Jun 20 21:50:20 2008 +0200
x86, bitops: make constant-bit set/clear_bit ops faster, gcc workaround
Jeremy Fitzhardinge reported this compiler bug:
Suggestion from Linus: add "r" to the input constraint of the
set_bit()/clear_bit()'s constant 'nr' branch:
Blows up on "gcc version 3.4.4 20050314 (prerelease) (Debian 3.4.3-13)":
CC init/main.o
include2/asm/bitops.h: In function `start_kernel':
include2/asm/bitops.h:59: warning: asm operand 1 probably doesn't match constraints
include2/asm/bitops.h:59: warning: asm operand 1 probably doesn't match constraints
include2/asm/bitops.h:59: warning: asm operand 1 probably doesn't match constraints
include2/asm/bitops.h:59: error: impossible constraint in `asm'
include2/asm/bitops.h:59: error: impossible constraint in `asm'
include2/asm/bitops.h:59: error: impossible constraint in `asm'
Reported-by: Jeremy Fitzhardinge <jeremy@goop.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
diff --git a/include/asm-x86/bitops.h b/include/asm-x86/bitops.h
index 6c5054819719..96b1829cea15 100644
--- a/include/asm-x86/bitops.h
+++ b/include/asm-x86/bitops.h
@@ -58,7 +58,7 @@ static inline void set_bit(unsigned int nr, volatile unsigned long *addr)
if (IS_IMMEDIATE(nr)) {
asm volatile(LOCK_PREFIX "orb %1,%0"
: CONST_MASK_ADDR(nr, addr)
- : "i" (CONST_MASK(nr))
+ : "iq" ((u8)CONST_MASK(nr))
: "memory");
} else {
asm volatile(LOCK_PREFIX "bts %1,%0"
@@ -95,7 +95,7 @@ static inline void clear_bit(int nr, volatile unsigned long *addr)
if (IS_IMMEDIATE(nr)) {
asm volatile(LOCK_PREFIX "andb %1,%0"
: CONST_MASK_ADDR(nr, addr)
- : "i" (~CONST_MASK(nr)));
+ : "iq" ((u8)~CONST_MASK(nr)));
} else {
asm volatile(LOCK_PREFIX "btr %1,%0"
: BITOP_ADDR(addr)
commit a1d5a8691f1b6c92491747bea3b778b184fa5837
Author: Ingo Molnar <mingo@elte.hu>
Date: Fri Jun 20 15:34:46 2008 +0200
x86: unify __set_fixmap, fix
fix build failure:
arch/x86/mm/pgtable.c:280: warning: ‘enum fixed_addresses’ declared inside parameter list
arch/x86/mm/pgtable.c:280: warning: its scope is only this definition or declaration, which is probably not what you want
arch/x86/mm/pgtable.c:280: error: parameter 1 (‘idx’) has incomplete type
Signed-off-by: Ingo Molnar <mingo@elte.hu>
diff --git a/arch/x86/mm/pgtable.c b/arch/x86/mm/pgtable.c
index e9fb66361fc8..892fd1892b8d 100644
--- a/arch/x86/mm/pgtable.c
+++ b/arch/x86/mm/pgtable.c
@@ -2,6 +2,7 @@
#include <asm/pgalloc.h>
#include <asm/pgtable.h>
#include <asm/tlb.h>
+#include <asm/fixmap.h>
pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address)
{
commit 7dbceaf9bb68919651901b101f44edd5391ee489
Author: Ingo Molnar <mingo@elte.hu>
Date: Fri Jun 20 07:28:24 2008 +0200
x86, bitops: make constant-bit set/clear_bit ops faster, adapt, clean up
fix integration bug introduced by "x86: bitops take an unsigned long *"
which turned "(void *) + x" into "(long *) + x".
small cleanups to make it more apparent which value get propagated where.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
diff --git a/include/asm-x86/bitops.h b/include/asm-x86/bitops.h
index ab7635a4acd9..6c5054819719 100644
--- a/include/asm-x86/bitops.h
+++ b/include/asm-x86/bitops.h
@@ -28,16 +28,15 @@
#define BITOP_ADDR(x) "+m" (*(volatile long *) (x))
#endif
-#define ADDR BITOP_ADDR(addr)
+#define ADDR BITOP_ADDR(addr)
/*
* We do the locked ops that don't return the old value as
* a mask operation on a byte.
*/
-#define IS_IMMEDIATE(nr) \
- (__builtin_constant_p(nr))
-#define CONST_MASK_ADDR BITOP_ADDR(addr + (nr>>3))
-#define CONST_MASK (1 << (nr & 7))
+#define IS_IMMEDIATE(nr) (__builtin_constant_p(nr))
+#define CONST_MASK_ADDR(nr, addr) BITOP_ADDR((void *)(addr) + ((nr)>>3))
+#define CONST_MASK(nr) (1 << ((nr) & 7))
/**
* set_bit - Atomically set a bit in memory
@@ -56,13 +55,17 @@
*/
static inline void set_bit(unsigned int nr, volatile unsigned long *addr)
{
- if (IS_IMMEDIATE(nr))
- asm volatile(LOCK_PREFIX "orb %1,%0" : CONST_MASK_ADDR : "i" (CONST_MASK) : "memory");
- else
- asm volatile(LOCK_PREFIX "bts %1,%0" : ADDR : "Ir" (nr) : "memory");
+ if (IS_IMMEDIATE(nr)) {
+ asm volatile(LOCK_PREFIX "orb %1,%0"
+ : CONST_MASK_ADDR(nr, addr)
+ : "i" (CONST_MASK(nr))
+ : "memory");
+ } else {
+ asm volatile(LOCK_PREFIX "bts %1,%0"
+ : BITOP_ADDR(addr) : "Ir" (nr) : "memory");
+ }
}
-
/**
* __set_bit - Set a bit in memory
* @nr: the bit to set
@@ -89,10 +92,15 @@ static inline void __set_bit(int nr, volatile unsigned long *addr)
*/
static inline void clear_bit(int nr, volatile unsigned long *addr)
{
- if (IS_IMMEDIATE(nr))
- asm volatile(LOCK_PREFIX "andb %1,%0" : CONST_MASK_ADDR : "i" (~CONST_MASK));
- else
- asm volatile(LOCK_PREFIX "btr %1,%0" : ADDR : "Ir" (nr));
+ if (IS_IMMEDIATE(nr)) {
+ asm volatile(LOCK_PREFIX "andb %1,%0"
+ : CONST_MASK_ADDR(nr, addr)
+ : "i" (~CONST_MASK(nr)));
+ } else {
+ asm volatile(LOCK_PREFIX "btr %1,%0"
+ : BITOP_ADDR(addr)
+ : "Ir" (nr));
+ }
}
/*
commit 7aa413def76146f7b3784228556d9e4bc562eab3
Author: Ingo Molnar <mingo@elte.hu>
Date: Thu Jun 19 13:28:11 2008 +0200
x86, MM: virtual address debug, cleanups
Signed-off-by: Ingo Molnar <mingo@elte.hu>
diff --git a/include/linux/mmdebug.h b/include/linux/mmdebug.h
index 860ed1a71bbe..8a5509877192 100644
--- a/include/linux/mmdebug.h
+++ b/include/linux/mmdebug.h
@@ -6,13 +6,13 @@
#ifdef CONFIG_DEBUG_VM
#define VM_BUG_ON(cond) BUG_ON(cond)
#else
-#define VM_BUG_ON(cond) do { } while(0)
+#define VM_BUG_ON(cond) do { } while (0)
#endif
#ifdef CONFIG_DEBUG_VIRTUAL
#define VIRTUAL_BUG_ON(cond) BUG_ON(cond)
#else
-#define VIRTUAL_BUG_ON(cond) do { } while(0)
+#define VIRTUAL_BUG_ON(cond) do { } while (0)
#endif
#endif
diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index dc41e9c8ca6f..830a5580c5d7 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -180,8 +180,10 @@ struct page *vmalloc_to_page(const void *vmalloc_addr)
pmd_t *pmd;
pte_t *ptep, pte;
- /* XXX we might need to change this if we add VIRTUAL_BUG_ON for
- * architectures that do not vmalloc module space */
+ /*
+ * XXX we might need to change this if we add VIRTUAL_BUG_ON for
+ * architectures that do not vmalloc module space
+ */
VIRTUAL_BUG_ON(!is_vmalloc_addr(vmalloc_addr) &&
!is_module_address(addr));
commit d819c49da624e3ee09b2844603d58265039eecdd
Merge: f18f982abf18 9bedbcb207ed
Author: Ingo Molnar <mingo@elte.hu>
Date: Thu Jun 19 09:37:31 2008 +0200
Merge branch 'linus' into sched/urgent
commit 1cdad71537b42d0f0bf247772942ce678e4e8898
Merge: 20b6331bfed1 15a8641eadb4
Author: Ingo Molnar <mingo@elte.hu>
Date: Thu Jun 19 09:09:15 2008 +0200
Merge branch 'sched' into sched-devel
Conflicts:
kernel/sched_rt.c
Signed-off-by: Ingo Molnar <mingo@elte.hu>
diff --cc kernel/sched_rt.c
index f721b52acd8d,1dad5bbb59b6..fee5fa7c72db
--- a/kernel/sched_rt.c
+++ b/kernel/sched_rt.c
@@@ -576,16 -454,17 +576,22 @@@ static void __enqueue_rt_entity(struct
struct rt_rq *rt_rq = rt_rq_of_se(rt_se);
struct rt_prio_array *array = &rt_rq->active;
struct rt_rq *group_rq = group_rt_rq(rt_se);
+ struct list_head *queue = array->queue + rt_se_prio(rt_se);
- if (group_rq && rt_rq_throttled(group_rq))
+ /*
+ * Don't enqueue the group if its throttled, or when empty.
+ * The latter is a consequence of the former when a child group
+ * get throttled and the current group doesn't have any other
+ * active members.
+ */
+ if (group_rq && (rt_rq_throttled(group_rq) || !group_rq->rt_nr_running))
return;
- list_add_tail(&rt_se->run_list, array->queue + rt_se_prio(rt_se));
+ if (rt_se->nr_cpus_allowed == 1)
+ list_add(&rt_se->run_list, queue);
+ else
+ list_add_tail(&rt_se->run_list, queue);
+
__set_bit(rt_se_prio(rt_se), array->bitmap);
inc_rt_tasks(rt_se, rt_rq);
@@@ -669,9 -549,10 +676,13 @@@ stati
void requeue_rt_entity(struct rt_rq *rt_rq, struct sched_rt_entity *rt_se)
{
struct rt_prio_array *array = &rt_rq->active;
+ struct list_head *queue = array->queue + rt_se_prio(rt_se);
- list_del_init(&rt_se->run_list);
- list_add_tail(&rt_se->run_list, array->queue + rt_se_prio(rt_se));
- if (on_rt_rq(rt_se))
- list_move_tail(&rt_se->run_list, queue);
++ if (on_rt_rq(rt_se)) {
++ list_del_init(&rt_se->run_list);
++ list_add_tail(&rt_se->run_list,
++ array->queue + rt_se_prio(rt_se));
++ }
}
static void requeue_task_rt(struct rq *rq, struct task_struct *p)
commit 5af970a48f3ba0dd96a036b196c79dc923f28231
Author: Ingo Molnar <mingo@elte.hu>
Date: Wed Jun 18 10:09:48 2008 +0200
rcutorture: WARN_ON_ONCE(1) when detecting an error
this makes it easier for automated tests to pick up such failures.
diff --git a/kernel/rcutorture.c b/kernel/rcutorture.c
index 0334b6a8baca..0ca7e9b290b0 100644
--- a/kernel/rcutorture.c
+++ b/kernel/rcutorture.c
@@ -687,6 +687,7 @@ rcu_torture_printk(char *page)
if (i > 1) {
cnt += sprintf(&page[cnt], "!!! ");
atomic_inc(&n_rcu_torture_error);
+ WARN_ON_ONCE(1);
}
cnt += sprintf(&page[cnt], "Reader Pipe: ");
for (i = 0; i < RCU_TORTURE_PIPE_LEN + 1; i++)
commit ee4311adf105f4d740f52e3948acc1d81598afcc
Author: Ingo Molnar <mingo@elte.hu>
Date: Tue Jun 17 17:43:02 2008 +0200
ftrace: build fix with gcc 4.3
fix:
arch/x86/kernel/ftrace.c: Assembler messages:
arch/x86/kernel/ftrace.c:82: Error: bad register name `%sil'
make[1]: *** [arch/x86/kernel/ftrace.o] Error 1
Signed-off-by: Ingo Molnar <mingo@elte.hu>
diff --git a/arch/x86/kernel/ftrace.c b/arch/x86/kernel/ftrace.c
index bc5cf8d46742..55828149e01e 100644
--- a/arch/x86/kernel/ftrace.c
+++ b/arch/x86/kernel/ftrace.c
@@ -88,7 +88,7 @@ ftrace_modify_code(unsigned long ip, unsigned char *old_code,
".previous\n"
_ASM_EXTABLE(1b, 3b)
: "=r"(faulted), "=a"(replaced)
- : "r"(ip), "r"(new), "r"(newch),
+ : "r"(ip), "r"(new), "c"(newch),
"0"(faulted), "a"(old)
: "memory");
sync_core();
commit f22529351f7060d61eff3b76d7c9706f90aaedf3
Author: Ingo Molnar <mingo@elte.hu>
Date: Thu May 22 10:37:48 2008 +0200
namespacecheck: fixes
Signed-off-by: Ingo Molnar <mingo@elte.hu>
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index b532e4a68c74..0d5bcf69952d 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -50,7 +50,7 @@ static struct ftrace_ops ftrace_list_end __read_mostly =
static struct ftrace_ops *ftrace_list __read_mostly = &ftrace_list_end;
ftrace_func_t ftrace_trace_function __read_mostly = ftrace_stub;
-void ftrace_list_func(unsigned long ip, unsigned long parent_ip)
+static void ftrace_list_func(unsigned long ip, unsigned long parent_ip)
{
struct ftrace_ops *op = ftrace_list;
diff --git a/kernel/trace/trace_sched_switch.c b/kernel/trace/trace_sched_switch.c
index c16935d3bc5c..93a662009151 100644
--- a/kernel/trace/trace_sched_switch.c
+++ b/kernel/trace/trace_sched_switch.c
@@ -196,7 +196,7 @@ static void tracing_sched_unregister(void)
&ctx_trace);
}
-void tracing_start_sched_switch(void)
+static void tracing_start_sched_switch(void)
{
long ref;
@@ -205,7 +205,7 @@ void tracing_start_sched_switch(void)
tracing_sched_register();
}
-void tracing_stop_sched_switch(void)
+static void tracing_stop_sched_switch(void)
{
long ref;