public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [2.6 patch] kill smp_tune_scheduling()
@ 2005-04-05 15:15 Adrian Bunk
  0 siblings, 0 replies; 5+ messages in thread
From: Adrian Bunk @ 2005-04-05 15:15 UTC (permalink / raw)
  To: linux-kernel

Since all remaining smp_tune_scheduling()'s are now empty (except for 
the useless setting of function-local variables), we can completely 
remove the remaining ones.

Signed-off-by: Adrian Bunk <bunk@stusta.de>

---

 arch/i386/kernel/smpboot.c           |   31 ---------------------------
 arch/i386/mach-voyager/voyager_smp.c |    4 ---
 arch/m32r/kernel/smpboot.c           |    7 ------
 arch/mips/kernel/smp.c               |   29 -------------------------
 arch/x86_64/kernel/smpboot.c         |   27 -----------------------
 5 files changed, 98 deletions(-)

--- linux-2.6.12-rc2-mm1-full/arch/mips/kernel/smp.c.old	2005-04-05 16:53:13.000000000 +0200
+++ linux-2.6.12-rc2-mm1-full/arch/mips/kernel/smp.c	2005-04-05 16:53:35.000000000 +0200
@@ -46,34 +46,6 @@
 EXPORT_SYMBOL(phys_cpu_present_map);
 EXPORT_SYMBOL(cpu_online_map);
 
-static void smp_tune_scheduling (void)
-{
-	struct cache_desc *cd = &current_cpu_data.scache;
-	unsigned long cachesize;       /* kB   */
-	unsigned long bandwidth = 350; /* MB/s */
-	unsigned long cpu_khz;
-
-	/*
-	 * Crude estimate until we actually meassure ...
-	 */
-	cpu_khz = loops_per_jiffy * 2 * HZ / 1000;
-
-	/*
-	 * Rough estimation for SMP scheduling, this is the number of
-	 * cycles it takes for a fully memory-limited process to flush
-	 * the SMP-local cache.
-	 *
-	 * (For a P5 this pretty much means we will choose another idle
-	 *  CPU almost always at wakeup time (this is due to the small
-	 *  L1 cache), on PIIs it's around 50-100 usecs, depending on
-	 *  the cache size)
-	 */
-	if (!cpu_khz)
-		return;
-
-	cachesize = cd->linesz * cd->sets * cd->ways;
-}
-
 extern void __init calibrate_delay(void);
 extern ATTRIB_NORET void cpu_idle(void);
 
@@ -217,7 +189,6 @@
 	cpu_data[0].udelay_val = loops_per_jiffy;
 	init_new_context(current, &init_mm);
 	current_thread_info()->cpu = 0;
-	smp_tune_scheduling();
 	prom_prepare_cpus(max_cpus);
 }
 
--- linux-2.6.12-rc2-mm1-full/arch/i386/kernel/smpboot.c.old	2005-04-05 16:53:43.000000000 +0200
+++ linux-2.6.12-rc2-mm1-full/arch/i386/kernel/smpboot.c	2005-04-05 16:53:58.000000000 +0200
@@ -855,36 +855,6 @@
 	return boot_error;
 }
 
-static void smp_tune_scheduling (void)
-{
-	unsigned long cachesize;       /* kB   */
-	unsigned long bandwidth = 350; /* MB/s */
-	/*
-	 * Rough estimation for SMP scheduling, this is the number of
-	 * cycles it takes for a fully memory-limited process to flush
-	 * the SMP-local cache.
-	 *
-	 * (For a P5 this pretty much means we will choose another idle
-	 *  CPU almost always at wakeup time (this is due to the small
-	 *  L1 cache), on PIIs it's around 50-100 usecs, depending on
-	 *  the cache size)
-	 */
-
-	if (!cpu_khz) {
-		/*
-		 * this basically disables processor-affinity
-		 * scheduling on SMP without a TSC.
-		 */
-		return;
-	} else {
-		cachesize = boot_cpu_data.x86_cache_size;
-		if (cachesize == -1) {
-			cachesize = 16; /* Pentiums, 2x8kB cache */
-			bandwidth = 100;
-		}
-	}
-}
-
 /*
  * Cycle through the processors sending APIC IPIs to boot each.
  */
@@ -913,7 +883,6 @@
 	x86_cpu_to_apicid[0] = boot_cpu_physical_apicid;
 
 	current_thread_info()->cpu = 0;
-	smp_tune_scheduling();
 	cpus_clear(cpu_sibling_map[0]);
 	cpu_set(0, cpu_sibling_map[0]);
 
