summaryrefslogtreecommitdiffstats
path: root/recipes-kernel/linux/files/patches/sched-nohz-Fix-overflow-error-in-scheduler_tick_max_.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-kernel/linux/files/patches/sched-nohz-Fix-overflow-error-in-scheduler_tick_max_.patch')
-rw-r--r--recipes-kernel/linux/files/patches/sched-nohz-Fix-overflow-error-in-scheduler_tick_max_.patch42
1 files changed, 42 insertions, 0 deletions
diff --git a/recipes-kernel/linux/files/patches/sched-nohz-Fix-overflow-error-in-scheduler_tick_max_.patch b/recipes-kernel/linux/files/patches/sched-nohz-Fix-overflow-error-in-scheduler_tick_max_.patch
new file mode 100644
index 0000000..0c60d55
--- /dev/null
+++ b/recipes-kernel/linux/files/patches/sched-nohz-Fix-overflow-error-in-scheduler_tick_max_.patch
@@ -0,0 +1,42 @@
1From 619480006f78ebf87d80b73d4085a52a1de56feb Mon Sep 17 00:00:00 2001
2From: Martin Borg <martin.borg@enea.com>
3Date: Mon, 3 Mar 2014 13:34:43 +0100
4Subject: [PATCH 1/2] sched/nohz: Fix overflow error in
5 scheduler_tick_max_deferment()
6
7---
8 include/linux/jiffies.h | 4 ++++
9 kernel/sched/core.c | 2 +-
10 2 files changed, 5 insertions(+), 1 deletion(-)
11
12diff --git a/include/linux/jiffies.h b/include/linux/jiffies.h
13index 8fb8edf..ac69959 100644
14--- a/include/linux/jiffies.h
15+++ b/include/linux/jiffies.h
16@@ -290,6 +290,10 @@ extern unsigned long preset_lpj;
17 */
18 extern unsigned int jiffies_to_msecs(const unsigned long j);
19 extern unsigned int jiffies_to_usecs(const unsigned long j);
20+static inline u64 jiffies_to_nsecs(const unsigned long j)
21+{
22+ return (u64)jiffies_to_usecs(j) * NSEC_PER_USEC;
23+}
24 extern unsigned long msecs_to_jiffies(const unsigned int m);
25 extern unsigned long usecs_to_jiffies(const unsigned int u);
26 extern unsigned long timespec_to_jiffies(const struct timespec *value);
27diff --git a/kernel/sched/core.c b/kernel/sched/core.c
28index 59c7367..8c3d8bf 100644
29--- a/kernel/sched/core.c
30+++ b/kernel/sched/core.c
31@@ -2779,7 +2779,7 @@ u64 scheduler_tick_max_deferment(void)
32 if (time_before_eq(next, now))
33 return 0;
34
35- return jiffies_to_usecs(next - now) * NSEC_PER_USEC;
36+ return jiffies_to_nsecs(next - now);
37 }
38
39 static __init int sched_nohz_full_init_debug(void)
40--
411.7.10.4
42