Patches contributed by Eötvös Lorand University


commit 79c81d220c8e25163f56edcdfaf23f83a4c88e6b
Merge: 3299b4dd1180 79a9d461fd52
Author: Ingo Molnar <mingo@elte.hu>
Date:   Thu Nov 6 07:43:47 2008 +0100

    Merge branch 'tracing/fastboot' into tracing/ftrace

commit 9fcd18c9e63e325dbd2b4c726623f760788d5aa8
Author: Ingo Molnar <mingo@elte.hu>
Date:   Wed Nov 5 16:52:08 2008 +0100

    sched: re-tune balancing
    
    Impact: improve wakeup affinity on NUMA systems, tweak SMP systems
    
    Given the fixes+tweaks to the wakeup-buddy code, re-tweak the domain
    balancing defaults on NUMA and SMP systems.
    
    Turn on SD_WAKE_AFFINE which was off on x86 NUMA - there's no reason
    why we would not want to have wakeup affinity across nodes as well.
    (we already do this in the standard NUMA template.)
    
    lat_ctx on a NUMA box is particularly happy about this change:
    
    before:
    
     |   phoenix:~/l> ./lat_ctx -s 0 2
     |   "size=0k ovr=2.60
     |   2 5.70
    
    after:
    
     |   phoenix:~/l> ./lat_ctx -s 0 2
     |   "size=0k ovr=2.65
     |   2 2.07
    
    a 2.75x speedup.
    
    pipe-test is similarly happy about it too:
    
     |  phoenix:~/sched-tests> ./pipe-test
     |   18.26 usecs/loop.
     |   14.70 usecs/loop.
     |   14.38 usecs/loop.
     |   10.55 usecs/loop.              # +WAKE_AFFINE on domain0+domain1
     |   8.63 usecs/loop.
     |   8.59 usecs/loop.
     |   9.03 usecs/loop.
     |   8.94 usecs/loop.
     |   8.96 usecs/loop.
     |   8.63 usecs/loop.
    
    Also:
    
     - disable SD_BALANCE_NEWIDLE on NUMA and SMP domains (keep it for siblings)
     - enable SD_WAKE_BALANCE on SMP domains
    
    Sysbench+postgresql improves all around the board, quite significantly:
    
               .28-rc3-11474e2c  .28-rc3-11474e2c-tune
    -------------------------------------------------
        1:             571              688    +17.08%
        2:            1236             1206    -2.55%
        4:            2381             2642    +9.89%
        8:            4958             5164    +3.99%
       16:            9580             9574    -0.07%
       32:            7128             8118    +12.20%
       64:            7342             8266    +11.18%
      128:            7342             8064    +8.95%
      256:            7519             7884    +4.62%
      512:            7350             7731    +4.93%
    -------------------------------------------------
      SUM:           55412            59341    +6.62%
    
    So it's a win both for the runup portion, the peak area and the tail.
    
    Signed-off-by: Ingo Molnar <mingo@elte.hu>

diff --git a/arch/x86/include/asm/topology.h b/arch/x86/include/asm/topology.h
index 90ac7718469a..4850e4b02b61 100644
--- a/arch/x86/include/asm/topology.h
+++ b/arch/x86/include/asm/topology.h
@@ -154,7 +154,7 @@ extern unsigned long node_remap_size[];
 
 #endif
 
-/* sched_domains SD_NODE_INIT for NUMAQ machines */
+/* sched_domains SD_NODE_INIT for NUMA machines */
 #define SD_NODE_INIT (struct sched_domain) {		\
 	.min_interval		= 8,			\
 	.max_interval		= 32,			\
@@ -169,8 +169,9 @@ extern unsigned long node_remap_size[];
 	.flags			= SD_LOAD_BALANCE	\
 				| SD_BALANCE_EXEC	\
 				| SD_BALANCE_FORK	\
