Re: [PATCH v4] sched/deadline: remove useless param from setup_new_dl_entity

2016-07-21 Thread Xunlei Pang
On 2016/07/21 at 22:46, Juri Lelli wrote: > On 21/07/16 15:36, Juri Lelli wrote: >> On 21/07/16 15:21, Juri Lelli wrote: >>> Hi, >>> >>> On 18/07/16 21:37, Xunlei Pang wrote: >>>> On 2016/07/18 at 21:04, Juri Lelli wrote: >>>>> On 1

Re: [V4 PATCH 1/2] x86/panic: Replace smp_send_stop() with kdump friendly version in panic path

2016-09-20 Thread Xunlei Pang
PV kernel >>> >>> Changes in V3: >>> - Revise comments, description, and symbol names >>> >>> Changes in V2: >>> - Replace smp_send_stop() call with crash_kexec version which >>> saves cpu states and cleans up VMX/SVM >>> - Dr

Re: [PATCH v5] sched/deadline: remove useless param from setup_new_dl_entity

2016-08-05 Thread Xunlei Pang
o the very same update at tasks wakeup time anyway. By doing > so, we don't need to worry about a potential PI donor anymore, as rt_ > mutex_setprio() takes care of that already for us. > > Cc: Ingo Molnar > Cc: Peter Zijlstra > Cc: Steven Rostedt > Cc: Luca Abeni >

Re: [PATCH v2 1/2] kexec: Introduce "/sys/kernel/kexec_crash_low_size"

2016-08-24 Thread Xunlei Pang
On 2016/08/24 at 16:20, Dave Young wrote: > On 08/23/16 at 06:11pm, Yinghai Lu wrote: >> On Wed, Aug 17, 2016 at 1:20 AM, Dave Young wrote: >>> On 08/17/16 at 09:50am, Xunlei Pang wrote: >>>> "/sys/kernel/kexec_crash_size" only handles crashk_res, it >

Re: [PATCH] s390/crash: Fix KEXEC_NOTE_BYTES definition

2017-06-22 Thread Xunlei Pang
On 06/22/2017 at 01:44 AM, Michael Holzheu wrote: > Am Fri, 9 Jun 2017 10:17:05 +0800 > schrieb Xunlei Pang : > >> S390 KEXEC_NOTE_BYTES is not used by note_buf_t as before, which >> is now defined as follows: >> typedef u32 note_buf_t[CRASH_CORE_NOTE_BYTES/4

Re: [PATCH v5 28/32] x86/mm, kexec: Allow kexec to be used with SME

2017-05-25 Thread Xunlei Pang
On 04/19/2017 at 05:21 AM, Tom Lendacky wrote: > Provide support so that kexec can be used to boot a kernel when SME is > enabled. > > Support is needed to allocate pages for kexec without encryption. This > is needed in order to be able to reboot in the kernel in the same manner > as originally b

Re: [PATCH v5 31/32] x86: Add sysfs support for Secure Memory Encryption

2017-05-25 Thread Xunlei Pang
On 05/26/2017 at 10:49 AM, Dave Young wrote: > Ccing Xunlei he is reading the patches see what need to be done for > kdump. There should still be several places to handle to make kdump work. > > On 05/18/17 at 07:01pm, Borislav Petkov wrote: >> On Tue, Apr 18, 2017 at 04:22:12PM -0500, Tom Lendacky

[PATCH v3] cpuidle/coupled: Add sanity check for safe_state_index

2015-08-30 Thread Xunlei Pang
From: Xunlei Pang Since we are using cpuidle_driver::safe_state_index directly as the target state index, it is better to add the sanity check at the point of registering the driver. Signed-off-by: Xunlei Pang --- v2->v3: Move the code to a new cpuidle_coupled_state_verify() depending

Re: [PATCH v3] cpuidle/coupled: Add sanity check for safe_state_index

2015-09-03 Thread Xunlei Pang
Hi Rafael, On 3 September 2015 at 09:35, Rafael J. Wysocki wrote: > On Monday, August 31, 2015 11:34:05 AM Xunlei Pang wrote: >> From: Xunlei Pang >> >> Since we are using cpuidle_driver::safe_state_index directly as the >> target state index, it is better to add th

Re: [PATCH v2 1/2] sched/fair: Fix bandwidth timer clock drift condition

2018-06-20 Thread Xunlei Pang
On 6/21/18 1:01 AM, bseg...@google.com wrote: > Xunlei Pang writes: > >> I noticed the group constantly got throttled even it consumed >> low cpu usage, this caused some jitters on the response time >> to some of our business containers enabling cpu quota. >> &g

Re: [PATCH v2 1/2] sched/fair: Fix bandwidth timer clock drift condition

2018-06-21 Thread Xunlei Pang
On 6/21/18 4:08 PM, Peter Zijlstra wrote: > On Thu, Jun 21, 2018 at 11:56:56AM +0800, Xunlei Pang wrote: >>>> Fixes: 51f2176d74ac ("sched/fair: Fix unlocked reads of some >>>> cfs_b->quota/period") >>>> Cc: Ben Segall >>> >>&g

[PATCH] sched/cputime: Ensure correct utime and stime proportion

2018-06-22 Thread Xunlei Pang
last parse in cputime_adjust(), and accumulate the corresponding results calculated into prev_cputime. A new field of task_cputime type is added in structure prev_cputime to record previous task_cputime so that we can get the elapsed time deltas. Signed-off-by: Xunlei Pang --- include/linux/sched.h

Re: [PATCH] sched/cputime: Ensure correct utime and stime proportion

2018-06-25 Thread Xunlei Pang
ase drop us a note to > help improve the system] > > url: > https://github.com/0day-ci/linux/commits/Xunlei-Pang/sched-cputime-Ensure-correct-utime-and-stime-proportion/20180622-153720 > reproduce: make htmldocs > > All warnings (new ones prefixed by >>): >

