Re: [RFC PATCH] powerpc/powernv: recheck lock bit in core_idle_lock_held after lwarx

2016-10-24 Thread Li Zhong
> On 25 Oct 2016, at 12:15, Paul Mackerras <pau...@ozlabs.org> wrote: > > On Tue, Oct 25, 2016 at 11:24:34AM +0800, Li Zhong wrote: >> The core_idle_lock_held loops when the lock bit is held by others. >> However, it is possible that after the lock bit is cleared, som

[RFC PATCH] powerpc/powernv: recheck lock bit in core_idle_lock_held after lwarx

2016-10-24 Thread Li Zhong
the first one is still executing in the critical section. This patch rechecks the lock bit after lwarx, and go back to loop if it is set. Signed-off-by: Li Zhong <zh...@linux.vnet.ibm.com> --- arch/powerpc/kernel/idle_book3s.S | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/powerpc/

Re: [RFC PATCH 1/2] KVM: PPC: divide the ics lock into smaller ones for each irq

2016-06-20 Thread Li Zhong
On Jun 20, 2016, at 13:25, Paul Mackerras <pau...@ozlabs.org> wrote:On Mon, May 16, 2016 at 02:58:18PM +0800, Li Zhong wrote:This patch tries to use smaller locks for each irq in the ics, insteadof a lock at the ics level, to provide better scalability.This looks like a worth-while thing

Re: [RFC PATCH 2/2] KVM: PPC: Don't take lock when check irq's resend flag

2016-06-20 Thread Li Zhong
> On Jun 20, 2016, at 13:27, Paul Mackerras <pau...@ozlabs.org> wrote: > > On Mon, May 16, 2016 at 03:02:13PM +0800, Li Zhong wrote: >> It seems that we don't need to take the lock before evaluating irq's >> resend flag. What needed is to make sure when we clear th

[RFC PATCH 2/2] KVM: PPC: Don't take lock when check irq's resend flag

