linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: tip-bot for Thomas Gleixner <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: viresh.kumar@linaro.org, preeti@linux.vnet.ibm.com,
	fweisbec@gmail.com, peterz@infradead.org, hpa@zytor.com,
	mtosatti@redhat.com, tglx@linutronix.de, mingo@kernel.org,
	linux-kernel@vger.kernel.org
Subject: [tip:timers/core] hrtimer: Get rid of hrtimer_get_res()
Date: Wed, 22 Apr 2015 12:05:56 -0700	[thread overview]
Message-ID: <tip-056a3cacbc46e5aca27b350ce4ecb3b33ebb0700@git.kernel.org> (raw)
In-Reply-To: <20150414203500.879888080@linutronix.de>

Commit-ID:  056a3cacbc46e5aca27b350ce4ecb3b33ebb0700
Gitweb:     http://git.kernel.org/tip/056a3cacbc46e5aca27b350ce4ecb3b33ebb0700
Author:     Thomas Gleixner <tglx@linutronix.de>
AuthorDate: Tue, 14 Apr 2015 21:08:32 +0000
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Wed, 22 Apr 2015 17:06:49 +0200

hrtimer: Get rid of hrtimer_get_res()

The resolution is directly accessible now. So its simpler just to fill
in the values of the timespec and be done with it.

