···294 */295extern unsigned int jiffies_to_msecs(const unsigned long j);296extern unsigned int jiffies_to_usecs(const unsigned long j);000000297extern unsigned long msecs_to_jiffies(const unsigned int m);298extern unsigned long usecs_to_jiffies(const unsigned int u);299extern unsigned long timespec_to_jiffies(const struct timespec *value);
···294 */295extern unsigned int jiffies_to_msecs(const unsigned long j);296extern unsigned int jiffies_to_usecs(const unsigned long j);297+298+static inline u64 jiffies_to_nsecs(const unsigned long j)299+{300+ return (u64)jiffies_to_usecs(j) * NSEC_PER_USEC;301+}302+303extern unsigned long msecs_to_jiffies(const unsigned int m);304extern unsigned long usecs_to_jiffies(const unsigned int u);305extern unsigned long timespec_to_jiffies(const struct timespec *value);
···2453 if (time_before_eq(next, now))2454 return 0;24552456+ return jiffies_to_nsecs(next - now);2457}2458#endif2459
+1-1
kernel/softirq.c
···326 * here, as softirq will be serviced on return from interrupt.327 */328 local_bh_disable();329- tick_check_idle();330 _local_bh_enable();331 }332
···326 * here, as softirq will be serviced on return from interrupt.327 */328 local_bh_disable();329+ tick_irq_enter();330 _local_bh_enable();331 }332
+14-13
kernel/time/tick-sched.c
···533 struct clock_event_device *dev = __get_cpu_var(tick_cpu_device).evtdev;534 u64 time_delta;53500536 /* Read jiffies and the time when jiffies were updated last */537 do {538 seq = read_seqbegin(&jiffies_lock);539 last_update = last_jiffies_update;540 last_jiffies = jiffies;541- time_delta = timekeeping_max_deferment();542 } while (read_seqretry(&jiffies_lock, seq));543544 if (rcu_needs_cpu(cpu, &rcu_delta_jiffies) ||···679static void tick_nohz_full_stop_tick(struct tick_sched *ts)680{681#ifdef CONFIG_NO_HZ_FULL682- int cpu = smp_processor_id();683684- if (!tick_nohz_full_cpu(cpu) || is_idle_task(current))685- return;686687- if (!ts->tick_stopped && ts->nohz_mode == NOHZ_MODE_INACTIVE)688- return;689690- if (!can_stop_full_tick())691- return;692693- tick_nohz_stop_sched_tick(ts, ktime_get(), cpu);694#endif695}696···1024#endif1025}10261027-static inline void tick_check_nohz_this_cpu(void)1028{1029 struct tick_sched *ts = &__get_cpu_var(tick_cpu_sched);1030 ktime_t now;···1043#else10441045static inline void tick_nohz_switch_to_nohz(void) { }1046-static inline void tick_check_nohz_this_cpu(void) { }10471048#endif /* CONFIG_NO_HZ_COMMON */10491050/*1051 * Called from irq_enter to notify about the possible interruption of idle()1052 */1053-void tick_check_idle(void)1054{1055 tick_check_oneshot_broadcast_this_cpu();1056- tick_check_nohz_this_cpu();1057}10581059/*
···533 struct clock_event_device *dev = __get_cpu_var(tick_cpu_device).evtdev;534 u64 time_delta;535536+ time_delta = timekeeping_max_deferment();537+538 /* Read jiffies and the time when jiffies were updated last */539 do {540 seq = read_seqbegin(&jiffies_lock);541 last_update = last_jiffies_update;542 last_jiffies = jiffies;0543 } while (read_seqretry(&jiffies_lock, seq));544545 if (rcu_needs_cpu(cpu, &rcu_delta_jiffies) ||···678static void tick_nohz_full_stop_tick(struct tick_sched *ts)679{680#ifdef CONFIG_NO_HZ_FULL681+ int cpu = smp_processor_id();682683+ if (!tick_nohz_full_cpu(cpu) || is_idle_task(current))684+ return;685686+ if (!ts->tick_stopped && ts->nohz_mode == NOHZ_MODE_INACTIVE)687+ return;688689+ if (!can_stop_full_tick())690+ return;691692+ tick_nohz_stop_sched_tick(ts, ktime_get(), cpu);693#endif694}695···1023#endif1024}10251026+static inline void tick_nohz_irq_enter(void)1027{1028 struct tick_sched *ts = &__get_cpu_var(tick_cpu_sched);1029 ktime_t now;···1042#else10431044static inline void tick_nohz_switch_to_nohz(void) { }1045+static inline void tick_nohz_irq_enter(void) { }10461047#endif /* CONFIG_NO_HZ_COMMON */10481049/*1050 * Called from irq_enter to notify about the possible interruption of idle()1051 */1052+void tick_irq_enter(void)1053{1054 tick_check_oneshot_broadcast_this_cpu();1055+ tick_nohz_irq_enter();1056}10571058/*