Re: [PATCH v3 5/6] sched/deadline/rtmutex: Fix unprotected PI access in enqueue_task_dl()

2016-04-20 Thread Xunlei Pang
On 2016/04/20 at 21:17, Peter Zijlstra wrote: > On Wed, Apr 20, 2016 at 09:00:32PM +0800, Xunlei Pang wrote: > >>> But what happens? How is it changed when it is blocked? >> The top waiter's policy can be changed by other tasks through >> sched_setattr() sys

Re: [PATCH v3 2/6] sched/rtmutex/deadline: Fix a PI crash for deadline tasks

2016-04-21 Thread Xunlei Pang
Hi Peter, On 2016/04/20 at 21:49, Xunlei Pang wrote: > On 2016/04/20 at 21:19, Peter Zijlstra wrote: >> On Thu, Apr 14, 2016 at 07:37:03PM +0800, Xunlei Pang wrote: >>> + /* Updated under pi_lock and rtmutex lock */ >>> struct rb_node *pi_waiters_leftm

Re: [PATCH v2 1/2] sched/rtmutex/deadline: Fix a PI crash for deadline tasks

2016-04-08 Thread Xunlei Pang
On 2016/04/07 at 02:14, Peter Zijlstra wrote: > On Wed, Apr 06, 2016 at 08:59:15PM +0800, Xunlei Pang wrote: >> A crash happened while I'm playing with deadline PI rtmutex. >> >> BUG: unable to handle kernel NULL pointer dereference at 0018 >> I

[PATCH] sched/rt/deadline: Share cpumask between rt and deadline for SMP scheduling

2016-04-08 Thread Xunlei Pang
sk" was already initiated. After that we again safely removed the NULL cpumask judgement from find_lowest_rq() and find_later_rq(), because "sched_pp_shared_mask" was surely initialized before the first SMP scheduling happens. Inspired-by: Peter Zijlstra Signed-off-by: Xunlei

Re: [PATCH] sched/deadline/rtmutex: Fix a PI crash for deadline tasks

2016-04-08 Thread Xunlei Pang
On 2016/04/09 at 02:59, Peter Zijlstra wrote: > On Fri, Apr 08, 2016 at 02:50:55PM -0400, Steven Rostedt wrote: >> On Fri, 8 Apr 2016 19:38:35 +0200 >> Peter Zijlstra wrote: >> >>> On Fri, Apr 08, 2016 at 12:25:10PM -0400, Steven Rostedt wrote: >>> So the preempt_disable() is to allow us to s

Re: [PATCH] sched/deadline/rtmutex: Fix a PI crash for deadline tasks

2016-04-08 Thread Xunlei Pang
On 2016/04/09 at 03:28, Steven Rostedt wrote: > On Fri, 8 Apr 2016 15:15:42 -0400 > Steven Rostedt wrote: > >> From what I understand, the slowfn() modifies the task pi_list (or >> rbtree, as it is today). As this is an unlock, the task being woken >> (the next one to grab the lock) is removed fro

Re: [PATCH] sched/deadline/rtmutex: Fix a PI crash for deadline tasks

2016-04-10 Thread Xunlei Pang
On 2016/04/09 at 21:29, Peter Zijlstra wrote: > On Sat, Apr 09, 2016 at 11:25:39AM +0800, Xunlei Pang wrote: > >>> In any case, I just realized we do not in fact provide this guarantee >>> (of pointing to a blocked task) that needs a bit more work. >> Current pa

Re: [PATCH] s390/kexec: Consolidate crash_map/unmap_reserved_pages() and arch_kexec_protect(unprotect)_crashkres()

2016-04-04 Thread Xunlei Pang
On 2016/04/04 at 22:58, Michael Holzheu wrote: > Hello Xunlei, > > On Sat, 2 Apr 2016 09:23:50 +0800 > Xunlei Pang wrote: > >> On 2016/04/02 at 01:41, Michael Holzheu wrote: >>> Hello Xunlei again, >>> >>> Some initial comments below... >>&g

[PATCH v2] s390/kexec: Consolidate crash_map/unmap_reserved_pages() and arch_kexec_protect(unprotect)_crashkres()

2016-04-05 Thread Xunlei Pang
mory to be mapped initially, so get rid of S390 crash kernel memblock removal in reserve_crashkernel(). Once kdump kernel is loaded, the new arch_kexec_protect_crashkres() implemented for S390 will actually unmap the pgtable like before. Cc: Heiko Carstens Signed-off-by: Xunlei Pang Signed-off-b

Re: [PATCH] sched/deadline/rtmutex: Fix a PI crash for deadline tasks

2016-04-05 Thread Xunlei Pang
On 2016/04/02 at 05:51, Peter Zijlstra wrote: > On Fri, Apr 01, 2016 at 09:34:24PM +0800, Xunlei Pang wrote: > >>>> I checked the code, currently only deadline accesses the >>>> pi_waiters/pi_waiters_leftmost >>>> without pi_lock held via rt_mutex_get_top

Re: [PATCH v2] s390/kexec: Consolidate crash_map/unmap_reserved_pages() and arch_kexec_protect(unprotect)_crashkres()

2016-04-05 Thread Xunlei Pang
On 2016/04/05 at 17:13, Michael Holzheu wrote: > Hello Xunlei, > > On Tue, 5 Apr 2016 15:09:59 +0800 > Xunlei Pang wrote: >> Commit 3f625002581b ("kexec: introduce a protection mechanism >> for the crashkernel reserved memory") is a similar mechanism >>

Re: [PATCH] sched/deadline/rtmutex: Fix a PI crash for deadline tasks

2016-04-05 Thread Xunlei Pang
On 2016/04/05 at 17:29, Peter Zijlstra wrote: > On Tue, Apr 05, 2016 at 11:19:54AM +0200, Peter Zijlstra wrote: >> Or did I miss something (again) ? :-) >> >> --- >> kernel/locking/rtmutex.c | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/kernel/locking/rtmutex.c b/

