Skip to contentSkip to conversation

scheduler updates for v2.6.28

GIT PULL Ingo Molnar 1 participant 1 message Oct 10, 2008

Subsystems (12)
lore
Share & tools
lore
#0 lore raw

Linus,

Please pull the latest sched-v28-for-linus git tree from:

git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip.git sched-v28-for-linus

Thanks,

Ingo

------------------>
Amit K. Arora (1):
sched: minor optimizations in wake_affine and select_task_rq_fair

Andrew Morton (1):
sched: clarify ifdef tangle

Bharata B Rao (2):
sched: call resched_task() conditionally from new task wake up path
sched: maintain only task entities in cfs_rq->tasks list

Chris Friesen (1):
sched: fix list traversal to use _rcu variant

Claudio Scordino (1):
sched: new documentation about CFS

Dario Faggioli (1):
sched_rt.c: resch needed in rt_rq_enqueue() for the root rt_rq

Frederic Weisbecker (1):
cpusets: scan_for_empty_cpusets(), cpuset doesn't seem to be so const

Gautham R Shenoy (1):
sched: fix __load_balance_iterator() for cfq with only one task

Ingo Molnar (4):
sched: clean up __might_sleep()
sched: extract walk_tg_tree(), fix
sched: turn off WAKEUP_OVERLAP
sched debug: add name to sched_domain sysctl entries

Joe Korty (1):
make might_sleep() display the oopsing process

Kevin Diggs (1):
sched: add kernel doc for the completion, fix kernel-doc-nano-HOWTO.txt

Krzysztof Helt (1):
sched: compilation fix with gcc 3.4.6

Li Zefan (1):
sched: remove redundant code in cpu_cgroup_create()

Manfred Spraul (2):
kernel/cpu.c: Move the CPU_DYING notifiers kernel/cpu.c: create a CPU_STARTING cpu_chain notifier

Martin Steigerwald (1):
CFS scheduler: documentation about scheduling policies

Oleg Nesterov (3):

      sched: do_wait_for_common: use signal_pending_state()
      wait_task_inactive(): don't consider task->nivcsw
      wait_task_inactive: "improve" the returned value for ->nvcsw == 0

Peter Zijlstra (12):
sched: rt-bandwidth for user grouping interface
sched: rt-bandwidth accounting fix
sched: rt-bandwidth group disable fixes
sched: extract walk_tg_tree()
sched: rt-bandwidth fixes
sched: wakeup preempt when small overlap
sched: rework wakeup preemption
sched: fixlet for group load balance
sched: add some comments to the bandwidth code
sched: more sanity checks on the bandwidth settings
sched: fixup buddy selection
sched: sync wakeups vs avg_overlap

Richard Kennedy (3):
sched: reorder signal_struct to remove 8 bytes on 64 bit builds
sched: reorder struct sched_rt_entity to remove padding on 64 bit builds reorder struct prop_local_single to remove padding on 64 bit builds

 Documentation/kernel-doc-nano-HOWTO.txt      |    4 +-
 Documentation/scheduler/sched-design-CFS.txt |  395 ++++++++++++++++----------
 arch/alpha/kernel/smp.c                      |    3 +
 arch/arm/kernel/smp.c                        |    1 +
 arch/cris/arch-v32/kernel/smp.c              |    1 +
 arch/ia64/kernel/smpboot.c                   |    1 +
 arch/m32r/kernel/smpboot.c                   |    2 +
 arch/mips/kernel/smp.c                       |    2 +
 arch/powerpc/kernel/smp.c                    |    1 +
 arch/s390/kernel/smp.c                       |    2 +
 arch/sh/kernel/smp.c                         |    2 +
 arch/sparc/kernel/sun4d_smp.c                |    1 +
 arch/sparc/kernel/sun4m_smp.c                |    2 +
 arch/um/kernel/smp.c                         |    1 +
 arch/x86/kernel/smpboot.c                    |    1 +
 arch/x86/mach-voyager/voyager_smp.c          |    2 +
 include/linux/completion.h                   |   41 +++
 include/linux/cpu.h                          |    1 +
 include/linux/notifier.h                     |   10 +-
 include/linux/proportions.h                  |    2 +-
 include/linux/sched.h                        |    9 +-
 kernel/cpu.c                                 |   24 ++-
 kernel/cpuset.c                              |    2 +-
 kernel/sched.c                               |  377 ++++++++++++++++---------
 kernel/sched_fair.c                          |  234 ++++------------
 kernel/sched_features.h                      |    1 +
 kernel/sched_idletask.c                      |    6 +-
 kernel/sched_rt.c                            |   57 ++++-
 kernel/user.c                                |    4 +-
 29 files changed, 702 insertions(+), 487 deletions(-)
