aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/time/time.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2018-07-03 09:20:22 +0200
committerIngo Molnar <mingo@kernel.org>2018-07-03 09:20:22 +0200
commit4520843dfa34417eb1e2061f60d2345d9ca614e1 (patch)
tree7b983b8cf20c6154cf897000610c5b7c754e26d9 /kernel/time/time.c
parentsched/fair: Remove stale tg_unthrottle_up() comments (diff)
parentkthread, sched/core: Fix kthread_parkme() (again...) (diff)
downloadlinux-dev-4520843dfa34417eb1e2061f60d2345d9ca614e1.tar.xz
linux-dev-4520843dfa34417eb1e2061f60d2345d9ca614e1.zip
Merge branch 'sched/urgent' into sched/core, to pick up fixes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel/time/time.c')
-rw-r--r--kernel/time/time.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/kernel/time/time.c b/kernel/time/time.c
index 6fa99213fc72..2b41e8e2d31d 100644
--- a/kernel/time/time.c
+++ b/kernel/time/time.c
@@ -28,6 +28,7 @@
*/
#include <linux/export.h>
+#include <linux/kernel.h>
#include <linux/timex.h>
#include <linux/capability.h>
#include <linux/timekeeper_internal.h>
@@ -314,9 +315,10 @@ unsigned int jiffies_to_msecs(const unsigned long j)
return (j + (HZ / MSEC_PER_SEC) - 1)/(HZ / MSEC_PER_SEC);
#else
# if BITS_PER_LONG == 32
- return (HZ_TO_MSEC_MUL32 * j) >> HZ_TO_MSEC_SHR32;
+ return (HZ_TO_MSEC_MUL32 * j + (1ULL << HZ_TO_MSEC_SHR32) - 1) >>
+ HZ_TO_MSEC_SHR32;
# else
- return (j * HZ_TO_MSEC_NUM) / HZ_TO_MSEC_DEN;
+ return DIV_ROUND_UP(j * HZ_TO_MSEC_NUM, HZ_TO_MSEC_DEN);
# endif
#endif
}