Re: [PATCH] s390/kexec: Consolidate crash_map/unmap_reserved_pages() and arch_kexec_protect(unprotect)_crashkres()

2016-04-06 Thread Xunlei Pang
On 2016/03/31 at 11:52, Xunlei Pang wrote: > Hi Bao, > > On 2016/03/31 at 10:52, Baoquan He wrote: >> On 03/31/16 at 10:43am, Minfei Huang wrote: >>> On 03/30/16 at 08:30pm, Baoquan He wrote: >>>> Hi Xunlei, >>>> >>>> I have two questio

[PATCH v2 2/2] rtmutex: Kill pi_waiters_leftmost from task_struct

2016-04-06 Thread Xunlei Pang
task. We don't remove rt_mutex:pi_waiters_leftmost, as it is quite possible for many tasks sharing one rtmutex. Thus, hereby remove pi_waiters_leftmost from task_struct. Signed-off-by: Xunlei Pang --- include/linux/init_task.h | 1 - include/linux/sched.h | 1 - ker

[PATCH v2 1/2] sched/rtmutex/deadline: Fix a PI crash for deadline tasks

2016-04-06 Thread Xunlei Pang
, with several tweaks and improvements by me. Tested-by: Xunlei Pang Originally-From: Peter Zijlstra (Intel) Signed-off-by: Xunlei Pang --- Without the patch, kernel crashes in seconds, after the patch it can survive overnight. include/linux/init_task.h | 3 +- include/linux/sched.h |

[PATCH] rtmutex: Consider deadline tasks in try_to_take_rt_mutex()

2016-04-06 Thread Xunlei Pang
so above logic will always return 0, this is wrong. To solve this, we added extra deadline comparing, and let the task with smaller deadline win, or the top waiter win if equal. Signed-off-by: Xunlei Pang --- kernel/locking/rtmutex.c | 19 --- 1 file changed, 16 insertions(+), 3

Re: [PATCH] sched/deadline: No need to check NULL later_mask

2016-04-06 Thread Xunlei Pang
On 2016/04/06 at 17:30, Peter Zijlstra wrote: > On Sat, Apr 02, 2016 at 06:14:28PM +0800, Xunlei Pang wrote: >> Your proposal is very nice! >> >> At the sched_init() stage we only have one (to be "idle") task and with irq >> disabled, >> no scheduling

Re: [PATCH v3 1/6] rtmutex: Deboost before waking up the top waiter

2016-04-18 Thread Xunlei Pang
On 2016/04/18 at 16:23, Thomas Gleixner wrote: > On Thu, 14 Apr 2016, Xunlei Pang wrote: >> We should deboost before waking the high-prio task such that >> we don't run two tasks with the 'same' priority. > No. This is fundamentaly broken. > > T1 (prio 0)

Re: [PATCH v3 1/6] rtmutex: Deboost before waking up the top waiter

2016-04-18 Thread Xunlei Pang
On 2016/04/18 at 17:02, Thomas Gleixner wrote: > On Mon, 18 Apr 2016, Xunlei Pang wrote: >> On 2016/04/18 at 16:23, Thomas Gleixner wrote: >>> On Thu, 14 Apr 2016, Xunlei Pang wrote: >>>> We should deboost before waking the high-prio task such that >>>

[PATCH v3] s390/kexec: Consolidate crash_map/unmap_reserved_pages() and arch_kexec_protect(unprotect)_crashkres()

2016-04-25 Thread Xunlei Pang
mory to be mapped initially, this is done in machine_kdump_pm_init() which is after reserve_crashkernel(). Once kdump kernel is loaded, the new arch_kexec_protect_crashkres() implemented for S390 will actually unmap the pgtable like before. Acked-by: Michael Holzheu Cc: Heiko Carstens Signed-off-

[PATCH v4 1/2] rtmutex: Deboost before waking up the top waiter

2016-04-26 Thread Xunlei Pang
tor. Suggested-by: Peter Zijlstra Signed-off-by: Xunlei Pang --- v3 -> v4: Improved changelog. kernel/futex.c | 5 ++--- kernel/locking/rtmutex.c| 28 kernel/locking/rtmutex_common.h | 1 + 3 files changed, 27 insertions(+), 7 deletions(-)

[PATCH v4 2/2] sched/rtmutex/deadline: Fix a PI crash for deadline tasks

2016-04-26 Thread Xunlei Pang
ex. Originally-From: Peter Zijlstra Signed-off-by: Xunlei Pang --- v3 -> v4: Cache a task_struct pi_top_task pointer instead of rt_mutex_waiter. include/linux/init_task.h | 1 + include/linux/sched.h | 2 ++ include/linux/sched/rt.h | 1 + kernel/for

[PATCH] s390/kexec: Consolidate crash_map/unmap_reserved_pages() and arch_kexec_protect(unprotect)_crashkres()

2016-03-30 Thread Xunlei Pang
d0) ([<0063067c>] system_call+0x244/0x264) Cc: Michael Holzheu Signed-off-by: Xunlei Pang --- Tested kexec/kdump on S390x arch/s390/kernel/machine_kexec.c | 86 ++-- arch/s390/kernel/setup.c | 7 ++-- include/linux/kexec.h

Re: [PATCH] s390/kexec: Consolidate crash_map/unmap_reserved_pages() and arch_kexec_protect(unprotect)_crashkres()

2016-03-30 Thread Xunlei Pang
ap/unmap_reserved_pages() and arch_kexec_protect(unprotect)_crashkres() [Patch03(x86_64)] kexec: provide arch_kexec_protect(unprotect)_crashkres() I don't know if it is possible to reorder that since they are already in "linux-next", ask Andrew for help :-) Regards, Xunlei >&

[PATCH] sched/deadline/rtmutex: Fix a PI crash for deadline tasks