Documentation/kernel-doc-nano-HOWTO.txt +2 -2
index 0bd3274..c6841ee 100644
@@ -168,10 +168,10 @@ if ($#ARGV < 0) {
 mkdir $ARGV[0],0777;
 $state = 0;
 while (<STDIN>) {
-    if (/^\.TH \"[^\"]*\" 4 \"([^\"]*)\"/) {
+    if (/^\.TH \"[^\"]*\" 9 \"([^\"]*)\"/) {
 	if ($state == 1) { close OUT }
 	$state = 1;
-	$fn = "$ARGV[0]/$1.4";
+	$fn = "$ARGV[0]/$1.9";
 	print STDERR "Creating $fn\n";
 	open OUT, ">$fn" or die "can't open $fn: $!\n";
 	print OUT $_;
Documentation/scheduler/sched-design-CFS.txt +242 -153

409 lines not on this page · raw message

arch/alpha/kernel/smp.c +3 -0
index 83df541..06b6fda 100644
@@ -149,6 +149,9 @@ smp_callin(void)
 	atomic_inc(&init_mm.mm_count);
 	current->active_mm = &init_mm;
 
+	/* inform the notifiers about the new cpu */
+	notify_cpu_starting(cpuid);
+
 	/* Must have completely accurate bogos.  */
 	local_irq_enable();
 
arch/arm/kernel/smp.c +1 -0
index e9842f6..e42a749 100644
@@ -277,6 +277,7 @@ asmlinkage void __cpuinit secondary_start_kernel(void)
 	/*
 	 * Enable local interrupts.
 	 */
+	notify_cpu_starting(cpu);
 	local_irq_enable();
 	local_fiq_enable();
 
arch/cris/arch-v32/kernel/smp.c +1 -0
index 952a24b..52e16c6 100644
@@ -178,6 +178,7 @@ void __init smp_callin(void)
 	unmask_irq(IPI_INTR_VECT);
 	unmask_irq(TIMER0_INTR_VECT);
 	preempt_disable();
+	notify_cpu_starting(cpu);
 	local_irq_enable();
 
 	cpu_set(cpu, cpu_online_map);
arch/ia64/kernel/smpboot.c +1 -0
index d8f05e5..1dcbb85 100644
@@ -401,6 +401,7 @@ smp_callin (void)
 	spin_lock(&vector_lock);
 	/* Setup the per cpu irq handling data structures */
 	__setup_vector_irq(cpuid);
+	notify_cpu_starting(cpuid);
 	cpu_set(cpuid, cpu_online_map);
 	per_cpu(cpu_state, cpuid) = CPU_ONLINE;
 	spin_unlock(&vector_lock);
arch/m32r/kernel/smpboot.c +2 -0
index 2c03ac1..fc29948 100644
@@ -498,6 +498,8 @@ static void __init smp_online(void)
 {
 	int cpu_id = smp_processor_id();
 
+	notify_cpu_starting(cpu_id);
+
 	local_irq_enable();
 
 	/* Get our bogomips. */
arch/mips/kernel/smp.c +2 -0
index 4410f17..7b59cfb 100644
@@ -121,6 +121,8 @@ asmlinkage __cpuinit void start_secondary(void)
 	cpu = smp_processor_id();
 	cpu_data[cpu].udelay_val = loops_per_jiffy;
 
+	notify_cpu_starting(cpu);
+
 	mp_ops->smp_finish();
 	set_cpu_sibling_map(cpu);
 
arch/powerpc/kernel/smp.c +1 -0
index 5337ca7..c27b10a 100644
@@ -453,6 +453,7 @@ int __devinit start_secondary(void *unused)
 	secondary_cpu_time_init();
 
 	ipi_call_lock();
+	notify_cpu_starting(cpu);
 	cpu_set(cpu, cpu_online_map);
 	/* Update sibling maps */
 	base = cpu_first_thread_in_core(cpu);
arch/s390/kernel/smp.c +2 -0
index 00b9b4d..9e8b1f9 100644
@@ -585,6 +585,8 @@ int __cpuinit start_secondary(void *cpuvoid)
 	/* Enable pfault pseudo page faults on this cpu. */
 	pfault_init();
 
+	/* call cpu notifiers */
+	notify_cpu_starting(smp_processor_id());
 	/* Mark this cpu as online */
 	spin_lock(&call_lock);
 	cpu_set(smp_processor_id(), cpu_online_map);
arch/sh/kernel/smp.c +2 -0
index 60c5084..001778f 100644
@@ -82,6 +82,8 @@ asmlinkage void __cpuinit start_secondary(void)
 
 	preempt_disable();
 
+	notify_cpu_starting(smp_processor_id());
+
 	local_irq_enable();
 
 	calibrate_delay();
arch/sparc/kernel/sun4d_smp.c +1 -0
index 6959640..446767e 100644
@@ -88,6 +88,7 @@ void __init smp4d_callin(void)
 	local_flush_cache_all();
 	local_flush_tlb_all();
 
+	notify_cpu_starting(cpuid);
 	/*
 	 * Unblock the master CPU _only_ when the scheduler state
 	 * of all secondary CPUs will be up-to-date, so after
arch/sparc/kernel/sun4m_smp.c +2 -0
index a14a76a..9964890 100644
@@ -71,6 +71,8 @@ void __cpuinit smp4m_callin(void)
 	local_flush_cache_all();
 	local_flush_tlb_all();
 
+	notify_cpu_starting(cpuid);
+
 	/* Get our local ticker going. */
 	smp_setup_percpu_timer();
 
arch/um/kernel/smp.c +1 -0
index be2d50c..0457721 100644
@@ -85,6 +85,7 @@ static int idle_proc(void *cpup)
 	while (!cpu_isset(cpu, smp_commenced_mask))
 		cpu_relax();
 
+	notify_cpu_starting(cpu);
 	cpu_set(cpu, cpu_online_map);
 	default_idle();
 	return 0;
arch/x86/kernel/smpboot.c +1 -0
index 7985c5b..0b8261c 100644
@@ -257,6 +257,7 @@ static void __cpuinit smp_callin(void)
 	end_local_APIC_setup();
 	map_cpu_to_logical_apicid();
 
+	notify_cpu_starting(cpuid);
 	/*
 	 * Get our bogomips.
 	 *
arch/x86/mach-voyager/voyager_smp.c +2 -0
index ee0fba0..199a5f4 100644
@@ -448,6 +448,8 @@ static void __init start_secondary(void *unused)
 
 	VDEBUG(("VOYAGER SMP: CPU%d, stack at about %p\n", cpuid, &cpuid));
 
+	notify_cpu_starting(cpuid);
+
 	/* enable interrupts */
 	local_irq_enable();
 
include/linux/completion.h +41 -0

71 lines not on this page · raw message

include/linux/cpu.h +1 -0
index d7faf88..c2747ac 100644
@@ -69,6 +69,7 @@ static inline void unregister_cpu_notifier(struct notifier_block *nb)
 #endif
 
 int cpu_up(unsigned int cpu);
+void notify_cpu_starting(unsigned int cpu);
 extern void cpu_hotplug_init(void);
 extern void cpu_maps_update_begin(void);
 extern void cpu_maps_update_done(void);
include/linux/notifier.h +9 -1
index da2698b..b86fa2f 100644
@@ -213,9 +213,16 @@ static inline int notifier_to_errno(int ret)
 #define CPU_DOWN_FAILED		0x0006 /* CPU (unsigned)v NOT going down */
 #define CPU_DEAD		0x0007 /* CPU (unsigned)v dead */
 #define CPU_DYING		0x0008 /* CPU (unsigned)v not running any task,
-				        * not handling interrupts, soon dead */
+					* not handling interrupts, soon dead.
+					* Called on the dying cpu, interrupts
+					* are already disabled. Must not
+					* sleep, must not fail */
 #define CPU_POST_DEAD		0x0009 /* CPU (unsigned)v dead, cpu_hotplug
 					* lock is dropped */
+#define CPU_STARTING		0x000A /* CPU (unsigned)v soon running.
+					* Called on the new cpu, just before
+					* enabling interrupts. Must not sleep,
+					* must not fail */
 
 /* Used for CPU hotplug events occuring while tasks are frozen due to a suspend
  * operation in progress
@@ -229,6 +236,7 @@ static inline int notifier_to_errno(int ret)
 #define CPU_DOWN_FAILED_FROZEN	(CPU_DOWN_FAILED | CPU_TASKS_FROZEN)
 #define CPU_DEAD_FROZEN		(CPU_DEAD | CPU_TASKS_FROZEN)
 #define CPU_DYING_FROZEN	(CPU_DYING | CPU_TASKS_FROZEN)
+#define CPU_STARTING_FROZEN	(CPU_STARTING | CPU_TASKS_FROZEN)
 
 /* Hibernation and suspend events */
 #define PM_HIBERNATION_PREPARE	0x0001 /* Going to hibernate */
include/linux/proportions.h +1 -1
index 5afc1b2..cf793bb 100644
@@ -104,8 +104,8 @@ struct prop_local_single {
 	 * snapshot of the last seen global state
 	 * and a lock protecting this state
 	 */
-	int shift;
 	unsigned long period;
+	int shift;
 	spinlock_t lock;		/* protect the snapshot state */
 };
 
include/linux/sched.h +6 -3
index 3d9120c..5d0819e 100644
@@ -451,8 +451,8 @@ struct signal_struct {
 	 * - everyone except group_exit_task is stopped during signal delivery
 	 *   of fatal signals, group_exit_task processes the signal.
 	 */
-	struct task_struct	*group_exit_task;
 	int			notify_count;
+	struct task_struct	*group_exit_task;
 
 	/* thread group stop support, overloads group_exit_code too */
 	int			group_stop_count;
@@ -824,6 +824,9 @@ struct sched_domain {
 	unsigned int ttwu_move_affine;
 	unsigned int ttwu_move_balance;
 #endif
+#ifdef CONFIG_SCHED_DEBUG
+	char *name;
+#endif
 };
 
 extern void partition_sched_domains(int ndoms_new, cpumask_t *doms_new,
@@ -897,7 +900,7 @@ struct sched_class {
 	void (*yield_task) (struct rq *rq);
 	int  (*select_task_rq)(struct task_struct *p, int sync);
 
-	void (*check_preempt_curr) (struct rq *rq, struct task_struct *p);
+	void (*check_preempt_curr) (struct rq *rq, struct task_struct *p, int sync);
 
 	struct task_struct * (*pick_next_task) (struct rq *rq);
 	void (*put_prev_task) (struct rq *rq, struct task_struct *p);
@@ -1010,8 +1013,8 @@ struct sched_entity {
 
 struct sched_rt_entity {
 	struct list_head run_list;
-	unsigned int time_slice;
 	unsigned long timeout;
+	unsigned int time_slice;
 	int nr_cpus_allowed;
 
 	struct sched_rt_entity *back;
kernel/cpu.c +22 -2
index f17e985..86d4904 100644
@@ -199,13 +199,14 @@ static int __ref take_cpu_down(void *_param)
 	struct take_cpu_down_param *param = _param;
 	int err;
 
-	raw_notifier_call_chain(&cpu_chain, CPU_DYING | param->mod,
-				param->hcpu);
 	/* Ensure this CPU doesn't handle any more interrupts. */
 	err = __cpu_disable();
 	if (err < 0)
 		return err;
 
+	raw_notifier_call_chain(&cpu_chain, CPU_DYING | param->mod,
+				param->hcpu);
+
 	/* Force idle task to run as soon as we yield: it should
 	   immediately notice cpu is offline and die quickly. */
 	sched_idle_next();
@@ -453,6 +454,25 @@ out:
 }
 #endif /* CONFIG_PM_SLEEP_SMP */
 
+/**
+ * notify_cpu_starting(cpu) - call the CPU_STARTING notifiers
+ * @cpu: cpu that just started
+ *
+ * This function calls the cpu_chain notifiers with CPU_STARTING.
+ * It must be called by the arch code on the new cpu, before the new cpu
+ * enables interrupts and before the "boot" cpu returns from __cpu_up().
+ */
+void notify_cpu_starting(unsigned int cpu)
+{
+	unsigned long val = CPU_STARTING;
+
+#ifdef CONFIG_PM_SLEEP_SMP
+	if (cpu_isset(cpu, frozen_cpus))
+		val = CPU_STARTING_FROZEN;
+#endif /* CONFIG_PM_SLEEP_SMP */
+	raw_notifier_call_chain(&cpu_chain, val, (void *)(long)cpu);
+}
+
 #endif /* CONFIG_SMP */
 
 /*
kernel/cpuset.c +1 -1
index 827cd9a..eab7bd6 100644
@@ -1921,7 +1921,7 @@ static void remove_tasks_in_empty_cpuset(struct cpuset *cs)
  * that has tasks along with an empty 'mems'.  But if we did see such
  * a cpuset, we'd handle it just like we do if its 'cpus' was empty.
  */
-static void scan_for_empty_cpusets(const struct cpuset *root)
+static void scan_for_empty_cpusets(struct cpuset *root)
 {
 	LIST_HEAD(queue);
 	struct cpuset *cp;	/* scans cpusets being updated */
kernel/sched.c +240 -137

664 lines not on this page · raw message

kernel/sched_fair.c +58 -176

393 lines not on this page · raw message

kernel/sched_features.h +1 -0
index 9353ca7..7c9e8f4 100644
@@ -11,3 +11,4 @@ SCHED_FEAT(ASYM_GRAN, 1)
 SCHED_FEAT(LB_BIAS, 1)
 SCHED_FEAT(LB_WAKEUP_UPDATE, 1)
 SCHED_FEAT(ASYM_EFF_LOAD, 1)
+SCHED_FEAT(WAKEUP_OVERLAP, 0)
kernel/sched_idletask.c +3 -3
index 3a4f92d..dec4cca 100644
@@ -14,7 +14,7 @@ static int select_task_rq_idle(struct task_struct *p, int sync)
 /*
  * Idle tasks are unconditionally rescheduled:
  */
-static void check_preempt_curr_idle(struct rq *rq, struct task_struct *p)
+static void check_preempt_curr_idle(struct rq *rq, struct task_struct *p, int sync)
 {
 	resched_task(rq->idle);
 }
@@ -76,7 +76,7 @@ static void switched_to_idle(struct rq *rq, struct task_struct *p,
 	if (running)
 		resched_task(rq->curr);
 	else
-		check_preempt_curr(rq, p);
+		check_preempt_curr(rq, p, 0);
 }
 
 static void prio_changed_idle(struct rq *rq, struct task_struct *p,
@@ -93,7 +93,7 @@ static void prio_changed_idle(struct rq *rq, struct task_struct *p,
 		if (p->prio > oldprio)
 			resched_task(rq->curr);
 	} else
-		check_preempt_curr(rq, p);
+		check_preempt_curr(rq, p, 0);
 }
 
 /*
kernel/sched_rt.c +51 -6

135 lines not on this page · raw message

kernel/user.c +2 -2
index 865ecf5..39d6159 100644
@@ -169,7 +169,7 @@ static ssize_t cpu_rt_runtime_show(struct kobject *kobj,
 {
 	struct user_struct *up = container_of(kobj, struct user_struct, kobj);
 
-	return sprintf(buf, "%lu\n", sched_group_rt_runtime(up->tg));
+	return sprintf(buf, "%ld\n", sched_group_rt_runtime(up->tg));
 }
 
 static ssize_t cpu_rt_runtime_store(struct kobject *kobj,
@@ -180,7 +180,7 @@ static ssize_t cpu_rt_runtime_store(struct kobject *kobj,
 	unsigned long rt_runtime;
 	int rc;
 
-	sscanf(buf, "%lu", &rt_runtime);
+	sscanf(buf, "%ld", &rt_runtime);
 
 	rc = sched_group_set_rt_runtime(up->tg, rt_runtime);