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 >

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

2016-09-11 Thread Xunlei Pang
. Signed-off-by: Xunlei Pang --- drivers/iommu/intel-svm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iommu/intel-svm.c b/drivers/iommu/intel-svm.c index 8ebb353..cfa75c2 100644 --- a/drivers/iommu/intel-svm.c +++ b/drivers/iommu/intel-svm.c @@ -39,7

Re: [PATCH][RFC v4] timekeeping: ignore the bogus sleep time if pm_trace is enabled

2016-08-18 Thread Xunlei Pang
On 2016/08/18 at 18:36, Oliver Neukum wrote: > On Thu, 2016-08-18 at 18:43 +0800, Chen Yu wrote: >> Previously we encountered some memory overflow issues due to >> the bogus sleep time brought by inconsistent rtc, which is >> triggered when pm_trace is enabled, please refer to: >>

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

Re: [tip:locking/core] rtmutex: Deboost before waking up the top waiter

2017-04-06 Thread Xunlei Pang
On 04/05/2017 at 04:08 PM, Mike Galbraith wrote: > locking/rtmutex: Fix preempt leak in __rt_mutex_futex_unlock() > > mark_wakeup_next_waiter() already disables preemption, doing so > again leaves us with an unpaired preempt_disable(). You can also fix the corresponding comment in

[PATCH] sched/deadline: Throttle a constrained task activated if overflow

2017-04-10 Thread Xunlei Pang
f bandwidth of the current period. Cc: Daniel Bristot de Oliveira Cc: Steven Rostedt Signed-off-by: Xunlei Pang --- kernel/sched/deadline.c | 47 +++ 1 file changed, 27 insertions(+), 20 deletions(-) diff --git a/kernel/sched/deadline.c b/kernel/sche

Re: [PATCH] sched/deadline: Throttle a constrained task activated if overflow

2017-04-10 Thread Xunlei Pang
On 04/11/2017 at 04:47 AM, Daniel Bristot de Oliveira wrote: > On 04/10/2017 11:22 AM, Xunlei Pang wrote: >> I was testing Daniel's changes with his test case in the commit >> df8eac8cafce ("sched/deadline: Throttle a constrained deadline >> task activated after t

Re: [PATCH] sched/deadline: Throttle a constrained task activated if overflow

2017-04-10 Thread Xunlei Pang
On 04/11/2017 at 04:47 AM, Daniel Bristot de Oliveira wrote: > On 04/10/2017 11:22 AM, Xunlei Pang wrote: >> I was testing Daniel's changes with his test case in the commit >> df8eac8cafce ("sched/deadline: Throttle a constrained deadline >> task activated after t

Re: [PATCH] sched/deadline: Throttle a constrained task activated if overflow

2017-04-11 Thread Xunlei Pang
On 04/11/2017 at 01:53 PM, Xunlei Pang wrote: > On 04/11/2017 at 04:47 AM, Daniel Bristot de Oliveira wrote: >> On 04/10/2017 11:22 AM, Xunlei Pang wrote: >>> I was testing Daniel's changes with his test case in the commit >>> df8eac8cafce ("sched/deadline: Throttle

Re: [PATCH] sched/deadline: Throttle a constrained task activated if overflow

2017-04-11 Thread Xunlei Pang
On 04/11/2017 at 05:24 PM, Daniel Bristot de Oliveira wrote: > On 04/11/2017 09:06 AM, Xunlei Pang wrote: >> On 04/11/2017 at 01:53 PM, Xunlei Pang wrote: >>> On 04/11/2017 at 04:47 AM, Daniel Bristot de Oliveira wrote: >>>> On 04/10/2017 11:22 AM, Xunlei Pang wrote

Re: [PATCH] sched/deadline: Throttle a constrained task activated if overflow

2017-04-11 Thread Xunlei Pang
On 04/11/2017 at 04:47 AM, Daniel Bristot de Oliveira wrote: > On 04/10/2017 11:22 AM, Xunlei Pang wrote: >> I was testing Daniel's changes with his test case in the commit >> df8eac8cafce ("sched/deadline: Throttle a constrained deadline >> task activated after t