2016-04-01 Thread Xunlei Pang
ue_pi() and rt_mutex_dequeue_pi() lock rq when operating "pi_waiters" and "pi_waiters_leftmost". We need this iff lock owner has the deadline priority. Signed-off-by: Xunlei Pang --- include/linux/sched/deadline.h | 3 +++ kernel/locking/rtmutex.c | 18 ++

[PATCH] sched/deadline: No need to check NULL later_mask

2016-04-01 Thread Xunlei Pang
Unlike rt tasks, we (should) have no deadline tasks in booting phase before the mask is allocated, so we can safely remove the check. Signed-off-by: Xunlei Pang --- kernel/sched/deadline.c | 4 1 file changed, 4 deletions(-) diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c

Re: [PATCH] sched/deadline: No need to check NULL later_mask

2016-04-01 Thread Xunlei Pang
On 2016/04/01 at 19:29, Peter Zijlstra wrote: > On Fri, Apr 01, 2016 at 07:13:18PM +0800, Xunlei Pang wrote: >> Unlike rt tasks, we (should) have no deadline tasks in >> booting phase before the mask is allocated, so we can >> safely remove the check. > Why? And have th

Re: [PATCH] sched/deadline/rtmutex: Fix a PI crash for deadline tasks

2016-04-01 Thread Xunlei Pang
On 2016/04/01 at 19:38, Peter Zijlstra wrote: > On Fri, Apr 01, 2016 at 07:00:18PM +0800, Xunlei Pang wrote: >> I found a kernel crash while playing with deadline PI rtmutex. >> >> BUG: unable to handle kernel NULL pointer dereference at 0018 >> I

Re: [PATCH] sched/deadline/rtmutex: Fix a PI crash for deadline tasks

2016-04-01 Thread Xunlei Pang
On 2016/04/01 at 21:12, Peter Zijlstra wrote: > > On 1 April 2016 14:23:58 CEST, Xunlei Pang wrote: > >>>> We need this iff lock owner has the deadline priority. >>> How is this deadline specific, those functions you modify are >>> deadline/rt agnostic

Re: [PATCH] s390/kexec: Consolidate crash_map/unmap_reserved_pages() and arch_kexec_protect(unprotect)_crashkres()

2016-04-01 Thread Xunlei Pang
On 2016/04/02 at 01:41, Michael Holzheu wrote: > Hello Xunlei again, > > Some initial comments below... > > On Wed, 30 Mar 2016 19:47:21 +0800 > Xunlei Pang wrote: > >> Commit 3f625002581b ("kexec: introduce a protection mechanism >> for the crashkernel re

Re: [PATCH] sched/deadline: No need to check NULL later_mask

2016-04-02 Thread Xunlei Pang
On 2016/04/02 at 00:21, Peter Zijlstra wrote: > On Fri, Apr 01, 2016 at 08:16:37PM +0800, Xunlei Pang wrote: >> On 2016/04/01 at 19:29, Peter Zijlstra wrote: >>> On Fri, Apr 01, 2016 at 07:13:18PM +0800, Xunlei Pang wrote: >>>> Unlike rt tasks, we (should) have no

Re: [PATCH] sched/deadline/rtmutex: Fix a PI crash for deadline tasks

2016-04-02 Thread Xunlei Pang
On 2016/04/02 at 05:51, Peter Zijlstra wrote: > On Fri, Apr 01, 2016 at 09:34:24PM +0800, Xunlei Pang wrote: > >>>> I checked the code, currently only deadline accesses the >>>> pi_waiters/pi_waiters_leftmost >>>> without pi_lock held via rt_mutex_get_top

Re: [PATCH] sched/deadline/rtmutex: Fix a PI crash for deadline tasks

2016-04-11 Thread Xunlei Pang
On 2016/04/10 at 16:22, Xunlei Pang wrote: > On 2016/04/09 at 21:29, Peter Zijlstra wrote: >> On Sat, Apr 09, 2016 at 11:25:39AM +0800, Xunlei Pang wrote: >> >>>> In any case, I just realized we do not in fact provide this guarantee >>>> (of pointing to a b

Re: [PATCH] sched/deadline/rtmutex: Fix a PI crash for deadline tasks

2016-04-12 Thread Xunlei Pang
On 2016/04/12 at 23:51, Peter Zijlstra wrote: > On Tue, Apr 12, 2016 at 11:08:04AM +0800, Xunlei Pang wrote: >> I spotted another issue, we access pi_task without any lock in >> enqueue_task_dl(), > OK, so I'm on the road and entirely jetlagged, but how can > enqueue_t

[PATCH] md: workqueue: Remove WQ_CPU_INTENSIVE from unbound workqueue allocations

2015-10-08 Thread Xunlei Pang
From: Xunlei Pang WQ_CPU_INTENSIVE is meaningless for the unbound workqueue, so remove it. Signed-off-by: Xunlei Pang --- drivers/md/dm-crypt.c | 4 ++-- drivers/md/dm-verity.c | 3 ++- drivers/md/raid5.c | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/md

[PATCH] workqueue: Allocate the unbound pool using local node memory

2015-10-08 Thread Xunlei Pang
From: Xunlei Pang Currently, get_unbound_pool() uses kzalloc() to allocate the worker pool. Actually, we can use the right node to do the allocation, achieving local memory access. This patch selects target node first, and uses kzalloc_node() instead. Signed-off-by: Xunlei Pang --- kernel

Re: [PATCH] sched/fair: don't push cfs_bandwith slack timers forward

2019-06-06 Thread Xunlei Pang
e, since we > need to start a new timer if the current one is in the process of > finishing. > > Signed-off-by: Ben Segall > --- We've also suffered from this performance issue recently: Reviewed-by: Xunlei Pang > kernel/sched/fair.c | 7 +++ > kernel/sched/sched.

Re: [PATCH v2] kexec: add cond_resched into kimage_alloc_crash_control_pages

2016-12-08 Thread Xunlei Pang
On 12/08/2016 at 10:37 AM, zhongjiang wrote: > From: zhong jiang > > A soft lookup will occur when I run trinity in syscall kexec_load. > the corresponding stack information is as follows. > > [ 237.235937] BUG: soft lockup - CPU#6 stuck for 22s! [trinity-c6:13859] > [ 237.242699] Kernel panic -

Re: [PATCH] x86/mce: Keep quiet in case of broadcasted mce after system panic

2017-01-23 Thread Xunlei Pang
On 01/23/2017 at 10:50 PM, Borislav Petkov wrote: > On Mon, Jan 23, 2017 at 09:35:53PM +0800, Xunlei Pang wrote: >> One possible timing sequence would be: >> 1st kernel running on multiple cpus panicked >> then the crash dump code starts >> the crash dump code stops

Re: [PATCH] x86/mce: Keep quiet in case of broadcasted mce after system panic

2017-01-23 Thread Xunlei Pang
On 01/24/2017 at 01:51 AM, Borislav Petkov wrote: > Hey Tony, > > a "welcome back" is in order? :-) > > On Mon, Jan 23, 2017 at 09:40:09AM -0800, Luck, Tony wrote: >> If the system had experienced some memory corruption, but >> recovered ... then there would be some pages sitting around >> that the

Re: [PATCH] x86/mce: Keep quiet in case of broadcasted mce after system panic

2017-01-23 Thread Xunlei Pang
On 01/24/2017 at 09:46 AM, Xunlei Pang wrote: > On 01/24/2017 at 01:51 AM, Borislav Petkov wrote: >> Hey Tony, >> >> a "welcome back" is in order? :-) >> >> On Mon, Jan 23, 2017 at 09:40:09AM -0800, Luck, Tony wrote: >>> If the system had e

