]> nv-tegra.nvidia Code Review - linux-2.6.git/commitdiff
[PATCH] Introduce CONFIG_DEFAULT_MIGRATION_COST
authorIngo Molnar <mingo@elte.hu>
Fri, 17 Feb 2006 21:52:44 +0000 (13:52 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Fri, 17 Feb 2006 21:59:26 +0000 (13:59 -0800)
Heiko Carstens <heiko.carstens@de.ibm.com> wrote:

  The boot sequence on s390 sometimes takes ages and we spend a very long
  time (up to one or two minutes) in calibrate_migration_costs.  The time
  spent there differs from boot to boot.  Also the calculated costs differ
  a lot.  I've seen differences by up to a factor of 15 (yes, factor not
  percent).  Also I doubt that making these measurements make much sense on
  a completely virtualized architecture where you cannot tell how much cpu
  time you will get anyway.

So introduce the CONFIG_DEFAULT_MIGRATION_COST method for an architecture
to set the scheduler migration costs.  This turns off automatic detection
of migration costs.  Makes sense on virtual platforms, where migration
costs are hard to measure accurately.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
arch/s390/Kconfig
kernel/sched.c

index b66602ad7b33073fe7a5b0d307703f9d0c6768f9..b7ca5bf9acfca27fbd1a971748d8defac878bea0 100644 (file)
@@ -80,6 +80,10 @@ config HOTPLUG_CPU
          can be controlled through /sys/devices/system/cpu/cpu#.
          Say N if you want to disable CPU hotplug.
 
+config DEFAULT_MIGRATION_COST
+       int
+       default "1000000"
+
 config MATHEMU
        bool "IEEE FPU emulation"
        depends on MARCH_G5
index 66d957227de9c847953961224828eff723e71057..12d291bf3379a38c94d11e600bdb1455781f3d01 100644 (file)
@@ -5058,7 +5058,18 @@ static void init_sched_build_groups(struct sched_group groups[], cpumask_t span,
 #define MAX_DOMAIN_DISTANCE 32
 
 static unsigned long long migration_cost[MAX_DOMAIN_DISTANCE] =
-               { [ 0 ... MAX_DOMAIN_DISTANCE-1 ] = -1LL };
+               { [ 0 ... MAX_DOMAIN_DISTANCE-1 ] =
+/*
+ * Architectures may override the migration cost and thus avoid
+ * boot-time calibration. Unit is nanoseconds. Mostly useful for
+ * virtualized hardware:
+ */
+#ifdef CONFIG_DEFAULT_MIGRATION_COST
+                       CONFIG_DEFAULT_MIGRATION_COST
+#else
+                       -1LL
+#endif
+};
 
 /*
  * Allow override of migration cost - in units of microseconds.