Re: [PATCH] sched/deadline: Throttle a constrained task activated if overflow

2017-04-12 Thread Xunlei Pang
On 04/12/2017 at 02:55 PM, Luca Abeni wrote: > Hi, > > On Wed, 12 Apr 2017 13:27:32 +0800 > Xunlei Pang wrote: > [...] >> The more I read the code, the more I am confused why >> dl_entity_overflow() is needed, if the task is before its deadline, >> jus

[PATCH 2/2] x86_64/kexec: Use PUD level 1GB page for identity mapping if available

2017-04-25 Thread Xunlei Pang
tity mapping pgtable for kdump if 1GB feature is available. Signed-off-by: Xunlei Pang --- arch/x86/kernel/machine_kexec_64.c | 5 + 1 file changed, 5 insertions(+) diff --git a/arch/x86/kernel/machine_kexec_64.c b/arch/x86/kernel/machine_kexec_64.c index 1d4f2b0..41f1ae7 100644 -

[PATCH 1/2] x86/mm/ident_map: Add PUD level 1GB page support

2017-04-25 Thread Xunlei Pang
booting into the new kernel. We will utilize this new support in the following patch. Signed-off-by: Xunlei Pang --- arch/x86/boot/compressed/pagetable.c | 2 +- arch/x86/include/asm/init.h | 3 ++- arch/x86/kernel/machine_kexec_64.c | 2 +- arch/x86/mm/ident_map.c | 13

Re: [PATCH 1/2] x86/mm/ident_map: Add PUD level 1GB page support

2017-04-25 Thread Xunlei Pang
On 04/26/2017 at 03:49 AM, Yinghai Lu wrote: > On Tue, Apr 25, 2017 at 2:13 AM, Xunlei Pang wrote: >> The current kernel_ident_mapping_init() creates the identity >> mapping using 2MB page(PMD level), this patch adds the 1GB >> page(PUD level) support. >> >>

[PATCH v2 1/2] x86/mm/ident_map: Add PUD level 1GB page support

2017-04-26 Thread Xunlei Pang
booting into the new kernel. We will utilize this new support in the following patch. Signed-off-by: Xunlei Pang --- v1->v2: - Rename info.use_pud_page to info.direct_gbpages - Align PUD_MASK before set_pud() arch/x86/boot/compressed/pagetable.c | 2 +- arch/x86/include/asm/init.h |

[PATCH v2 2/2] x86_64/kexec: Use PUD level 1GB page for identity mapping if available

2017-04-26 Thread Xunlei Pang
tity mapping pgtable for kdump if 1GB feature is available. Signed-off-by: Xunlei Pang --- arch/x86/kernel/machine_kexec_64.c | 5 + 1 file changed, 5 insertions(+) diff --git a/arch/x86/kernel/machine_kexec_64.c b/arch/x86/kernel/machine_kexec_64.c index 1d4f2b0..613df62 100644 -

Re: [PATCH v2 1/2] x86/mm/ident_map: Add PUD level 1GB page support

2017-04-26 Thread Xunlei Pang
On 04/26/2017 at 04:09 PM, Ingo Molnar wrote: > * Xunlei Pang wrote: > >> The current kernel_ident_mapping_init() creates the identity >> mapping using 2MB page(PMD level), this patch adds the 1GB >> page(PUD level) support. >> >> This is useful on large m

Re: [PATCH v4 3/3] kdump: Protect vmcoreinfo data under the crash memory

2017-04-26 Thread Xunlei Pang
On 04/26/2017 at 03:09 PM, Dave Young wrote: > On 04/20/17 at 07:39pm, 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

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

2017-04-26 Thread Xunlei Pang
On 04/26/2017 at 03:19 PM, Dave Young wrote: > Add ia64i list, and s390 list although Michael has tested it > > On 04/20/17 at 07:39pm, Xunlei Pang wrote: >> As Eric said, >> "what we need to do is move the variable vmcoreinfo_note out >> of the kernel's .b

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