Re: [PATCH] x86/mce: Keep quiet in case of broadcasted mce after system panic

2017-01-23 Thread Xunlei Pang
On 01/24/2017 at 02:14 AM, Borislav Petkov wrote: > On Mon, Jan 23, 2017 at 10:01:53AM -0800, Luck, Tony wrote: >> will ignore the machine check on the other cpus ... assuming >> that "cpu_is_offline(smp_processor_id())" does the right thing >> in the kexec case where this is an "old" cpu that isn'

Re: [PATCH] x86/mce: Keep quiet in case of broadcasted mce after system panic

2017-01-25 Thread Xunlei Pang
On 01/24/2017 at 08:22 PM, Borislav Petkov wrote: > On Tue, Jan 24, 2017 at 09:27:45AM +0800, Xunlei Pang wrote: >> It occurred on real hardware when testing crash dump. >> >> 1) SysRq-c was injected for the test in 1st kernel >> [ 49.897279] SysRq : Trigger a crash 2)

[PATCH v2] x86/crash: Update the stale comment in reserve_crashkernel()

2017-01-22 Thread Xunlei Pang
CRASH_KERNEL_ADDR_MAX has been missing for a long time, update it with more detailed explanation. Cc: Robert LeBlanc Cc: Baoquan He Signed-off-by: Xunlei Pang --- arch/x86/kernel/setup.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/x86/kernel/setup.c b/arch/x86

[PATCH] x86/mce: Keep quiet in case of broadcasted mce after system panic

2017-01-23 Thread Xunlei Pang
/patch/6167631/ https://lists.gt.net/linux/kernel/2146557 Cc: Naoya Horiguchi Signed-off-by: Xunlei Pang --- arch/x86/kernel/cpu/mcheck/mce.c | 24 +--- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck

Re: [PATCH v2] x86/crash: Update the stale comment in reserve_crashkernel()

2017-01-23 Thread Xunlei Pang
On 01/23/2017 at 04:48 PM, Dave Young wrote: > Hi, Xunlei > > On 01/23/17 at 02:48pm, Xunlei Pang wrote: >> CRASH_KERNEL_ADDR_MAX has been missing for a long time, >> update it with more detailed explanation. >> >> Cc: Robert LeBlanc >> Cc: Ba

Re: [PATCH] x86/mce: Keep quiet in case of broadcasted mce after system panic

2017-01-23 Thread Xunlei Pang
On 01/23/2017 at 08:51 PM, Borislav Petkov wrote: > On Mon, Jan 23, 2017 at 04:01:51PM +0800, Xunlei Pang wrote: >> We met an issue for kdump: after kdump kernel boots up, >> and there comes a broadcasted mce in first kernel, the > How does that even happen? > > Lemm

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

2016-07-15 Thread Xunlei Pang
ction. > > While we are at it we also optimize things further calling setup_new_dl_ > entity only for already queued tasks, since (as pointed out by Xunlei) > we already do the very same update at tasks wakeup time anyway. > > Cc: Ingo Molnar > Cc: Peter Zijlstra > Cc:

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

2016-07-18 Thread Xunlei Pang
On 2016/07/18 at 21:04, Juri Lelli wrote: > On 15/07/16 18:39, Xunlei Pang wrote: >> On 2016/07/13 at 18:58, Juri Lelli wrote: > [...] > >> Since this is only called for queued cases now, there is no need to >> check boosted stuff here. As enqueue_task(ENQUEUE_REP

Re: [RFC][PATCH 2/8] sched/rtmutex/deadline: Fix a PI crash for deadline tasks

2016-06-14 Thread Xunlei Pang
On 2016/06/14 at 18:21, Juri Lelli wrote: > Hi, > > On 07/06/16 21:56, Peter Zijlstra wrote: >> From: Xunlei Pang >> >> A crash happened while I was playing with deadline PI rtmutex. >> >> BUG: unable to handle kernel NULL pointer de

Re: [PATCH] sched/fair: do not announce throttled next buddy in dequeue_task_fair

2016-07-12 Thread Xunlei Pang
On 2016/07/13 at 09:50, Wanpeng Li wrote: > 2016-07-13 1:25 GMT+08:00 : >> Konstantin Khlebnikov writes: >> >>> On 11.07.2016 15:12, Xunlei Pang wrote: >>>> On 2016/07/11 at 17:54, Wanpeng Li wrote: >>>>> Hi Konstantin, Xunlei, >>>>

Re: [PATCH 3/3] x86/apic: Improved the setting of interrupt mode for bsp

2016-07-25 Thread Xunlei Pang
On 2016/07/25 at 11:04, Wei, Jiangang wrote: > Hi He, > > Thanks for your response firstly. > > On Fri, 2016-07-22 at 18:40 +0800, Baoquan He wrote: >> Hi Jiangang, >> >> This is very nice, should be the stuff Eric and Ingo would like to see. >> But I have several questions: >> >> 1) Are you not go