-				| SD_SERIALIZE		\
-				| SD_WAKE_BALANCE,	\
+				| SD_WAKE_AFFINE	\
+				| SD_WAKE_BALANCE	\
+				| SD_SERIALIZE,		\
 	.last_balance		= jiffies,		\
 	.balance_interval	= 1,			\
 }
diff --git a/include/linux/topology.h b/include/linux/topology.h
index 2158fc0d5a56..34a7ee0ebed2 100644
--- a/include/linux/topology.h
+++ b/include/linux/topology.h
@@ -146,10 +146,10 @@ void arch_update_cpu_topology(void);
 	.wake_idx		= 1,			\
 	.forkexec_idx		= 1,			\
 	.flags			= SD_LOAD_BALANCE	\
-				| SD_BALANCE_NEWIDLE	\
-				| SD_BALANCE_FORK	\
 				| SD_BALANCE_EXEC	\
+				| SD_BALANCE_FORK	\
 				| SD_WAKE_AFFINE	\
+				| SD_WAKE_BALANCE	\
 				| BALANCE_FOR_PKG_POWER,\
 	.last_balance		= jiffies,		\
 	.balance_interval	= 1,			\

commit 6cf87efbc7a3676e0ad7c9622ec6aec244a593bc
Author: Ingo Molnar <mingo@elte.hu>
Date:   Tue Nov 4 10:42:23 2008 +0100

    x86 debug: mark early_printk.o as notrace
    
    Impact: do not do function-tracing in the early-printk code
    
    this is useful when earlyprintk=vga,keep is used to debug tracer
    plugins.
    
    Signed-off-by: Ingo Molnar <mingo@elte.hu>

diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile
index e489ff9cb3e2..943fe6026c64 100644
--- a/arch/x86/kernel/Makefile
+++ b/arch/x86/kernel/Makefile
@@ -12,6 +12,7 @@ CFLAGS_REMOVE_tsc.o = -pg
 CFLAGS_REMOVE_rtc.o = -pg
 CFLAGS_REMOVE_paravirt-spinlocks.o = -pg
 CFLAGS_REMOVE_ftrace.o = -pg
+CFLAGS_REMOVE_early_printk.o = -pg
 endif
 
 #

commit be19ef82e068e92a28df50341938fdeb5ea56436
Author: Ingo Molnar <mingo@elte.hu>
Date:   Mon Nov 3 14:35:12 2008 +0100

    rcu: make rcu-stall debug printout more standard
    
    Impact: change debug printout
    
    Change "RCU detected CPU stall" to "INFO: RCU detected CPU stall"
    message, to make it easier for tools to pick up the warning.
    
    Signed-off-by: Ingo Molnar <mingo@elte.hu>

diff --git a/kernel/rcuclassic.c b/kernel/rcuclassic.c
index 37f72e551542..e503a002f330 100644
--- a/kernel/rcuclassic.c
+++ b/kernel/rcuclassic.c
@@ -191,7 +191,7 @@ static void print_other_cpu_stall(struct rcu_ctrlblk *rcp)
 
 	/* OK, time to rat on our buddy... */
 