2017-04-26 Thread Xunlei Pang
On 04/26/2017 at 05:51 PM, Xunlei Pang wrote: > On 04/26/2017 at 03:19 PM, Dave Young wrote: >> Add ia64i list, and s390 list although Michael has tested it >> >> On 04/20/17 at 07:39pm, Xunlei Pang wrote: >>> As Eric said, >>> "what we need to

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

2017-04-26 Thread Xunlei Pang
On 04/27/2017 at 11:06 AM, Dave Young wrote: > [snip] > > static int __init crash_save_vmcoreinfo_init(void) > { > + /* One page should be enough for VMCOREINFO_BYTES under all archs */ Can we add a comment in the VMCOREINFO_BYTES header file about the one page

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

2017-04-27 Thread Xunlei Pang
On 04/27/2017 at 01:44 PM, Dave Young wrote: > Hi Xunlei, > > On 04/27/17 at 01:25pm, Xunlei Pang wrote: >> On 04/27/2017 at 11:06 AM, Dave Young wrote: >>> [snip] >>>>>>> >>>>>>> static int __init crash_save_vmcoreinfo_

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

2017-04-27 Thread Xunlei Pang
reinfo now is kept far away from other kernel data structures. Cc: Juergen Gross Suggested-by: Eric Biederman Tested-by: Michael Holzheu Reviewed-by: Juergen Gross Signed-off-by: Xunlei Pang --- v4->v5: Changed VMCOREINFO_BYTES definition to PAGE_SIZE according to Dave's comment v3-

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

2017-04-27 Thread Xunlei Pang
Dave Young Signed-off-by: Xunlei Pang --- v4->v5: No change. v3->v4: -Rebased on the latest linux-next arch/powerpc/kernel/fadump.c | 3 +-- include/linux/crash_core.h | 1 - kernel/crash_core.c | 3 +-- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/arch/powerpc/k

[PATCH v5 3/3] kdump: Protect vmcoreinfo data under the crash memory

2017-04-27 Thread Xunlei Pang
and update to use 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. Tested-by: Michael Holzheu Signed-off-by: Xu

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] 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] 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] 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 cras

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

2016-12-05 Thread Xunlei Pang
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, accordi

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] 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

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 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? > >

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 s

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

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

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

2016-05-11 Thread Xunlei Pang
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(). >>> 1) If cfs_rq is currently being throttled, we need to subtract th

[PATCH] sched/rt/deadline: Don't push if task's scheduling class was changed

2016-05-08 Thread Xunlei Pang
eck in find_lock_later_rq() after double_lock_balance(), if the scheduling class of the deadline task was changed, break and retry. Apply the same logic to RT. Signed-off-by: Xunlei Pang --- kernel/sched/deadline.c | 1 + kernel/sched/rt.c | 1 + 2 files changed, 2 insertions(+) diff --git a

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

2016-05-10 Thread Xunlei Pang
Two minor fixes for cfs_rq_clock_task(). 1) If cfs_rq is currently being throttled, we need to subtract the cfs throttled clock time. 2) Make "throttled_clock_task_time" update SMP unrelated. Now UP cases need it as well. Signed-off-by: Xunlei Pang --- kernel/sched/fair.c |

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 20:25, Peter Zijlstra wrote: > On Fri, Apr 15, 2016 at 10:19:12AM +0800, Xunlei Pang wrote: >> On 2016/04/15 at 09:58, Xunlei Pang wrote: >>> On 2016/04/14 at 23:31, Peter Zijlstra wrote: >>>> On Thu, Apr 14, 2016 at 07:37:06PM +0800, Xunlei Pang wro

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

2016-04-20 Thread Xunlei Pang
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_leftmost; >> +struct rb_node *pi_waiters_leftmost_copy; &

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() syscall

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

2016-04-25 Thread Xunlei Pang
ash memory 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
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(-) diff

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

2016-04-26 Thread Xunlei Pang
. 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/fork.c

[PATCH 1/2] kexec: Set KEXEC_TYPE_CRASH before sanity_check_segment_list()

