Commit b64c5fda authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull core timer changes from Ingo Molnar:
 "It contains continued generic-NOHZ work by Frederic and smaller
  cleanups."

* 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  time: Kill xtime_lock, replacing it with jiffies_lock
  clocksource: arm_generic: use this_cpu_ptr per-cpu helper
  clocksource: arm_generic: use integer math helpers
  time/jiffies: Make clocksource_jiffies static
  clocksource: clean up parse_pmtmr()
  tick: Correct the comments for tick_sched_timer()
  tick: Conditionally build nohz specific code in tick handler
  tick: Consolidate tick handling for high and low res handlers
  tick: Consolidate timekeeping handling code
parents f57d54ba 9c3f9e28
Loading
Loading
Loading
Loading
+8 −9
Original line number Diff line number Diff line
@@ -233,16 +233,15 @@ fs_initcall(init_acpi_pm_clocksource);
 */
static int __init parse_pmtmr(char *arg)
{
	unsigned long base;
	unsigned int base;
	int ret;

	if (strict_strtoul(arg, 16, &base))
		return -EINVAL;
#ifdef CONFIG_X86_64
	if (base > UINT_MAX)
		return -ERANGE;
#endif
	printk(KERN_INFO "PMTMR IOPort override: 0x%04x -> 0x%04lx\n",
	       pmtmr_ioport, base);
	ret = kstrtouint(arg, 16, &base);
	if (ret)
		return ret;

	pr_info("PMTMR IOPort override: 0x%04x -> 0x%04x\n", pmtmr_ioport,
		base);
	pmtmr_ioport = base;

	return 1;
+3 −3
Original line number Diff line number Diff line
@@ -127,7 +127,7 @@ static void __init arch_timer_calibrate(void)

	/* Cache the sched_clock multiplier to save a divide in the hot path. */

	sched_clock_mult = NSEC_PER_SEC / arch_timer_rate;
	sched_clock_mult = DIV_ROUND_CLOSEST(NSEC_PER_SEC, arch_timer_rate);

	pr_info("Architected local timer running at %u.%02uMHz.\n",
		 arch_timer_rate / 1000000, (arch_timer_rate / 10000) % 100);
@@ -221,10 +221,10 @@ int __init arm_generic_timer_init(void)
	clocksource_register_hz(&clocksource_counter, arch_timer_rate);

	/* Calibrate the delay loop directly */
	lpj_fine = arch_timer_rate / HZ;
	lpj_fine = DIV_ROUND_CLOSEST(arch_timer_rate, HZ);

	/* Immediately configure the timer on the boot CPU */
	arch_timer_setup(per_cpu_ptr(&arch_timer_evt, smp_processor_id()));
	arch_timer_setup(this_cpu_ptr(&arch_timer_evt));

	register_cpu_notifier(&arch_timer_cpu_nb);

+1 −1
Original line number Diff line number Diff line
@@ -35,7 +35,7 @@ static cycle_t i8253_read(struct clocksource *cs)

	raw_spin_lock_irqsave(&i8253_lock, flags);
	/*
	 * Although our caller may have the read side of xtime_lock,
	 * Although our caller may have the read side of jiffies_lock,
	 * this is now a seqlock, and we are cheating in this routine
	 * by having side effects on state that we cannot undo if
	 * there is a collision on the seqlock and our caller has to
+2 −1
Original line number Diff line number Diff line
@@ -70,11 +70,12 @@ extern int register_refined_jiffies(long clock_tick_rate);

/*
 * The 64-bit value is not atomic - you MUST NOT read it
 * without sampling the sequence number in xtime_lock.
 * without sampling the sequence number in jiffies_lock.
 * get_jiffies_64() will do this for you as appropriate.
 */
extern u64 __jiffy_data jiffies_64;
extern unsigned long volatile __jiffy_data jiffies;
extern seqlock_t jiffies_lock;

#if (BITS_PER_LONG < 64)
u64 get_jiffies_64(void);
+5 −3
Original line number Diff line number Diff line
@@ -58,7 +58,7 @@ static cycle_t jiffies_read(struct clocksource *cs)
	return (cycle_t) jiffies;
}

struct clocksource clocksource_jiffies = {
static struct clocksource clocksource_jiffies = {
	.name		= "jiffies",
	.rating		= 1, /* lowest valid rating*/
	.read		= jiffies_read,
@@ -67,6 +67,8 @@ struct clocksource clocksource_jiffies = {
	.shift		= JIFFIES_SHIFT,
};

__cacheline_aligned_in_smp DEFINE_SEQLOCK(jiffies_lock);

#if (BITS_PER_LONG < 64)
u64 get_jiffies_64(void)
{
@@ -74,9 +76,9 @@ u64 get_jiffies_64(void)
	u64 ret;

	do {
		seq = read_seqbegin(&xtime_lock);
		seq = read_seqbegin(&jiffies_lock);
		ret = jiffies_64;
	} while (read_seqretry(&xtime_lock, seq));
	} while (read_seqretry(&jiffies_lock, seq));
	return ret;
}
EXPORT_SYMBOL(get_jiffies_64);
Loading