--- linux-2.6.12-rc2-mm1-full/arch/i386/mach-voyager/voyager_smp.c.old	2005-04-05 16:54:07.000000000 +0200
+++ linux-2.6.12-rc2-mm1-full/arch/i386/mach-voyager/voyager_smp.c	2005-04-05 16:54:22.000000000 +0200
@@ -688,10 +688,6 @@
 	 * schedule at the moment */
 	//global_irq_holder = boot_cpu_id;
 
-	/* FIXME: Need to do something about this but currently only works
-	 * on CPUs with a tsc which none of mine have. 
-	smp_tune_scheduling();
-	 */
 	smp_store_cpu_info(boot_cpu_id);
 	printk("CPU%d: ", boot_cpu_id);
 	print_cpu_info(&cpu_data[boot_cpu_id]);
--- linux-2.6.12-rc2-mm1-full/arch/m32r/kernel/smpboot.c.old	2005-04-05 16:54:30.000000000 +0200
+++ linux-2.6.12-rc2-mm1-full/arch/m32r/kernel/smpboot.c	2005-04-05 16:54:42.000000000 +0200
@@ -109,7 +109,6 @@
 
 void smp_prepare_boot_cpu(void);
 void smp_prepare_cpus(unsigned int);
-static void smp_tune_scheduling(void);
 static void init_ipi_lock(void);
 static void do_boot_cpu(int);
 int __cpu_up(unsigned int);
@@ -185,7 +184,6 @@
 	 * Setup boot CPU information
 	 */
 	smp_store_cpu_info(0); /* Final full version of the data */
-	smp_tune_scheduling();
 
 	/*
 	 * If SMP should be disabled, then really disable it!
@@ -229,11 +227,6 @@
 	Dprintk("Boot done.\n");
 }
 
-static void __init smp_tune_scheduling(void)
-{
-	/* Nothing to do. */
-}
-
 /*
  * init_ipi_lock : Initialize IPI locks.
  */
--- linux-2.6.12-rc2-mm1-full/arch/x86_64/kernel/smpboot.c.old	2005-04-05 16:54:49.000000000 +0200
+++ linux-2.6.12-rc2-mm1-full/arch/x86_64/kernel/smpboot.c	2005-04-05 16:55:08.000000000 +0200
@@ -660,32 +660,6 @@
 	}
 }
 
-static void smp_tune_scheduling (void)
-{
-	int cachesize;       /* kB   */
-	unsigned long bandwidth = 1000; /* MB/s */
-	/*
-	 * Rough estimation for SMP scheduling, this is the number of
-	 * cycles it takes for a fully memory-limited process to flush
-	 * the SMP-local cache.
-	 *
-	 * (For a P5 this pretty much means we will choose another idle
-	 *  CPU almost always at wakeup time (this is due to the small
-	 *  L1 cache), on PIIs it's around 50-100 usecs, depending on
-	 *  the cache size)
-	 */
-
-	if (!cpu_khz) {
-		return;
-	} else {
-		cachesize = boot_cpu_data.x86_cache_size;
-		if (cachesize == -1) {
-			cachesize = 16; /* Pentiums, 2x8kB cache */
-			bandwidth = 100;
-		}
-	}
-}
-
 /*
  * Cycle through the processors sending APIC IPIs to boot each.
  */
@@ -704,7 +678,6 @@
 	print_cpu_info(&cpu_data[0]);
 
 	current_thread_info()->cpu = 0;