Re: [PATCH] sched/fair: sync expires_seq in distribute_cfs_runtime()

2018-07-29 Thread Xunlei Pang
;s a problem, as expires_seq will get synced in assign_cfs_rq_runtime(). Thanks, Xunlei > > Fixes: 512ac999d275 ("sched/fair: Fix bandwidth timer clock drift condition") > Cc: Xunlei Pang > Cc: Ben Segall > Cc: Linus Torvalds > Cc: Peter Zijlstra > Cc: Thomas

Re: [PATCH] sched/fair: sync expires_seq in distribute_cfs_runtime()

2018-07-31 Thread Xunlei Pang
On 7/31/18 1:55 AM, Cong Wang wrote: > On Sun, Jul 29, 2018 at 10:29 PM Xunlei Pang wrote: >> >> Hi Cong, >> >> On 7/28/18 8:24 AM, Cong Wang wrote: >>> Each time we sync cfs_rq->runtime_expires with cfs_b->runtime_expires, >>> we should sync i

Re: [PATCH] sched/fair: sync expires_seq in distribute_cfs_runtime()

2018-07-31 Thread Xunlei Pang
On 8/1/18 4:55 AM, Cong Wang wrote: > On Tue, Jul 31, 2018 at 10:13 AM wrote: >> >> Xunlei Pang writes: >> >>> On 7/31/18 1:55 AM, Cong Wang wrote: >>>> On Sun, Jul 29, 2018 at 10:29 PM Xunlei Pang >>>> wrote: >>>>> >&g

Re: [tip:sched/core] sched/cputime: Ensure accurate utime and stime ratio in cputime_adjust()

2018-07-24 Thread Xunlei Pang
On 7/23/18 5:21 PM, Peter Zijlstra wrote: > On Tue, Jul 17, 2018 at 12:08:36PM +0800, Xunlei Pang wrote: >> The trace data corresponds to the last sample period: >> trace entry 1: >> cat-20755 [022] d... 1370.106496: cputime_adjust: task >> tick-bas

[PATCH v2 1/3] sched/deadline: Zero out positive runtime after throttling constrained tasks

