···294294 */295295extern unsigned int jiffies_to_msecs(const unsigned long j);296296extern unsigned int jiffies_to_usecs(const unsigned long j);297297+298298+static inline u64 jiffies_to_nsecs(const unsigned long j)299299+{300300+ return (u64)jiffies_to_usecs(j) * NSEC_PER_USEC;301301+}302302+297303extern unsigned long msecs_to_jiffies(const unsigned int m);298304extern unsigned long usecs_to_jiffies(const unsigned int u);299305extern unsigned long timespec_to_jiffies(const struct timespec *value);
···326326 * here, as softirq will be serviced on return from interrupt.327327 */328328 local_bh_disable();329329- tick_check_idle();329329+ tick_irq_enter();330330 _local_bh_enable();331331 }332332
+14-13
kernel/time/tick-sched.c
···533533 struct clock_event_device *dev = __get_cpu_var(tick_cpu_device).evtdev;534534 u64 time_delta;535535536536+ time_delta = timekeeping_max_deferment();537537+536538 /* Read jiffies and the time when jiffies were updated last */537539 do {538540 seq = read_seqbegin(&jiffies_lock);539541 last_update = last_jiffies_update;540542 last_jiffies = jiffies;541541- time_delta = timekeeping_max_deferment();542543 } while (read_seqretry(&jiffies_lock, seq));543544544545 if (rcu_needs_cpu(cpu, &rcu_delta_jiffies) ||···679678static void tick_nohz_full_stop_tick(struct tick_sched *ts)680679{681680#ifdef CONFIG_NO_HZ_FULL682682- int cpu = smp_processor_id();681681+ int cpu = smp_processor_id();683682684684- if (!tick_nohz_full_cpu(cpu) || is_idle_task(current))685685- return;683683+ if (!tick_nohz_full_cpu(cpu) || is_idle_task(current))684684+ return;686685687687- if (!ts->tick_stopped && ts->nohz_mode == NOHZ_MODE_INACTIVE)688688- return;686686+ if (!ts->tick_stopped && ts->nohz_mode == NOHZ_MODE_INACTIVE)687687+ return;689688690690- if (!can_stop_full_tick())691691- return;689689+ if (!can_stop_full_tick())690690+ return;692691693693- tick_nohz_stop_sched_tick(ts, ktime_get(), cpu);692692+ tick_nohz_stop_sched_tick(ts, ktime_get(), cpu);694693#endif695694}696695···10241023#endif10251024}1026102510271027-static inline void tick_check_nohz_this_cpu(void)10261026+static inline void tick_nohz_irq_enter(void)10281027{10291028 struct tick_sched *ts = &__get_cpu_var(tick_cpu_sched);10301029 ktime_t now;···10431042#else1044104310451044static inline void tick_nohz_switch_to_nohz(void) { }10461046-static inline void tick_check_nohz_this_cpu(void) { }10451045+static inline void tick_nohz_irq_enter(void) { }1047104610481047#endif /* CONFIG_NO_HZ_COMMON */1049104810501049/*10511050 * Called from irq_enter to notify about the possible interruption of idle()10521051 */10531053-void tick_check_idle(void)10521052+void tick_irq_enter(void)10541053{10551054 tick_check_oneshot_broadcast_this_cpu();10561056- tick_check_nohz_this_cpu();10551055+ tick_nohz_irq_enter();10571056}1058105710591058/*