-	smp_tune_scheduling();
 
 	if (!physid_isset(hard_smp_processor_id(), phys_cpu_present_map)) {
 		printk("weird, boot CPU (#%d) not listed by the BIOS.\n",


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [2.6 patch] kill smp_tune_scheduling()
@ 2005-04-13  2:18 Adrian Bunk
  0 siblings, 0 replies; 5+ messages in thread
From: Adrian Bunk @ 2005-04-13  2:18 UTC (permalink / raw)
  To: linux-kernel

Since all remaining smp_tune_scheduling()'s are now empty (except for 
the useless setting of function-local variables), we can completely 
remove the remaining ones.

Signed-off-by: Adrian Bunk <bunk@stusta.de>

---

 arch/i386/kernel/smpboot.c           |   31 ---------------------------
 arch/i386/mach-voyager/voyager_smp.c |    4 ---
 arch/m32r/kernel/smpboot.c           |    7 ------
 arch/mips/kernel/smp.c               |   29 -------------------------
 4 files changed, 71 deletions(-)

--- linux-2.6.12-rc2-mm1-full/arch/mips/kernel/smp.c.old	2005-04-05 16:53:13.000000000 +0200
+++ linux-2.6.12-rc2-mm1-full/arch/mips/kernel/smp.c	2005-04-05 16:53:35.000000000 +0200
@@ -46,34 +46,6 @@
 EXPORT_SYMBOL(phys_cpu_present_map);
 EXPORT_SYMBOL(cpu_online_map);
 
-static void smp_tune_scheduling (void)
-{
-	struct cache_desc *cd = &current_cpu_data.scache;
-	unsigned long cachesize;       /* kB   */
-	unsigned long bandwidth = 350; /* MB/s */
-	unsigned long cpu_khz;
-
-	/*
-	 * Crude estimate until we actually meassure ...
-	 */
-	cpu_khz = loops_per_jiffy * 2 * HZ / 1000;
-
-	/*
-	 * Rough estimation for SMP scheduling, this is the number of
-	 * cycles it takes for a fully memory-limited process to flush
-	 * the SMP-local cache.
-	 *
-	 * (For a P5 this pretty much means we will choose another idle
-	 *  CPU almost always at wakeup time (this is due to the small
-	 *  L1 cache), on PIIs it's around 50-100 usecs, depending on
-	 *  the cache size)
-	 */
-	if (!cpu_khz)
-		return;
-
-	cachesize = cd->linesz * cd->sets * cd->ways;
-}
-
 extern void __init calibrate_delay(void);
 extern ATTRIB_NORET void cpu_idle(void);
 
@@ -217,7 +189,6 @@
 	cpu_data[0].udelay_val = loops_per_jiffy;
 	init_new_context(current, &init_mm);
 	current_thread_info()->cpu = 0;
-	smp_tune_scheduling();
 	prom_prepare_cpus(max_cpus);
 }
 
--- linux-2.6.12-rc2-mm1-full/arch/i386/kernel/smpboot.c.old	2005-04-05 16:53:43.000000000 +0200
+++ linux-2.6.12-rc2-mm1-full/arch/i386/kernel/smpboot.c	2005-04-05 16:53:58.000000000 +0200
@@ -855,36 +855,6 @@
 	return boot_error;
 }
 
-static void smp_tune_scheduling (void)
-{
-	unsigned long cachesize;       /* kB   */
-	unsigned long bandwidth = 350; /* MB/s */
-	/*
-	 * Rough estimation for SMP scheduling, this is the number of
-	 * cycles it takes for a fully memory-limited process to flush
-	 * the SMP-local cache.
-	 *
-	 * (For a P5 this pretty much means we will choose another idle
-	 *  CPU almost always at wakeup time (this is due to the small
-	 *  L1 cache), on PIIs it's around 50-100 usecs, depending on
-	 *  the cache size)
-	 */
-
-	if (!cpu_khz) {
-		/*
-		 * this basically disables processor-affinity
-		 * scheduling on SMP without a TSC.
-		 */
-		return;
-	} else {
-		cachesize = boot_cpu_data.x86_cache_size;
-		if (cachesize == -1) {
-			cachesize = 16; /* Pentiums, 2x8kB cache */
-			bandwidth = 100;
-		}
-	}
-}
-
 /*
  * Cycle through the processors sending APIC IPIs to boot each.
  */
@@ -913,7 +883,6 @@
 	x86_cpu_to_apicid[0] = boot_cpu_physical_apicid;
 
 	current_thread_info()->cpu = 0;
-	smp_tune_scheduling();
 	cpus_clear(cpu_sibling_map[0]);
 	cpu_set(0, cpu_sibling_map[0]);
 
--- linux-2.6.12-rc2-mm1-full/arch/i386/mach-voyager/voyager_smp.c.old	2005-04-05 16:54:07.000000000 +0200
+++ linux-2.6.12-rc2-mm1-full/arch/i386/mach-voyager/voyager_smp.c	2005-04-05 16:54:22.000000000 +0200
@@ -688,10 +688,6 @@
 	 * schedule at the moment */
 	//global_irq_holder = boot_cpu_id;
 
-	/* FIXME: Need to do something about this but currently only works
-	 * on CPUs with a tsc which none of mine have. 
-	smp_tune_scheduling();
-	 */
 	smp_store_cpu_info(boot_cpu_id);
 	printk("CPU%d: ", boot_cpu_id);
 	print_cpu_info(&cpu_data[boot_cpu_id]);
