Merge tag 'ceph-for-4.8-rc1' of git://github.com/ceph/ceph-client
[deliverable/linux.git] / kernel / time / timer.c
index 8f29abeb8c4d5458cd518dfd8ef8800eeb4e8eac..555670a5143c61bed5e7015f4f13849240be37b9 100644 (file)
@@ -1804,7 +1804,7 @@ static void migrate_timer_list(struct timer_base *new_base, struct hlist_head *h
        }
 }
 
-static void migrate_timers(int cpu)
+int timers_dead_cpu(unsigned int cpu)
 {
        struct timer_base *old_base;
        struct timer_base *new_base;
@@ -1831,29 +1831,9 @@ static void migrate_timers(int cpu)
                spin_unlock_irq(&new_base->lock);
                put_cpu_ptr(&timer_bases);
        }
+       return 0;
 }
 
-static int timer_cpu_notify(struct notifier_block *self,
-                               unsigned long action, void *hcpu)
-{
-       switch (action) {
-       case CPU_DEAD:
-       case CPU_DEAD_FROZEN:
-               migrate_timers((long)hcpu);
-               break;
-       default:
-               break;
-       }
-
-       return NOTIFY_OK;
-}
-
-static inline void timer_register_cpu_notifier(void)
-{
-       cpu_notifier(timer_cpu_notify, 0);
-}
-#else
-static inline void timer_register_cpu_notifier(void) { }
 #endif /* CONFIG_HOTPLUG_CPU */
 
 static void __init init_timer_cpu(int cpu)
@@ -1881,7 +1861,6 @@ void __init init_timers(void)
 {
        init_timer_cpus();
        init_timer_stats();
-       timer_register_cpu_notifier();
        open_softirq(TIMER_SOFTIRQ, run_timer_softirq);
 }
 
@@ -1925,9 +1904,15 @@ static void __sched do_usleep_range(unsigned long min, unsigned long max)
 }
 
 /**
- * usleep_range - Drop in replacement for udelay where wakeup is flexible
+ * usleep_range - Sleep for an approximate time
  * @min: Minimum time in usecs to sleep
  * @max: Maximum time in usecs to sleep
+ *
+ * In non-atomic context where the exact wakeup time is flexible, use
+ * usleep_range() instead of udelay().  The sleep improves responsiveness
+ * by avoiding the CPU-hogging busy-wait of udelay(), and the range reduces
+ * power usage by allowing hrtimers to take advantage of an already-
+ * scheduled interrupt instead of scheduling a new one just for this sleep.
  */
 void __sched usleep_range(unsigned long min, unsigned long max)
 {
This page took 0.026068 seconds and 5 git commands to generate.