2015-12-01 Thread Xunlei Pang
sanity_check_segment_list() checks KEXEC_TYPE_CRASH flag to ensure all the segments of the loaded crash kernel are winthin the kernel crash resource limits, so set the flag beforehand. Signed-off-by: Xunlei Pang --- kernel/kexec.c | 13 - 1 file changed, 8 insertions(+), 5 deletions

Re: [PATCH 1/2] kexec: Set KEXEC_TYPE_CRASH before sanity_check_segment_list()

2015-12-01 Thread Xunlei Pang
Hi Dave, On 12/02/2015 at 01:47 PM, Dave Young wrote: > Ccing Andrew since usually he monitors and picks up kexec patches. > > On 12/02/15 at 01:26pm, Xunlei Pang wrote: >> sanity_check_segment_list() checks KEXEC_TYPE_CRASH flag to ensure >> all the segments of th

[PATCH v2] kexec: Set KEXEC_TYPE_CRASH before sanity_check_segment_list()

2015-12-02 Thread Xunlei Pang
sanity_check_segment_list() checks KEXEC_TYPE_CRASH flag to ensure all the segments of the loaded crash kernel are winthin the kernel crash resource limits, so set the flag beforehand. Signed-off-by: Xunlei Pang Acked-by: Dave Young --- v1 -> v2: Improved some comments. kernel/kexec.c |

[PATCH] sched/core: Clear the root_domain cpumasks in init_rootdomain()

2015-12-02 Thread Xunlei Pang
the same thing for root_domain's other cpumask memembers: dlo_mask, span, and online. Signed-off-by: Xunlei Pang --- kernel/sched/core.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 5b420d2..5691953 100644 --- a/kernel

Re: [PATCH] sched/core: Clear the root_domain cpumasks in init_rootdomain()

2015-12-02 Thread Xunlei Pang
Hi Peter, On 12/02/2015 at 08:34 PM, Peter Zijlstra wrote: > On Wed, Dec 02, 2015 at 07:52:59PM +0800, Xunlei Pang wrote: >> The patch cleans the garbage by using zalloc_cpumask_var() >> instead of alloc_cpumask_var() for root_domain::rto_mask >> allocation, thereby address

[PATCH v2 2/2] kexec: Provide arch_kexec_protect(unprotect)_crashkres()

2016-01-06 Thread Xunlei Pang
Implement the protection method for the crash kernel memory reservation for the 64-bit x86 kdump. Signed-off-by: Xunlei Pang --- arch/x86/kernel/machine_kexec_64.c | 41 ++ 1 file changed, 41 insertions(+) diff --git a/arch/x86/kernel/machine_kexec_64.c b

[PATCH v2 1/2] kexec: Introduce a protection mechanism for the crashkernel reserved memory

2016-01-06 Thread Xunlei Pang
. The architecture can make its specific implementation by overriding arch_kexec_protect_crashkres() and arch_kexec_unprotect_crashkres(). Signed-off-by: Xunlei Pang --- include/linux/kexec.h | 2 ++ kernel/kexec.c| 9 - kernel/kexec_core.c | 6 ++ kernel/kexec_file.c | 8 +++- 4

Re: [PATCH v2 2/2] kexec: Provide arch_kexec_protect(unprotect)_crashkres()

2016-01-06 Thread Xunlei Pang
On 01/07/2016 at 01:08 AM, Minfei Huang wrote: > On 01/06/16 at 05:50pm, Xunlei Pang wrote: >> diff --git a/arch/x86/kernel/machine_kexec_64.c >> b/arch/x86/kernel/machine_kexec_64.c >> index 819ab3f..cda867d 100644 >> --- a/arch/x86/kernel/machine_kexec_64

Re: [PATCH v2 2/2] kexec: Provide arch_kexec_protect(unprotect)_crashkres()

2016-01-06 Thread Xunlei Pang
On 01/07/2016 at 10:14 AM, Xunlei Pang wrote: > On 01/07/2016 at 01:08 AM, Minfei Huang wrote: >> On 01/06/16 at 05:50pm, Xunlei Pang wrote: >>> diff --git a/arch/x86/kernel/machine_kexec_64.c >>> b/arch/x86/kernel/machine_kexec_64.c >>> index 819ab3f..cda8