--- linux-2.6.12-rc2-mm1-full/arch/m32r/kernel/smpboot.c.old	2005-04-05 16:54:30.000000000 +0200
+++ linux-2.6.12-rc2-mm1-full/arch/m32r/kernel/smpboot.c	2005-04-05 16:54:42.000000000 +0200
@@ -109,7 +109,6 @@
 
 void smp_prepare_boot_cpu(void);
 void smp_prepare_cpus(unsigned int);
-static void smp_tune_scheduling(void);
 static void init_ipi_lock(void);
 static void do_boot_cpu(int);
 int __cpu_up(unsigned int);
@@ -185,7 +184,6 @@
 	 * Setup boot CPU information
 	 */
 	smp_store_cpu_info(0); /* Final full version of the data */
-	smp_tune_scheduling();
 
 	/*
 	 * If SMP should be disabled, then really disable it!
@@ -229,11 +227,6 @@
 	Dprintk("Boot done.\n");
 }
 
-static void __init smp_tune_scheduling(void)
-{
-	/* Nothing to do. */
-}
-
 /*
  * init_ipi_lock : Initialize IPI locks.
  */

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [2.6 patch] kill smp_tune_scheduling()
@ 2005-08-22  0:57 Adrian Bunk
  0 siblings, 0 replies; 5+ messages in thread
From: Adrian Bunk @ 2005-08-22  0:57 UTC (permalink / raw)
  To: linux-kernel

Since all remaining smp_tune_scheduling()'s are now empty (except for 
the useless setting of function-local variables), we can completely 
remove them.

Signed-off-by: Adrian Bunk <bunk@stusta.de>

---

 arch/i386/kernel/smpboot.c           |   31 ---------------------------
 arch/i386/mach-voyager/voyager_smp.c |    4 ---
 arch/m32r/kernel/smpboot.c           |    8 ------
 arch/mips/kernel/smp.c               |   29 -------------------------
 4 files changed, 72 deletions(-)

--- linux-2.6.12-rc2-mm1-full/arch/mips/kernel/smp.c.old	2005-04-05 16:53:13.000000000 +0200
+++ linux-2.6.12-rc2-mm1-full/arch/mips/kernel/smp.c	2005-04-05 16:53:35.000000000 +0200
@@ -46,34 +46,6 @@
 EXPORT_SYMBOL(phys_cpu_present_map);
 EXPORT_SYMBOL(cpu_online_map);
 
-static void smp_tune_scheduling (void)
-{
-	struct cache_desc *cd = &current_cpu_data.scache;
-	unsigned long cachesize;       /* kB   */
-	unsigned long bandwidth = 350; /* MB/s */
-	unsigned long cpu_khz;
-
-	/*
-	 * Crude estimate until we actually meassure ...
-	 */
-	cpu_khz = loops_per_jiffy * 2 * HZ / 1000;
-
-	/*
-	 * Rough estimation for SMP scheduling, this is the number of
-	 * cycles it takes for a fully memory-limited process to flush
-	 * the SMP-local cache.
-	 *
-	 * (For a P5 this pretty much means we will choose another idle
-	 *  CPU almost always at wakeup time (this is due to the small
-	 *  L1 cache), on PIIs it's around 50-100 usecs, depending on
-	 *  the cache size)
-	 */
-	if (!cpu_khz)
-		return;
-
-	cachesize = cd->linesz * cd->sets * cd->ways;
-}
-
 extern void __init calibrate_delay(void);
 extern ATTRIB_NORET void cpu_idle(void);
 
@@ -217,7 +189,6 @@
 	cpu_data[0].udelay_val = loops_per_jiffy;
 	init_new_context(current, &init_mm);
 	current_thread_info()->cpu = 0;
-	smp_tune_scheduling();
 	prom_prepare_cpus(max_cpus);
 }
 
--- linux-2.6.12-rc2-mm1-full/arch/i386/mach-voyager/voyager_smp.c.old	2005-04-05 16:54:07.000000000 +0200
+++ linux-2.6.12-rc2-mm1-full/arch/i386/mach-voyager/voyager_smp.c	2005-04-05 16:54:22.000000000 +0200
@@ -688,10 +688,6 @@
 	 * schedule at the moment */
 	//global_irq_holder = boot_cpu_id;
 
-	/* FIXME: Need to do something about this but currently only works
-	 * on CPUs with a tsc which none of mine have. 
-	smp_tune_scheduling();
-	 */
 	smp_store_cpu_info(boot_cpu_id);
 	printk("CPU%d: ", boot_cpu_id);
 	print_cpu_info(&cpu_data[boot_cpu_id]);
