Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 680014d6 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 time(r) updates from Thomas Gleixner:
 "A small set of updates for timers and timekeeping:

   - The most interesting change is the consolidation of clock MONOTONIC
     and clock BOOTTIME.

     Clock MONOTONIC behaves now exactly like clock BOOTTIME and does
     not longer ignore the time spent in suspend. A new clock
     MONOTONIC_ACTIVE is provived which behaves like clock MONOTONIC in
     kernels before this change. This allows applications to
     programmatically check for the clock MONOTONIC behaviour.

     As discussed in the review thread, this has the potential of
     breaking user space and we might have to revert this. Knock on wood
     that we can avoid that exercise.

   - Updates to the NTP mechanism to improve accuracy

   - A new kernel internal data structure to aid the ongoing Y2038 work.

   - Cleanups and simplifications of the clocksource code.

   - Make the alarmtimer code play nicely with debugobjects"

* 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  alarmtimer: Init nanosleep alarm timer on stack
  y2038: Introduce struct __kernel_old_timeval
  tracing: Unify the "boot" and "mono" tracing clocks
  hrtimer: Unify MONOTONIC and BOOTTIME clock behavior
  posix-timers: Unify MONOTONIC and BOOTTIME clock behavior
  timekeeping: Remove boot time specific code
  Input: Evdev - unify MONOTONIC and BOOTTIME clock behavior
  timekeeping: Make the MONOTONIC clock behave like the BOOTTIME clock
  timekeeping: Add the new CLOCK_MONOTONIC_ACTIVE clock
  timekeeping/ntp: Determine the multiplier directly from NTP tick length
  timekeeping/ntp: Don't align NTP frequency adjustments to ticks
  clocksource: Use ATTRIBUTE_GROUPS
  clocksource: Use DEVICE_ATTR_RW/RO/WO to define device attributes
  clocksource: Don't walk the clocksource list for empty override
parents 0c21fd6e bd031430
Loading
Loading
Loading
Loading
+7 −15
Original line number Diff line number Diff line
@@ -461,21 +461,13 @@ of ftrace. Here is a list of some of the key files:
		and ticks at the same rate as the hardware clocksource.

	boot:
		This is the boot clock (CLOCK_BOOTTIME) and is based on the
		fast monotonic clock, but also accounts for time spent in
		suspend. Since the clock access is designed for use in
		tracing in the suspend path, some side effects are possible
		if clock is accessed after the suspend time is accounted before
		the fast mono clock is updated. In this case, the clock update
		appears to happen slightly sooner than it normally would have.
		Also on 32-bit systems, it's possible that the 64-bit boot offset
		sees a partial update. These effects are rare and post
		processing should be able to handle them. See comments in the
		ktime_get_boot_fast_ns() function for more information.
		Same as mono. Used to be a separate clock which accounted
		for the time spent in suspend while CLOCK_MONOTONIC did
		not.

	To set a clock, simply echo the clock name into this file::

		  echo global > trace_clock
	  # echo global > trace_clock

  trace_marker:

+1 −6
Original line number Diff line number Diff line
@@ -31,7 +31,6 @@
enum evdev_clock_type {
	EV_CLK_REAL = 0,
	EV_CLK_MONO,
	EV_CLK_BOOT,
	EV_CLK_MAX
};

@@ -198,12 +197,10 @@ static int evdev_set_clk_type(struct evdev_client *client, unsigned int clkid)
	case CLOCK_REALTIME:
		clk_type = EV_CLK_REAL;
		break;
	case CLOCK_BOOTTIME:
	case CLOCK_MONOTONIC:
		clk_type = EV_CLK_MONO;
		break;
	case CLOCK_BOOTTIME:
		clk_type = EV_CLK_BOOT;
		break;
	default:
		return -EINVAL;
	}
@@ -314,8 +311,6 @@ static void evdev_events(struct input_handle *handle,

	ev_time[EV_CLK_MONO] = ktime_get();
	ev_time[EV_CLK_REAL] = ktime_mono_to_real(ev_time[EV_CLK_MONO]);
	ev_time[EV_CLK_BOOT] = ktime_mono_to_any(ev_time[EV_CLK_MONO],
						 TK_OFFS_BOOT);

	rcu_read_lock();

+0 −2
Original line number Diff line number Diff line
@@ -161,11 +161,9 @@ struct hrtimer_clock_base {
enum  hrtimer_base_type {
	HRTIMER_BASE_MONOTONIC,
	HRTIMER_BASE_REALTIME,
	HRTIMER_BASE_BOOTTIME,
	HRTIMER_BASE_TAI,
	HRTIMER_BASE_MONOTONIC_SOFT,
	HRTIMER_BASE_REALTIME_SOFT,
	HRTIMER_BASE_BOOTTIME_SOFT,
	HRTIMER_BASE_TAI_SOFT,
	HRTIMER_MAX_CLOCK_BASES,
};
+1 −0
Original line number Diff line number Diff line
@@ -217,5 +217,6 @@ static inline s64 timeval_to_ns(const struct timeval *tv)
 * Returns the timeval representation of the nsec parameter.
 */
extern struct timeval ns_to_timeval(const s64 nsec);
extern struct __kernel_old_timeval ns_to_kernel_old_timeval(s64 nsec);

#endif
+4 −0
Original line number Diff line number Diff line
@@ -52,6 +52,7 @@ struct tk_read_base {
 * @offs_real:		Offset clock monotonic -> clock realtime
 * @offs_boot:		Offset clock monotonic -> clock boottime
 * @offs_tai:		Offset clock monotonic -> clock tai
 * @time_suspended:	Accumulated suspend time
 * @tai_offset:		The current UTC to TAI offset in seconds
 * @clock_was_set_seq:	The sequence number of clock was set events
 * @cs_was_changed_seq:	The sequence number of clocksource change events
@@ -94,6 +95,7 @@ struct timekeeper {
	ktime_t			offs_real;
	ktime_t			offs_boot;
	ktime_t			offs_tai;
	ktime_t			time_suspended;
	s32			tai_offset;
	unsigned int		clock_was_set_seq;
	u8			cs_was_changed_seq;
@@ -117,6 +119,8 @@ struct timekeeper {
	s64			ntp_error;
	u32			ntp_error_shift;
	u32			ntp_err_mult;
	/* Flag used to avoid updating NTP twice with same second */
	u32			skip_second_overflow;
#ifdef CONFIG_DEBUG_TIMEKEEPING
	long			last_warning;
	/*
Loading