aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorMarcelo Tosatti <mtosatti@redhat.com>2013-07-10 21:21:57 -0400
committerPaolo Bonzini <pbonzini@redhat.com>2013-07-18 06:29:30 -0400
commite04c5d76b0cfb66cadd900cf147526f2271884b8 (patch)
treea303b66c1fc1ae7786148d2f50e8b0b86290162b /kernel
parentb3897a49e22fc173efa77527a447c714f753f681 (diff)
remove sched notifier for cross-cpu migrations
Linux as a guest on KVM hypervisor, the only user of the pvclock vsyscall interface, does not require notification on task migration because: 1. cpu ID number maps 1:1 to per-CPU pvclock time info. 2. per-CPU pvclock time info is updated if the underlying CPU changes. 3. that version is increased whenever underlying CPU changes. Which is sufficient to guarantee nanoseconds counter is calculated properly. Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> Acked-by: Peter Zijlstra <peterz@infradead.org> Signed-off-by: Gleb Natapov <gleb@redhat.com>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/sched/core.c15
1 files changed, 0 insertions, 15 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 0d8eb4525e76..0efd2eefb027 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -976,13 +976,6 @@ void check_preempt_curr(struct rq *rq, struct task_struct *p, int flags)
976 rq->skip_clock_update = 1; 976 rq->skip_clock_update = 1;
977} 977}
978 978
979static ATOMIC_NOTIFIER_HEAD(task_migration_notifier);
980
981void register_task_migration_notifier(struct notifier_block *n)
982{
983 atomic_notifier_chain_register(&task_migration_notifier, n);
984}
985
986#ifdef CONFIG_SMP 979#ifdef CONFIG_SMP
987void set_task_cpu(struct task_struct *p, unsigned int new_cpu) 980void set_task_cpu(struct task_struct *p, unsigned int new_cpu)
988{ 981{
@@ -1013,18 +1006,10 @@ void set_task_cpu(struct task_struct *p, unsigned int new_cpu)
1013 trace_sched_migrate_task(p, new_cpu); 1006 trace_sched_migrate_task(p, new_cpu);
1014 1007
1015 if (task_cpu(p) != new_cpu) { 1008 if (task_cpu(p) != new_cpu) {
1016 struct task_migration_notifier tmn;
1017
1018 if (p->sched_class->migrate_task_rq) 1009 if (p->sched_class->migrate_task_rq)
1019 p->sched_class->migrate_task_rq(p, new_cpu); 1010 p->sched_class->migrate_task_rq(p, new_cpu);
1020 p->se.nr_migrations++; 1011 p->se.nr_migrations++;
1021 perf_sw_event(PERF_COUNT_SW_CPU_MIGRATIONS, 1, NULL, 0); 1012 perf_sw_event(PERF_COUNT_SW_CPU_MIGRATIONS, 1, NULL, 0);
1022
1023 tmn.task = p;
1024 tmn.from_cpu = task_cpu(p);
1025 tmn.to_cpu = new_cpu;
1026
1027 atomic_notifier_call_chain(&task_migration_notifier, 0, &tmn);
1028 } 1013 }
1029 1014
1030 __set_task_cpu(p, new_cpu); 1015 __set_task_cpu(p, new_cpu);