--- linux-2.6.12-rc2-mm1-full/arch/m32r/kernel/smpboot.c.old	2005-04-05 16:54:30.000000000 +0200
+++ linux-2.6.12-rc2-mm1-full/arch/m32r/kernel/smpboot.c	2005-04-05 16:54:42.000000000 +0200
@@ -109,7 +109,6 @@
 
 void smp_prepare_boot_cpu(void);
 void smp_prepare_cpus(unsigned int);
-static void smp_tune_scheduling(void);
 static void init_ipi_lock(void);
 static void do_boot_cpu(int);
 int __cpu_up(unsigned int);
@@ -185,7 +184,6 @@
 	 * Setup boot CPU information
 	 */
 	smp_store_cpu_info(0); /* Final full version of the data */
-	smp_tune_scheduling();
 
 	/*
 	 * If SMP should be disabled, then really disable it!
@@ -229,11 +227,6 @@
 	Dprintk("Boot done.\n");
 }
 
-static void __init smp_tune_scheduling(void)
-{
-	/* Nothing to do. */
-}
-
 /*
  * init_ipi_lock : Initialize IPI locks.
  */
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
--- linux-2.6.13-rc6-mm1-modular/arch/i386/kernel/smpboot.c.old	2005-08-22 02:55:50.000000000 +0200
+++ linux-2.6.13-rc6-mm1-modular/arch/i386/kernel/smpboot.c	2005-08-22 02:56:08.000000000 +0200
@@ -1034,36 +1034,6 @@
 }
 #endif
 
-static void smp_tune_scheduling (void)
-{
-	unsigned long cachesize;       /* kB   */
-	unsigned long bandwidth = 350; /* MB/s */
-	/*
-	 * Rough estimation for SMP scheduling, this is the number of
-	 * cycles it takes for a fully memory-limited process to flush
-	 * the SMP-local cache.
-	 *
-	 * (For a P5 this pretty much means we will choose another idle
-	 *  CPU almost always at wakeup time (this is due to the small
-	 *  L1 cache), on PIIs it's around 50-100 usecs, depending on
-	 *  the cache size)
-	 */
-
-	if (!cpu_khz) {
-		/*
-		 * this basically disables processor-affinity
-		 * scheduling on SMP without a TSC.
-		 */
-		return;
-	} else {
-		cachesize = boot_cpu_data.x86_cache_size;
-		if (cachesize == -1) {
-			cachesize = 16; /* Pentiums, 2x8kB cache */
-			bandwidth = 100;
-		}
-	}
-}
-
 /*
  * Cycle through the processors sending APIC IPIs to boot each.
  */
@@ -1092,7 +1062,6 @@
 	x86_cpu_to_apicid[0] = boot_cpu_physical_apicid;
 
 	current_thread_info()->cpu = 0;
-	smp_tune_scheduling();
 	cpus_clear(cpu_sibling_map[0]);
 	cpu_set(0, cpu_sibling_map[0]);
 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [2.6 patch] kill smp_tune_scheduling()
@ 2005-11-02  9:12 Adrian Bunk
  0 siblings, 0 replies; 5+ messages in thread
From: Adrian Bunk @ 2005-11-02  9:12 UTC (permalink / raw)
  To: linux-kernel

Since all remaining smp_tune_scheduling()'s are now empty (except for
the useless setting of function-local variables), we can completely
remove them.

Signed-off-by: Adrian Bunk <bunk@stusta.de>

---

 arch/i386/kernel/smpboot.c           |   31 ---------------------------
 arch/i386/mach-voyager/voyager_smp.c |    4 ---
 arch/m32r/kernel/smpboot.c           |    7 ------
 arch/mips/kernel/smp.c               |   28 ------------------------
 4 files changed, 70 deletions(-)

--- linux-2.6.14-rc5-mm1-full-2.95/arch/i386/kernel/smpboot.c.old	2005-11-02 02:57:42.000000000 +0100
+++ linux-2.6.14-rc5-mm1-full-2.95/arch/i386/kernel/smpboot.c	2005-11-02 02:57:54.000000000 +0100
@@ -1062,40 +1062,10 @@
 	unlock_cpu_hotplug();
 	return ret;
 }
 #endif
 
