]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
manual merge of sched/core
authorIngo Molnar <mingo@kernel.org>
Tue, 19 Feb 2013 07:45:35 +0000 (08:45 +0100)
committerIngo Molnar <mingo@kernel.org>
Tue, 19 Feb 2013 07:45:35 +0000 (08:45 +0100)
Signed-off-by: Ingo Molnar <mingo@kernel.org>
13 files changed:
1  2 
arch/powerpc/kernel/entry_64.S
arch/powerpc/kernel/time.c
include/linux/hardirq.h
init/Kconfig
kernel/context_tracking.c
kernel/irq/manage.c
kernel/sched/fair.c
kernel/sched/rt.c
kernel/time/tick-sched.c
kernel/timer.c
kernel/trace/trace.c
mm/mmap.c
mm/page_alloc.c

Simple merge
Simple merge
Simple merge
diff --cc init/Kconfig
Simple merge
index d566aba7e801e1559db28220d63245e7f05aac18,74f68f4dc6c20ef9c660ae344f97497821208dfa..2071a46472cdb27eb5a601ae426a95c7d821a38d
@@@ -1,40 -1,11 +1,27 @@@
 +/*
 + * Context tracking: Probe on high level context boundaries such as kernel
 + * and userspace. This includes syscalls and exceptions entry/exit.
 + *
 + * This is used by RCU to remove its dependency on the timer tick while a CPU
 + * runs in userspace.
 + *
 + *  Started by Frederic Weisbecker:
 + *
 + * Copyright (C) 2012 Red Hat, Inc., Frederic Weisbecker <fweisbec@redhat.com>
 + *
 + * Many thanks to Gilad Ben-Yossef, Paul McKenney, Ingo Molnar, Andrew Morton,
 + * Steven Rostedt, Peter Zijlstra for suggestions and improvements.
 + *
 + */
 +
  #include <linux/context_tracking.h>
+ #include <linux/kvm_host.h>
  #include <linux/rcupdate.h>
  #include <linux/sched.h>
- #include <linux/percpu.h>
  #include <linux/hardirq.h>
+ #include <linux/export.h>
  
- struct context_tracking {
-       /*
-        * When active is false, probes are unset in order
-        * to minimize overhead: TIF flags are cleared
-        * and calls to user_enter/exit are ignored. This
-        * may be further optimized using static keys.
-        */
-       bool active;
-       enum {
-               IN_KERNEL = 0,
-               IN_USER,
-       } state;
- };
- static DEFINE_PER_CPU(struct context_tracking, context_tracking) = {
+ DEFINE_PER_CPU(struct context_tracking, context_tracking) = {
  #ifdef CONFIG_CONTEXT_TRACKING_FORCE
        .active = true,
  #endif
@@@ -70,15 -31,9 +57,16 @@@ void user_enter(void
        local_irq_save(flags);
        if (__this_cpu_read(context_tracking.active) &&
            __this_cpu_read(context_tracking.state) != IN_USER) {
-               __this_cpu_write(context_tracking.state, IN_USER);
 +              /*
 +               * At this stage, only low level arch entry code remains and
 +               * then we'll run in userspace. We can assume there won't be
 +               * any RCU read-side critical section until the next call to
 +               * user_exit() or rcu_irq_enter(). Let's remove RCU's dependency
 +               * on the tick.
 +               */
+               vtime_user_enter(current);
                rcu_user_enter();
+               __this_cpu_write(context_tracking.state, IN_USER);
        }
        local_irq_restore(flags);
  }
@@@ -104,30 -55,31 +92,49 @@@ void user_exit(void
  
        local_irq_save(flags);
        if (__this_cpu_read(context_tracking.state) == IN_USER) {
-               __this_cpu_write(context_tracking.state, IN_KERNEL);
 +              /*
 +               * We are going to run code that may use RCU. Inform
 +               * RCU core about that (ie: we may need the tick again).
 +               */
                rcu_user_exit();
+               vtime_user_exit(current);
+               __this_cpu_write(context_tracking.state, IN_KERNEL);
        }
        local_irq_restore(flags);
  }
  
 +
 +/**
 + * context_tracking_task_switch - context switch the syscall callbacks
 + * @prev: the task that is being switched out
 + * @next: the task that is being switched in
 + *
 + * The context tracking uses the syscall slow path to implement its user-kernel
 + * boundaries probes on syscalls. This way it doesn't impact the syscall fast
 + * path on CPUs that don't do context tracking.
 + *
 + * But we need to clear the flag on the previous task because it may later
 + * migrate to some CPU that doesn't do the context tracking. As such the TIF
 + * flag may not be desired there.
 + */
+ void guest_enter(void)
+ {
+       if (vtime_accounting_enabled())
+               vtime_guest_enter(current);
+       else
+               __guest_enter();
+ }
+ EXPORT_SYMBOL_GPL(guest_enter);
+ void guest_exit(void)
+ {
+       if (vtime_accounting_enabled())
+               vtime_guest_exit(current);
+       else
+               __guest_exit();
+ }
+ EXPORT_SYMBOL_GPL(guest_exit);
  void context_tracking_task_switch(struct task_struct *prev,
                             struct task_struct *next)
  {
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc kernel/timer.c
Simple merge
Simple merge
diff --cc mm/mmap.c
Simple merge
diff --cc mm/page_alloc.c
Simple merge