Text size reduction (combined with "hrtimer: Get rid of the resolution
field in hrtimer_clock_base"):
       x8664 -61, i386 -221, ARM -60, power64 -48

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Cc: Preeti U Murthy <preeti@linux.vnet.ibm.com>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Marcelo Tosatti <mtosatti@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Link: http://lkml.kernel.org/r/20150414203500.879888080@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 include/linux/hrtimer.h    |  1 -
 kernel/time/alarmtimer.c   |  6 +++---
 kernel/time/hrtimer.c      | 16 ----------------
 kernel/time/posix-timers.c | 17 ++++++++++++-----
 4 files changed, 15 insertions(+), 25 deletions(-)

diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h
index bc6f91b..8025156 100644
--- a/include/linux/hrtimer.h
+++ b/include/linux/hrtimer.h
@@ -385,7 +385,6 @@ static inline int hrtimer_restart(struct hrtimer *timer)
 
 /* Query timers: */
 extern ktime_t hrtimer_get_remaining(const struct hrtimer *timer);
-extern int hrtimer_get_res(const clockid_t which_clock, struct timespec *tp);
 
 extern ktime_t hrtimer_get_next_event(void);
 
diff --git a/kernel/time/alarmtimer.c b/kernel/time/alarmtimer.c
index 1b001ed..0b55a75 100644
--- a/kernel/time/alarmtimer.c
+++ b/kernel/time/alarmtimer.c
@@ -495,12 +495,12 @@ static enum alarmtimer_restart alarm_handle_timer(struct alarm *alarm,
  */
 static int alarm_clock_getres(const clockid_t which_clock, struct timespec *tp)
 {
-	clockid_t baseid = alarm_bases[clock2alarm(which_clock)].base_clockid;
-
 	if (!alarmtimer_get_rtcdev())
 		return -EINVAL;
 
-	return hrtimer_get_res(baseid, tp);
+	tp->tv_sec = 0;
+	tp->tv_nsec = hrtimer_resolution;
+	return 0;
 }
 
 /**
diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c
index 965687a..73131da 100644
--- a/kernel/time/hrtimer.c
+++ b/kernel/time/hrtimer.c
@@ -1179,22 +1179,6 @@ void hrtimer_init(struct hrtimer *timer, clockid_t clock_id,
 }
 EXPORT_SYMBOL_GPL(hrtimer_init);
 
-/**
- * hrtimer_get_res - get the timer resolution for a clock
- * @which_clock: which clock to query
- * @tp:		 pointer to timespec variable to store the resolution
- *
- * Store the resolution of the clock selected by @which_clock in the
- * variable pointed to by @tp.
- */
-int hrtimer_get_res(const clockid_t which_clock, struct timespec *tp)
-{
-	tp->tv_sec = 0;
-	tp->tv_nsec = hrtimer_resolution;
-	return 0;
-}
-EXPORT_SYMBOL_GPL(hrtimer_get_res);
-
 static void __run_hrtimer(struct hrtimer *timer, ktime_t *now)
 {
 	struct hrtimer_clock_base *base = timer->base;
diff --git a/kernel/time/posix-timers.c b/kernel/time/posix-timers.c
index 31ea01f..31d11ac 100644
--- a/kernel/time/posix-timers.c
+++ b/kernel/time/posix-timers.c
@@ -272,13 +272,20 @@ static int posix_get_tai(clockid_t which_clock, struct timespec *tp)
 	return 0;
 }
 
+static int posix_get_hrtimer_res(clockid_t which_clock, struct timespec *tp)
+{
+	tp->tv_sec = 0;
+	tp->tv_nsec = hrtimer_resolution;
+	return 0;
+}
+
 /*
  * Initialize everything, well, just everything in Posix clocks/timers ;)
  */
 static __init int init_posix_timers(void)
 {
 	struct k_clock clock_realtime = {
-		.clock_getres	= hrtimer_get_res,
+		.clock_getres	= posix_get_hrtimer_res,
 		.clock_get	= posix_clock_realtime_get,
 		.clock_set	= posix_clock_realtime_set,
 		.clock_adj	= posix_clock_realtime_adj,
@@ -290,7 +297,7 @@ static __init int init_posix_timers(void)
 		.timer_del	= common_timer_del,
 	};
 	struct k_clock clock_monotonic = {
-		.clock_getres	= hrtimer_get_res,
+		.clock_getres	= posix_get_hrtimer_res,
 		.clock_get	= posix_ktime_get_ts,
 		.nsleep		= common_nsleep,
 		.nsleep_restart	= hrtimer_nanosleep_restart,
@@ -300,7 +307,7 @@ static __init int init_posix_timers(void)
 		.timer_del	= common_timer_del,
 	};
 	struct k_clock clock_monotonic_raw = {
-		.clock_getres	= hrtimer_get_res,
+		.clock_getres	= posix_get_hrtimer_res,
 		.clock_get	= posix_get_monotonic_raw,
 	};
 	struct k_clock clock_realtime_coarse = {
@@ -312,7 +319,7 @@ static __init int init_posix_timers(void)
 		.clock_get	= posix_get_monotonic_coarse,
 	};
 	struct k_clock clock_tai = {
-		.clock_getres	= hrtimer_get_res,
+		.clock_getres	= posix_get_hrtimer_res,
 		.clock_get	= posix_get_tai,
 		.nsleep		= common_nsleep,
 		.nsleep_restart	= hrtimer_nanosleep_restart,
@@ -322,7 +329,7 @@ static __init int init_posix_timers(void)
 		.timer_del	= common_timer_del,
 	};
 	struct k_clock clock_boottime = {
-		.clock_getres	= hrtimer_get_res,
+		.clock_getres	= posix_get_hrtimer_res,
 		.clock_get	= posix_get_boottime,
 		.nsleep		= common_nsleep,
 		.nsleep_restart	= hrtimer_nanosleep_restart,

  reply	other threads:[~2015-04-22 19:06 UTC|newest]

Thread overview: 123+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-14 21:08 [patch 00/39] hrtimer/tick: Optimizations, cleanups and solutions for various issues Thomas Gleixner
2015-04-14 21:08 ` [patch 01/39] hrtimer: Update active_bases before calling hrtimer_force_reprogram() Thomas Gleixner
2015-04-14 21:08 ` [patch 02/39] hrtimer: Get rid of the resolution field in hrtimer_clock_base Thomas Gleixner
2015-04-15  6:29   ` Frans Klaver
2015-04-15  6:32     ` Frans Klaver
2015-04-20  8:34   ` Preeti U Murthy
2015-04-22 19:05   ` [tip:timers/core] " tip-bot for Thomas Gleixner
2015-04-14 21:08 ` [patch 03/39] net: sched: Use hrtimer_resolution instead of hrtimer_get_res() Thomas Gleixner
2015-04-16 16:04   ` David Miller
2015-04-22 19:05   ` [tip:timers/core] " tip-bot for Thomas Gleixner
2015-04-14 21:08 ` [patch 04/39] sound: " Thomas Gleixner
2015-04-16  8:07   ` Takashi Iwai
2015-04-16  9:08     ` Thomas Gleixner
2015-04-22 19:05   ` [tip:timers/core] " tip-bot for Thomas Gleixner
2015-04-14 21:08 ` [patch 05/39] hrtimer: Get rid " Thomas Gleixner
2015-04-22 19:05   ` tip-bot for Thomas Gleixner [this message]
2015-04-14 21:08 ` [patch 06/39] hrtimer: Make the statistics fields smaller Thomas Gleixner
2015-04-22 19:06   ` [tip:timers/core] " tip-bot for Thomas Gleixner
2015-04-14 21:08 ` [patch 07/39] hrtimer: Get rid of softirq time Thomas Gleixner
2015-04-22 19:06   ` [tip:timers/core] " tip-bot for Thomas Gleixner
2015-04-14 21:08 ` [patch 08/39] hrtimer: Make offset update smarter Thomas Gleixner
2015-04-20  9:30   ` Preeti U Murthy
2015-04-22 19:06   ` [tip:timers/core] " tip-bot for Thomas Gleixner
2015-04-14 21:08 ` [patch 09/39] hrtimer: Use a bits for various boolean indicators Thomas Gleixner
2015-04-22 19:07   ` [tip:timers/core] hrtimer: Use " tip-bot for Thomas Gleixner
2015-04-14 21:08 ` [patch 10/39] hrtimer: Use cpu_base->active_base for hotpath iterators Thomas Gleixner
2015-04-20 11:16   ` Preeti U Murthy
2015-04-21 11:53     ` Thomas Gleixner
2015-04-22  3:13       ` Preeti U Murthy
2015-04-22 19:07   ` [tip:timers/core] hrtimer: Use cpu_base-> active_base " tip-bot for Thomas Gleixner
2015-04-14 21:08 ` [patch 11/39] hrtimer: Cache line align the hrtimer cpu base Thomas Gleixner
2015-04-22 19:07   ` [tip:timers/core] " tip-bot for Thomas Gleixner
2015-04-14 21:08 ` [patch 12/39] hrtimer: Align the hrtimer clock bases as well Thomas Gleixner
2015-04-22 19:07   ` [tip:timers/core] " tip-bot for Thomas Gleixner
2015-04-14 21:08 ` [patch 13/39] timerqueue: Let timerqueue_add/del return information Thomas Gleixner
2015-04-22 19:08   ` [tip:timers/core] timerqueue: Let timerqueue_add/ del " tip-bot for Thomas Gleixner
2015-04-14 21:08 ` [patch 14/39] hrtimer: Make use of timerqueue_add/del return values Thomas Gleixner
2015-04-22 19:08   ` [tip:timers/core] hrtimer: Make use of timerqueue_add/ del " tip-bot for Thomas Gleixner
2015-04-14 21:08 ` [patch 15/39] hrtimer: Keep pointer to first timer and simplify __remove_hrtimer() Thomas Gleixner
2015-04-22 19:08   ` [tip:timers/core] " tip-bot for Thomas Gleixner
2015-04-14 21:08 ` [patch 16/39] hrtimer: Get rid of hrtimer softirq Thomas Gleixner
2015-04-22 19:09   ` [tip:timers/core] " tip-bot for Thomas Gleixner
2015-04-14 21:08 ` [patch 17/39] tick: sched: Remove hrtimer_active() checks Thomas Gleixner
2015-04-16 13:37   ` Frederic Weisbecker
2015-04-22 19:09   ` [tip:timers/core] " tip-bot for Thomas Gleixner
2015-04-14 21:08 ` [patch 18/39] tick: sched: Force tick interrupt and get rid of softirq magic Thomas Gleixner
2015-04-22 14:22   ` Frederic Weisbecker
2015-04-22 14:32     ` Thomas Gleixner
2015-04-23 11:47       ` Frederic Weisbecker
2015-04-23 13:07         ` Thomas Gleixner
2015-04-23 16:14           ` Frederic Weisbecker
2015-04-22 19:09   ` [tip:timers/core] " tip-bot for Thomas Gleixner
2015-04-14 21:08 ` [patch 19/39] tick: sched: Restructure code Thomas Gleixner
2015-04-22 19:09   ` [tip:timers/core] tick: Sched: " tip-bot for Thomas Gleixner
2015-04-14 21:08 ` [patch 20/39] tick: nohz: Rework next timer evaluation Thomas Gleixner
2015-04-16 16:42   ` Paul E. McKenney
2015-04-21 12:04     ` Thomas Gleixner
2015-04-22 19:10   ` [tip:timers/core] tick: Nohz: " tip-bot for Thomas Gleixner
2015-04-14 21:09 ` [patch 21/39] x86: perf: Use hrtimer_start() Thomas Gleixner
2015-04-22 19:10   ` [tip:timers/core] " tip-bot for Thomas Gleixner
2015-04-14 21:09 ` [patch 22/39] x86: perf: uncore: " Thomas Gleixner
2015-04-22 19:10   ` [tip:timers/core] " tip-bot for Thomas Gleixner
2015-04-14 21:09 ` [patch 23/39] perf: core: " Thomas Gleixner
2015-04-22 19:11   ` [tip:timers/core] " tip-bot for Thomas Gleixner
2015-04-14 21:09 ` [patch 24/39] sched: core: Use hrtimer_start[_expires]() Thomas Gleixner
2015-04-22 19:11   ` [tip:timers/core] " tip-bot for Thomas Gleixner
2015-04-14 21:09 ` [patch 25/39] sched: deadline: Use hrtimer_start() Thomas Gleixner
2015-04-22 19:11   ` [tip:timers/core] " tip-bot for Thomas Gleixner
2015-04-14 21:09 ` [patch 26/39] hrtimer: Get rid of __hrtimer_start_range_ns() Thomas Gleixner
2015-04-22 19:11   ` [tip:timers/core] " tip-bot for Thomas Gleixner
2015-04-14 21:09 ` [patch 27/39] hrtimer: Make hrtimer_start() a inline wrapper Thomas Gleixner
2015-04-22 19:12   ` [tip:timers/core] " tip-bot for Thomas Gleixner
2015-04-14 21:09 ` [patch 28/39] hrtimer: Remove bogus hrtimer_active() check Thomas Gleixner
2015-04-22 19:12   ` [tip:timers/core] " tip-bot for Thomas Gleixner
2015-04-14 21:09 ` [patch 29/39] hrtimer: Rmove " Thomas Gleixner
2015-04-22 19:12   ` [tip:timers/core] futex: Remove " tip-bot for Thomas Gleixner
2015-04-14 21:09 ` [patch 30/39] rtmutex: " Thomas Gleixner
2015-04-22 19:13   ` [tip:timers/core] " tip-bot for Thomas Gleixner
2015-04-14 21:09 ` [patch 31/39] net: core: pktgen: " Thomas Gleixner
2015-04-16 16:04   ` David Miller
2015-04-22 19:13   ` [tip:timers/core] net: core: pktgen: Remove bogus hrtimer_active( ) check tip-bot for Thomas Gleixner
2015-04-14 21:09 ` [patch 32/39] alarmtimer: Get rid of unused return value Thomas Gleixner
2015-04-22 19:13   ` [tip:timers/core] " tip-bot for Thomas Gleixner
2015-04-14 21:09 ` [patch 34/39] tick: broadcast-hrtimer: Remove overly clever return value abuse Thomas Gleixner
2015-04-17 10:33   ` Preeti U Murthy
2015-04-22 19:13   ` [tip:timers/core] " tip-bot for Thomas Gleixner
2015-04-14 21:09 ` [patch 35/39] hrtimer: Remove hrtimer_start() return value Thomas Gleixner
2015-04-22 19:14   ` [tip:timers/core] " tip-bot for Thomas Gleixner
2015-04-14 21:09 ` [patch 36/39] hrtimer: Avoid locking in hrtimer_cancel() if timer not active Thomas Gleixner
2015-04-22 19:14   ` [tip:timers/core] " tip-bot for Thomas Gleixner
2015-04-14 21:09 ` [patch 37/39] staging: ozwpan: Remove hrtimer_active() check Thomas Gleixner
2015-04-14 21:09 ` [patch 38/39] timer: Remove pointless return value of do_usleep_range() Thomas Gleixner
2015-04-22 19:14   ` [tip:timers/core] " tip-bot for Thomas Gleixner
2015-04-14 21:09 ` [patch 39/39] timer: Put usleep_range into the __sched section Thomas Gleixner
2015-04-22 19:14   ` [tip:timers/core] " tip-bot for Thomas Gleixner
     [not found] ` <20150414203503.322172417@linutronix.de>
2015-04-14 21:38   ` [patch 33/39] power: reset: ltc2952: Remove bogus hrtimer_start() return value checks Frans Klaver
2015-04-30 15:49   ` Sebastian Reichel
  -- strict thread matches above, loose matches on Subject: below --
2015-04-07  2:10 [PATCH V2 0/2] hrtimer: Iterate only over active clock-bases Viresh Kumar
2015-04-07  2:10 ` [PATCH V2 1/2] hrtimer: update '->active_bases' before calling hrtimer_force_reprogram() Viresh Kumar
2015-04-22 19:04   ` [tip:timers/core] hrtimer: Update active_bases " tip-bot for Viresh Kumar
2015-04-07  2:10 ` [PATCH V2 2/2] hrtimer: Iterate only over active clock-bases Viresh Kumar
2015-04-08 12:10   ` Peter Zijlstra
2015-04-08 20:11   ` Thomas Gleixner
2015-04-09  2:42     ` Viresh Kumar
2015-04-09  6:28     ` [PATCH] hrtimer: Replace cpu_base->active_bases with a direct check of the active list Ingo Molnar
2015-04-09  6:38       ` Ingo Molnar
2015-04-09  6:39         ` [PATCH] hrtimer: Only iterate over active bases in migrate_hrtimers() Ingo Molnar
2015-04-09  6:53         ` [PATCH] hrtimer: Replace timerqueue_getnext() uses with direct access to 'active.next' Ingo Molnar
2015-04-09  7:10         ` [PATCH] hrtimers: Use consistent variable names for timerqueue_node iterations Ingo Molnar
2015-04-09  6:57       ` [PATCH] hrtimer: Replace cpu_base->active_bases with a direct check of the active list Peter Zijlstra
2015-04-09  7:09         ` Ingo Molnar
2015-04-09  7:20           ` Ingo Molnar
2015-04-09  8:58             ` Thomas Gleixner
2015-04-09  8:58             ` Peter Zijlstra
2015-04-09  9:18               ` Thomas Gleixner
2015-04-09  9:31                 ` Peter Zijlstra
2015-04-09  9:56                   ` Thomas Gleixner
2015-04-13  5:53                 ` Preeti U Murthy
2015-04-13  7:53                   ` Thomas Gleixner
2015-04-09  8:03           ` Peter Zijlstra
2015-04-09  8:10             ` Ingo Molnar
2015-04-09  8:53       ` Thomas Gleixner
2015-04-09  9:18         ` Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-056a3cacbc46e5aca27b350ce4ecb3b33ebb0700@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=fweisbec@gmail.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=mtosatti@redhat.com \
    --cc=peterz@infradead.org \
    --cc=preeti@linux.vnet.ibm.com \
    --cc=tglx@linutronix.de \
    --cc=viresh.kumar@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).