-static void smp_tune_scheduling (void)
-{
-	unsigned long cachesize;       /* kB   */
-	unsigned long bandwidth = 350; /* MB/s */
-	/*
-	 * Rough estimation for SMP scheduling, this is the number of
-	 * cycles it takes for a fully memory-limited process to flush
-	 * the SMP-local cache.
-	 *
-	 * (For a P5 this pretty much means we will choose another idle
-	 *  CPU almost always at wakeup time (this is due to the small
-	 *  L1 cache), on PIIs it's around 50-100 usecs, depending on
-	 *  the cache size)
-	 */
-
-	if (!cpu_khz) {
-		/*
-		 * this basically disables processor-affinity
-		 * scheduling on SMP without a TSC.
-		 */
-		return;
-	} else {
-		cachesize = boot_cpu_data.x86_cache_size;
-		if (cachesize == -1) {
-			cachesize = 16; /* Pentiums, 2x8kB cache */
-			bandwidth = 100;
-		}
-	}
-}
-
 /*
  * Cycle through the processors sending APIC IPIs to boot each.
  */
 
 static int boot_cpu_logical_apicid;
@@ -1129,11 +1099,10 @@
 
 	boot_cpu_logical_apicid = logical_smp_processor_id();
 	x86_cpu_to_apicid[0] = boot_cpu_physical_apicid;
 
 	current_thread_info()->cpu = 0;
-	smp_tune_scheduling();
 
 	set_cpu_sibling_map(0);
 
 	map_cpu_to_logical_apicid();
 
--- linux-2.6.14-rc5-mm1-full-2.95/arch/i386/mach-voyager/voyager_smp.c.old	2005-11-02 02:58:03.000000000 +0100
+++ linux-2.6.14-rc5-mm1-full-2.95/arch/i386/mach-voyager/voyager_smp.c	2005-11-02 02:58:15.000000000 +0100
@@ -697,14 +697,10 @@
 	voyager_extended_cpus = 1;
 	/* Remove the global_irq_holder setting, it triggers a BUG() on
 	 * schedule at the moment */
 	//global_irq_holder = boot_cpu_id;
 
