]> git.karo-electronics.de Git - linux-beck.git/commitdiff
Merge branch 'linus' into timers/core
authorIngo Molnar <mingo@kernel.org>
Sun, 12 Jan 2014 13:12:44 +0000 (14:12 +0100)
committerIngo Molnar <mingo@kernel.org>
Sun, 12 Jan 2014 13:12:44 +0000 (14:12 +0100)
Pick up the latest fixes and refresh the branch.

Signed-off-by: Ingo Molnar <mingo@kernel.org>
1  2 
init/Kconfig
kernel/time/tick-sched.c

diff --combined init/Kconfig
index 12d61f82e5f7eb0c345d9d53326eaa8f73b51f82,4e5d96ab2034c25e2c1bb38d4ab9e619f8e04e86..5236dc562a362b84924e9147a385787621f765cd
@@@ -532,7 -532,7 +532,7 @@@ config CONTEXT_TRACKING_FORC
          dynticks subsystem by forcing the context tracking on all
          CPUs in the system.
  
 -        Say Y only if you're working on the developpement of an
 +        Say Y only if you're working on the development of an
          architecture backend for the context tracking.
  
          Say N otherwise, this option brings an overhead that you
@@@ -809,6 -809,12 +809,12 @@@ config GENERIC_SCHED_CLOC
  config ARCH_SUPPORTS_NUMA_BALANCING
        bool
  
+ #
+ # For architectures that know their GCC __int128 support is sound
+ #
+ config ARCH_SUPPORTS_INT128
+       bool
  # For architectures that (ab)use NUMA to represent different memory regions
  # all cpu-local but of different latencies, such as SuperH.
  #