2016-05-16 Thread Li Zhong
(), and an newly added wmb when setting irq's resend flag, and icp's resend_map. Signed-off-by: Li Zhong <zh...@linux.vnet.ibm.com> --- arch/powerpc/kvm/book3s_hv_rm_xics.c | 14 +++--- arch/powerpc/kvm/book3s_xics.c | 22 +++--- 2 files changed, 14 insertions(

[RFC PATCH 1/2] KVM: PPC: divide the ics lock into smaller ones for each irq

2016-05-16 Thread Li Zhong
This patch tries to use smaller locks for each irq in the ics, instead of a lock at the ics level, to provide better scalability. Signed-off-by: Li Zhong <zh...@linux.vnet.ibm.com> --- arch/powerpc/kvm/book3s_hv_rm_xics.c | 24 ++--- arch/powerpc/kvm/book3s_xics.c

[PATCH v3 powerpc] perf/hv-24x7 fail 24x7 initcall if create_events_from_catalog() fails

2015-04-13 Thread Li Zhong
-by: Li Zhong zh...@linux.vnet.ibm.com --- arch/powerpc/perf/hv-24x7.c | 37 + 1 file changed, 29 insertions(+), 8 deletions(-) diff --git a/arch/powerpc/perf/hv-24x7.c b/arch/powerpc/perf/hv-24x7.c index 9445a82..ead1420 100644 --- a/arch/powerpc/perf/hv-24x7.c

[RFC PATCH powerpc] perf/hv-24x7 set the attr group to NULL if events failed to be initialized

2015-02-15 Thread Li Zhong
and interface group to be removed because of the error. This patch moves the three events groups to the end of the attr groups, and if create_events_from_catalog() fails to set their attributes, we set them to NULL in attr_groups. Signed-off-by: Li Zhong zh...@linux.vnet.ibm.com --- arch/powerpc

Re: [powerpc] init nvram_pstore_info's buf_lock

2014-11-17 Thread Li Zhong
On 二, 2014-11-18 at 15:33 +1100, Michael Ellerman wrote: On Mon, 2014-17-11 at 02:52:30 UTC, Li Zhong wrote: It seems nvram_pstore_info's buf_lock is not initialized before registering, which causes some strange behavior when trying to obtain the lock during kdump process. What kind

[PATCH powerpc] init nvram_pstore_info's buf_lock

2014-11-16 Thread Li Zhong
It seems nvram_pstore_info's buf_lock is not initialized before registering, which causes some strange behavior when trying to obtain the lock during kdump process. Signed-off-by: Li Zhong zh...@linux.vnet.ibm.com --- arch/powerpc/platforms/pseries/nvram.c | 2 ++ 1 file changed, 2 insertions

Re: [RFC PATCH v3 1/3] powerpc: Fix warning reported by verify_cpu_node_mapping()

2014-10-15 Thread Li Zhong
On 二, 2014-10-14 at 15:35 +1100, Michael Ellerman wrote: On Tue, 2014-10-14 at 10:39 +0800, Li Zhong wrote: On 二, 2014-10-07 at 08:33 -0700, Nishanth Aravamudan wrote: On 07.10.2014 [17:28:38 +1100], Michael Ellerman wrote: On Fri, 2014-10-03 at 16:26 -0700, Nishanth Aravamudan wrote

Re: [RFC PATCH v3 1/3] powerpc: Fix warning reported by verify_cpu_node_mapping()

2014-10-13 Thread Li Zhong
should send them explicitly. I think they occur every boot, unconditionally, on pseries. Doesn't prevent boot, just really noisy. I think it'd be good to get them into -stable. Li Zhong, can you push them once they get sent upstream? I guess I only need to send the first two patches

Re: [PATCH] powerpc: Reimplement __get_SP() as a function not a define

2014-10-08 Thread Li Zhong
On 三, 2014-10-01 at 15:10 +1000, Anton Blanchard wrote: Li Zhong points out an issue with our current __get_SP() implementation. If ftrace function tracing is enabled (ie -pg profiling using _mcount) we spill a stack frame on 64bit all the time. If a function calls __get_SP() and later

Re: [RFC PATCH v3 1/3] powerpc: Fix warning reported by verify_cpu_node_mapping()

2014-10-07 Thread Li Zhong
should send them explicitly. I think they occur every boot, unconditionally, on pseries. Doesn't prevent boot, just really noisy. I think it'd be good to get them into -stable. Li Zhong, can you push them once they get sent upstream? Ok, I will send these patches to stable mailing

Re: [PATCH v2] powerpc: Fix warning reported by verify_cpu_node_mapping()

2014-08-27 Thread Li Zhong
On 三, 2014-08-27 at 09:41 +0800, Li Zhong wrote: On 二, 2014-08-26 at 08:10 -0500, Nathan Fontenot wrote: On 08/25/2014 02:22 AM, Li Zhong wrote: With commit 2fabf084b, during boottime, cpu_numa_callback() is called earlier(before their online) for each cpu, and verify_cpu_node_mapping

[RFC PATCH v3 1/3] powerpc: Fix warning reported by verify_cpu_node_mapping()

2014-08-27 Thread Li Zhong
siblings 1/2/3 and 0 don't belong to the same node! As we don't actually do the checking during this early stage, so maybe we could directly call numa_setup_cpu() in do_init_bootmem(). Cc: Nishanth Aravamudan n...@linux.vnet.ibm.com Cc: Nathan Fontenot nf...@linux.vnet.ibm.com Signed-off-by: Li

[RFC PATCH v3 2/3] powerpc: Only set numa node information for present cpus at boottime

2014-08-27 Thread Li Zhong
, but not present cpus, their numa information will be set up after they are started, as the original code did before commit 2fabf084b6ad. Cc: Nishanth Aravamudan n...@linux.vnet.ibm.com Cc: Nathan Fontenot nf...@linux.vnet.ibm.com Signed-off-by: Li Zhong zh...@linux.vnet.ibm.com --- arch/powerpc/kernel

[RFC PATCH v3 3/3] powerpc: some changes in numa_setup_cpu()

2014-08-27 Thread Li Zhong
the first online node to numa_cpu_lookup_table instead of 0 ( in case 0 might not be an online node? ) Cc: Nishanth Aravamudan n...@linux.vnet.ibm.com Cc: Nathan Fontenot nf...@linux.vnet.ibm.com Signed-off-by: Li Zhong zh...@linux.vnet.ibm.com --- arch/powerpc/mm/numa.c | 14 -- 1 file

Re: [PATCH v2] powerpc: Fix warning reported by verify_cpu_node_mapping()

2014-08-26 Thread Li Zhong
On 二, 2014-08-26 at 08:10 -0500, Nathan Fontenot wrote: On 08/25/2014 02:22 AM, Li Zhong wrote: With commit 2fabf084b, during boottime, cpu_numa_callback() is called earlier(before their online) for each cpu, and verify_cpu_node_mapping() uses cpu_to_node() to check whether siblings

Re: [RFC PATCH powerpc] Fix warning reported by verify_cpu_node_mapping()

2014-08-25 Thread Li Zhong
On 五, 2014-08-22 at 15:04 -0700, Nishanth Aravamudan wrote: On 22.08.2014 [10:12:56 +0800], Li Zhong wrote: On ???, 2014-08-21 at 08:45 -0700, Nishanth Aravamudan wrote: On 21.08.2014 [16:14:02 +0800], Li Zhong wrote: With commit 2fabf084b, during boottime, cpu_numa_callback() is called

[PATCH v2] powerpc: Fix warning reported by verify_cpu_node_mapping()

2014-08-25 Thread Li Zhong
don't actually do the checking during this early stage, so maybe we could directly call numa_setup_cpu() in do_init_bootmem(). Also, as Nish suggested, here it's better to use present cpu mask instead of possible mask to avoid warning in numa_setup_cpu(). Signed-off-by: Li Zhong zh

[RFC PATCH powerpc] Fix warning reported by verify_cpu_node_mapping()

2014-08-21 Thread Li Zhong
! As we don't actually do the checking during this early stage, so maybe we could directly call numa_setup_cpu() in do_init_bootmem()? Signed-off-by: Li Zhong zh...@linux.vnet.ibm.com --- arch/powerpc/mm/numa.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/powerpc/mm/numa.c

Re: [RFC PATCH powerpc] Fix warning reported by verify_cpu_node_mapping()

2014-08-21 Thread Li Zhong
On 四, 2014-08-21 at 08:45 -0700, Nishanth Aravamudan wrote: On 21.08.2014 [16:14:02 +0800], Li Zhong wrote: With commit 2fabf084b, during boottime, cpu_numa_callback() is called earlier(before their online) for each cpu, and verify_cpu_node_mapping() uses cpu_to_node() to check whether

[PATCH powerpc] use machine_subsys_initcall() for opal_hmi_handler_init()

2014-08-12 Thread Li Zhong
As opal_message_init() uses machine_early_initcall(powernv, ), and opal_hmi_handler_init() depends on that early initcall, so it also needs use machine_* to check the machine_id. Signed-off-by: Li Zhong zh...@linux.vnet.ibm.com --- arch/powerpc/platforms/powernv/opal-hmi.c | 3 ++- 1 file

[PATCH powerpc] use _GLOBAL_TOC for memmove

2014-07-21 Thread Li Zhong
path_openat+0x100/0x810 [c00073f97ce0] c0272ea8 do_filp_open+0x58/0xd0 [c00073f97dc0] c025ade8 do_sys_open+0x1b8/0x300 [c00073f97e30] c000a008 syscall_exit+0x0/0x7c --- Exception: c01 (System Call) at 3fffaabe2854 Signed-off-by: Li Zhong zh

[PATCH powerpc] Fix parameter restoring issue in commit 752a6422f

2014-06-24 Thread Li Zhong
%DAR: 01a3fcf00020b4ac Virtual PID = 0 ok Signed-off-by: Li Zhong zh...@linux.vnet.ibm.com --- diff --git a/arch/powerpc/platforms/powernv/opal-takeover.S b/arch/powerpc/platforms/powernv/opal-takeover.S index 11a3169..9093540 100644 --- a/arch/powerpc/platforms/powernv/opal-takeover.S +++ b

Re: [PATCH powerpc] Fix parameter restoring issue in commit 752a6422f

2014-06-24 Thread Li Zhong
DaYu just reminded me that Michael already had a patch removing all the related code. Please ignore this patch.. Thanks, Zhong On Wed, 2014-06-25 at 12:00 +0800, Li Zhong wrote: In commit 752a6422f, new stack frame is created for parameters. However, the r1 is added back a little earlier

[PATCH 1/4] powerpc: implement vmemmap_list_free()

2014-06-11 Thread Li Zhong
the memory when continuous doing memory hot-plug/remove operations, but didn't reclaim the pages already allocated, so the memory usage will only increase, but won't exceed the value for the largest memory configuration. Signed-off-by: Li Zhong zh...@linux.vnet.ibm.com Cc: Nathan Fontenot nf

[PATCH 2/4] powerpc: implement vmemmap_remove_mapping() for BOOK3S

2014-06-11 Thread Li Zhong
This is to be called in vmemmap_free(), leave the implementation on BOOK3E empty as before. Signed-off-by: Li Zhong zh...@linux.vnet.ibm.com Cc: Nathan Fontenot nf...@linux.vnet.ibm.com --- arch/powerpc/mm/hash_utils_64.c |2 +- arch/powerpc/mm/init_64.c | 22

[PATCH 3/4] powerpc: implement vmemmap_free()

2014-06-11 Thread Li Zhong
vmemmap_free() does the opposite of vmemap_populate(). This patch also puts vmemmap_free() and vmemmap_list_free() into CONFIG_MEMMORY_HOTPLUG. Signed-off-by: Li Zhong zh...@linux.vnet.ibm.com Cc: Nathan Fontenot nf...@linux.vnet.ibm.com --- arch/powerpc/mm/init_64.c | 85

[PATCH 4/4] powerpc: start loop at section start of start in vmemmap_populated()

2014-06-11 Thread Li Zhong
. After we adjust start to be the start of the section, it also means it's aligned with vmemmap as of the sizeof struct page, so we could use page_to_pfn directly in the loop. Signed-off-by: Li Zhong zh...@linux.vnet.ibm.com Cc: Nathan Fontenot nf...@linux.vnet.ibm.com --- arch/powerpc/mm/init_64

[RFC PATCH] powerpc: fix wrong sp saved in save_stack_trace()

2014-05-08 Thread Li Zhong
asm be compiled after r1 being added back to the original value. But as a workaround, maybe we could move this embedded asm into save_context_stack(). Signed-off-by: Li Zhong zh...@linux.vnet.ibm.com --- arch/powerpc/kernel/stacktrace.c | 9 - 1 file changed, 4 insertions(+), 5 deletions

Re: [RFC PATCH] Fix Oops in rtas_stop_self()

2014-04-27 Thread Li Zhong
easily be outside 32bit range. Ah, yes, the stack here is obviously at a much higher address than 4GB. You can add: Signed-off-by: Anton Blanchard an...@samba.org And also: Cc: sta...@vger.kernel.org # 3.14+ OK, Thanks, Zhong Signed-off-by: Li Zhong zh...@linux.vnet.ibm.com

[PATCH] powerpc: Fix Oops in rtas_stop_self()

2014-04-27 Thread Li Zhong
-off-by: Li Zhong zh...@linux.vnet.ibm.com Signed-off-by: Anton Blanchard an...@samba.org Cc: sta...@vger.kernel.org # 3.14+ --- arch/powerpc/platforms/pseries/hotplug-cpu.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/platforms/pseries/hotplug-cpu.c b/arch

[RFC PATCH] Fix Oops in rtas_stop_self()

2014-04-25 Thread Li Zhong
[ 247.194751] ---[ end trace d1d21584135396ba ]--- Signed-off-by: Li Zhong zh...@linux.vnet.ibm.com --- arch/powerpc/platforms/pseries/hotplug-cpu.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/platforms/pseries/hotplug-cpu.c b/arch/powerpc/platforms

[RFC PATCH v2 powerpc] Protect remove_memory() with device hotplug lock

2014-04-10 Thread Li Zhong
by * try_offline_node(). */ void __ref remove_memory(int nid, u64 start, u64 size) With this lock held, the other process(#1120 above) trying to online the memory block will retry the system call when calling lock_device_hotplug_sysfs(), and finally find No such device error. Signed-off-by: Li Zhong

[RFC PATCH powerpc] Protect remove_memory() with device hotplug lock

2014-04-09 Thread Li Zhong
by * try_offline_node(). */ void __ref remove_memory(int nid, u64 start, u64 size) With this lock held, the other process(#1120 above) trying to online the memory block will retry the system call when calling lock_device_hotplug_sysfs(), and finally find No such device error. Signed-off-by: Li Zhong

[PATCH] powerpc: use of_node_init() for the fakenode in msi_bitmap.c

2014-04-03 Thread Li Zhong
48485279 6000 0fe0 3900 393f0038 4b80 [0.897992] ---[ end trace 1eeffdb9f825a556 ]--- Signed-off-by: Li Zhong zh...@linux.vnet.ibm.com --- arch/powerpc/sysdev/msi_bitmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/sysdev/msi_bitmap.c b/arch

[PATCH powerpc] cpuidle: fix per cpu accessing of cpuidle_devices

2014-01-25 Thread Li Zhong
780b17e1 41820078 2fa3 [ 204.774601] ---[ end trace edf1df93cf81e28d ]--- Signed-off-by: Li Zhong zh...@linux.vnet.ibm.com --- arch/powerpc/platforms/pseries/processor_idle.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/powerpc/platforms/pseries

Re: [RFC PATCH powerpc] Fix compile error of pgtable-ppc64.h

2014-01-17 Thread Li Zhong
On Fri, 2014-01-17 at 12:27 +0530, Aneesh Kumar K.V wrote: Li Zhong zh...@linux.vnet.ibm.com writes: It seems that forward declaration couldn't work well with typedef, use struct spinlock directly to avoiding following build errors: In file included from include/linux/spinlock.h:81

[RFC PATCH powerpc] Fix compile error of pgtable-ppc64.h

2014-01-16 Thread Li Zhong
/include/asm/pgtable-ppc64.h:563: note: previous declaration of 'spinlock_t' was here Signed-off-by: Li Zhong zh...@linux.vnet.ibm.com --- arch/powerpc/include/asm/pgtable-ppc64.h |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/include/asm/pgtable-ppc64.h

[RFC PATCH powerpc 1/2] fix using page adddress as the page stucture pointer in __pte_free_tlb()

2013-12-02 Thread Li Zhong
[0.563429] Instruction dump: [0.563433] 635a0d00 3b61 2fbc 41fe0014 e8810070 7f83e378 486543c1 6000 [0.563450] e81e0022 829f0018 92810090 eaff0010 7efd012a a1210090 8aa10093 3809 [0.563469] ---[ end trace 3be1fd3d950f1716 ]--- Signed-off-by: Li Zhong zh

[RFC PATCH powerpc 2/2] adjust the variable type and name in __pte_free_tlb()

2013-12-02 Thread Li Zhong
The patch adjusts the variable type and name for page in __pte_free_tlb(), which now seems a little confusing. Signed-off-by: Li Zhong zh...@linux.vnet.ibm.com --- arch/powerpc/include/asm/pgalloc-64.h |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc

[PATCH powerpc] Revert c6102609 and replace it with the correct fix for vio dma mask setting

2013-11-27 Thread Li Zhong
This patch reverts my previous fix, and replace it with the correct fix from Russell. And as Russell pointed out -- dma_set_mask_and_coherent() (and the other dma_set_mask() functions) are really supposed to be used by drivers only. Signed-off-by: Li Zhong zh...@linux.vnet.ibm.com --- arch

Re: [RFC PATCH powerpc] Fix a dma_mask issue of vio

2013-11-20 Thread Li Zhong
-dev.dma_mask = viodev-dev.coherent_dma_mask; } /* register with generic device framework */ Right that's exactly what I had in mind. Li, can you test this please ? Sure, and it works. Tested-by: Li Zhong zh...@linux.vnet.ibm.com The previous fix using dma_coerce_mask_and_coherent

[RFC PATCH powerpc] Fix a dma_mask issue of vio

2013-11-19 Thread Li Zhong
I encountered following issue: [0.283035] ibmvscsi 3015: couldn't initialize event pool [5.688822] ibmvscsi: probe of 3015 failed with error -1 which prevents the storage from being recognized, and the machine from booting. After some digging, it seems that it is caused by commit

Re: [RFC PATCH powerpc] Fix compiling error in powernv/rng.c

2013-11-19 Thread Li Zhong
On Tue, 2013-11-19 at 15:04 +1100, Michael Ellerman wrote: On Fri, Nov 15, 2013 at 03:36:04PM +0800, Li Zhong wrote: This is seen when CONFIG_SMP is not enabled: arch/powerpc/platforms/powernv/rng.c: In function 'rng_init_per_cpu': arch/powerpc/platforms/powernv/rng.c:74: error: implicit

Re: [RFC PATCH powerpc] Fix a dma_mask issue of vio

2013-11-19 Thread Li Zhong
On Wed, 2013-11-20 at 12:28 +1100, Benjamin Herrenschmidt wrote: On Tue, 2013-11-19 at 16:11 +0800, Li Zhong wrote: I encountered following issue: [0.283035] ibmvscsi 3015: couldn't initialize event pool [5.688822] ibmvscsi: probe of 3015 failed with error -1 which

[PATCH powerpc] Fix compiling error in rng.c

2013-11-14 Thread Li Zhong
-by: Li Zhong zh...@linux.vnet.ibm.com --- arch/powerpc/platforms/pseries/rng.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/powerpc/platforms/pseries/rng.c b/arch/powerpc/platforms/pseries/rng.c index a702f1c..62c7838 100644 --- a/arch/powerpc/platforms/pseries/rng.c

[RFC PATCH powerpc] Fix compiling error in powernv/rng.c

2013-11-14 Thread Li Zhong
This is seen when CONFIG_SMP is not enabled: arch/powerpc/platforms/powernv/rng.c: In function 'rng_init_per_cpu': arch/powerpc/platforms/powernv/rng.c:74: error: implicit declaration of function 'cpu_to_chip_id' Signed-off-by: Li Zhong zh...@linux.vnet.ibm.com --- arch/powerpc/platforms

Re: [RFC PATCH powerpc] Set cpu sibling mask before online cpu

2013-06-13 Thread Li Zhong
On Tue, 2013-06-11 at 14:03 +0530, Srivatsa S. Bhat wrote: On 06/11/2013 12:30 PM, Benjamin Herrenschmidt wrote: On Thu, 2013-05-16 at 18:20 +0800, Li Zhong wrote: It seems following race is possible: .../... vdso_getcpu_init(); #endif - notify_cpu_starting(cpu

[RFC PATCH powerpc] Set cpu sibling mask before online cpu

2013-05-16 Thread Li Zhong
-off-by: Li Zhong zh...@linux.vnet.ibm.com --- arch/powerpc/kernel/smp.c |8 +--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c index ee7ac5e..c765937 100644 --- a/arch/powerpc/kernel/smp.c +++ b/arch/powerpc/kernel/smp.c

Re: [RFC PATCH v3 0/5] powerpc: Support context tracking for Power pSeries

2013-05-13 Thread Li Zhong
On Mon, 2013-05-13 at 15:51 +1000, Benjamin Herrenschmidt wrote: On Mon, 2013-05-13 at 13:21 +0800, Li Zhong wrote: These patches try to support context tracking for Power arch, beginning with 64-bit pSeries. The codes are ported from that of the x86_64, and in each patch, I listed

Re: [RFC PATCH v3 2/5] powerpc: Exception hooks for context tracking subsystem

2013-05-13 Thread Li Zhong
On Mon, 2013-05-13 at 15:57 +1000, Benjamin Herrenschmidt wrote: On Mon, 2013-05-13 at 13:21 +0800, Li Zhong wrote: int recover = 0; + enum ctx_state prev_state; + + prev_state = exception_enter(); Please make it nicer: enum ctx_state prev_state = exception_enter

Re: [RFC PATCH v3 0/5] powerpc: Support context tracking for Power pSeries

2013-05-13 Thread Li Zhong
On Mon, 2013-05-13 at 18:59 +1000, Benjamin Herrenschmidt wrote: On Mon, 2013-05-13 at 16:03 +0800, Li Zhong wrote: To my understanding, it is used to enable RCU user extended quiescent state, so RCU on that cpu doesn't need scheduler ticks. And together with some other code(already

Re: [RFC PATCH v3 2/5] powerpc: Exception hooks for context tracking subsystem

2013-05-13 Thread Li Zhong
On Mon, 2013-05-13 at 19:06 +1000, Benjamin Herrenschmidt wrote: On Mon, 2013-05-13 at 16:44 +0800, Li Zhong wrote: Yes, the above and hash_page() are two C functions for a same exception. And the exception hooks enable RCU usage in those C codes. But for asm codes, I think we could assume

[RFC PATCH v4 0/5] powerpc: Support context tracking for Power pSeries

2013-05-13 Thread Li Zhong
These patches try to support context tracking for Power arch, beginning with 64-bit pSeries. The codes are ported from that of the x86_64, and in each patch, I listed the corresponding patch for x86. v4: fixed some cosmetic issues suggested by Ben. Li Zhong (5): powerpc: Syscall hooks

[RFC PATCH v4 1/5] powerpc: Syscall hooks for context tracking subsystem

2013-05-13 Thread Li Zhong
it. TIF_NOHZ is added to _TIF_SYCALL_T_OR_A, so it is better for it to be in the same 16 bits with others in the group, so in the asm code, andi. with this group could work. Signed-off-by: Li Zhong zh...@linux.vnet.ibm.com Acked-by: Frederic Weisbecker fweis...@gmail.com --- arch/powerpc/include/asm

[RFC PATCH v4 2/5] powerpc: Exception hooks for context tracking subsystem

2013-05-13 Thread Li Zhong
6c1e0256fad84a843d915414e4b5973b7443d48d context_tracking: Restore correct previous context state on exception exit it is able for exception hooks to use the generic code above instead of a redundant arch implementation. Signed-off-by: Li Zhong zh...@linux.vnet.ibm.com --- arch/powerpc/kernel/traps.c | 80

[RFC PATCH v4 3/5] powerpc: Exit user context on notify resume

2013-05-13 Thread Li Zhong
This patch allows RCU usage in do_notify_resume, e.g. signal handling. It corresponds to [PATCH] x86: Exit RCU extended QS on notify resume commit edf55fda35c7dc7f2d9241c3abaddaf759b457c6 Signed-off-by: Li Zhong zh...@linux.vnet.ibm.com --- arch/powerpc/kernel/signal.c |5 + 1 file

[RFC PATCH v4 4/5] powerpc: Use the new schedule_user API on userspace preemption

2013-05-13 Thread Li Zhong
This patch corresponds to [PATCH] x86: Use the new schedule_user API on userspace preemption commit 0430499ce9d78691f3985962021b16bf8f8a8048 Signed-off-by: Li Zhong zh...@linux.vnet.ibm.com --- arch/powerpc/include/asm/context_tracking.h | 10 ++ arch/powerpc/kernel/entry_64.S

[RFC PATCH v4 5/5] powerpc: select HAVE_CONTEXT_TRACKING for pSeries

2013-05-13 Thread Li Zhong
Start context tracking support from pSeries. Signed-off-by: Li Zhong zh...@linux.vnet.ibm.com --- arch/powerpc/platforms/pseries/Kconfig |1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/platforms/pseries/Kconfig b/arch/powerpc/platforms/pseries/Kconfig index 9a0941b..023b288

[RFC PATCH v3 0/5] powerpc: Support context tracking for Power pSeries

2013-05-12 Thread Li Zhong
the exception are pulled into 3.10, so there is no dependency on tip tree. So patch #2 and #6 in previous version_2 is merged together. Li Zhong (5): powerpc: Syscall hooks for context tracking subsystem powerpc: Exception hooks for context tracking subsystem powerpc: Exit user context

[RFC PATCH v3 1/5] powerpc: Syscall hooks for context tracking subsystem

2013-05-12 Thread Li Zhong
it. TIF_NOHZ is added to _TIF_SYCALL_T_OR_A, so it is better for it to be in the same 16 bits with others in the group, so in the asm code, andi. with this group could work. Signed-off-by: Li Zhong zh...@linux.vnet.ibm.com Acked-by: Frederic Weisbecker fweis...@gmail.com --- arch/powerpc/include/asm

[RFC PATCH v3 2/5] powerpc: Exception hooks for context tracking subsystem

2013-05-12 Thread Li Zhong
6c1e0256fad84a843d915414e4b5973b7443d48d context_tracking: Restore correct previous context state on exception exit it is able for exception hooks to use the generic code above instead of a redundant arch implementation. Signed-off-by: Li Zhong zh...@linux.vnet.ibm.com --- arch/powerpc/kernel/traps.c | 91

[RFC PATCH v3 3/5] powerpc: Exit user context on notify resume

2013-05-12 Thread Li Zhong
This patch allows RCU usage in do_notify_resume, e.g. signal handling. It corresponds to [PATCH] x86: Exit RCU extended QS on notify resume commit edf55fda35c7dc7f2d9241c3abaddaf759b457c6 Signed-off-by: Li Zhong zh...@linux.vnet.ibm.com --- arch/powerpc/kernel/signal.c |5 + 1 file

[RFC PATCH v3 4/5] powerpc: Use the new schedule_user API on userspace preemption

2013-05-12 Thread Li Zhong
This patch corresponds to [PATCH] x86: Use the new schedule_user API on userspace preemption commit 0430499ce9d78691f3985962021b16bf8f8a8048 Signed-off-by: Li Zhong zh...@linux.vnet.ibm.com --- arch/powerpc/include/asm/context_tracking.h | 10 ++ arch/powerpc/kernel/entry_64.S

[RFC PATCH v3 5/5] powerpc: select HAVE_CONTEXT_TRACKING for pSeries

2013-05-12 Thread Li Zhong
Start context tracking support from pSeries. Signed-off-by: Li Zhong zh...@linux.vnet.ibm.com --- arch/powerpc/platforms/pseries/Kconfig |1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/platforms/pseries/Kconfig b/arch/powerpc/platforms/pseries/Kconfig index 9a0941b..023b288

Re: [PATCH] powerpc: Fix MAX_STACK_TRACE_ENTRIES too low warning again

2013-05-07 Thread Li Zhong
On Tue, 2013-05-07 at 10:32 +0800, Li Zhong wrote: Saw this warning again, and this time from the ret_from_fork path. It seems we could clear the back chain earlier in copy_thread(), which could cover both path, and also fix potential lockdep usage in schedule_tail(), or exception occurred

[PATCH v2] powerpc: Fix MAX_STACK_TRACE_ENTRIES too low warning again

2013-05-07 Thread Li Zhong
Saw this warning again, and this time from the ret_from_fork path. It seems we could clear the back chain earlier in copy_thread(), which could cover both path, and also fix potential lockdep usage in schedule_tail(), or exception occurred before we clear the back chain. Signed-off-by: Li Zhong

[PATCH] powerpc: Fix MAX_STACK_TRACE_ENTRIES too low warning again

2013-05-06 Thread Li Zhong
Saw this warning again, and this time from the ret_from_fork path. It seems we could clear the back chain earlier in copy_thread(), which could cover both path, and also fix potential lockdep usage in schedule_tail(), or exception occurred before we clear the back chain. Signed-off-by: Li Zhong

Re: [RFC PATCH powerpc] make CONFIG_NUMA depends on CONFIG_SMP

2013-04-18 Thread Li Zhong
On Thu, 2013-04-18 at 11:46 +1000, Michael Ellerman wrote: On Wed, May 30, 2012 at 05:31:58PM +0800, Li Zhong wrote: I'm not sure whether it makes sense to add this dependency to avoid CONFI_NUMA !CONFIG_SMP. I want to do this because I saw some build errors on next-tree when

Re: [RFC PATCH v2 3/4] powerpc: Don't bolt the hpte in kernel_map_linear_page()

2013-04-15 Thread Li Zhong
On Mon, 2013-04-15 at 08:56 +0200, Benjamin Herrenschmidt wrote: On Mon, 2013-04-15 at 13:50 +1000, Paul Mackerras wrote: On Fri, Apr 12, 2013 at 10:16:59AM +0800, Li Zhong wrote: It seems that in kernel_unmap_linear_page(), it only checks whether there is a map

Re: [RFC PATCH v2 1/4] powerpc: Move the setting of rflags out of loop in __hash_page_huge

2013-04-15 Thread Li Zhong
On Mon, 2013-04-15 at 16:32 +1000, Michael Ellerman wrote: On Fri, Apr 12, 2013 at 10:16:57AM +0800, Li Zhong wrote: It seems that rflags don't get changed in the repeating loop, so move it out of the loop. You've also changed the way new_pte is handled on repeat, but I think that's OK

Re: [RFC PATCH v2 4/4] powerpc: Try to insert the hptes repeatedly in kernel_map_linear_page()

2013-04-15 Thread Li Zhong
On Mon, 2013-04-15 at 16:36 +1000, Michael Ellerman wrote: On Fri, Apr 12, 2013 at 10:17:00AM +0800, Li Zhong wrote: This patch tries to fix following issue when CONFIG_DEBUG_PAGEALLOC is enabled: Please include a better changelog. OK, I'll use the following as a template, thank you

Re: [RFC PATCH v2 3/4] powerpc: Don't bolt the hpte in kernel_map_linear_page()

2013-04-15 Thread Li Zhong
On Mon, 2013-04-15 at 13:27 +0200, Benjamin Herrenschmidt wrote: On Mon, 2013-04-15 at 16:15 +0800, Li Zhong wrote: So the code is implemented in ppc_md.hpte_remove(), may be called by __hash_huge_page(), and asm code htab_call_hpte_remove? This is why the linear mapping

[RFC PATCH v3 1/3] powerpc: Move the setting of rflags out of loop in __hash_page_huge

2013-04-15 Thread Li Zhong
It seems that new_pte and rflags don't get changed in the repeating loop, so move their assignment out of the loop. Signed-off-by: Li Zhong zh...@linux.vnet.ibm.com --- arch/powerpc/mm/hugetlbpage-hash64.c |8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch

[RFC PATCH v3 2/3] powerpc: Split the code trying to insert hpte repeatedly as an helper function

2013-04-15 Thread Li Zhong
Move the logic trying to insert hpte in __hash_page_huge() to an helper function, so it could also be used by others. Signed-off-by: Li Zhong zh...@linux.vnet.ibm.com --- arch/powerpc/mm/hash_utils_64.c | 35 ++ arch/powerpc/mm/hugetlbpage-hash64.c | 31

[RFC PATCH v3 3/3] powerpc: Try to insert the hptes repeatedly in kernel_map_linear_page()

2013-04-15 Thread Li Zhong
7f63db78 48785781 6000 [ 543.076224] ---[ end trace bd5807e8d6ae186b ]--- Signed-off-by: Li Zhong zh...@linux.vnet.ibm.com --- arch/powerpc/mm/hash_utils_64.c | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm

[RFC PATCH v2 0/4] try secondary hash before BUG in kernel_map_linear_page()

2013-04-11 Thread Li Zhong
out of the repeating loop, so the splitting is easier. Patch #3 removes the HPTE_V_BOLTED flag in kernel_map_linear_page(), it seems not needed based on my understanding. Changes are split into smaller ones, so each one did only one thing. Thanks, Zhong Li Zhong (4): powerpc: Move

[RFC PATCH v2 2/4] powerpc: Split the code trying to insert hpte repeatedly as an helper function

2013-04-11 Thread Li Zhong
Move the logical trying to insert hpte in __hash_page_huge() to an helper function, so it could also be used by others. Signed-off-by: Li Zhong zh...@linux.vnet.ibm.com --- arch/powerpc/mm/hash_utils_64.c | 35 ++ arch/powerpc/mm/hugetlbpage-hash64.c | 31

[RFC PATCH v2 1/4] powerpc: Move the setting of rflags out of loop in __hash_page_huge

2013-04-11 Thread Li Zhong
It seems that rflags don't get changed in the repeating loop, so move it out of the loop. Signed-off-by: Li Zhong zh...@linux.vnet.ibm.com --- arch/powerpc/mm/hugetlbpage-hash64.c |8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/mm/hugetlbpage-hash64.c

[RFC PATCH v2 3/4] powerpc: Don't bolt the hpte in kernel_map_linear_page()

2013-04-11 Thread Li Zhong
It seems that in kernel_unmap_linear_page(), it only checks whether there is a map in the linear_map_hash_slots array, so seems we don't need bolt the hpte. Signed-off-by: Li Zhong zh...@linux.vnet.ibm.com --- arch/powerpc/mm/hash_utils_64.c |2 +- 1 file changed, 1 insertion(+), 1 deletion

[RFC PATCH v2 4/4] powerpc: Try to insert the hptes repeatedly in kernel_map_linear_page()

2013-04-11 Thread Li Zhong
0b00 7f63db78 48785781 6000 [ 543.076224] ---[ end trace bd5807e8d6ae186b ]--- Signed-off-by: Li Zhong zh...@linux.vnet.ibm.com --- arch/powerpc/mm/hash_utils_64.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch

Re: [RFC PATCH powerpc] try secondary hash before BUG in kernel_map_linear_page()

2013-04-09 Thread Li Zhong
On Wed, 2013-04-10 at 12:21 +1000, Michael Ellerman wrote: On Mon, Feb 25, 2013 at 05:29:35PM +0800, Li Zhong wrote: This patch tries to fix following issue when CONFIG_DEBUG_PAGEALLOC is enabled: [ 543.075675] [ cut here ] [ 543.075701] kernel BUG at arch

Re: [RFC PATCH v2 6/6] powerpc: Use generic code for exception handling

2013-04-09 Thread Li Zhong
On Wed, 2013-04-10 at 14:56 +1000, Michael Ellerman wrote: On Fri, Mar 29, 2013 at 06:00:21PM +0800, Li Zhong wrote: After the exception handling moved to generic code, and some changes in ... diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c index 360fba8

Re: [RFC PATCH v2 6/6] powerpc: Use generic code for exception handling

2013-04-09 Thread Li Zhong
On Wed, 2013-04-10 at 13:32 +0800, Li Zhong wrote: On Wed, 2013-04-10 at 14:56 +1000, Michael Ellerman wrote: On Fri, Mar 29, 2013 at 06:00:21PM +0800, Li Zhong wrote: After the exception handling moved to generic code, and some changes in ... diff --git a/arch/powerpc/mm/hash_utils_64

Re: [RFC PATCH v2 2/6] powerpc: Exception hooks for context tracking subsystem

2013-04-08 Thread Li Zhong
On Fri, 2013-04-05 at 13:50 +1100, Paul Mackerras wrote: On Fri, Mar 29, 2013 at 06:00:17PM +0800, Li Zhong wrote: This is the exception hooks for context tracking subsystem, including data access, program check, single step, instruction breakpoint, machine check, alignment, fp

[RFC PATCH v2 0/6] powerpc: Support context tracking for Power pSeries

2013-03-29 Thread Li Zhong
code merging. And it might also make future changes easier. Thanks, Zhong Li Zhong (6): powerpc: Syscall hooks for context tracking subsystem powerpc: Exception hooks for context tracking subsystem powerpc: Exit user context on notify resume powerpc: Use the new schedule_user API

[RFC PATCH v2 1/6] powerpc: Syscall hooks for context tracking subsystem

2013-03-29 Thread Li Zhong
it. TIF_NOHZ is added to _TIF_SYCALL_T_OR_A, so it is better for it to be in the same 16 bits with others in the group, so in the asm code, andi. with this group could work. Signed-off-by: Li Zhong zh...@linux.vnet.ibm.com Acked-by: Frederic Weisbecker fweis...@gmail.com --- arch/powerpc/include/asm

[RFC PATCH v2 2/6] powerpc: Exception hooks for context tracking subsystem

2013-03-29 Thread Li Zhong
for userspace RCU extended QS commit 6ba3c97a38803883c2eee489505796cb0a727122 Signed-off-by: Li Zhong zh...@linux.vnet.ibm.com --- arch/powerpc/include/asm/context_tracking.h | 28 + arch/powerpc/kernel/exceptions-64s.S|4 +- arch/powerpc/kernel/traps.c

[RFC PATCH v2 3/6] powerpc: Exit user context on notify resume

2013-03-29 Thread Li Zhong
This patch allows RCU usage in do_notify_resume, e.g. signal handling. It corresponds to [PATCH] x86: Exit RCU extended QS on notify resume commit edf55fda35c7dc7f2d9241c3abaddaf759b457c6 Signed-off-by: Li Zhong zh...@linux.vnet.ibm.com --- arch/powerpc/kernel/signal.c |5 + 1 file

[RFC PATCH v2 4/6] powerpc: Use the new schedule_user API on userspace preemption

2013-03-29 Thread Li Zhong
This patch corresponds to [PATCH] x86: Use the new schedule_user API on userspace preemption commit 0430499ce9d78691f3985962021b16bf8f8a8048 Signed-off-by: Li Zhong zh...@linux.vnet.ibm.com --- arch/powerpc/include/asm/context_tracking.h | 11 +++ arch/powerpc/kernel/entry_64.S

[RFC PATCH v2 6/6] powerpc: Use generic code for exception handling

2013-03-29 Thread Li Zhong
on exception exit it is able for this patch to replace the implementation in arch code with the generic code in above commits. Signed-off-by: Li Zhong zh...@linux.vnet.ibm.com --- arch/powerpc/include/asm/context_tracking.h | 29 --- arch/powerpc/kernel/exceptions-64s.S|4

[RFC PATCH v2 5/6] powerpc: select HAVE_CONTEXT_TRACKING for pSeries

2013-03-29 Thread Li Zhong
Start context tracking support from pSeries. Signed-off-by: Li Zhong zh...@linux.vnet.ibm.com --- arch/powerpc/platforms/pseries/Kconfig |1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/platforms/pseries/Kconfig b/arch/powerpc/platforms/pseries/Kconfig index 9a0941b..023b288

[RFC PATCH powerpc] try secondary hash before BUG in kernel_map_linear_page()

2013-02-25 Thread Li Zhong
0b00 7f63db78 48785781 6000 [ 543.076224] ---[ end trace bd5807e8d6ae186b ]--- The code is borrowed from that in __hash_page_huge(). Signed-off-by: Li Zhong zh...@linux.vnet.ibm.com --- arch/powerpc/mm/hash_utils_64.c | 17 + 1 file changed, 17 insertions(+) diff

Re: [RFC PATCH 2/5] powerpc: Exception hooks for context tracking subsystem

2013-02-16 Thread Li Zhong
On Sun, 2013-02-10 at 15:10 +0100, Frederic Weisbecker wrote: 2013/2/1 Li Zhong zh...@linux.vnet.ibm.com: This is the exception hooks for context tracking subsystem, including data access, program check, single step, instruction breakpoint, machine check, alignment, fp unavailable

Re: [RFC PATCH 1/5] powerpc: Syscall hooks for context tracking subsystem

2013-02-07 Thread Li Zhong
On Thu, 2013-02-07 at 01:29 +0100, Frederic Weisbecker wrote: 2013/2/1 Li Zhong zh...@linux.vnet.ibm.com: This is the syscall slow path hooks for context tracking subsystem, corresponding to [PATCH] x86: Syscall hooks for userspace RCU extended QS commit

[RFC PATCH 0/5] powerpc: Support context tracking for Power pSeries

2013-02-01 Thread Li Zhong
These patches try to support context tracking for Power arch, beginning with 64-bit pSeries. The codes are ported from that of the x86_64, and in each patch, I listed the corresponding patch for x86. Would you please help review and give your comments? Thanks, Zhong Li Zhong (5): powerpc

[RFC PATCH 1/5] powerpc: Syscall hooks for context tracking subsystem

2013-02-01 Thread Li Zhong
it. TIF_NOHZ is added to _TIF_SYCALL_T_OR_A, so it is better for it to be in the same 16 bits with others in the group, so in the asm code, andi. with this group could work. Signed-off-by: Li Zhong zh...@linux.vnet.ibm.com --- arch/powerpc/include/asm/thread_info.h |7 +-- arch/powerpc/kernel

  1   2   >