Re: [PATCH] sched/fair: Fix the wrong throttled clock time for cfs_rq_clock_task()

2016-05-30 Thread Xunlei Pang
Ping On 2016/05/12 at 11:36, Xunlei Pang wrote: > On 2016/05/11 at 14:49, Peter Zijlstra wrote: >> On Tue, May 10, 2016 at 11:19:44AM -0700, bseg...@google.com wrote: >>> Xunlei Pang writes: >>> >>>> Two minor fixes for cfs_rq_clock_task(). >>>>

Re: [PATCH v4 2/2] sched/rtmutex/deadline: Fix a PI crash for deadline tasks

2016-05-30 Thread Xunlei Pang
Ping Could someone have some comments on this bug? On 2016/04/26 at 16:30, Xunlei Pang wrote: > A crash happened while I was playing with deadline PI rtmutex. > > BUG: unable to handle kernel NULL pointer dereference at 0018 > IP: [] rt_mutex_get_top_task+0x1f/0x

[PATCH] iommu/vt-d: Flush old iotlb for kdump when the device gets context mapped

2016-11-16 Thread Xunlei Pang
can survive the kdump tests. CC: Myron Stowe CC: Don Brace CC: Baoquan He CC: Dave Young Tested-by: Joseph Szczypek Signed-off-by: Xunlei Pang --- drivers/iommu/intel-iommu.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/iommu/intel-iommu.c b/drivers

Re: [PATCH] iommu/vt-d: Flush old iotlb for kdump when the device gets context mapped

2016-11-16 Thread Xunlei Pang
Ccing David On 2016/11/16 at 17:02, Xunlei Pang wrote: > We met the DMAR fault both on hpsa P420i and P421 SmartArray controllers > under kdump, it can be steadily reproduced on several different machines, > the dmesg log is like: > HP HPSA Driver (v 3.4.16-0) > hpsa :02:00.0:

Re: [PATCH] iommu/vt-d: Flush old iotlb for kdump when the device gets context mapped

2016-11-16 Thread Xunlei Pang
On 2016/11/16 at 22:58, Myron Stowe wrote: > On Wed, Nov 16, 2016 at 2:13 AM, Xunlei Pang wrote: >> Ccing David >> On 2016/11/16 at 17:02, Xunlei Pang wrote: >>> We met the DMAR fault both on hpsa P420i and P421 SmartArray controllers >>> under kdump, it can

Re: [PATCH] iommu/vt-d: Fix the size calculation of pasid table