diff --combined kernel/time/tick-sched.c
index 2afd43fca93bc8bd72f576a3b5f32904ba7b68e9,ea20f7d1ac2c4f91af4dd8dd4db3b01b5c6ae4b7..52cee12b3302d92817fedb0c1a245bc2bc91a549
@@@ -361,8 -361,8 +361,8 @@@ void __init tick_nohz_init(void
  /*
   * NO HZ enabled ?
   */
- int tick_nohz_enabled __read_mostly  = 1;
static int tick_nohz_enabled __read_mostly  = 1;
+ int tick_nohz_active  __read_mostly;
  /*
   * Enable / Disable tickless mode
   */
@@@ -391,9 -391,11 +391,9 @@@ __setup("nohz=", setup_tick_nohz)
   */
  static void tick_nohz_update_jiffies(ktime_t now)
  {
 -      int cpu = smp_processor_id();
 -      struct tick_sched *ts = &per_cpu(tick_cpu_sched, cpu);
        unsigned long flags;
  
 -      ts->idle_waketime = now;
 +      __this_cpu_write(tick_cpu_sched.idle_waketime, now);
  
        local_irq_save(flags);
        tick_do_update_jiffies64(now);
@@@ -424,15 -426,17 +424,15 @@@ update_ts_time_stats(int cpu, struct ti
  
  }
  
 -static void tick_nohz_stop_idle(int cpu, ktime_t now)
 +static void tick_nohz_stop_idle(struct tick_sched *ts, ktime_t now)
  {
 -      struct tick_sched *ts = &per_cpu(tick_cpu_sched, cpu);
 -
 -      update_ts_time_stats(cpu, ts, now, NULL);
 +      update_ts_time_stats(smp_processor_id(), ts, now, NULL);
        ts->idle_active = 0;
  
        sched_clock_idle_wakeup_event(0);
  }
  
 -static ktime_t tick_nohz_start_idle(int cpu, struct tick_sched *ts)
 +static ktime_t tick_nohz_start_idle(struct tick_sched *ts)
  {
        ktime_t now = ktime_get();
  
@@@ -461,7 -465,7 +461,7 @@@ u64 get_cpu_idle_time_us(int cpu, u64 *
        struct tick_sched *ts = &per_cpu(tick_cpu_sched, cpu);
        ktime_t now, idle;
  
-       if (!tick_nohz_enabled)
+       if (!tick_nohz_active)
                return -1;
  
        now = ktime_get();
@@@ -502,7 -506,7 +502,7 @@@ u64 get_cpu_iowait_time_us(int cpu, u6
        struct tick_sched *ts = &per_cpu(tick_cpu_sched, cpu);
        ktime_t now, iowait;
  
-       if (!tick_nohz_enabled)
+       if (!tick_nohz_active)
                return -1;
  
        now = ktime_get();
@@@ -707,8 -711,10 +707,10 @@@ static bool can_stop_idle_tick(int cpu
                return false;
        }
  
-       if (unlikely(ts->nohz_mode == NOHZ_MODE_INACTIVE))
+       if (unlikely(ts->nohz_mode == NOHZ_MODE_INACTIVE)) {
+               ts->sleep_length = (ktime_t) { .tv64 = NSEC_PER_SEC/HZ };
                return false;
+       }
  
        if (need_resched())
                return false;
@@@ -748,7 -754,7 +750,7 @@@ static void __tick_nohz_idle_enter(stru
        ktime_t now, expires;
        int cpu = smp_processor_id();
  
 -      now = tick_nohz_start_idle(cpu, ts);
 +      now = tick_nohz_start_idle(ts);
  
        if (can_stop_idle_tick(cpu, ts)) {
                int was_stopped = ts->tick_stopped;
@@@ -795,11 -801,6 +797,6 @@@ void tick_nohz_idle_enter(void
        local_irq_disable();
  
        ts = &__get_cpu_var(tick_cpu_sched);
-       /*
-        * set ts->inidle unconditionally. even if the system did not
-        * switch to nohz mode the cpu frequency governers rely on the
-        * update of the idle time accounting in tick_nohz_start_idle().
-        */
        ts->inidle = 1;
        __tick_nohz_idle_enter(ts);
  
@@@ -910,7 -911,8 +907,7 @@@ static void tick_nohz_account_idle_tick
   */
  void tick_nohz_idle_exit(void)
  {
 -      int cpu = smp_processor_id();
 -      struct tick_sched *ts = &per_cpu(tick_cpu_sched, cpu);
 +      struct tick_sched *ts = &__get_cpu_var(tick_cpu_sched);
        ktime_t now;
  
        local_irq_disable();
                now = ktime_get();
  
        if (ts->idle_active)
 -              tick_nohz_stop_idle(cpu, now);
 +              tick_nohz_stop_idle(ts, now);
  
        if (ts->tick_stopped) {
                tick_nohz_restart_sched_tick(ts, now);
@@@ -968,7 -970,7 +965,7 @@@ static void tick_nohz_switch_to_nohz(vo
        struct tick_sched *ts = &__get_cpu_var(tick_cpu_sched);
        ktime_t next;
  
-       if (!tick_nohz_enabled)
+       if (!tick_nohz_active)
                return;
  
        local_irq_disable();
                local_irq_enable();
                return;
        }
+       tick_nohz_active = 1;
        ts->nohz_mode = NOHZ_MODE_LOWRES;
  
        /*
   * timer and do not touch the other magic bits which need to be done
   * when idle is left.
   */
 -static void tick_nohz_kick_tick(int cpu, ktime_t now)
 +static void tick_nohz_kick_tick(struct tick_sched *ts, ktime_t now)
  {
  #if 0
        /* Switch back to 2.6.27 behaviour */
 -
 -      struct tick_sched *ts = &per_cpu(tick_cpu_sched, cpu);
        ktime_t delta;
  
        /*
  #endif
  }
  
 -static inline void tick_check_nohz(int cpu)
 +static inline void tick_check_nohz_this_cpu(void)
  {
 -      struct tick_sched *ts = &per_cpu(tick_cpu_sched, cpu);
 +      struct tick_sched *ts = &__get_cpu_var(tick_cpu_sched);
        ktime_t now;
  
        if (!ts->idle_active && !ts->tick_stopped)
                return;
        now = ktime_get();
        if (ts->idle_active)
 -              tick_nohz_stop_idle(cpu, now);
 +              tick_nohz_stop_idle(ts, now);
        if (ts->tick_stopped) {
                tick_nohz_update_jiffies(now);
 -              tick_nohz_kick_tick(cpu, now);
 +              tick_nohz_kick_tick(ts, now);
        }
  }
  
  #else
  
  static inline void tick_nohz_switch_to_nohz(void) { }
 -static inline void tick_check_nohz(int cpu) { }
 +static inline void tick_check_nohz_this_cpu(void) { }
  
  #endif /* CONFIG_NO_HZ_COMMON */
  
  /*
   * Called from irq_enter to notify about the possible interruption of idle()
   */
 -void tick_check_idle(int cpu)
 +void tick_check_idle(void)
  {
 -      tick_check_oneshot_broadcast(cpu);
 -      tick_check_nohz(cpu);
 +      tick_check_oneshot_broadcast_this_cpu();
 +      tick_check_nohz_this_cpu();
  }
  
  /*
@@@ -1132,8 -1136,10 +1129,10 @@@ void tick_setup_sched_timer(void
        }
  
  #ifdef CONFIG_NO_HZ_COMMON
-       if (tick_nohz_enabled)
+       if (tick_nohz_enabled) {
                ts->nohz_mode = NOHZ_MODE_HIGHRES;
+               tick_nohz_active = 1;
+       }
  #endif
  }
  #endif /* HIGH_RES_TIMERS */