Re: [PATCH v2 2/2] kexec: Provide arch_kexec_protect(unprotect)_crashkres()

2016-01-06 Thread Xunlei Pang
On 01/07/2016 at 10:36 AM, Minfei Huang wrote: > On 01/07/16 at 10:14am, Xunlei Pang wrote: >>>> +static int >>>> +kexec_mark_range(unsigned long start, unsigned long end, bool protect) >>>> +{ >>>> + struct page *page; >>>> + unsi

Re: [PATCH] kexec: Move some memembers and definitions within the scope of CONFIG_KEXEC_FILE

2015-12-22 Thread Xunlei Pang
On 12/22/2015 at 06:47 PM, Minfei Huang wrote: > On 12/21/15 at 02:09pm, Xunlei Pang wrote: >> diff --git a/include/linux/kexec.h b/include/linux/kexec.h >> index 7b68d27..2cc643c 100644 >> --- a/include/linux/kexec.h >> +++ b/include/linux/kexec.h >

[PATCH 1/2] kexec: Introduce a protection mechanism for the crashkernel reserved memory

2015-12-23 Thread Xunlei Pang
. The architecture can make its specific implementation by overriding arch_kexec_protect_crashkres() and arch_kexec_unprotect_crashkres(). Signed-off-by: Xunlei Pang --- include/linux/kexec.h | 2 ++ kernel/kexec.c| 9 - kernel/kexec_core.c | 6 ++ kernel/kexec_file.c | 8 +++- 4

[PATCH 2/2] kexec: Provide arch_kexec_protect(unprotect)_crashkres()

2015-12-23 Thread Xunlei Pang
Implement the protection method for the crash kernel memory reservation for the 64-bit x86 kdump. Signed-off-by: Xunlei Pang --- Only provided x86_64 implementation, as I've only tested on x86_64 so far. arch/x86/kernel/machine_kexec_64.c | 43 ++ 1 file

Re: [PATCH 2/2] kexec: Provide arch_kexec_protect(unprotect)_crashkres()

2015-12-23 Thread Xunlei Pang
On 12/24/2015 at 01:54 PM, Dave Young wrote: > Ccing Vivek > > On 12/23/15 at 07:12pm, Xunlei Pang wrote: >> Implement the protection method for the crash kernel memory >> reservation for the 64-bit x86 kdump. >> >> Signed-off-by: Xunlei Pang >> --- >>

Re: [PATCH 2/2] kexec: Provide arch_kexec_protect(unprotect)_crashkres()

2015-12-23 Thread Xunlei Pang
On 12/24/2015 at 02:16 PM, Dave Young wrote: > Hi, Xunlei > > On 12/24/15 at 02:05pm, Xunlei Pang wrote: >> On 12/24/2015 at 01:54 PM, Dave Young wrote: >>> Ccing Vivek >>> >>> On 12/23/15 at 07:12pm, Xunlei Pang wrote: >>>> Imple

[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/core: Clear the root_domain cpumasks in init_rootdomain()

2015-12-02 Thread Xunlei Pang
Hi Peter, On 12/03/2015 at 12:25 AM, Peter Zijlstra wrote: > On Wed, Dec 02, 2015 at 09:12:30PM +0800, Xunlei Pang wrote: >> Hi Peter, >> >> On 12/02/2015 at 08:34 PM, Peter Zijlstra wrote: >>> On Wed, Dec 02, 2015 at 07:52:59PM +0800, Xunlei Pang wrote: >>>

[PATCH v2 1/3] sched/core: Clear the root_domain cpumasks in init_rootdomain()

2015-12-02 Thread Xunlei Pang
, thereby addressing the issues. Do the same thing for root_domain's other cpumask memembers: dlo_mask, span, and online. Signed-off-by: Xunlei Pang --- v1->v2: Use alloc_cpumask_var() with __GFP_ZERO instead of zalloc_cpumask_var() to avoid duplicate clean for systems with

[PATCH v2 2/3] sched/cpupri: Cleanup of duplicate memory initialization

2015-12-02 Thread Xunlei Pang
There is already a memset clear operation for '*cp', so we can use alloc_cpumask_var() with __GFP_ZERO instead of zalloc_cpumask_var() to avoid duplicate clear for systems without CONFIG_CPUMASK_OFFSTACK set. Also omit "atomic_set(>count, 0);". Signed-off-by: Xunlei Pang ---

[PATCH v2 3/3] sched/cpudeadline: Cleanup of duplicate memory initialization

2015-12-02 Thread Xunlei Pang
There is already a memset clear operation for '*cp', so we can use alloc_cpumask_var() with __GFP_ZERO instead of zalloc_cpumask_var() to avoid duplicate clear for systems without CONFIG_CPUMASK_OFFSTACK set. Also omit "cp->size = 0;". Signed-off-by: Xunlei Pang --- kernel/sched/

Re: [PATCH] sched/core: Clear the root_domain cpumasks in init_rootdomain()

2015-12-03 Thread Xunlei Pang
Hi Ingo, On 12/03/2015 at 04:28 PM, Ingo Molnar wrote: > * Xunlei Pang wrote: > >> Hi Peter, >> >> On 12/03/2015 at 12:25 AM, Peter Zijlstra wrote: >>> On Wed, Dec 02, 2015 at 09:12:30PM +0800, Xunlei Pang wrote: >>>> Hi Peter, >>>

Re: [PATCH] sched/core: Clear the root_domain cpumasks in init_rootdomain()

2015-12-04 Thread Xunlei Pang
Hi Ingo, On 12/04/2015 at 04:09 PM, Ingo Molnar wrote: > * Xunlei Pang wrote: > >>> Hm, is the alloc_cpumask_var() done in alloc_sched_domains() safe? >> Until now, I haven't found any other similar issues, but I will check >> further. >> >>> At lea

Re: [patch] kexec: potetially using uninitialized variable

2016-03-11 Thread Xunlei Pang
Hi Dan, On 2016/03/11 at 16:07, Dan Carpenter wrote: > At the end of the function we check if "ret" has a negative error code, > but it seems possible that it is uninitialized. > > Fixes: 12db5562e035 ('kexec: load and relocate purgatory at kernel load time') > Signed-off-by: Dan Carpenter > >

[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

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

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] 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 v3 5/6] sched/deadline/rtmutex: Fix unprotected PI access in enqueue_task_dl()

2016-04-14 Thread Xunlei Pang
On 2016/04/14 at 23:31, Peter Zijlstra wrote: > On Thu, Apr 14, 2016 at 07:37:06PM +0800, Xunlei Pang wrote: >> We access @pi_task's data without any lock in enqueue_task_dl(), though >> checked "dl_prio(pi_task->normal_prio)" condition, that's not enough. &

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

2016-04-14 Thread Xunlei Pang
On 2016/04/15 at 09:58, Xunlei Pang wrote: > On 2016/04/14 at 23:31, Peter Zijlstra wrote: >> On Thu, Apr 14, 2016 at 07:37:06PM +0800, Xunlei Pang wrote: >>> We access @pi_task's data without any lock in enqueue_task_dl(), though >>> checked "dl_prio(pi_task-

Re: [PATCH] sched/deadline: Fix a bug in dl_overflow()

2016-04-15 Thread Xunlei Pang
On 2016/04/15 at 15:07, Juri Lelli wrote: > [+Luca] > > Hi, > > On 14/04/16 20:19, Xunlei Pang wrote: >> I got a minus(very big) dl_b->total_bw during my deadline tests. >> >> # grep dl /proc/sched_debug >> dl_rq[0]: >> .dl_

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) lock(X) >

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 >>>

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] 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
ash memory 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

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

2016-03-30 Thread Xunlei Pang
_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 >> Thanks >> Minfei >>

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

2016-04-01 Thread Xunlei Pang
() 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 ++ ker

[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

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

<    4   5   6   7   8   9   10   11   >