2016-10-10 Thread Xunlei Pang
Ping David for confirmation On 2016/09/19 at 20:18, Joerg Roedel wrote: > [Cc'ing David] > > On Mon, Sep 12, 2016 at 10:49:11AM +0800, Xunlei Pang wrote: >> According to the vt-d spec, the size of pasid (state) entry is 8B >> which equals 3 in power of 2, the number of p

Re: [PATCH v2] iommu/vt-d: Flush old iommu caches for kdump when the device gets context mapped

2016-11-27 Thread Xunlei Pang
Ping Joerg/David, do you have any comment on it? On 2016/11/19 at 00:23, Xunlei Pang wrote: > We met the DMAR fault both on hpsa P420i and P421 SmartArray controllers > under kdump, it can be steadily reproduced on several different machines, > the dmesg log is like(running on 4.9.0-rc

Re: [PATCH] iommu/vt-d: Fix the size calculation of pasid table

2016-10-31 Thread Xunlei Pang
es us 1MiB > tables — still not ideal, but better than before. > > Reported by Mika Kuoppala and also by > Xunlei Pang who submitted a simpler patch to fix > only the allocation (and not the free) to the "correct" limit... which > was still problematic. > > Si

Re: [PATCH v2] kexec: add cond_resched into kimage_alloc_crash_control_pages

2016-12-20 Thread Xunlei Pang
On 12/19/2016 at 11:23 AM, Baoquan He wrote: > On 12/09/16 at 03:16pm, Xunlei Pang wrote: >> On 12/09/2016 at 01:13 PM, zhong jiang wrote: >>> On 2016/12/8 17:41, Xunlei Pang wrote: >>>> On 12/08/2016 at 10:37 AM, zhongjiang wrote: >>>>> From: zhong jia

Re: [PATCH] Add +~800M crashkernel explaination

2016-12-13 Thread Xunlei Pang
On 12/10/2016 at 01:20 PM, Robert LeBlanc wrote: > On Fri, Dec 9, 2016 at 7:49 PM, Baoquan He wrote: >> On 12/09/16 at 05:22pm, Robert LeBlanc wrote: >>> When trying to configure crashkernel greater than about 800 MB, the >>> kernel fails to allocate memory on x86 and x86_64. This is due to an >>>

Re: [PATCH] Add +~800M crashkernel explaination

2016-12-13 Thread Xunlei Pang
On 12/14/2016 at 11:08 AM, Xunlei Pang wrote: > On 12/10/2016 at 01:20 PM, Robert LeBlanc wrote: >> On Fri, Dec 9, 2016 at 7:49 PM, Baoquan He wrote: >>> On 12/09/16 at 05:22pm, Robert LeBlanc wrote: >>>> When trying to configure crashkernel greater than about 80

Re: [PATCH] Add +~800M crashkernel explaination

2016-12-14 Thread Xunlei Pang
On 12/15/2016 at 01:50 AM, Robert LeBlanc wrote: > On Tue, Dec 13, 2016 at 8:08 PM, Xunlei Pang wrote: >> On 12/10/2016 at 01:20 PM, Robert LeBlanc wrote: >>> On Fri, Dec 9, 2016 at 7:49 PM, Baoquan He wrote: >>>> On 12/09/16 at 05:22pm, Robert LeBlanc wrote:

[PATCH] x86/crash: Update the stale comment in reserve_crashkernel()

2016-12-14 Thread Xunlei Pang
CRASH_KERNEL_ADDR_MAX was missing for a long time, update it with more detailed explanation. Cc: Robert LeBlanc Cc: Baoquan He Signed-off-by: Xunlei Pang --- arch/x86/kernel/setup.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/x86/kernel/setup.c b/arch/x86

Re: [PATCH] x86/crash: Update the stale comment in reserve_crashkernel()

2016-12-23 Thread Xunlei Pang
On 12/22/2016 at 11:22 AM, Baoquan He wrote: > On 12/15/16 at 11:30am, Xunlei Pang wrote: >> CRASH_KERNEL_ADDR_MAX was missing for a long time, update it >> with more detailed explanation. >> >> Cc: Robert LeBlanc >> Cc: Baoquan He >> Signed-off-by:

Re: [PATCH] iommu/vt-d: Flush old iotlb for kdump when the device gets context mapped

2016-12-01 Thread Xunlei Pang
On 12/01/2016 at 06:33 PM, Joerg Roedel wrote: > On Thu, Dec 01, 2016 at 10:15:45AM +0800, Xunlei Pang wrote: >> index 3965e73..624eac9 100644 >> --- a/drivers/iommu/intel-iommu.c >> +++ b/drivers/iommu/intel-iommu.c >> @@ -2024,6 +2024,25 @@ static int domain

[PATCH v3] iommu/vt-d: Flush old iommu caches for kdump when the device gets context mapped

2016-12-05 Thread Xunlei Pang
vt-d: Copy translation tables from old kernel") Fixes: dbcd861f252d ("iommu/vt-d: Do not re-use domain-ids from the old kernel") Fixes: cf484d0e6939 ("iommu/vt-d: Mark copied context entries") Signed-off-by: Xunlei Pang --- v2->v3: Flush context cache only and add Fixes-tag, ac

Re: [PATCH] iommu/vt-d: Flush old iotlb for kdump when the device gets context mapped

2016-11-30 Thread Xunlei Pang
On 11/29/2016 at 10:35 PM, Joerg Roedel wrote: > On Thu, Nov 17, 2016 at 10:47:28AM +0800, Xunlei Pang wrote: >> As per the comment, the code here only needs to flush context caches >> for the special domain 0 which is used to tag the >> non-present/erroneous caches, seems we

Re: [PATCH] iommu/vt-d: Flush old iotlb for kdump when the device gets context mapped

2016-11-30 Thread Xunlei Pang
On 11/30/2016 at 10:26 PM, Joerg Roedel wrote: > On Wed, Nov 30, 2016 at 06:23:34PM +0800, Baoquan He wrote: >> OK, talked with Xunlei. The old cache could be entry with present bit >> set. > -EPARSE > > Anyway, what I was trying to say is, that the IOMMU TLB is tagged with > domain-ids, and that t

[PATCH v2] iommu/vt-d: Flush old iommu caches for kdump when the device gets context mapped

2016-11-18 Thread Xunlei Pang
ff-by: Xunlei Pang --- v1 -> v2: Flush caches using old domain id. drivers/iommu/intel-iommu.c | 22 ++ 1 file changed, 22 insertions(+) diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c index 3965e73..653304d 100644 --- a/drivers/iommu/intel-iommu.c +++ b

Re: [PATCH v2] kexec: add cond_resched into kimage_alloc_crash_control_pages

2016-12-08 Thread Xunlei Pang
On 12/09/2016 at 01:13 PM, zhong jiang wrote: > On 2016/12/8 17:41, Xunlei Pang wrote: >> On 12/08/2016 at 10:37 AM, zhongjiang wrote: >>> From: zhong jiang >>> >>> A soft lookup will occur when I run trinity in syscall kexec_load. >>> the

Re: [PATCH v3 1/3] kexec: Move vmcoreinfo out of the kernel's .bss section

2017-03-22 Thread Xunlei Pang
On 03/21/2017 at 11:33 AM, Eric W. Biederman wrote: > Xunlei Pang writes: > >> As Eric said, >> "what we need to do is move the variable vmcoreinfo_note out >> of the kernel's .bss section. And modify the code to regenerate >> and keep this inform

Re: [PATCH v3 1/3] kexec: Move vmcoreinfo out of the kernel's .bss section

2017-03-22 Thread Xunlei Pang
On 03/22/2017 at 04:55 PM, Xunlei Pang wrote: > On 03/21/2017 at 11:33 AM, Eric W. Biederman wrote: >> Xunlei Pang writes: >> >>> As Eric said, >>> "what we need to do is move the variable vmcoreinfo_note out >>> of the kernel's .bss section.

Re: [PATCH v3 1/3] kexec: Move vmcoreinfo out of the kernel's .bss section

2017-03-22 Thread Xunlei Pang
On 03/22/2017 at 04:55 PM, Xunlei Pang wrote: > On 03/21/2017 at 11:33 AM, Eric W. Biederman wrote: >> Xunlei Pang writes: >> >>> As Eric said, >>> "what we need to do is move the variable vmcoreinfo_note out >>> of the kernel's .bss section.

Re: [PATCH v3 1/3] kexec: Move vmcoreinfo out of the kernel's .bss section

2017-03-22 Thread Xunlei Pang
On 03/22/2017 at 12:30 PM, Dave Young wrote: > On 03/21/17 at 10:18pm, Eric W. Biederman wrote: >> Dave Young writes: >> >>> On 03/20/17 at 10:33pm, Eric W. Biederman wrote: >>>> Xunlei Pang writes: >>>> >>>>> As Eric said, >

Re: [PATCH v3 1/3] kexec: Move vmcoreinfo out of the kernel's .bss section

2017-03-23 Thread Xunlei Pang
On 03/23/2017 at 04:48 AM, Michael Holzheu wrote: > Am Wed, 22 Mar 2017 12:30:04 +0800 > schrieb Dave Young : > >> On 03/21/17 at 10:18pm, Eric W. Biederman wrote: >>> Dave Young writes: >>> > [snip] > I think makedumpfile is using it, but I also vote to remove the CRASHTIME. It is bette

Re: [PATCH v2] kexec: Introduce vmcoreinfo signature verification

2017-03-19 Thread Xunlei Pang
On 03/18/2017 at 01:22 AM, Eric W. Biederman wrote: > Xunlei Pang writes: > >> Currently vmcoreinfo data is updated at boot time subsys_initcall(), >> it has the risk of being modified by some wrong code during system >> is running. >> >> As a result,

Re: [PATCH] kexec: Update vmcoreinfo after crash happened

2017-03-19 Thread Xunlei Pang
On 03/19/2017 at 02:23 AM, Petr Tesarik wrote: > On Thu, 16 Mar 2017 21:40:58 +0800 > Xunlei Pang wrote: > >> On 03/16/2017 at 09:18 PM, Baoquan He wrote: >>> On 03/16/17 at 08:36pm, Xunlei Pang wrote: >>>> On 03/16/2017 at 08:27 PM, Baoquan He wrote: >>

Re: [PATCH] x86_64, kexec: Avoid unnecessary identity mappings for kdump

2017-03-19 Thread Xunlei Pang
On 03/18/2017 at 01:38 AM, Eric W. Biederman wrote: > Xunlei Pang writes: > >> kexec setups identity mappings for all the memory mapped in 1st kernel, >> this is not necessary for the kdump case. Actually it can cause extra >> memory consumption for paging structures, whi

Re: [PATCH v2] kexec: Introduce vmcoreinfo signature verification

2017-03-19 Thread Xunlei Pang
On 03/20/2017 at 10:13 AM, Baoquan He wrote: > On 03/17/17 at 12:22pm, Eric W. Biederman wrote: >> Xunlei Pang writes: >> >>> Currently vmcoreinfo data is updated at boot time subsys_initcall(), >>> it has the risk of being modified by some wrong code during sy

Re: [PATCH v2] kexec: Introduce vmcoreinfo signature verification

2017-03-19 Thread Xunlei Pang
On 03/20/2017 at 11:55 AM, Baoquan He wrote: > On 03/20/17 at 10:39am, Xunlei Pang wrote: >> On 03/20/2017 at 10:13 AM, Baoquan He wrote: >>> On 03/17/17 at 12:22pm, Eric W. Biederman wrote: >>>> Xunlei Pang writes: >>>> >>>>> Currentl

[PATCH v3 1/3] kexec: Move vmcoreinfo out of the kernel's .bss section

2017-03-19 Thread Xunlei Pang
se vmcoreinfo now is kept far away from other kernel data structures. Suggested-by: Eric Biederman Signed-off-by: Xunlei Pang --- arch/ia64/kernel/machine_kexec.c | 5 - arch/x86/kernel/crash.c | 2 +- include/linux/kexec.h| 2 +- kernel/kexec_core

[PATCH v3 3/3] kdump: Relocate vmcoreinfo to the crash memory range

2017-03-19 Thread Xunlei Pang
se this new one instead in the following crash_save_vmcoreinfo(). BTW, we do not touch vmcoreinfo_note, because it will be fully updated using the protected vmcoreinfo_data after crash which is surely correct just like the cpu crash note. Signed-off-by: Xunlei Pang --- include/linux/kexec.h | 3 +

[PATCH v3 2/3] powerpc/fadump: Use the correct VMCOREINFO_NOTE_SIZE for phdr

2017-03-19 Thread Xunlei Pang
x it, also this change should be safe and backward compatible. After this, we can get rid of variable vmcoreinfo_max_size, let's use the macro VMCOREINFO_BYTES instead, fewer variables means more safety for vmcoreinfo operation. Signed-off-by: Xunlei Pang --- arch/powerpc/kernel/fadump.c |

[RFC PATCH] x86_64/mm/boot: Fix kernel_ident_mapping_init() failure for kexec

2017-03-19 Thread Xunlei Pang
Cc: Kirill A. Shutemov Signed-off-by: Xunlei Pang --- arch/x86/mm/ident_map.c| 22 ++ include/asm-generic/5level-fixup.h | 6 +++--- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/arch/x86/mm/ident_map.c b/arch/x86/mm/ident_map.c index 04210a

Re: [PATCH] kexec: Update vmcoreinfo after crash happened

2017-03-20 Thread Xunlei Pang
On 03/20/2017 at 09:04 PM, Petr Tesarik wrote: > On Mon, 20 Mar 2017 10:17:42 +0800 > Xunlei Pang wrote: > >> On 03/19/2017 at 02:23 AM, Petr Tesarik wrote: >>> On Thu, 16 Mar 2017 21:40:58 +0800 >>> Xunlei Pang wrote: >>> >>>> On 03/16/2017

Re: [PATCH v3 1/3] kexec: Move vmcoreinfo out of the kernel's .bss section

2017-03-24 Thread Xunlei Pang
On 03/24/2017 at 01:46 AM, Michael Holzheu wrote: > Am Thu, 23 Mar 2017 17:23:53 +0800 > schrieb Xunlei Pang : > >> On 03/23/2017 at 04:48 AM, Michael Holzheu wrote: >>> Am Wed, 22 Mar 2017 12:30:04 +0800 >>> schrieb Dave Young : >>> >>>> On 03

[PATCH] kexec: Update vmcoreinfo after crash happened

2017-03-16 Thread Xunlei Pang
teed. Signed-off-by: Xunlei Pang --- kernel/kexec_core.c | 14 +++--- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/kernel/kexec_core.c b/kernel/kexec_core.c index bfe62d5..1bfdd96 100644 --- a/kernel/kexec_core.c +++ b/kernel/kexec_core.c @@ -1367,12 +1

Re: [PATCH] kexec: Update vmcoreinfo after crash happened

2017-03-16 Thread Xunlei Pang
you think? Regards, Xunlei > > Baoquan > > On 03/16/17 at 08:16pm, Xunlei Pang wrote: >> Currently vmcoreinfo data is updated at boot time subsys_initcall(), >> it has the risk of being modified by some wrong code during system >> is running. >> >> As a resu

Re: [PATCH] kexec: Update vmcoreinfo after crash happened

2017-03-16 Thread Xunlei Pang
On 03/16/2017 at 09:18 PM, Baoquan He wrote: > On 03/16/17 at 08:36pm, Xunlei Pang wrote: >> On 03/16/2017 at 08:27 PM, Baoquan He wrote: >>> Hi Xunlei, >>> >>> Did you really see this ever happened? Because the vmcore size estimate >>> feature, namel

[PATCH v2] kexec: Introduce vmcoreinfo signature verification

2017-03-16 Thread Xunlei Pang
ave_vmcoreinfo() to see if the signature was broken, if so we have to re-save the vmcoreinfo data to get the correct vmcoreinfo for kdump as possible as we can. Signed-off-by: Xunlei Pang --- v1->v2: - Keep crash_save_vmcoreinfo_init() because "makedumpfile --mem-usage" uses the informati

[PATCH] x86_64, kexec: Avoid unnecessary identity mappings for kdump

2017-03-17 Thread Xunlei Pang
the crash memory and the ISA memory(may be needed by purgatory/kdump boot). Signed-off-by: Xunlei Pang --- arch/x86/kernel/machine_kexec_64.c | 34 ++ 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/arch/x86/kernel/machine_kexec_64.c b/arch/

Re: [PATCH v4] x86/mce: Don't participate in rendezvous process once nmi_shootdown_cpus() was made

2017-03-03 Thread Xunlei Pang
Ping Boris On 02/23/2017 at 09:36 PM, Xunlei Pang wrote: > We met an issue for kdump: after kdump kernel boots up, > and there comes a broadcasted mce in first kernel, the > other cpus remaining in first kernel will enter the old > mce handler of first kernel, then timeout and panic

Re: [PATCH v2] x86/mce: Don't participate in rendezvous process once nmi_shootdown_cpus() was made

2017-02-21 Thread Xunlei Pang
On 02/20/2017 at 07:09 PM, Borislav Petkov wrote: > On Mon, Feb 20, 2017 at 02:10:37PM +0800, Xunlei Pang wrote: >> @@ -1128,8 +1129,9 @@ void do_machine_check(struct pt_regs *regs, long >> error_code) >> */ >> int lmce = 1; >> >> -/

[PATCH v3] x86/mce: Don't participate in rendezvous process once nmi_shootdown_cpus() was made

2017-02-21 Thread Xunlei Pang
/linux/kernel/2146557 Cc: Naoya Horiguchi Suggested-by: Borislav Petkov Signed-off-by: Xunlei Pang --- v1->v2: Using crashing_cpu according to Borislav's suggestion. v2->v3: - Used crashing_cpu in mce.c explicitly, not skip crashing_cpu. - Added some comments. arch/x86/include/a

Re: [PATCH] x86/mce: Keep quiet in case of broadcasted mce after system panic

2017-02-21 Thread Xunlei Pang
On 02/22/2017 at 02:20 AM, Luck, Tony wrote: >> It's from my understanding, I didn't get the explicit description from the >> intel SDM on this point. >> If a broadcast SRAO comes on real hardware, will MSR_IA32_MCG_STATUS of each >> cpu have MCG_STATUS_RIPV bit set? > MCG_STATUS is a per-thread

Re: [PATCH v3] x86/mce: Don't participate in rendezvous process once nmi_shootdown_cpus() was made

2017-02-22 Thread Xunlei Pang
On 02/23/2017 at 02:50 AM, Luck, Tony wrote: > On Wed, Feb 22, 2017 at 12:11:14PM +0800, Xunlei Pang wrote: >> +/* >> + * Cases to bail out to avoid rendezvous process timeout: >> + * 1)If this CPU is offline. >> + * 2)If crashing_cpu was set, e.g. ente

[PATCH v4] x86/mce: Don't participate in rendezvous process once nmi_shootdown_cpus() was made

2017-02-23 Thread Xunlei Pang
/linux/kernel/2146557 Cc: Naoya Horiguchi Suggested-by: Borislav Petkov Signed-off-by: Xunlei Pang --- v1->v2: - Using crashing_cpu according to Borislav's suggestion. v2->v3: - Used crashing_cpu in mce.c explicitly, not skip crashing_cpu. - Added some comments. v3->v4: - A

Re: [PATCH] x86/mce: Keep quiet in case of broadcasted mce after system panic

2017-02-15 Thread Xunlei Pang
On 01/26/2017 at 02:44 PM, Borislav Petkov wrote: > On Thu, Jan 26, 2017 at 02:30:02PM +0800, Xunlei Pang wrote: >> The hardware machine check is hard to reproduce, but the mce code of >> RHEL7 is quite the same as that of tip/master, anyway we are able to >> inject softwar

<    1   2   3   4   5   6   >