-	/* FIXME: Need to do something about this but currently only works
-	 * on CPUs with a tsc which none of mine have. 
-	smp_tune_scheduling();
-	 */
 	smp_store_cpu_info(boot_cpu_id);
 	printk("CPU%d: ", boot_cpu_id);
 	print_cpu_info(&cpu_data[boot_cpu_id]);
 
 	if(is_cpu_quad()) {
--- linux-2.6.14-rc5-mm1-full-2.95/arch/m32r/kernel/smpboot.c.old	2005-11-02 02:58:23.000000000 +0100
+++ linux-2.6.14-rc5-mm1-full-2.95/arch/m32r/kernel/smpboot.c	2005-11-02 02:58:34.000000000 +0100
@@ -108,11 +108,10 @@
 /* Function Prototypes                                                       */
 /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
 
 void smp_prepare_boot_cpu(void);
 void smp_prepare_cpus(unsigned int);
-static void smp_tune_scheduling(void);
 static void init_ipi_lock(void);
 static void do_boot_cpu(int);
 int __cpu_up(unsigned int);
 void smp_cpus_done(unsigned int);
 
@@ -184,11 +183,10 @@
 
 	/*
 	 * Setup boot CPU information
 	 */
 	smp_store_cpu_info(0); /* Final full version of the data */
-	smp_tune_scheduling();
 
 	/*
 	 * If SMP should be disabled, then really disable it!
 	 */
 	if (!max_cpus) {
@@ -228,15 +226,10 @@
 
 smp_done:
 	Dprintk("Boot done.\n");
 }
 
-static void __init smp_tune_scheduling(void)
-{
-	/* Nothing to do. */
-}
-
 /*
  * init_ipi_lock : Initialize IPI locks.
  */
 static void __init init_ipi_lock(void)
 {
--- linux-2.6.14-rc5-mm1-full-2.95/arch/mips/kernel/smp.c.old	2005-11-02 02:58:44.000000000 +0100
+++ linux-2.6.14-rc5-mm1-full-2.95/arch/mips/kernel/smp.c	2005-11-02 02:58:53.000000000 +0100
@@ -44,37 +44,10 @@
 int __cpu_logical_map[NR_CPUS];		/* Map logical to physical */
 
 EXPORT_SYMBOL(phys_cpu_present_map);
 EXPORT_SYMBOL(cpu_online_map);
 
-static void smp_tune_scheduling (void)
-{
-	struct cache_desc *cd = &current_cpu_data.scache;
-	unsigned long cachesize;       /* kB   */
-	unsigned long cpu_khz;
-
-	/*
-	 * Crude estimate until we actually meassure ...
-	 */
-	cpu_khz = loops_per_jiffy * 2 * HZ / 1000;
-
-	/*
-	 * Rough estimation for SMP scheduling, this is the number of
-	 * cycles it takes for a fully memory-limited process to flush
-	 * the SMP-local cache.
-	 *
-	 * (For a P5 this pretty much means we will choose another idle
-	 *  CPU almost always at wakeup time (this is due to the small
-	 *  L1 cache), on PIIs it's around 50-100 usecs, depending on
-	 *  the cache size)
-	 */
-	if (!cpu_khz)
-		return;
-
-	cachesize = cd->linesz * cd->sets * cd->ways;
-}
-
 extern void __init calibrate_delay(void);
 extern ATTRIB_NORET void cpu_idle(void);
 
 /*
  * First C code run on the secondary CPUs after being started up by
@@ -232,11 +205,10 @@
 /* called from main before smp_init() */
 void __init smp_prepare_cpus(unsigned int max_cpus)
 {
 	init_new_context(current, &init_mm);
 	current_thread_info()->cpu = 0;
-	smp_tune_scheduling();
 	prom_prepare_cpus(max_cpus);
 }
 
 /* preload SMP state for boot cpu */
 void __devinit smp_prepare_boot_cpu(void)


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [2.6 patch] kill smp_tune_scheduling()
@ 2005-11-07 20:49 Adrian Bunk
  0 siblings, 0 replies; 5+ messages in thread
From: Adrian Bunk @ 2005-11-07 20:49 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel

Since all remaining smp_tune_scheduling()'s are now empty (except for
the useless setting of function-local variables), we can completely
remove them.

Signed-off-by: Adrian Bunk <bunk@stusta.de>

---

This patch was already sent on:
- 2 Nov 2005

 arch/i386/kernel/smpboot.c           |   31 ---------------------------
 arch/i386/mach-voyager/voyager_smp.c |    4 ---
 arch/m32r/kernel/smpboot.c           |    7 ------
 arch/mips/kernel/smp.c               |   28 ------------------------
 4 files changed, 70 deletions(-)

--- linux-2.6.14-rc5-mm1-full-2.95/arch/i386/kernel/smpboot.c.old	2005-11-02 02:57:42.000000000 +0100
+++ linux-2.6.14-rc5-mm1-full-2.95/arch/i386/kernel/smpboot.c	2005-11-02 02:57:54.000000000 +0100
@@ -1062,40 +1062,10 @@
 	unlock_cpu_hotplug();
 	return ret;
 }
 #endif
 
-static void smp_tune_scheduling (void)
-{
-	unsigned long cachesize;       /* kB   */
-	unsigned long bandwidth = 350; /* MB/s */
-	/*
-	 * Rough estimation for SMP scheduling, this is the number of
-	 * cycles it takes for a fully memory-limited process to flush
-	 * the SMP-local cache.
-	 *
-	 * (For a P5 this pretty much means we will choose another idle
-	 *  CPU almost always at wakeup time (this is due to the small
-	 *  L1 cache), on PIIs it's around 50-100 usecs, depending on
-	 *  the cache size)
-	 */
-
-	if (!cpu_khz) {
-		/*
-		 * this basically disables processor-affinity
-		 * scheduling on SMP without a TSC.
-		 */
-		return;
-	} else {
-		cachesize = boot_cpu_data.x86_cache_size;
-		if (cachesize == -1) {
-			cachesize = 16; /* Pentiums, 2x8kB cache */
-			bandwidth = 100;
-		}
-	}
-}
-
 /*
  * Cycle through the processors sending APIC IPIs to boot each.
  */
 
 static int boot_cpu_logical_apicid;
@@ -1129,11 +1099,10 @@
 
 	boot_cpu_logical_apicid = logical_smp_processor_id();
 	x86_cpu_to_apicid[0] = boot_cpu_physical_apicid;
 
 	current_thread_info()->cpu = 0;
-	smp_tune_scheduling();
 
 	set_cpu_sibling_map(0);
 
 	map_cpu_to_logical_apicid();
 
--- linux-2.6.14-rc5-mm1-full-2.95/arch/i386/mach-voyager/voyager_smp.c.old	2005-11-02 02:58:03.000000000 +0100
+++ linux-2.6.14-rc5-mm1-full-2.95/arch/i386/mach-voyager/voyager_smp.c	2005-11-02 02:58:15.000000000 +0100
@@ -697,14 +697,10 @@
 	voyager_extended_cpus = 1;
 	/* Remove the global_irq_holder setting, it triggers a BUG() on
 	 * schedule at the moment */
 	//global_irq_holder = boot_cpu_id;
 