-	printk(KERN_ERR "RCU detected CPU stalls:");
+	printk(KERN_ERR "INFO: RCU detected CPU stalls:");
 	for_each_possible_cpu(cpu) {
 		if (cpu_isset(cpu, rcp->cpumask))
 			printk(" %d", cpu);
@@ -204,7 +204,7 @@ static void print_cpu_stall(struct rcu_ctrlblk *rcp)
 {
 	unsigned long flags;
 
-	printk(KERN_ERR "RCU detected CPU %d stall (t=%lu/%lu jiffies)\n",
+	printk(KERN_ERR "INFO: RCU detected CPU %d stall (t=%lu/%lu jiffies)\n",
 			smp_processor_id(), jiffies,
 			jiffies - rcp->gp_start);
 	dump_stack();

commit 7a895f53cda9d9362c30144e42c124a1ae996b9e
Merge: d9e540762f5c 5d9881ea1440 fd3fdf11d3c6 a26a2a27396c 127cafbb2762 c2c805294600
Author: Ingo Molnar <mingo@elte.hu>
Date:   Mon Nov 3 10:34:23 2008 +0100

    Merge branches 'tracing/ftrace', 'tracing/markers', 'tracing/mmiotrace', 'tracing/nmisafe', 'tracing/tracepoints' and 'tracing/urgent' into tracing/core

diff --cc include/linux/ftrace.h
index 899ec4b26b6c,a3d46151be19,a3d46151be19,22240dfe912e,703eb53cfa2b,703eb53cfa2b..e46a7b34037c
--- a/include/linux/ftrace.h
+++ b/include/linux/ftrace.h
@@@@@@@ -74,28 -79,6 -79,6 -74,31 -74,28 -74,28 +74,31 @@@@@@@ extern void ftrace_caller(void)
      extern void ftrace_call(void);
      extern void mcount_call(void);
      
+++ ++/* May be defined in arch */
+++ ++extern int ftrace_arch_read_dyn_info(char *buf, int size);
+++ ++
 ++   /**
 ++    * ftrace_modify_code - modify code segment
 ++    * @ip: the address of the code segment
 ++    * @old_code: the contents of what is expected to be there
 ++    * @new_code: the code to patch in
 ++    *
 ++    * This is a very sensitive operation and great care needs
 ++    * to be taken by the arch.  The operation should carefully
 ++    * read the location, check to see if what is read is indeed
 ++    * what we expect it to be, and then on success of the compare,
 ++    * it should write to the location.
 ++    *
 ++    * Return must be:
 ++    *  0 on success
 ++    *  -EFAULT on error reading the location
 ++    *  -EINVAL on a failed compare of the contents
 ++    *  -EPERM  on error writing to the location
 ++    * Any other value will be considered a failure.
 ++    */
 ++   extern int ftrace_modify_code(unsigned long ip, unsigned char *old_code,
 ++   			      unsigned char *new_code);
 ++   
      extern int skip_trace(unsigned long ip);
      
      extern void ftrace_release(void *start, unsigned long size);
diff --cc kernel/trace/trace.c
index 482583eb8001,d345d649d073,d345d649d073,7f86067d760c,8a499e2adaec,85bee775a03e..e4c40c868d67
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@@@@@@ -2407,7 -2375,22 -2375,22 -2373,23 -2378,23 -2380,23 +2409,7 @@@@@@@ static int tracing_set_tracer(char *buf
      {
      	struct trace_array *tr = &global_trace;
      	struct tracer *t;
 -----	char buf[max_tracer_type_len+1];
 -----	int i;
 -----	size_t ret;
   ---
   ---	ret = cnt;
 -----
 -----	if (cnt > max_tracer_type_len)
 -----		cnt = max_tracer_type_len;
 --   	ret = cnt;
 -----
 -----	if (copy_from_user(&buf, ubuf, cnt))
 -----		return -EFAULT;
 -----
 -----	buf[cnt] = 0;
 -----
 -----	/* strip ending whitespace. */
 -----	for (i = cnt - 1; i > 0 && isspace(buf[i]); i--)
 -----		buf[i] = 0;
 +++++	int ret = 0;
      
      	mutex_lock(&trace_types_lock);
      	for (t = trace_types; t; t = t->next) {
@@@@@@@ -2431,35 -2414,8 -2414,8 -2413,8 -2418,8 -2420,8 +2433,35 @@@@@@@
       out:
      	mutex_unlock(&trace_types_lock);
      
 --   	if (ret == cnt)
 --   		filp->f_pos += cnt;
 +++++	return ret;
 +++++}
 +++++
 +++++static ssize_t
 +++++tracing_set_trace_write(struct file *filp, const char __user *ubuf,
 +++++			size_t cnt, loff_t *ppos)
 +++++{
 +++++	char buf[max_tracer_type_len+1];
 +++++	int i;
 +++++	size_t ret;
 +++++
 +++++	if (cnt > max_tracer_type_len)
 +++++		cnt = max_tracer_type_len;
 +++++
 +++++	if (copy_from_user(&buf, ubuf, cnt))
 +++++		return -EFAULT;
 +++++
 +++++	buf[cnt] = 0;
 +++++
 +++++	/* strip ending whitespace. */
 +++++	for (i = cnt - 1; i > 0 && isspace(buf[i]); i--)
 +++++		buf[i] = 0;
 +++++
 +++++	ret = tracing_set_tracer(buf);
 +++++	if (!ret)
 +++++		ret = cnt;
 +++++
 ++   	if (ret > 0)
 ++   		filp->f_pos += ret;
      
      	return ret;
      }

commit 36609469c8278554b046aa4cc9a5fa9ccea35306
Merge: b3acf29afda0 45beca08dd8b
Author: Ingo Molnar <mingo@elte.hu>
Date:   Mon Nov 3 09:11:13 2008 +0100

    Merge commit 'v2.6.28-rc3' into tracing/ftrace

commit db5935001a43528e673ad26ffec9d98c60a496a9
Merge: 34f3a814eef8 45beca08dd8b
Author: Ingo Molnar <mingo@elte.hu>
Date:   Mon Nov 3 08:57:41 2008 +0100

    Merge commit 'v2.6.28-rc3' into sched/core

commit b342797c1e5116a130841527b47dfaa462ed0968
Author: Ingo Molnar <mingo@elte.hu>
Date:   Fri Oct 31 09:31:38 2008 +0100

    x86: build fix
    
    Impact: build fix on certain UP configs
    
    fix:
    
     arch/x86/kernel/cpu/common.c: In function 'cpu_init':
     arch/x86/kernel/cpu/common.c:1141: error: 'boot_cpu_id' undeclared (first use in this function)
     arch/x86/kernel/cpu/common.c:1141: error: (Each undeclared identifier is reported only once
     arch/x86/kernel/cpu/common.c:1141: error: for each function it appears in.)
    
    Pull in asm/smp.h on UP, so that we get the definition of
    boot_cpu_id.
    
    Signed-off-by: Ingo Molnar <mingo@elte.hu>

diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index 003a65395bd5..b9c9ea0217a9 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -20,6 +20,7 @@
 #include <asm/pat.h>
 #include <asm/asm.h>
 #include <asm/numa.h>
+#include <asm/smp.h>
 #ifdef CONFIG_X86_LOCAL_APIC
 #include <asm/mpspec.h>
 #include <asm/apic.h>

commit 1c4acdb467f8a6704855a5670ff3d82e3c18eb0b
Author: Ingo Molnar <mingo@elte.hu>
Date:   Fri Oct 31 00:43:03 2008 +0100

    x86: cpu_index build fix
    
    fix:
    
     arch/x86/kernel/cpu/common.c: In function 'early_identify_cpu':
     arch/x86/kernel/cpu/common.c:553: error: 'struct cpuinfo_x86' has no member named 'cpu_index'
    
    as cpu_index is only available on SMP.
    
    Signed-off-by: Ingo Molnar <mingo@elte.hu>

diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index da8f15ac7a6d..003a65395bd5 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -550,7 +550,9 @@ static void __init early_identify_cpu(struct cpuinfo_x86 *c)
 
 	validate_pat_support(c);
 
+#ifdef CONFIG_SMP
 	c->cpu_index = boot_cpu_id;
+#endif
 }
 
 void __init early_cpu_init(void)

commit e1e302d8a9ab06ba8d7d5ec503d8996e6cf0eca4
Merge: 944ac4259e39 7f82f000ed03
Author: Ingo Molnar <mingo@elte.hu>
Date:   Fri Oct 31 00:38:21 2008 +0100

    Merge branch 'linus' into tracing/ftrace