Re: [RFC PATCH 2/4] rtc: Convert rtc_class_ops.set_mmss() to use time64_t

2014-11-28 Thread pang.xunlei
On 27 November 2014 at 20:02, Xunlei Pang wrote: > Currently the rtc_class_op's set_mmss() function takes a 32bit second > value (on 32bit systems), which is problematic for dates past y2038. > > This patch resolves it by changing the interface and all users to use > y2038 safe time64_t. > > Cc: J

Re: [RFC PATCH 4/4] rtc/imxdi: Update driver to address time issues

2014-11-28 Thread pang.xunlei
On 28 November 2014 at 07:24, Thomas Gleixner wrote: > On Thu, 27 Nov 2014, Xunlei Pang wrote: >> @@ -213,17 +213,16 @@ static int dryice_rtc_set_mmss(struct device *dev, >> time64_t secs) >> { >> struct imxdi_dev *imxdi = dev_get_drvdata(dev); >> int rc; >> + u32 hwtime; >> + >>

Re: [RFC PATCH 3/4] rtc/lib: Provide interfaces to map between 32bit hardware and 64bit time

2014-11-28 Thread pang.xunlei
On 28 November 2014 at 07:16, Thomas Gleixner wrote: > On Thu, 27 Nov 2014, Xunlei Pang wrote: >> +/* Rtc epoch year, can be overrided by command line */ >> +static unsigned int rtc_epoch = 1970; >> +time64_t rtc_epoch_secs_since_1970; >> + >> +static int __init >> +set_rtc_epoch(char *str) > > On

Re: [RFC PATCH 1/4] rtc/mxc: Convert get_alarm_or_time()/set_alarm_or_time() to use time64_t

2014-11-28 Thread pang.xunlei
On 28 November 2014 at 07:47, Arnd Bergmann wrote: > On Friday 28 November 2014 00:02:47 Thomas Gleixner wrote: >> >> > static int rtc_update_alarm(struct device *dev, struct rtc_time *alrm) >> > { >> > struct rtc_time alarm_tm, now_tm; >> > - unsigned long now, time; >> > + time64

[PATCH] time: Avoid possible NTP adjustment mult overflow

2014-11-24 Thread pang.xunlei
avoids any possible mult overflow by judging the overflow case before adding mult_adj to mult, also adds the WARNING message when capturing such case. Signed-off-by: pang.xunlei --- Fix the problem in the former patch catched by Fengguang's 0day robot: [time] WARNING: CPU: 0 PI

[PATCH v3 3/3] sched/deadline: Change the return meaning of cpudl_find()

2014-11-20 Thread pang.xunlei
nally, this patch avoids the extra cpumask_set_cpu() operation in cpudl_find() as well. Signed-off-by: pang.xunlei --- kernel/sched/cpudeadline.c | 16 +++- kernel/sched/cpudeadline.h | 3 +++ kernel/sched/deadline.c| 17 - 3 files changed, 18 insertions(+), 18 delet

[PATCH v3 2/3] sched/deadline: Fix wrong cpudl_find() in check_preempt_equal_dl()

2014-11-20 Thread pang.xunlei
In check_preempt_equal_dl(), cpudl_find() is called with a NULL later_mask, thus cpudl_find() here doesn't check cpudl.free_cpus at all. This patch takles this issue by always passing a non-NULL cpumask to cpudl_find(), and assigns later_mask in this function. Signed-off-by: pang.x

[PATCH v3 1/3] sched/deadline: Modify cpudl.free_cpus to reflect rd->span

2014-11-20 Thread pang.xunlei
_rq(). This patch adds cpudl_set_freecpu() to initialize cpudl.free_cpus when doing rq_attach_root(), so we can avoid the extra rd->span operation when calling cpudl_find(). Signed-off-by: pang.xunlei --- kernel/sched/core.c| 2 ++ kernel/sched/cpudeadline.c | 18 ++

Re: [PATCH v2 3/4] sched/deadline: add the "set_flag" argument to cpudl_find()

2014-11-20 Thread pang.xunlei
On 20 November 2014 22:58, pang.xunlei wrote: > On 20 November 2014 00:24, Steven Rostedt wrote: >> On Wed, 19 Nov 2014 23:46:21 +0800 >> "pang.xunlei" wrote: >> >>> The call site of cpudl_find() in check_preempt_equal_dl() doesn't >>> use

Re: [PATCH v2 3/4] sched/deadline: add the "set_flag" argument to cpudl_find()

2014-11-20 Thread pang.xunlei
On 20 November 2014 00:24, Steven Rostedt wrote: > On Wed, 19 Nov 2014 23:46:21 +0800 > "pang.xunlei" wrote: > >> The call site of cpudl_find() in check_preempt_equal_dl() doesn't >> use later_mask, so add this extra argument to distinquish the ca

[PATCH v2 1/4] sched/deadline: Modify cpudl.free_cpus to reflect rd->span

2014-11-19 Thread pang.xunlei
_rq(). This patch adds cpudl_set_freecpu() to initialize cpudl.free_cpus when doing rq_attach_root(), so we can avoid the extra rd->span operation when calling cpudl_find(). Signed-off-by: pang.xunlei --- kernel/sched/core.c|2 ++ kernel/sched/cpudeadline.c | 18 ++

[PATCH v2 3/4] sched/deadline: add the "set_flag" argument to cpudl_find()

2014-11-19 Thread pang.xunlei
The call site of cpudl_find() in check_preempt_equal_dl() doesn't use later_mask, so add this extra argument to distinquish the case. Signed-off-by: pang.xunlei --- kernel/sched/cpudeadline.c |6 -- kernel/sched/cpudeadline.h |2 +- kernel/sched/deadline.c|6 +++--- 3

[PATCH v2 2/4] sched/deadline: Fix wrong cpudl_find() in check_preempt_equal_dl()

2014-11-19 Thread pang.xunlei
In check_preempt_equal_dl(), cpudl_find() is called with a NULL later_mask, thus cpudl_find() here doesn't check cpudl.free_cpus at all. This patch takles this issue by always passing a non-NULL cpumask to cpudl_find(), and assigns later_mask in this function. Signed-off-by: pang.x

[PATCH v2 4/4] sched/deadline: change cpudl_find() to return bool instead of best_cpu

2014-11-19 Thread pang.xunlei
cpudl_find() is not a good place to select the best cpu, so leave this role to its call site, currently it is find_later_rq() where we can do the election of the best cpu according to sd topology. Signed-off-by: pang.xunlei --- kernel/sched/cpudeadline.c | 15 +-- kernel/sched

Re: [PATCH v9 08/10] sched: replace capacity_factor by usage

2014-11-19 Thread pang.xunlei
On 4 November 2014 00:54, Vincent Guittot wrote: > The scheduler tries to compute how many tasks a group of CPUs can handle by > assuming that a task's load is SCHED_LOAD_SCALE and a CPU's capacity is > SCHED_CAPACITY_SCALE. group_capacity_factor divides the capacity of the group > by SCHED_LOAD_S

Re: [RFC PATCH v3 0/5] y2038 in-kernel interface changes for drivers/rtc

2014-11-19 Thread pang.xunlei
On 18 November 2014 22:13, Thomas Gleixner wrote: > On Tue, 18 Nov 2014, pang.xunlei wrote: >> On 32bit systems, the kernel uses a 32bit signed time_t value >> for seconds since 1970-01-01:00:00:00. This will overflow at >> 2038-01-19 03:14:08, and is widely known as the y2

Re: [PATCH 2/2] sched/deadline: Fix wrong cpudl_find() in check_preempt_equal_dl()

2014-11-18 Thread pang.xunlei
On 18 November 2014 04:15, Steven Rostedt wrote: > On Tue, 18 Nov 2014 00:11:04 +0800 > "pang.xunlei" wrote: > >> In check_preempt_equal_dl(), cpudl_find() is called with a NULL later_mask, >> thus cpudl_find() here doesn't check cpudl.free_cpus at all. &

Re: [PATCH 1/2] sched/deadline: Modify cpudl.free_cpus to reflect rd->span

2014-11-18 Thread pang.xunlei
On 18 November 2014 03:39, Steven Rostedt wrote: > On Tue, 18 Nov 2014 00:11:03 +0800 > >> index 539ca3c..9a69353 >> --- a/kernel/sched/cpudeadline.c >> +++ b/kernel/sched/cpudeadline.c >> @@ -107,7 +107,9 @@ int cpudl_find(struct cpudl *cp, struct task_struct *p, >> int best_cpu = -1; >>

[RFC PATCH v3 4/5] rtc/lib: Provide y2038 safe rtc_tm_to_time()/rtc_time_to_tm() replacement

2014-11-18 Thread pang.xunlei
users. In addition, change rtc_tm_to_ktime() and rtc_ktime_to_tm() to use the safe version in passing. Signed-off-by: pang.xunlei --- drivers/rtc/rtc-lib.c | 38 -- include/linux/rtc.h | 21 +++-- 2 files changed, 39 insertions(+), 20 deletion

[RFC PATCH v3 1/5] time: Provide y2038 safe do_settimeofday() replacement

2014-11-18 Thread pang.xunlei
64() using timespec64. After this patch, do_settimeofday() is deprecated and all its call sites will be fixed using do_settimeofday64(), after that it can be removed. Signed-off-by: pang.xunlei --- include/linux/timekeeping.h | 21 - kernel/time/timekeeping.

[RFC PATCH v3 3/5] time: Provide y2038 safe mktime() replacement

2014-11-18 Thread pang.xunlei
As part of addressing "y2038 problem" for in-kernel uses, this patch adds safe mktime64() using time64_t. After this patch, mktime() is deprecated and all its call sites will be fixed using mktime64(), after that it can be removed. Signed-off-by: pang.xunlei --- include/linux/tim

[RFC PATCH v3 2/5] time: Provide y2038 safe timekeeping_inject_sleeptime() replacement

2014-11-18 Thread pang.xunlei
ved. NOTE: timekeeping_inject_sleeptime() is safe actually, but we want to eliminate timespec eventually, so comes this patch. Signed-off-by: pang.xunlei --- include/linux/timekeeping.h | 13 - kernel/time/timekeeping.c | 10 -- 2 files changed, 16 insertions(+), 7 deletions(-) di

[RFC PATCH v3 5/5] rtc/mc13xxx: Eliminate time problems

2014-11-18 Thread pang.xunlei
-mc13xxx.c(time-safe hardware): - Replace rtc_time_to_tm() with rtc_time64_to_tm() - Replace rtc_tm_to_time() with rtc_tm_to_time64() Then, this driver can work properly with no time issues. Signed-off-by: pang.xunlei --- drivers/rtc/rtc-mc13xxx.c | 25 +++-- 1 file changed

[RFC PATCH v3 0/5] y2038 in-kernel interface changes for drivers/rtc

2014-11-18 Thread pang.xunlei
to keep it relatively short some patches to demonstrate how the conversion will be done. If the feedback is positive on this series, we'll provide the full conversion series as well. pang.xunlei (5): time: Provide y2038 safe do_settimeofday() replacement time: Pro

[PATCH 2/2] sched/deadline: Fix wrong cpudl_find() in check_preempt_equal_dl()

2014-11-17 Thread pang.xunlei
In check_preempt_equal_dl(), cpudl_find() is called with a NULL later_mask, thus cpudl_find() here doesn't check cpudl.free_cpus at all. This patch takles this issue by always passing a non-NULL cpumask to cpudl_find(), and assigns later_mask in this function. Signed-off-by: pang.x

[PATCH 1/2] sched/deadline: Modify cpudl.free_cpus to reflect rd->span

2014-11-17 Thread pang.xunlei
_rq(). This patch adds cpudl_set_freecpu() to initialize cpudl.free_cpus when doing rq_attach_root(), so we can avoid the extra rd->span operation when calling cpudl_find(). Signed-off-by: pang.xunlei --- kernel/sched/core.c| 2 ++ kernel/sched/cpudeadline.c | 19 +++

[tip:sched/core] sched/cpupri: Remove unnecessary definitions in cpupri.h

2014-11-16 Thread tip-bot for pang.xunlei
Commit-ID: 74e6942fbc7f52320c2fc900a9a6b0a315927915 Gitweb: http://git.kernel.org/tip/74e6942fbc7f52320c2fc900a9a6b0a315927915 Author: pang.xunlei AuthorDate: Thu, 6 Nov 2014 15:52:01 +0800 Committer: Ingo Molnar CommitDate: Sun, 16 Nov 2014 10:58:59 +0100 sched/cpupri: Remove

[tip:sched/core] sched/deadline: Remove unnecessary definitions in cpudeadline.h

2014-11-16 Thread tip-bot for pang.xunlei
Commit-ID: c1a2b5f6293caa14804adca1840eeea1e8f6b322 Gitweb: http://git.kernel.org/tip/c1a2b5f6293caa14804adca1840eeea1e8f6b322 Author: pang.xunlei AuthorDate: Thu, 6 Nov 2014 15:52:04 +0800 Committer: Ingo Molnar CommitDate: Sun, 16 Nov 2014 10:59:00 +0100 sched/deadline: Remove

[PATCH v4 4/7] sched/deadline: Remove unnecessary definitions in cpudeadline.h

2014-11-05 Thread pang.xunlei
Actually, cpudl_set() and cpudl_init() can never be used without CONFIG_SMP. Signed-off-by: pang.xunlei --- kernel/sched/cpudeadline.h |3 --- 1 file changed, 3 deletions(-) diff --git a/kernel/sched/cpudeadline.h b/kernel/sched/cpudeadline.h index 538c979..020039b 100644 --- a/kernel

[PATCH v4 7/7] sched/deadline: Modify cpudl_find() for more cases of electing best_cpu

2014-11-05 Thread pang.xunlei
idle cases. Add rt_enter_dl()/rt_exit_dl() to detect non-RT cases. Add a set_flag parameter to cpudl_find(). Use the same thought as that in tackling RT in the former patch. Signed-off-by: pang.xunlei --- kernel/sched/cpudeadline.c | 76 kernel/

[PATCH v4 1/7] sched/cpupri: Remove unnecessary definitions in cpupri.h

2014-11-05 Thread pang.xunlei
Actually, cpupri_set() and cpupri_init() can never be used without CONFIG_SMP. Signed-off-by: pang.xunlei --- kernel/sched/cpupri.h |3 --- 1 file changed, 3 deletions(-) diff --git a/kernel/sched/cpupri.h b/kernel/sched/cpupri.h index 6b03334..63cbb9c 100644 --- a/kernel/sched/cpupri.h

[PATCH v4 3/7] sched/rt: Optimize find_lowest_rq() to select a cache hot cpu

2014-11-05 Thread pang.xunlei
Add the case for iteration of sched_domains without SD_WAKE_AFFINE flags to select a cpu, this flag may be unset through proc by users. Signed-off-by: pang.xunlei --- kernel/sched/rt.c | 18 ++ 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/kernel/sched/rt.c b

[PATCH v4 2/7] sched/rt: Deal with cpupri.pri_to_cpu[CPUPRI_IDLE] for idle cases

2014-11-05 Thread pang.xunlei
idle cpu as the goal. Signed-off-by: pang.xunlei --- kernel/sched/idle_task.c |3 +++ kernel/sched/rt.c| 21 + kernel/sched/sched.h |6 ++ 3 files changed, 30 insertions(+) diff --git a/kernel/sched/idle_task.c b/kernel/sched/idle_task.c index

[PATCH v4 5/7] sched/deadline: Fix several problems with cpudl_find()

2014-11-05 Thread pang.xunlei
ly which can be better determined in find_later_rq() via sched_domain topology. This patch adds a new cpudl_set_freecpu() to initialize cpudl.free_cpus when rq_attach_root(), and modifies cpudl_find() and all its call sites in order to address these problems. Signed-off-by: pang.xunlei --- kern

[PATCH v4 6/7] sched/deadline: Optimize find_later_rq() to select a cache hot cpu

2014-11-05 Thread pang.xunlei
Add the case for iteration of sched_domains without SD_WAKE_AFFINE flags to select a cpu, this flag may be unset through proc by users. Signed-off-by: pang.xunlei --- kernel/sched/deadline.c | 19 ++- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/kernel/sched

[PATCH v3 5/7] sched/deadline: Optimize find_later_rq() to select a cache hot cpu

2014-11-05 Thread pang.xunlei
Add the case for iteration of sched_domains without SD_WAKE_AFFINE flags to select a cpu, this flag may be unset through proc by users. Signed-off-by: pang.xunlei --- kernel/sched/deadline.c | 19 ++- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/kernel/sched

[PATCH v3 4/7] sched/deadline: Fix several problems with cpudl_find()

2014-11-05 Thread pang.xunlei
all sites to address these problems. The former patch by "Juri Lelli" is: "sched/deadline: Fix inter- exclusive cpusets migrations" Signed-off-by: pang.xunlei --- kernel/sched/cpudeadline.c | 29 ++--- kernel/sched

[PATCH v3 3/7] sched/rt: Optimize find_lowest_rq() to select a cache hot cpu

2014-11-05 Thread pang.xunlei
Add the case for iteration of sched_domains without SD_WAKE_AFFINE flags to select a cpu, this flag may be unset through proc by users. Signed-off-by: pang.xunlei --- kernel/sched/rt.c | 18 ++ 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/kernel/sched/rt.c b

[PATCH v3 6/7] sched/deadline: Remove unnecessary definitions in cpudeadline.h

2014-11-05 Thread pang.xunlei
Actually, cpudl_set() and cpudl_init() can never be used without CONFIG_SMP. Signed-off-by: pang.xunlei --- kernel/sched/cpudeadline.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/kernel/sched/cpudeadline.h b/kernel/sched/cpudeadline.h index 0c9636e..dfdf594 100644 --- a/kernel/sched

[PATCH v3 7/7] sched/deadline: Modify cpudl_find() for more cases of electing best_cpu

2014-11-05 Thread pang.xunlei
same thought as tackling RT in the former patch. Signed-off-by: pang.xunlei --- kernel/sched/cpudeadline.c | 80 +- kernel/sched/cpudeadline.h | 13 ++-- kernel/sched/deadline.c| 32 --- kernel/sched/idle_task.c | 2 ++ k

[PATCH v3 1/7] sched/rt: Deal with cpupri.pri_to_cpu[CPUPRI_IDLE] for idle cases

2014-11-05 Thread pang.xunlei
idle cpu as the goal. Signed-off-by: pang.xunlei --- kernel/sched/idle_task.c | 3 +++ kernel/sched/rt.c| 21 + kernel/sched/sched.h | 6 ++ 3 files changed, 30 insertions(+) diff --git a/kernel/sched/idle_task.c b/kernel/sched/idle_task.c index 67ad4e7

[PATCH v3 2/7] sched/cpupri: Remove unnecessary definitions in cpupri.h

2014-11-05 Thread pang.xunlei
Actually, cpupri_set() and cpupri_init() can never be used without CONFIG_SMP. Signed-off-by: pang.xunlei --- kernel/sched/cpupri.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/kernel/sched/cpupri.h b/kernel/sched/cpupri.h index 6b03334..63cbb9c 100644 --- a/kernel/sched/cpupri.h +++ b

Re: [PATCH v2 2/6] sched/rt: Optimize select_task_rq_rt() for non-RT curr task

2014-11-04 Thread pang.xunlei
On 4 November 2014 22:47, Steven Rostedt wrote: > On Tue, 4 Nov 2014 22:29:24 +0800 > "pang.xunlei" wrote: > > >> > Migration is not cheap. It causes cache misses and TLB flushes. This is >> > not something that should be taken lightly. >> Ok, thank

Re: [PATCH v2 2/6] sched/rt: Optimize select_task_rq_rt() for non-RT curr task

2014-11-04 Thread pang.xunlei
On 4 November 2014 20:52, Steven Rostedt wrote: > On Tue, 4 Nov 2014 19:13:01 +0800 > "pang.xunlei" wrote: > >> When selecting the cpu for a waking RT task, if curr is a non-RT >> task which is bound only on this cpu, then we can give it a chance >> to sele

Re: [PATCH v2 5/6] sched/dl: Optimize select_task_rq_dl() for non-DL curr task

2014-11-04 Thread pang.xunlei
On 4 November 2014 19:24, Wanpeng Li wrote: > > On 14/11/4 下午7:13, pang.xunlei wrote: >> >> When selecting the cpu for a waking DL task, if curr is a non-DL >> task which is bound only on this cpu, then we can give it a chance >> to select a different cpu for this

[PATCH v2 3/6] sched/cpupri: Remove unnecessary definitions in cpupri.h

2014-11-04 Thread pang.xunlei
Actually, cpupri_set() and cpupri_init() can never be used without CONFIG_SMP. Signed-off-by: pang.xunlei --- kernel/sched/cpupri.h |3 --- 1 file changed, 3 deletions(-) diff --git a/kernel/sched/cpupri.h b/kernel/sched/cpupri.h index 6b03334..63cbb9c 100644 --- a/kernel/sched/cpupri.h

[PATCH v2 4/6] sched/dl: Modify cpudl_find() for more cases of electing best_cpu

2014-11-04 Thread pang.xunlei
same thought as tackling RT in the former patch. Signed-off-by: pang.xunlei --- kernel/sched/cpudeadline.c | 79 +++- kernel/sched/cpudeadline.h | 13 ++-- kernel/sched/deadline.c| 32 +++--- kernel/sched/idle_task.c |2 ++ k

[PATCH v2 5/6] sched/dl: Optimize select_task_rq_dl() for non-DL curr task

2014-11-04 Thread pang.xunlei
When selecting the cpu for a waking DL task, if curr is a non-DL task which is bound only on this cpu, then we can give it a chance to select a different cpu for this DL task to avoid curr starving. Signed-off-by: pang.xunlei --- kernel/sched/deadline.c | 14 ++ 1 file changed, 10

[PATCH v2 6/6] sched/dl: Remove unnecessary definitions in cpudeadline.h

2014-11-04 Thread pang.xunlei
Actually, cpudl_set() and cpudl_init() can never be used without CONFIG_SMP. Signed-off-by: pang.xunlei --- kernel/sched/cpudeadline.h |3 --- 1 file changed, 3 deletions(-) diff --git a/kernel/sched/cpudeadline.h b/kernel/sched/cpudeadline.h index d79e4d8..7096e5a 100644 --- a/kernel

[PATCH v2 1/6] sched/cpupri: Deal with cpupri.pri_to_cpu[CPUPRI_IDLE] for idle cases

2014-11-04 Thread pang.xunlei
to find one idle cpu as the goal. Signed-off-by: pang.xunlei --- kernel/sched/idle_task.c |3 +++ kernel/sched/rt.c| 21 + kernel/sched/sched.h |6 ++ 3 files changed, 30 insertions(+) diff --git a/kernel/sched/idle_task.c b/kernel/sched/idle_task.c

[PATCH v2 2/6] sched/rt: Optimize select_task_rq_rt() for non-RT curr task

2014-11-04 Thread pang.xunlei
When selecting the cpu for a waking RT task, if curr is a non-RT task which is bound only on this cpu, then we can give it a chance to select a different cpu(definitely an idle cpu if existing) for the RT task to avoid curr starving. Signed-off-by: pang.xunlei --- kernel/sched/rt.c | 10

[PATCH 3/3] sched/rt: Optimize select_task_rq_rt() for non-RT curr task

2014-11-03 Thread pang.xunlei
When selecting the cpu for a waking RT task, if curr is a non-RT task which is bound only on this cpu, then we can give it a chance to select a different cpu(definitely an idle cpu if existing) for the RT task to avoid curr starving. Signed-off-by: pang.xunlei --- kernel/sched/rt.c | 10

[PATCH 2/3] sched/cpupri: Remove unnecessary definitions in cpupri.h

2014-11-03 Thread pang.xunlei
Actually, cpupri_set() and cpupri_init() can never be used without CONFIG_SMP. Signed-off-by: pang.xunlei --- kernel/sched/cpupri.h |3 --- 1 file changed, 3 deletions(-) diff --git a/kernel/sched/cpupri.h b/kernel/sched/cpupri.h index 6b03334..63cbb9c 100644 --- a/kernel/sched/cpupri.h

[PATCH 1/3] sched/cpupri: Deal with cpupri.pri_to_cpu[CPUPRI_IDLE] for idle cases

2014-11-03 Thread pang.xunlei
to find one idle cpu as the goal. Signed-off-by: pang.xunlei --- kernel/sched/idle_task.c | 21 + 1 file changed, 21 insertions(+) diff --git a/kernel/sched/idle_task.c b/kernel/sched/idle_task.c index 67ad4e7..3dc372e 100644 --- a/kernel/sched/idle_task.c +++ b/kernel

Re: [RFC PATCH v2 03/11] time: Add rtc_tm_to_time64() safe version(using time64_t)

2014-10-30 Thread pang.xunlei
On 30 October 2014 21:55, Thomas Gleixner wrote: > On Thu, 30 Oct 2014, pang.xunlei wrote: > > Same $subject issue. > >> As part of addressing 2038 saftey for in-kernel uses, this patch >> adds safe rtc_tm_to_time64() using time64_t. After this patch, >> rtc_tm_t

[RFC PATCH v2 05/11] time: Convert all users of do_settimeofday() to use do_settimeofday64()

2014-10-30 Thread pang.xunlei
time64.h to avoid warnings. Signed-off-by: pang.xunlei --- arch/x86/xen/time.c |9 +++-- drivers/hv/hv_util.c|6 +++--- drivers/rtc/hctosys.c | 10 +- drivers/staging/android/alarm-dev.c |7 +-- include/linux/time64.h

[RFC PATCH v2 07/11] time: Convert alarm_set_rtc() to use timespec64

2014-10-30 Thread pang.xunlei
As part of addressing 2038 saftey for in-kernel uses, this patch creates no functional change, and converts alarm_set_rtc() to use timespec64. Signed-off-by: pang.xunlei --- drivers/staging/android/alarm-dev.c | 17 ++--- 1 file changed, 10 insertions(+), 7 deletions(-) diff

[RFC PATCH v2 00/11] Convert do_settimeofday() to use timespec64

2014-10-30 Thread pang.xunlei
back to make sure there are no objections with my approach. Please access the link below for all the related patches if interested: https://git.linaro.org/people/pang.xunlei/linuxstable.git pang.xunlei (11): time: Add do_settimeofday64() safe version(using timespec64) time: Add mktime64() safe versi

[RFC PATCH v2 09/11] time: Convert pvclock_read_wallclock() to use timespec64

2014-10-30 Thread pang.xunlei
As part of addressing 2038 safety for in-kernel uses, this patch creates no functional change, converts pvclock_read_wallclock() to use timespec64 instead of timespec. Signed-off-by: pang.xunlei --- arch/x86/include/asm/pvclock.h |2 +- arch/x86/kernel/kvmclock.c |7 +-- arch

[RFC PATCH v2 08/11] time: Convert xen_read_wallclock() to use timespec64

2014-10-30 Thread pang.xunlei
As part of addressing 2038 safety for in-kernel uses, this patch creates no functional change, converts xen_read_wallclock() to use timespec64 instead of timespec. Signed-off-by: pang.xunlei --- arch/x86/xen/time.c | 23 --- 1 file changed, 12 insertions(+), 11 deletions

[RFC PATCH v2 04/11] time: Add rtc_time_to_tm64() safe version(using time64_t)

2014-10-30 Thread pang.xunlei
: pang.xunlei --- drivers/rtc/rtc-lib.c | 20 include/linux/rtc.h |1 + 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/drivers/rtc/rtc-lib.c b/drivers/rtc/rtc-lib.c index 6948cbd..e84e3a0 100644 --- a/drivers/rtc/rtc-lib.c +++ b/drivers/rtc/rtc-lib.c

[RFC PATCH v2 10/11] time: Convert x86_platform.set_wallclock()to use timespec64

2014-10-30 Thread pang.xunlei
As part of addressing 2038 saftey for in-kernel uses, this patch creates no functional change, converts x86_platform.set_wallclock() to use timespec64. Signed-off-by: pang.xunlei --- arch/x86/include/asm/intel_mid_vrtc.h|2 +- arch/x86/include/asm/mc146818rtc.h |2

[RFC PATCH v2 02/11] time: Add mktime64() safe version(using time64_t)

2014-10-30 Thread pang.xunlei
As part of addressing 2038 saftey for in-kernel uses, this patch adds safe mktime64() using time64_t. After this patch, mktime() should be replaced by mktime64() one by one. Eventually, mktime() will be removed from the kernel when it has no users. Signed-off-by: pang.xunlei --- include/linux

[RFC PATCH v2 11/11] time: Convert x86_platform.get_wallclock()to use timespec64

2014-10-30 Thread pang.xunlei
As part of addressing 2038 saftey for in-kernel uses, this patch creates no functional change, converts x86_platform.get_wallclock() to use timespec64. Also changes time64.h to avoid build warnings. Signed-off-by: pang.xunlei --- arch/x86/include/asm/intel_mid_vrtc.h|2 +- arch/x86

[RFC PATCH v2 01/11] time: Add do_settimeofday64() safe version(using timespec64)

2014-10-30 Thread pang.xunlei
timespec64. After this patch, do_settimeofday() should be replaced by do_settimeofday64() one by one. Eventually, do_settimeofday() will be removed from the kernel when it has no users. Signed-off-by: pang.xunlei --- include/linux/timekeeping.h |1 + kernel/time/timekeeping.

[RFC PATCH v2 03/11] time: Add rtc_tm_to_time64() safe version(using time64_t)

2014-10-30 Thread pang.xunlei
: pang.xunlei --- drivers/rtc/rtc-lib.c | 15 ++- include/linux/rtc.h |1 + 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/drivers/rtc/rtc-lib.c b/drivers/rtc/rtc-lib.c index c4cf057..6948cbd 100644 --- a/drivers/rtc/rtc-lib.c +++ b/drivers/rtc/rtc-lib.c @@ -110,10

[RFC PATCH v2 06/11] time: Remove do_settimeofday()

2014-10-30 Thread pang.xunlei
Remove do_settimeofday(), since it has no users by now. Signed-off-by: pang.xunlei --- include/linux/timekeeping.h |1 - kernel/time/timekeeping.c | 16 2 files changed, 17 deletions(-) diff --git a/include/linux/timekeeping.h b/include/linux/timekeeping.h index

[PATCH RFC 04/12] time: Add rtc_tm_to_time() safe version(using time64_t)

2014-10-26 Thread pang.xunlei
g time64_t. After this patch, rtc_tm_to_time_unsafe() should be replaced by rtc_tm_to_time() one by one. Eventually, rtc_tm_to_time_unsafe() will be removed from the kernel when it has no users. Signed-off-by: pang.xunlei --- drivers/rtc/rtc-lib.c |9 + include/linux/rtc.h |1

[PATCH RFC 06/12] time: Fix build warnings for time64_t to __kernel_time_t warning on 64-bit systems.

2014-10-26 Thread pang.xunlei
The kernel uses 32-bit signed value(time_t) for seconds since 1970-01-01:00:00:00, so it will overflow at 2038-01-19 03:14:08 on 32-bit systems. We call this "2038 safety" issue. This patch fixed the build warnings brought by former patches. Signed-off-by: pang.xunlei --- inc

[PATCH RFC 09/12] time: Convert rtc_time_to_tm_unsafe() to rtc_time_to_tm() in alarm_set_rtc()

2014-10-26 Thread pang.xunlei
ting users, and converts rtc_time_to_tm_unsafe() to rtc_time_to_tm(). Signed-off-by: pang.xunlei --- drivers/staging/android/alarm-dev.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/staging/android/alarm-dev.c b/drivers/staging/android/alarm-dev.c inde

[PATCH RFC 11/12] time: Convert xen_read_wallclock() to use timespec64

2014-10-26 Thread pang.xunlei
ting users, converts xen_read_wallclock() to use timespec64 instead of timespec. Signed-off-by: pang.xunlei --- arch/x86/xen/time.c | 31 +++ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/arch/x86/xen/time.c b/arch/x86/xen/time.c index cf1b591..2ce0

[PATCH RFC 12/12] time: Convert pvclock_read_wallclock() to use timespec64

2014-10-26 Thread pang.xunlei
ting users, converts pvclock_read_wallclock() to use timespec64 instead of timespec. Signed-off-by: pang.xunlei --- arch/x86/include/asm/pvclock.h |2 +- arch/x86/kernel/kvmclock.c |7 +-- arch/x86/kernel/pvclock.c |8 arch/x86/xen/time.c| 10 ++---

[PATCH RFC 08/12] time: Add rtc_time_to_tm() safe version(using time64_t)

2014-10-26 Thread pang.xunlei
g time64_t. After this patch, rtc_time_to_tm_unsafe() should be replaced by rtc_time_to_tm() one by one. Eventually, rtc_time_to_tm_unsafe() will be removed from the kernel when it has no users. Signed-off-by: pang.xunlei --- drivers/rtc/rtc-lib.c | 18 ++ include/linux/rtc.

[PATCH RFC 05/12] time: Convert rtc_tm_to_time_unsafe() to rtc_tm_to_time() in rtc_hctosys()

2014-10-26 Thread pang.xunlei
ting users, and converts rtc_tm_to_time_unsafe() to rtc_tm_to_time() in rtc_hctosys(). Signed-off-by: pang.xunlei --- drivers/rtc/hctosys.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/rtc/hctosys.c b/drivers/rtc/hctosys.c index 4e9a5c6..c80723f 10

[PATCH RFC 07/12] time: Rename rtc_time_to_tm() to rtc_time_to_tm_unsafe()

2014-10-26 Thread pang.xunlei
g patch. Signed-off-by: pang.xunlei --- arch/mips/sibyte/swarm/rtc_m41t81.c |2 +- arch/mips/sibyte/swarm/rtc_xicor1241.c |2 +- arch/sh/kernel/time.c|2 +- arch/x86/kernel/rtc.c|2 +- arch/x86/platform/intel-mid/int

[PATCH RFC 02/12] time: Add mktime() safe version(using time64_t)

2014-10-26 Thread pang.xunlei
4_t. After this patch, mktime_unsafe() should be replaced by mktime() one by one. Eventually, mktime_unsafe() will be removed from the kernel when it has no users. Signed-off-by: pang.xunlei --- include/linux/time.h |8 ++-- kernel/time/time.c | 39 ++--

[PATCH RFC 10/12] time: Convert do_settimeofday() to use timespec64

2014-10-26 Thread pang.xunlei
cture, and modify all users of do_settimeofday() to provide timespec64 structures (via timespec_to_timespec64() as needed). Signed-off-by: pang.xunlei --- arch/x86/xen/time.c | 10 -- drivers/hv/hv_util.c|4 ++-- drivers/rtc/hctosys.c

[PATCH RFC 03/12] time: Rename rtc_tm_to_time() to rtc_tm_to_time_unsafe()

2014-10-26 Thread pang.xunlei
g patch. Signed-off-by: pang.xunlei --- arch/sh/kernel/time.c |2 +- drivers/power/charger-manager.c |8 drivers/rtc/class.c |4 ++-- drivers/rtc/hctosys.c |2 +- drivers/rtc/interface.c | 10 +- drivers/rtc/rtc-88

[PATCH RFC 01/12] time: Rename mktime() to mktime_unsafe()

2014-10-26 Thread pang.xunlei
s part of addressing 2038 saftey for in-kernel uses, this patch renames mktime() to mktime_unsafe(), and changes all its calling users correspondingly. The safe version of mktime() will be added in the following patch. Signed-off-by: pang.xunlei --- arch/avr32/kernel/time.c

[PATCH RFC 00/12] time: Convert do_settimeofday() to use timespec64

2014-10-26 Thread pang.xunlei
ese conversions. NOTE: This series actually contains 157 patches in total, but just sent out a small subset here for feedback to make sure there are no objections with my approach. Please access the link below to see all the patches: https://git.linaro.org/people/pang.xunlei/linuxstable.git

[PATCH 2/2] time: Complete NTP adjustment threshold judging conditions

2014-10-09 Thread pang.xunlei
The clocksource mult-adjustment threshold is [mult-maxadj, mult+maxadj], timekeeping_adjust() only deals with the upper threshold, but misses the lower threshold. This patch adds the lower threshold judging condition. Signed-off-by: pang.xunlei --- kernel/time/timekeeping.c |2 +- 1 file

[PATCH 1/2] time: Fix NTP adjustment mult overflow.

2014-10-09 Thread pang.xunlei
e to happen in practice. This patch avoids mult overflow by judging the overflow case before adding mult_adj to mult, also adds the WARNING message when capturing such case. Signed-off-by: pang.xunlei --- kernel/time/timekeeping.c |6 ++ 1 file changed, 6 insertions(+) diff --git a/kern