2017-05-11 Thread Xunlei Pang
if positive after throttling. Fixes: df8eac8cafce ("sched/deadline: Throttle a constrained deadline task activated after the deadline) Acked-by: Daniel Bristot de Oliveira Signed-off-by: Xunlei Pang --- kernel/sched/deadline.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kern

[PATCH v2 3/3] sched/deadline: Add statistics to track runtime underruns

2017-05-11 Thread Xunlei Pang
errun_block: 0 dl.nr_underrun_yield: 0 Very large "dl.nr_underrun_sched" hints it's very likely that there is some underlying scheduling issue. Note that we don't use CONFIG_SCHED_DEBUG as the accounting added has little overhead(also

[PATCH v2 2/3] sched/deadline: Throttle the task when missing its deadline

2017-05-11 Thread Xunlei Pang
case of missed deadlines") Cc: Luca Abeni Signed-off-by: Xunlei Pang --- kernel/sched/deadline.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c index d3d291e..5691149 100644 --- a/kernel/sched/deadline.c +++ b/ke

Re: [PATCH] sched/deadline: Zero out positive runtime after throttling constrained tasks

2017-05-11 Thread Xunlei Pang
On 05/11/2017 at 09:38 AM, Xunlei Pang wrote: > On 05/10/2017 at 09:36 PM, Steven Rostedt wrote: >> On Wed, 10 May 2017 21:03:37 +0800 >> Xunlei Pang wrote: >> >>> When a contrained task is throttled by dl_check_constrained_dl(), >>> it may carry the remai

Re: [PATCH v2 2/3] sched/deadline: Throttle the task when missing its deadline

2017-05-11 Thread Xunlei Pang
On 05/12/2017 at 01:57 PM, luca abeni wrote: > Hi again, > > (sorry for the previous email; I replied from gmail and I did not > realize I was sending it in html). > > > On Fri, 12 May 2017 11:32:08 +0800 > Xunlei Pang wrote: > >> dl_runtime_exceeded() only

Re: [PATCH v2 2/3] sched/deadline: Throttle the task when missing its deadline

2017-05-12 Thread Xunlei Pang
On 05/12/2017 at 03:01 PM, luca abeni wrote: > Hi, > > On Fri, 12 May 2017 14:53:33 +0800 > Xunlei Pang wrote: > >> On 05/12/2017 at 01:57 PM, luca abeni wrote: >>> Hi again, >>> >>> (sorry for the previous email; I replied from gmail an

Re: [PATCH v2 2/3] sched/deadline: Throttle the task when missing its deadline

2017-05-14 Thread Xunlei Pang
On 05/13/2017 at 04:58 AM, luca abeni wrote: > On Fri, 12 May 2017 15:19:55 +0800 > Xunlei Pang wrote: > [...] >>>> "As seen, enforcing that the total utilization is smaller than M >>>> does not guarantee that global EDF schedules the tasks without >

Re: linux-next: build warning after merge of the akpm-current tree

2017-05-14 Thread Xunlei Pang
hen/Andrew, Sorry for the trouble. The following patch will fix it, do you want to me to send it out separately? or help merge it into fc7d2b44367f ("powerpc/fadump: use the correct VMCOREINFO_NOTE_SIZE for phdr") directly? Thanks, Xunlei === Fr

Re: [PATCH v2 1/3] sched/deadline: Zero out positive runtime after throttling constrained tasks

2017-05-14 Thread Xunlei Pang
On 05/12/2017 at 11:32 AM, Xunlei Pang wrote: > When a contrained task is throttled by dl_check_constrained_dl(), > it may carry the remaining positive runtime, as a result when > dl_task_timer() fires and calls replenish_dl_entity(), it will > not be replenished correctly due to

[PATCH] crash: Fix linux-next build warning

2017-05-14 Thread Xunlei Pang
MCOREINFO_BYTES. Andrew will help merge it into commit fc7d2b44367f ("powerpc/fadump: use the correct VMCOREINFO_NOTE_SIZE for phdr") before sending it to stable. Signed-off-by: Xunlei Pang --- kernel/crash_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel

Re: [PATCH 1/3] mm/memcg: Fix min/low usage in propagate_protected_usage()

2018-12-05 Thread Xunlei Pang
Hi Roman, On 2018/12/4 AM 2:00, Roman Gushchin wrote: > On Mon, Dec 03, 2018 at 04:01:17PM +0800, Xunlei Pang wrote: >> When usage exceeds min, min usage should be min other than 0. >> Apply the same for low. >> >> Signed-off-by: Xunlei Pang >> --- >> mm

[PATCH 1/3] mm/memcg: Fix min/low usage in propagate_protected_usage()

2018-12-03 Thread Xunlei Pang
When usage exceeds min, min usage should be min other than 0. Apply the same for low. Signed-off-by: Xunlei Pang --- mm/page_counter.c | 12 ++-- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/mm/page_counter.c b/mm/page_counter.c index de31470655f6..75d53f15f040 100644

[PATCH 2/3] mm/vmscan: Enable kswapd to reclaim low-protected memory

2018-12-03 Thread Xunlei Pang
igned-off-by: Xunlei Pang --- mm/vmscan.c | 8 1 file changed, 8 insertions(+) diff --git a/mm/vmscan.c b/mm/vmscan.c index 62ac0c488624..3d412eb91f73 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -3531,6 +3531,7 @@ static int balance_pgdat(pg_data_t *pgdat, int order, int classzon

[PATCH 3/3] mm/memcg: Avoid reclaiming below hard protection

2018-12-03 Thread Xunlei Pang
this part of usages to be reclaimed. Signed-off-by: Xunlei Pang --- include/linux/memcontrol.h | 7 +-- mm/memcontrol.c| 9 +++-- mm/vmscan.c| 17 +++-- 3 files changed, 27 insertions(+), 6 deletions(-) diff --git a/include/linux/memcontrol.h b

Re: [PATCH 1/3] mm/memcg: Fix min/low usage in propagate_protected_usage()

2018-12-03 Thread Xunlei Pang
On 2018/12/3 下午7:54, Michal Hocko wrote: > On Mon 03-12-18 16:01:17, Xunlei Pang wrote: >> When usage exceeds min, min usage should be min other than 0. >> Apply the same for low. > > Why? What is the actual problem. children_min_usage tracks the total children usages un

Re: [PATCH 2/3] mm/vmscan: Enable kswapd to reclaim low-protected memory

2018-12-03 Thread Xunlei Pang
On 2018/12/3 下午7:56, Michal Hocko wrote: > On Mon 03-12-18 16:01:18, Xunlei Pang wrote: >> There may be cgroup memory overcommitment, it will become >> even common in the future. >> >> Let's enable kswapd to reclaim low-protected memory in case >> of memory p

Re: [PATCH 2/3] mm/vmscan: Enable kswapd to reclaim low-protected memory

2018-12-03 Thread Xunlei Pang
On 2018/12/4 AM 1:22, Michal Hocko wrote: > On Mon 03-12-18 23:20:31, Xunlei Pang wrote: >> On 2018/12/3 下午7:56, Michal Hocko wrote: >>> On Mon 03-12-18 16:01:18, Xunlei Pang wrote: >>>> There may be cgroup memory overcommitment, it will become >>>>

Re: [PATCH 3/3] mm/memcg: Avoid reclaiming below hard protection

2018-12-03 Thread Xunlei Pang
On 2018/12/3 PM 7:57, Michal Hocko wrote: > On Mon 03-12-18 16:01:19, Xunlei Pang wrote: >> When memcgs get reclaimed after its usage exceeds min, some >> usages below the min may also be reclaimed in the current >> implementation, the amount is considerably large dur

Re: [PATCH 2/3] mm/vmscan: Enable kswapd to reclaim low-protected memory

2018-12-04 Thread Xunlei Pang
On 2018/12/4 PM 3:25, Michal Hocko wrote: > On Tue 04-12-18 10:40:29, Xunlei Pang wrote: >> On 2018/12/4 AM 1:22, Michal Hocko wrote: >>> On Mon 03-12-18 23:20:31, Xunlei Pang wrote: >>>> On 2018/12/3 下午7:56, Michal Hocko wrote: >>>>> On Mon 03-12-18

Re: [PATCH] sched/cputime: Ensure correct utime and stime proportion

2018-07-08 Thread Xunlei Pang
Hi Peter, On 7/5/18 9:21 PM, Xunlei Pang wrote: > On 7/5/18 6:46 PM, Peter Zijlstra wrote: >> On Wed, Jun 27, 2018 at 08:22:42PM +0800, Xunlei Pang wrote: >>> tick-based whole utime is utime_0, tick-based whole stime >>> is stime_0, scheduler time is rtime_0. >>

[PATCH v2] sched/cputime: Ensure accurate utime and stime ratio in cputime_adjust()

2018-07-09 Thread Xunlei Pang
time type field is added in prev_cputime to record previous task_cputime so that we can get the elapsed times as the accurate ratio. Signed-off-by: Xunlei Pang --- v1->v2: - Rewrite the changelog. include/linux/sched.h | 34 include/linux/sched/cputi

Re: [PATCH] sched/cputime: Ensure correct utime and stime proportion

2018-07-09 Thread Xunlei Pang
Hi Peter, On 7/9/18 6:48 PM, Peter Zijlstra wrote: > On Mon, Jul 09, 2018 at 01:52:38PM +0800, Xunlei Pang wrote: >> Please see the enclosure for the reproducer cputime_adjust.tgz > > No, I'm not going to reverse engineer something if you cannot even > explain what the pr

Re: [PATCH] sched/cputime: Ensure correct utime and stime proportion

2018-06-26 Thread Xunlei Pang
On 6/22/18 3:15 PM, Xunlei Pang wrote: > We use per-cgroup cpu usage statistics similar to "cgroup rstat", > and encountered a problem that user and sys usages are wrongly > split sometimes. > > Run tasks with some random run-sleep pattern for a long time, and > when t

Re: [PATCH] sched/cputime: Ensure correct utime and stime proportion

2018-06-27 Thread Xunlei Pang
On 6/26/18 11:49 PM, Peter Zijlstra wrote: > On Tue, Jun 26, 2018 at 08:19:49PM +0800, Xunlei Pang wrote: >> On 6/22/18 3:15 PM, Xunlei Pang wrote: >>> We use per-cgroup cpu usage statistics similar to "cgroup rstat", >>> and encountered a problem that user

[PATCH 2/2] sched/fair: Advance global expiration when period timer is restarted

2018-06-18 Thread Xunlei Pang
is re-armed. The global expiration should be advanced accordingly when the bandwidth period timer is restarted. Signed-off-by: Xunlei Pang --- kernel/sched/fair.c | 15 ++- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 9f

[PATCH 1/2] sched/fair: Fix bandwidth timer clock drift condition

2018-06-18 Thread Xunlei Pang
following patch. Fixes: 51f2176d74ac ("sched/fair: Fix unlocked reads of some cfs_b->quota/period") Cc: Ben Segall Signed-off-by: Xunlei Pang --- kernel/sched/fair.c | 14 -- kernel/sched/sched.h | 6 -- 2 files changed, 12 insertions(+), 8 deletions(-) diff --gi

Re: [PATCH 1/2] sched/fair: Fix bandwidth timer clock drift condition

2018-06-18 Thread Xunlei Pang
On 6/19/18 2:44 AM, bseg...@google.com wrote: > Xunlei Pang writes: > >> The current condition to judge clock drift in expire_cfs_rq_runtime() >> is wrong, the two runtime_expires are actually the same when clock >> drift happens, so this condtion can never hit

Re: [PATCH 2/2] sched/fair: Advance global expiration when period timer is restarted

2018-06-18 Thread Xunlei Pang
On 6/19/18 2:58 AM, bseg...@google.com wrote: > Xunlei Pang writes: > >> I noticed the group frequently got throttled even it consumed >> low cpu usage, this caused some jitters on the response time >> to some of our business containers enabling cpu quota. >>

Re: [PATCH 2/2] sched/fair: Advance global expiration when period timer is restarted

2018-06-18 Thread Xunlei Pang
On 6/19/18 12:36 PM, Cong Wang wrote: > On Mon, Jun 18, 2018 at 2:16 AM, Xunlei Pang wrote: >> I noticed the group frequently got throttled even it consumed >> low cpu usage, this caused some jitters on the response time >> to some of our business containers enabling cpu q

Re: [PATCH 2/2] sched/fair: Advance global expiration when period timer is restarted

2018-06-19 Thread Xunlei Pang
On 6/20/18 1:49 AM, bseg...@google.com wrote: > Xunlei Pang writes: > >> On 6/19/18 2:58 AM, bseg...@google.com wrote: >>> Xunlei Pang writes: >>> >>>> I noticed the group frequently got throttled even it consumed >>>> low cpu usage, this ca

[PATCH v2 2/2] sched/fair: Advance global expiration when period timer is restarted

2018-06-20 Thread Xunlei Pang
date the global expiration in start_cfs_bandwidth() to avoid frequent expire_cfs_rq_runtime() calls once a new period begins. Signed-off-by: Xunlei Pang --- kernel/sched/fair.c | 15 ++- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair

[PATCH v2 1/2] sched/fair: Fix bandwidth timer clock drift condition

2018-06-20 Thread Xunlei Pang
76d74ac ("sched/fair: Fix unlocked reads of some cfs_b->quota/period") Cc: Ben Segall Signed-off-by: Xunlei Pang --- kernel/sched/fair.c | 14 -- kernel/sched/sched.h | 6 -- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/kernel/sched/

Re: [PATCH 2/2] sched/fair: Advance global expiration when period timer is restarted

2018-06-20 Thread Xunlei Pang
On 6/20/18 2:06 PM, Xunlei Pang wrote: > On 6/20/18 1:49 AM, bseg...@google.com wrote: >> Xunlei Pang writes: >> >>> On 6/19/18 2:58 AM, bseg...@google.com wrote: >>>> Xunlei Pang writes: >>>> >>>>> I noticed the group frequently

Re: [PATCH] sched/cputime: Ensure correct utime and stime proportion

2018-07-03 Thread Xunlei Pang
On 7/2/18 11:21 PM, Tejun Heo wrote: > Hello, Peter. > > On Tue, Jun 26, 2018 at 05:49:08PM +0200, Peter Zijlstra wrote: >> Well, no, because the Changelog is incomprehensible and the patch >> doesn't really have useful comments, so I'll have to reverse engineer >> the entire thing, and I've just

Re: [PATCH] sched/cputime: Ensure correct utime and stime proportion

2018-07-05 Thread Xunlei Pang
On 7/5/18 6:46 PM, Peter Zijlstra wrote: > On Wed, Jun 27, 2018 at 08:22:42PM +0800, Xunlei Pang wrote: >> tick-based whole utime is utime_0, tick-based whole stime >> is stime_0, scheduler time is rtime_0. > >> For a long time, the process runs mainly in userspace wi

Re: [tip:sched/core] sched/cputime: Ensure accurate utime and stime ratio in cputime_adjust()

2018-07-16 Thread Xunlei Pang
On 7/17/18 1:41 AM, Ingo Molnar wrote: > > * Peter Zijlstra wrote: > >> On Sun, Jul 15, 2018 at 04:36:17PM -0700, tip-bot for Xunlei Pang wrote: >>> Commit-ID: 8d4c00dc38a8aa30dae8402955e55e7b34e74bc8 >>> Gitweb: >>> https://git.kernel.org/ti

[PATCH 1/2] rtc/ab8500: set uie_unsupported flag

2014-12-08 Thread Xunlei Pang
ll disfunctional due to timer2 with the earliest expires in the timerqueue. So, rtc drivers must set this flag if they don't support UIE. Signed-off-by: Xunlei Pang --- drivers/rtc/rtc-ab8500.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/rtc/rtc-ab8500.c b/drivers/rtc/rtc-ab8

[PATCH 2/2] rtc: Refine rtc_timer_do_work() to consider other set alarm failures

2014-12-08 Thread Xunlei Pang
pires time, so the alarm irq will never be programmed. When such failures happen, this patch will retry __rtc_set_alarm(), if still can't program the alarm time, it will remove current rtc_timer from timerqueue and fetch next one, thus preventing it from affecting other rtc timers. Signed-off-

Re: [PATCH v2 3/3] time: clocksource: Add a comment to CLOCK_SOURCE_SUSPEND_NONSTOP

2015-01-23 Thread Xunlei Pang
Hi Thomas, On 23 January 2015 at 05:07, Thomas Gleixner wrote: > On Thu, 22 Jan 2015, Xunlei Pang wrote: >> When doing timekeeping_resume(), if the nonstop clocksource >> wraps back, "cycle_delta" will miss the wrap time. >> >> It's hard to de

Re: [PATCH v2 1/3] time: Don't bother to run rtc_resume() for the nonstop clocksource

2015-01-23 Thread Xunlei Pang
On 23 January 2015 at 02:30, John Stultz wrote: > On Thu, Jan 22, 2015 at 4:01 AM, Xunlei Pang wrote: >> If a system does not provide a persistent_clock(), the time >> will be updated on resume by rtc_resume(). With the addition >> of the non-stop clocksources for suspend

Re: [PATCH 1/5] sched/deadline: Modify cpudl::free_cpus to reflect rd->online

2015-01-23 Thread Xunlei Pang
Hi Peter, Juri, Could you please give some comments on these 5 patches? Thanks for your time. Regards, Xunlei On 19 January 2015 at 12:49, Xunlei Pang wrote: > Currently, cpudl::free_cpus contains all cpus during init, see > cpudl_init(). When calling cpudl_find(), we have to add rd->

[RFC PATCH v2 6/9] rtc/mxc: Modify rtc_update_alarm() not to touch the alarm time

2015-01-13 Thread Xunlei Pang
From: Xunlei Pang rtc_class_ops's set_alarm() shouldn't deal with the alarm date, as this is handled in the rtc core. See rtc_dev_ioctl()'s RTC_ALM_SET and RTC_WKALM_SET cases. Signed-off-by: Xunlei Pang --- drivers/rtc/rtc-mxc.c | 22 -- 1 file change

[RFC PATCH v2 9/9] alpha: change to use rtc_class_ops's set_mmss64()

2015-01-13 Thread Xunlei Pang
From: Xunlei Pang Change alpha_rtc_set_mmss() and remote_set_mmss() to use rtc_class_ops's set_mmss64(). Signed-off-by: Xunlei Pang --- arch/alpha/kernel/rtc.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/alpha/kernel/rtc.c b/arch/alpha/kernel/rtc.c

[RFC PATCH v2 2/9] time: Provide y2106 safe get_seconds() replacement

2015-01-13 Thread Xunlei Pang
From: Xunlei Pang As part of addressing "y2038 problem" for in-kernel uses, this patch adds safe get_seconds64() using time64_t. After this patch, get_seconds() is deprecated and all its call sites will be fixed using get_seconds64(), after that it can be removed. Signed-off-by: X

[RFC PATCH v2 3/9] rtc/test: Update driver to address y2038/y2106 issues

2015-01-13 Thread Xunlei Pang
From: Xunlei Pang This driver has a number of y2038/y2106 issues. This patch resolves them by: - Repalce get_seconds() with get_seconds64() - Replace rtc_time_to_tm() with rtc_time64_to_tm() - Change test_rtc_set_mmss() to use rtc_class_ops's set_mmss64() After this patch, this driver s

[RFC PATCH v2 8/9] rtc/mxc: Update driver to address y2038/y2106 issues

2015-01-13 Thread Xunlei Pang
From: Xunlei Pang This driver has a number of y2038/y2106 issues. This patch resolves them by: - Replace rtc_time_to_tm() with rtc_time64_to_tm() - Replace rtc_tm_to_time() with rtc_tm_to_time64() - Change mxc_rtc_set_mmss() to use rtc_class_ops's set_mmss64() After this patch, the d

[RFC PATCH v2 0/9] Provide y2038/y2106 safe rtc_class_ops.set_mmss64()

2015-01-13 Thread Xunlei Pang
From: Xunlei Pang This patch series relies on a former patchset[1], it provides y2038/y2106 safe rtc_class_ops.set_mmss64(), and converts some possible users of set_mmss() to use set_mmss64(), in the hope that making these users(i.e. rtc drivers) y2038/y2106 safe. The first version of this

[RFC PATCH v2 1/9] rtc: Provide y2038 safe rtc_class_ops.set_mmss() replacement

2015-01-13 Thread Xunlei Pang
From: Xunlei Pang 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 provides a safe version named set_mmss64() using y2038 safe time64_t. After this patch, set_mmss() is deprecated and al

[RFC PATCH v2 7/9] rtc/mxc: Convert get_alarm_or_time()/set_alarm_or_time() to use time64_t

2015-01-13 Thread Xunlei Pang
From: Xunlei Pang We want to convert mxc_rtc_set_mmss() to use rtc_class_ops's set_mmss64(), but it uses get_alarm_or_time()/set_alarm_or_time() internal interfaces which are y2038 unsafe. So here as a separate patch, it converts these two internal interfaces of "mxc" to use s

[RFC PATCH v2 4/9] rtc/ab3100: Update driver to address y2038/y2106 issues

2015-01-13 Thread Xunlei Pang
From: Xunlei Pang This driver has a number of y2038/y2106 issues. This patch resolves them by: - Replace rtc_tm_to_time() with rtc_tm_to_time64() - Replace rtc_time_to_tm() with rtc_time64_to_tm() - Change ab3100_rtc_set_mmss() to use rtc_class_ops's set_mmss64() After this patch, the d

[RFC PATCH v2 5/9] rtc/mc13xxx: Update driver to address y2038/y2106 issues

2015-01-13 Thread Xunlei Pang
From: Xunlei Pang This driver has a number of y2038/y2106 issues. This patch resolves them by: - Replace rtc_time_to_tm() with rtc_time64_to_tm() - Change mc13xxx_rtc_set_mmss() to use rtc_class_ops's set_mmss64() After this patch, the driver should not have any remaining y2038/y2106 i

Re: [RFC PATCH v2 2/9] time: Provide y2106 safe get_seconds() replacement

2015-01-14 Thread Xunlei Pang
On 14 January 2015 at 04:42, Thomas Gleixner wrote: > On Tue, 13 Jan 2015, Xunlei Pang wrote: > >> From: Xunlei Pang >> >> As part of addressing "y2038 problem" for in-kernel uses, this >> patch adds safe get_seconds64() using time64_t. >> >> A

Re: [RFC PATCH v2 3/9] rtc/test: Update driver to address y2038/y2106 issues

2015-01-14 Thread Xunlei Pang
On 14 January 2015 at 00:19, Alessandro Zummo wrote: > On Tue, 13 Jan 2015 23:44:51 +0800 > Xunlei Pang wrote: > >> This patch resolves them by: >> - Repalce get_seconds() with get_seconds64() >> - Replace rtc_time_to_tm() with rtc_time64_to_tm() >> -

Re: [RFC PATCH v2 5/9] rtc/mc13xxx: Update driver to address y2038/y2106 issues

2015-01-14 Thread Xunlei Pang
Cc Uwe Kleine-Koenig On 13 January 2015 at 23:44, Xunlei Pang wrote: > From: Xunlei Pang > > This driver has a number of y2038/y2106 issues. > > This patch resolves them by: > - Replace rtc_time_to_tm() with rtc_time64_to_tm() > - Change mc13xxx_rtc_set_mmss() to use rtc_c

Re: [RFC PATCH v2 6/9] rtc/mxc: Modify rtc_update_alarm() not to touch the alarm time

2015-01-14 Thread Xunlei Pang
Cc Fabio Estevam On 13 January 2015 at 23:44, Xunlei Pang wrote: > From: Xunlei Pang > > rtc_class_ops's set_alarm() shouldn't deal with the alarm date, > as this is handled in the rtc core. > > See rtc_dev_ioctl()'s RTC_ALM_SET and RTC_WKALM_SET case

Re: [RFC PATCH v2 3/9] rtc/test: Update driver to address y2038/y2106 issues

2015-01-14 Thread Xunlei Pang
On 14 January 2015 at 23:03, Alessandro Zummo wrote: > On Wed, 14 Jan 2015 22:56:15 +0800 > Xunlei Pang wrote: > >> We want to do away with set_mmss() eventually, time64 is the final version, >> so I think this would be ok. > > We'll get rid of set_mmss() from th

Re: [RFC PATCH v2 3/9] rtc/test: Update driver to address y2038/y2106 issues

2015-01-16 Thread Xunlei Pang
On 14 January 2015 at 23:39, Alessandro Zummo wrote: > On Wed, 14 Jan 2015 23:26:37 +0800 > Xunlei Pang wrote: > >> But on the other hand, we will have no test for set_mmss64(), >> because adding the set_mmss64() will make set_mmss() dysfunctional. > > add a modu

[PATCH 4/5] sched/rt: Consider deadline tasks in cpupri_find()

2015-01-18 Thread Xunlei Pang
t use of percpu local_cpu_mask to save an extra mask allocation, so always passing a non-NULL lowest_mask to cpupri_find(). Signed-off-by: Xunlei Pang --- kernel/sched/core.c | 2 ++ kernel/sched/cpupri.c | 22 +- kernel/sched/cpupri.h | 1 + kernel/sched/rt.c | 9

[PATCH 2/5] sched/deadline: Remove cpu_active_mask from cpudl_find()

2015-01-18 Thread Xunlei Pang
onto a dying cpu) which rq_offline_dl() can't handle timely, then it can be handled through _cpu_down()->...->multi_cpu_stop()->migration_call() ->migrate_tasks(), preventing the task from hanging on the dead cpu. Signed-off-by: Xunlei Pang --- kernel/sched/cpudeadline.c | 3 +--

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

2015-01-18 Thread Xunlei Pang
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 later_mask to cpudl_find(), thereby fixing this issue. Signed-off-by: Xunlei Pang --- kernel/

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

2015-01-18 Thread Xunlei Pang
e interation of sched_domain() in passing. Signed-off-by: Xunlei Pang --- kernel/sched/rt.c | 17 + 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c index d28cfa4..e6a42e6 100644 --- a/kernel/sched/rt.c +++ b/kernel/sched/rt.c @@ -1535,6 +1

[PATCH 1/5] sched/deadline: Modify cpudl::free_cpus to reflect rd->online

2015-01-18 Thread Xunlei Pang
_rq(). This patch adds cpudl_set_freecpu() and cpudl_clear_freecpu() for changing cpudl::free_cpus when doing rq_online_dl()/rq_offline_dl(), so we can avoid the rd->span operation when calling cpudl_find() in find_later_rq(). Signed-off-by: Xunlei Pang --- kernel/sched/cpudeadline.

Re: [PATCH 4/5] sched/rt: Consider deadline tasks in cpupri_find()

2015-01-28 Thread Xunlei Pang
Hi Steven, On 28 January 2015 at 07:04, Steven Rostedt wrote: > On Tue, 27 Jan 2015 13:58:59 +0100 > Peter Zijlstra wrote: > > >> Not a bad idea, Cc'ed Steve who likes to look after the RT bits, >> excessive quoting for him. > > Yep I do. > > >> > index ade2958..48c9576 100644 >> > --- a/kernel/

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

2015-01-28 Thread Xunlei Pang
Hi Peter, On 28 January 2015 at 00:47, Peter Zijlstra wrote: > On Mon, Jan 19, 2015 at 04:49:38AM +0000, Xunlei Pang 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 al

[PATCH 2/5] drivers/rtc/isl1208: Replace deprecated rtc_tm_to_time()

2015-04-15 Thread Xunlei Pang
From: Xunlei Pang isl1208_i2c_set_alarm() uses deprecated rtc_tm_to_time(), which will overflow in year 2106 on 32-bit machines. This patch solves this by: - Replacing rtc_tm_to_time() with rtc_tm_to_time64() Cc: Herbert Valerio Riedel Signed-off-by: Xunlei Pang --- drivers/rtc/rtc-isl1208

[PATCH 1/5] drivers/rtc/pcf8563: Replace deprecated rtc_time_to_tm() and rtc_tm_to_time()

2015-04-15 Thread Xunlei Pang
From: Xunlei Pang pcf8563_rtc_set_alarm() uses deprecated rtc_tm_to_time() and rtc_time_to_tm(), which will overflow in year 2106 on 32-bit machines. This patch solves this by: - Replacing rtc_time_to_tm() with rtc_time64_to_tm() - Replacing rtc_tm_to_time() with rtc_tm_to_time64() Signed

[PATCH 3/5] drivers/rtc/sunxi: Replace deprecated rtc_tm_to_time()

2015-04-15 Thread Xunlei Pang
From: Xunlei Pang sunxi_rtc_setalarm() uses deprecated rtc_tm_to_time(), which will overflow in year 2106 on 32-bit machines. This patch solves this by: - Replacing rtc_tm_to_time() with rtc_tm_to_time64() Also remove the unnecessary initial zeroing of some local variables in

[PATCH 4/5] drivers/rtc/pl030: Replace deprecated rtc_tm_to_time() and rtc_time_to_tm()

2015-04-15 Thread Xunlei Pang
From: Xunlei Pang The driver uses deprecated rtc_tm_to_time() and rtc_time_to_tm(), which will overflow in year 2106 on 32-bit machines. This patch solves this by: - Replacing rtc_tm_to_time() with rtc_tm_to_time64() - Replacing rtc_time_to_tm() with rtc_time64_to_tm() Cc: Russell King

[PATCH 5/5] drivers/rtc/sa1100: Replace deprecated rtc_tm_to_time() and rtc_time_to_tm()

2015-04-15 Thread Xunlei Pang
From: Xunlei Pang The driver uses deprecated rtc_tm_to_time() and rtc_time_to_tm(), which will overflow in year 2106 on 32-bit machines. This patch solves this by: - Replacing rtc_tm_to_time() with rtc_tm_to_time64() - Replacing rtc_time_to_tm() with rtc_time64_to_tm() Cc: CIH Cc: Nicolas

Re: [PATCH RESEND v4 2/3] sched/rt: Fix wrong SMP scheduler behavior for equal prio cases

2015-03-31 Thread Xunlei Pang
On 27 March 2015 at 23:28, Steven Rostedt wrote: > On Mon, 9 Mar 2015 15:32:27 +0800 > Xunlei Pang wrote: > >> From: Xunlei Pang >> >> Currently, SMP RT scheduler has some trouble in dealing with >> equal prio cases. >> >> For example, in check_p

Re: [PATCH] sched/fair: Restore env status before goto redo in load_balance()

2015-03-31 Thread Xunlei Pang
On 27 March 2015 at 23:30, Peter Zijlstra wrote: > On Wed, Mar 18, 2015 at 02:31:02PM +0800, Xunlei Pang wrote: >> From: Xunlei Pang >> >> In load_balance(), some members of lb_env will be assigned with >> new values in LBF_DST_PINNED case. But lb_env::flags may still

Re: [PATCH v10 07/11] sched: get CPU's usage statistic

2015-03-31 Thread Xunlei Pang
Vincent, On 27 March 2015 at 23:37, Vincent Guittot wrote: > On 27 March 2015 at 16:12, Xunlei Pang wrote: >>> +static int get_cpu_usage(int cpu) >>> +{ >>> + unsigned long usage = cpu_rq(cpu)->cfs.utilization_load_avg; >>> + uns

Re: [PATCH v10 08/11] sched: replace capacity_factor by usage

2015-03-31 Thread Xunlei Pang
Hi Vincent, On 27 March 2015 at 23:59, Vincent Guittot wrote: > On 27 March 2015 at 15:52, Xunlei Pang wrote: >> Hi Vincent, >> >> On 27 February 2015 at 23:54, Vincent Guittot >> wrote: >>> /** >>> @@ -6432,18 +6435,19 @@ static inline void updat

Re: [PATCH v10 08/11] sched: replace capacity_factor by usage

2015-04-01 Thread Xunlei Pang
Hi Vincent, On 1 April 2015 at 17:06, Vincent Guittot wrote: > On 1 April 2015 at 05:37, Xunlei Pang wrote: >> Hi Vincent, >> >> On 27 March 2015 at 23:59, Vincent Guittot >> wrote: >>> On 27 March 2015 at 15:52, Xunlei Pang wrote: >>>> Hi

[RFC PATCH 4/6] lib/plist: Provide plist_add_head() for nodes with the same prio

2015-04-26 Thread Xunlei Pang
From: Xunlei Pang If there're multiple nodes with the same prio as @node, currently plist_add() will add @node behind all of them. Now we need to add @node before all of these nodes for SMP RT scheduler. This patch adds a common __plist_add() for adding @node before or after existing nodes

[RFC PATCH 2/6] sched/rt: Check to push task away when its affinity is changed

2015-04-26 Thread Xunlei Pang
From: Xunlei Pang We may suffer from extra rt overload rq due to the affinity, so when the affinity of any runnable rt task is changed, we should check to trigger balancing, otherwise it will cause some unnecessary delayed real-time response. Unfortunately, current RT global scheduler does

[RFC PATCH 6/6] sched/rt: Requeue p back if the preemption of check_preempt_equal_prio_common() failed

2015-04-26 Thread Xunlei Pang
From: Xunlei Pang In check_preempt_equal_prio_common(), it requeues "next" ahead in the "run queue" and want to push current away. But when doing the actual pushing, if the system state changes, the pushing may fail as a result. In this case, p finally becomes the new curr

[RFC PATCH 1/6] sched/rt: Provide new check_preempt_equal_prio_common()

2015-04-26 Thread Xunlei Pang
From: Xunlei Pang When p is queued, there may be other tasks already queued at the same priority in the "run queue", so we should peek the most front one to do the equal priority preemption. This patch modifies check_preempt_equal_prio() and provides new check_preempt_equal_prio_comm

[RFC PATCH 3/6] sched/rt: Check to push FIFO current away at each tick

2015-04-26 Thread Xunlei Pang
From: Xunlei Pang There may be some non-migratable tasks queued in the "run queue" with the same priority as current which is FIFO and migratable, so at each tick we can check and try to push current away and give these tasks a chance of running(we don't do this for tasks qu

[RFC PATCH 5/6] sched/rt: Fix wrong SMP scheduler behavior for equal prio cases

2015-04-26 Thread Xunlei Pang
From: Xunlei Pang We know, there are two main queues each cpu for RT scheduler: Let's call them "run queue" and "pushable queue" respectively. For RT tasks, the scheduler uses "plist" to manage the pushable queue, so when there are multiple tasks queued at th

[RFC PATCH RESEND 0/4] Maintain the FIFO order for same priority RT tasks

2015-04-26 Thread Xunlei Pang
From: Xunlei Pang 1. TWO FIFO QUEUES We know, there are two main queues each cpu for RT SMP scheduler. Let's name them "run queue" and "pushable queue" respectively. "run queue" is from the intra-cpu's perspective, while "pushable queue" is

[RFC PATCH RESEND 1/4] sched/rt: Modify check_preempt_equal_prio() for multiple tasks queued at the same priority

2015-04-26 Thread Xunlei Pang
From: Xunlei Pang In check_preempt_equal_prio(), when p is queued, there may be other tasks already queued at the same priority in the "run queue", so we should peek the most front one to do the preemption, not the p. This patch modified it and moved the preemption job to a new func

[RFC PATCH RESEND 2/4] lib/plist: Provide plist_add_head() for nodes with the same prio

2015-04-26 Thread Xunlei Pang
From: Xunlei Pang If there're multiple nodes with the same prio as @node, currently plist_add() will add @node behind all of them. Now we need to add @node before all of these nodes for SMP RT scheduler. This patch adds a common __plist_add() for adding @node before or after existing nodes

  1   2   3   4   5   6   >