aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched/clock.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/sched/clock.c')
-rw-r--r--kernel/sched/clock.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/kernel/sched/clock.c b/kernel/sched/clock.c
index 43c2bcc35761..3ef6451e972e 100644
--- a/kernel/sched/clock.c
+++ b/kernel/sched/clock.c
@@ -60,13 +60,14 @@
60#include <linux/sched.h> 60#include <linux/sched.h>
61#include <linux/static_key.h> 61#include <linux/static_key.h>
62#include <linux/workqueue.h> 62#include <linux/workqueue.h>
63#include <linux/compiler.h>
63 64
64/* 65/*
65 * Scheduler clock - returns current time in nanosec units. 66 * Scheduler clock - returns current time in nanosec units.
66 * This is default implementation. 67 * This is default implementation.
67 * Architectures and sub-architectures can override this. 68 * Architectures and sub-architectures can override this.
68 */ 69 */
69unsigned long long __attribute__((weak)) sched_clock(void) 70unsigned long long __weak sched_clock(void)
70{ 71{
71 return (unsigned long long)(jiffies - INITIAL_JIFFIES) 72 return (unsigned long long)(jiffies - INITIAL_JIFFIES)
72 * (NSEC_PER_SEC / HZ); 73 * (NSEC_PER_SEC / HZ);
@@ -301,14 +302,14 @@ u64 sched_clock_cpu(int cpu)
301 if (unlikely(!sched_clock_running)) 302 if (unlikely(!sched_clock_running))
302 return 0ull; 303 return 0ull;
303 304
304 preempt_disable(); 305 preempt_disable_notrace();
305 scd = cpu_sdc(cpu); 306 scd = cpu_sdc(cpu);
306 307
307 if (cpu != smp_processor_id()) 308 if (cpu != smp_processor_id())
308 clock = sched_clock_remote(scd); 309 clock = sched_clock_remote(scd);
309 else 310 else
310 clock = sched_clock_local(scd); 311 clock = sched_clock_local(scd);
311 preempt_enable(); 312 preempt_enable_notrace();
312 313
313 return clock; 314 return clock;
314} 315}