lkml.org 
[lkml]   [2017]   [Nov]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[RFC patch 1/7] timekeeping: Do not unconditionally suspend NMI safe timekeepers
If the current clocksource can be accessed safely after timekeeping is
suspended then there is no reason to suspend the NMI safe timekeepers.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
include/linux/clocksource.h | 3 ++-
kernel/time/timekeeping.c | 3 +++
2 files changed, 5 insertions(+), 1 deletion(-)

--- a/include/linux/clocksource.h
+++ b/include/linux/clocksource.h
@@ -119,7 +119,8 @@ struct clocksource {
#define CLOCK_SOURCE_VALID_FOR_HRES 0x20
#define CLOCK_SOURCE_UNSTABLE 0x40
#define CLOCK_SOURCE_SUSPEND_NONSTOP 0x80
-#define CLOCK_SOURCE_RESELECT 0x100
+#define CLOCK_SOURCE_SUSPEND_ACCESS_OK 0x100
+#define CLOCK_SOURCE_RESELECT 0x200

/* simplify initialization of mask field */
#define CLOCKSOURCE_MASK(bits) GENMASK_ULL((bits) - 1, 0)
--- a/kernel/time/timekeeping.c
+++ b/kernel/time/timekeeping.c
@@ -545,6 +545,9 @@ static void halt_fast_timekeeper(struct
static struct tk_read_base tkr_dummy;
struct tk_read_base *tkr = &tk->tkr_mono;

+ if (tkr->clock->flags & CLOCK_SOURCE_SUSPEND_ACCESS_OK)
+ return;
+
memcpy(&tkr_dummy, tkr, sizeof(tkr_dummy));
cycles_at_suspend = tk_clock_read(tkr);
tkr_dummy.clock = &dummy_clock;

\
 
 \ /
  Last update: 2017-11-15 19:29    [W:0.110 / U:0.368 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site