-	/* FIXME: Need to do something about this but currently only works
-	 * on CPUs with a tsc which none of mine have. 
-	smp_tune_scheduling();
-	 */
 	smp_store_cpu_info(boot_cpu_id);
 	printk("CPU%d: ", boot_cpu_id);
 	print_cpu_info(&cpu_data[boot_cpu_id]);
 
 	if(is_cpu_quad()) {
--- linux-2.6.14-rc5-mm1-full-2.95/arch/m32r/kernel/smpboot.c.old	2005-11-02 02:58:23.000000000 +0100
+++ linux-2.6.14-rc5-mm1-full-2.95/arch/m32r/kernel/smpboot.c	2005-11-02 02:58:34.000000000 +0100
@@ -108,11 +108,10 @@
 /* Function Prototypes                                                       */
 /*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*/
 
 void smp_prepare_boot_cpu(void);
 void smp_prepare_cpus(unsigned int);
-static void smp_tune_scheduling(void);
 static void init_ipi_lock(void);
 static void do_boot_cpu(int);
 int __cpu_up(unsigned int);
 void smp_cpus_done(unsigned int);
 
@@ -184,11 +183,10 @@
 
 	/*
 	 * Setup boot CPU information
 	 */
 	smp_store_cpu_info(0); /* Final full version of the data */
-	smp_tune_scheduling();
 
 	/*
 	 * If SMP should be disabled, then really disable it!
 	 */
 	if (!max_cpus) {
@@ -228,15 +226,10 @@
 
 smp_done:
 	Dprintk("Boot done.\n");
 }
 
-static void __init smp_tune_scheduling(void)
-{
-	/* Nothing to do. */
-}
-
 /*
  * init_ipi_lock : Initialize IPI locks.
  */
 static void __init init_ipi_lock(void)
 {
--- linux-2.6.14-rc5-mm1-full-2.95/arch/mips/kernel/smp.c.old	2005-11-02 02:58:44.000000000 +0100
+++ linux-2.6.14-rc5-mm1-full-2.95/arch/mips/kernel/smp.c	2005-11-02 02:58:53.000000000 +0100
@@ -44,37 +44,10 @@
 int __cpu_logical_map[NR_CPUS];		/* Map logical to physical */
 
 EXPORT_SYMBOL(phys_cpu_present_map);
 EXPORT_SYMBOL(cpu_online_map);
 
-static void smp_tune_scheduling (void)
-{
-	struct cache_desc *cd = &current_cpu_data.scache;
-	unsigned long cachesize;       /* kB   */
-	unsigned long cpu_khz;
-
-	/*
-	 * Crude estimate until we actually meassure ...
-	 */
-	cpu_khz = loops_per_jiffy * 2 * HZ / 1000;
-
-	/*
-	 * Rough estimation for SMP scheduling, this is the number of
-	 * cycles it takes for a fully memory-limited process to flush
-	 * the SMP-local cache.
-	 *
-	 * (For a P5 this pretty much means we will choose another idle
-	 *  CPU almost always at wakeup time (this is due to the small
-	 *  L1 cache), on PIIs it's around 50-100 usecs, depending on
-	 *  the cache size)
-	 */
-	if (!cpu_khz)
-		return;
-
-	cachesize = cd->linesz * cd->sets * cd->ways;
-}
-
 extern void __init calibrate_delay(void);
 extern ATTRIB_NORET void cpu_idle(void);
 
 /*
  * First C code run on the secondary CPUs after being started up by
@@ -232,11 +205,10 @@
 /* called from main before smp_init() */
 void __init smp_prepare_cpus(unsigned int max_cpus)
 {
 	init_new_context(current, &init_mm);
 	current_thread_info()->cpu = 0;
-	smp_tune_scheduling();
 	prom_prepare_cpus(max_cpus);
 }
 
 /* preload SMP state for boot cpu */
 void __devinit smp_prepare_boot_cpu(void)


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-11-07 20:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-07 20:49 [2.6 patch] kill smp_tune_scheduling() Adrian Bunk
  -- strict thread matches above, loose matches on Subject: below --
2005-11-02  9:12 Adrian Bunk
2005-08-22  0:57 Adrian Bunk
2005-04-13  2:18 Adrian Bunk
2005-04-05 15:15 Adrian Bunk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox