Re: [PATCH V3] mm: numa: bugfix for LAST_CPUPID_NOT_IN_PAGE_FLAGS

2014-02-28 Thread Peter Zijlstra
On Fri, Feb 28, 2014 at 02:32:02PM +0530, Aneesh Kumar K.V wrote:
> From: Liu Ping Fan 
> 
> When doing some numa tests on powerpc, I triggered an oops bug. I find
> it is caused by using page->_last_cpupid.  It should be initialized as
> "-1 & LAST_CPUPID_MASK", but not "-1". Otherwise, in task_numa_fault(),
> we will miss the checking (last_cpupid == (-1 & LAST_CPUPID_MASK)).
> And finally cause an oops bug in task_numa_group(), since the online cpu is
> less than possible cpu. This happen with CONFIG_SPARSE_VMEMMAP disabled
> 
> Signed-off-by: Liu Ping Fan 
> Signed-off-by: Aneesh Kumar K.V 


Acked-by: Peter Zijlstra 

> ---
>   
>  include/linux/mm.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/include/linux/mm.h b/include/linux/mm.h
> index f28f46eade6a..86245839c9fa 100644
> --- a/include/linux/mm.h
> +++ b/include/linux/mm.h
> @@ -757,7 +757,7 @@ static inline bool __cpupid_match_pid(pid_t task_pid, int 
> cpupid)
>  #ifdef LAST_CPUPID_NOT_IN_PAGE_FLAGS
>  static inline int page_cpupid_xchg_last(struct page *page, int cpupid)
>  {
> - return xchg(&page->_last_cpupid, cpupid);
> + return xchg(&page->_last_cpupid, cpupid & LAST_CPUPID_MASK);
>  }
>  
>  static inline int page_cpupid_last(struct page *page)
> @@ -766,7 +766,7 @@ static inline int page_cpupid_last(struct page *page)
>  }
>  static inline void page_cpupid_reset_last(struct page *page)
>  {
> - page->_last_cpupid = -1;
> + page->_last_cpupid = -1 & LAST_CPUPID_MASK;
>  }
>  #else
>  static inline int page_cpupid_last(struct page *page)
> -- 
> 1.8.3.2
> 
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH] mm: numa: bugfix for LAST_CPUPID_NOT_IN_PAGE_FLAGS

2014-02-28 Thread Aneesh Kumar K.V
liu ping fan  writes:

> On Fri, Feb 28, 2014 at 12:47 PM, Aneesh Kumar K.V
>  wrote:
>> Andrew Morton  writes:
>>
> Thanks for sending V2.  Since the ppc machine env is changed by
> others, I am blocking on setting up the env for re-test this patch.
> And not send out it quickly.

I sent an updated v3 also taking care of xchg

http://article.gmane.org/gmane.linux.kernel/1657613

-aneesh

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH V3] mm: numa: bugfix for LAST_CPUPID_NOT_IN_PAGE_FLAGS

2014-02-28 Thread Aneesh Kumar K.V
From: Liu Ping Fan 

When doing some numa tests on powerpc, I triggered an oops bug. I find
it is caused by using page->_last_cpupid.  It should be initialized as
"-1 & LAST_CPUPID_MASK", but not "-1". Otherwise, in task_numa_fault(),
we will miss the checking (last_cpupid == (-1 & LAST_CPUPID_MASK)).
And finally cause an oops bug in task_numa_group(), since the online cpu is
less than possible cpu. This happen with CONFIG_SPARSE_VMEMMAP disabled

Call trace:
[   55.978091] SMP NR_CPUS=64 NUMA PowerNV
[   55.978118] Modules linked in:
[   55.978145] CPU: 24 PID: 804 Comm: systemd-udevd Not tainted3.13.0-rc1+ #32
[   55.978183] task: c01e2746aa80 ti: c01e32c5 
task.ti:c01e32c5
[   55.978219] NIP: c00f5ad0 LR: c00f5ac8 CTR:c0913cf0
[   55.978256] REGS: c01e32c53510 TRAP: 0300   Not tainted(3.13.0-rc1+)
[   55.978286] MSR: 90009032   CR:28024424  XER: 
2000
[   55.978380] CFAR: c0009324 DAR: 7265717569726857 DSISR:4000 
SOFTE: 1
GPR00: c00f5ac8 c01e32c53790 c1f343380021
GPR04:  0031 c1f74338
GPR08: 0001 7265717569726573 
GPR12: 28024422 cffdd800 296b2e640020
GPR16: 0002 0003 c01e2f8e4658c01e25c1c1d8
GPR20: c01e2f8e4000 c1f7a858 06584392
GPR24: 00a8 c01e33c1a400 01d8c01e25c1c000
GPR28: c01e33c37ff0 000783784392 003fc01e32c53790
[   55.978903] NIP [c00f5ad0] .task_numa_fault+0x1470/0x2370
[   55.978934] LR [c00f5ac8] .task_numa_fault+0x1468/0x2370
[   55.978964] Call Trace:
[   55.978978] [c01e32c53790] 
[c00f5ac8].task_numa_fault+0x1468/0x2370 (unreliable)
[   55.979036] [c01e32c539e0] [c020a820].do_numa_page+0x480/0x4a0
[   55.979072] [c01e32c53b10] [c020bfec].handle_mm_fault+0x4ec/0xc90
[   55.979123] [c01e32c53c00] [c0e88c98].do_page_fault+0x3a8/0x890
[   55.979161] [c01e32c53e30] [c0009568]handle_page_fault+0x10/0x30
[   55.979197] Instruction dump:
[   55.979216] 3c82fefb 3884b138 48d9cff1 6000 48000574 3c62fefb3863af78 
3c82fefb
[   55.979277] 3884b138 48d9cfd5 6000 e93f0100 <812902e4> 7d2907b45529063e 
7d2a07b4
[   55.979354] ---[ end trace 15f2510da5ae07cf ]---

Signed-off-by: Liu Ping Fan 
Signed-off-by: Aneesh Kumar K.V 
---
Changes from V2:
* Also updated cpupid_xchg_last to use LAST_CPUPID_MASK. We use the
  that function with value -1
* Update Author information after taking to Liu
  
 include/linux/mm.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/mm.h b/include/linux/mm.h
index f28f46eade6a..86245839c9fa 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -757,7 +757,7 @@ static inline bool __cpupid_match_pid(pid_t task_pid, int 
cpupid)
 #ifdef LAST_CPUPID_NOT_IN_PAGE_FLAGS
 static inline int page_cpupid_xchg_last(struct page *page, int cpupid)
 {
-   return xchg(&page->_last_cpupid, cpupid);
+   return xchg(&page->_last_cpupid, cpupid & LAST_CPUPID_MASK);
 }
 
 static inline int page_cpupid_last(struct page *page)
@@ -766,7 +766,7 @@ static inline int page_cpupid_last(struct page *page)
 }
 static inline void page_cpupid_reset_last(struct page *page)
 {
-   page->_last_cpupid = -1;
+   page->_last_cpupid = -1 & LAST_CPUPID_MASK;
 }
 #else
 static inline int page_cpupid_last(struct page *page)
-- 
1.8.3.2

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH] Corenet: Add QE platform support for Corenet

2014-02-28 Thread Zhao Qiang
There is QE on platform T104x, add support.
Call funcs qe_ic_init and qe_init if CONFIG_QUICC_ENGINE is defined.

Signed-off-by: Zhao Qiang 
---
 arch/powerpc/platforms/85xx/corenet_generic.c | 32 +++
 1 file changed, 32 insertions(+)

diff --git a/arch/powerpc/platforms/85xx/corenet_generic.c 
b/arch/powerpc/platforms/85xx/corenet_generic.c
index fbd871e..f8c8e0c 100644
--- a/arch/powerpc/platforms/85xx/corenet_generic.c
+++ b/arch/powerpc/platforms/85xx/corenet_generic.c
@@ -26,6 +26,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 
 #include 
 #include 
@@ -38,6 +40,10 @@ void __init corenet_gen_pic_init(void)
unsigned int flags = MPIC_BIG_ENDIAN | MPIC_SINGLE_DEST_CPU |
MPIC_NO_RESET;
 
+#ifdef CONFIG_QUICC_ENGINE
+   struct device_node *np;
+#endif
+
if (ppc_md.get_irq == mpic_get_coreint_irq)
flags |= MPIC_ENABLE_COREINT;
 
@@ -45,6 +51,16 @@ void __init corenet_gen_pic_init(void)
BUG_ON(mpic == NULL);
 
mpic_init(mpic);
+
+#ifdef CONFIG_QUICC_ENGINE
+   np = of_find_compatible_node(NULL, NULL, "fsl,qe-ic");
+   if (np) {
+   qe_ic_init(np, 0, qe_ic_cascade_low_mpic,
+   qe_ic_cascade_high_mpic);
+   of_node_put(np);
+   }
+#endif
+
 }
 
 /*
@@ -52,11 +68,24 @@ void __init corenet_gen_pic_init(void)
  */
 void __init corenet_gen_setup_arch(void)
 {
+#ifdef CONFIG_QUICC_ENGINE
+   struct device_node *np;
+#endif
mpc85xx_smp_init();
 
swiotlb_detect_4g();
 
pr_info("%s board from Freescale Semiconductor\n", ppc_md.name);
+
+#ifdef CONFIG_QUICC_ENGINE
+   np = of_find_compatible_node(NULL, NULL, "fsl,qe");
+   if (!np) {
+   pr_err("%s: Could not find Quicc Engine node\n", __func__);
+   return;
+   }
+   qe_reset();
+   of_node_put(np);
+#endif
 }
 
 static const struct of_device_id of_device_ids[] = {
@@ -81,6 +110,9 @@ static const struct of_device_id of_device_ids[] = {
{
.compatible = "fsl,qoriq-pcie-v3.0",
},
+   {
+   .compatible = "fsl,qe",
+   },
/* The following two are for the Freescale hypervisor */
{
.name   = "hypervisor",
-- 
1.8.5


___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[git pull] Please pull powerpc.git merge branch

2014-02-28 Thread Benjamin Herrenschmidt
Hi Linus !

Here are a few more powerpc fixes for 3.14. Most of these are also
CC'ed to stable and fix bugs in new functionality introduced in
the last 2 or 3 versions.

The following changes since commit 66f9af83e56bfa12964d251df9d60fb571579913:

  powerpc/eeh: Disable EEH on reboot (2014-02-17 11:19:39 +1100)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc.git merge

for you to fetch changes up to e0cf957614976896111e676e5134ac98ee227d3d:

  powerpc/powernv: Fix indirect XSCOM unmangling (2014-02-28 19:15:49 +1100)


Benjamin Herrenschmidt (2):
  powerpc/powernv: Fix opal_xscom_{read,write} prototype
  powerpc/powernv: Fix indirect XSCOM unmangling

Gavin Shan (2):
  powerpc/powernv: Dump PHB diag-data immediately
  powerpc/powernv: Refactor PHB diag-data dump

Laurent Dufour (1):
  powerpc/crashdump : Fix page frame number check in copy_oldmem_page

Liu Ping Fan (1):
  powerpc/ftrace: bugfix for test_24bit_addr

Paul Mackerras (1):
  powerpc: Increase stack redzone for 64-bit userspace to 512 bytes

Tony Breeds (1):
  powerpc/le: Ensure that the 'stop-self' RTAS token is handled correctly

 arch/powerpc/include/asm/compat.h|   5 +-
 arch/powerpc/include/asm/opal.h  |   4 +-
 arch/powerpc/include/asm/ptrace.h|  16 +-
 arch/powerpc/kernel/crash_dump.c |   8 +-
 arch/powerpc/kernel/ftrace.c |   1 +
 arch/powerpc/kernel/signal_64.c  |   4 +-
 arch/powerpc/platforms/powernv/eeh-ioda.c|  96 ++--
 arch/powerpc/platforms/powernv/opal-xscom.c  |  21 +--
 arch/powerpc/platforms/powernv/pci.c | 220 +++
 arch/powerpc/platforms/pseries/hotplug-cpu.c |  22 +--
 10 files changed, 219 insertions(+), 178 deletions(-)


___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev