* Re: [PATCH 1/1] sparc: task_cpu() for stopper thread on sparc32 returns 0
@ 2012-04-20 3:36 ` Yong Zhang
0 siblings, 0 replies; 20+ messages in thread
From: Yong Zhang @ 2012-04-20 3:36 UTC (permalink / raw)
To: Sam Ravnborg
Cc: Konrad Eisele, Peter Zijlstra, Ingo Molnar, lkml, sparclinux,
davem, daniel
On Thu, Apr 19, 2012 at 05:34:28PM +0200, Sam Ravnborg wrote:
> Added a few more people - as this patch touches a core file.
>
> I expect we have an issue on sparc32 - that manifest
> in this bug. But I do not know this code at all.
>
> Sam
>
> On Thu, Apr 19, 2012 at 11:22:42AM +0200, Konrad Eisele wrote:
> > The stopper thread for CPU > 0 (at least in sparc32)
> > has on initialization task_cpu() set to zero even
> > for CPUs > 0. The patch explicitly checks weather the
> > CPU is allowed to run on the cpu that task_cpu()
> > return or changes the return cpu.
Actually try_to_wake_up() will put the task to the right place.
Could you please try the following patch? (Hope I'm putting
notify_cpu_starting() in the right place).
---
From: Yong Zhang <yong.zhang@windriver.com>
Date: Fri, 20 Apr 2012 11:31:45 +0800
Subject: [PATCH] sparc32,leon: add notify_cpu_starting()
Otherwise cpu_active_mask will not set, which lead to other issue.
Signed-off-by: Yong Zhang <yong.zhang0@gmail.com>
---
arch/sparc/kernel/leon_smp.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/arch/sparc/kernel/leon_smp.c b/arch/sparc/kernel/leon_smp.c
index 1210fde..bb017e7 100644
--- a/arch/sparc/kernel/leon_smp.c
+++ b/arch/sparc/kernel/leon_smp.c
@@ -78,6 +78,8 @@ void __cpuinit leon_callin(void)
local_flush_tlb_all();
leon_configure_cache_smp();
+ notify_cpu_starting(cpuid);
+
/* Get our local ticker going. */
smp_setup_percpu_timer();
--
1.7.5.4
^ permalink raw reply related [flat|nested] 20+ messages in thread
* Re: [PATCH 1/1] sparc: task_cpu() for stopper thread on sparc32 returns 0
2012-04-20 3:36 ` Yong Zhang
@ 2012-04-20 3:56 ` David Miller
-1 siblings, 0 replies; 20+ messages in thread
From: David Miller @ 2012-04-20 3:56 UTC (permalink / raw)
To: yong.zhang0
Cc: sam, konrad, a.p.zijlstra, mingo, linux-kernel, sparclinux, daniel
From: Yong Zhang <yong.zhang0@gmail.com>
Date: Fri, 20 Apr 2012 11:36:34 +0800
> diff --git a/arch/sparc/kernel/leon_smp.c b/arch/sparc/kernel/leon_smp.c
> index 1210fde..bb017e7 100644
> --- a/arch/sparc/kernel/leon_smp.c
> +++ b/arch/sparc/kernel/leon_smp.c
> @@ -78,6 +78,8 @@ void __cpuinit leon_callin(void)
> local_flush_tlb_all();
> leon_configure_cache_smp();
>
> + notify_cpu_starting(cpuid);
> +
This is the most reasonable theory I've seen for this
problem :-)
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 1/1] sparc: task_cpu() for stopper thread on sparc32 returns 0
@ 2012-04-20 3:56 ` David Miller
0 siblings, 0 replies; 20+ messages in thread
From: David Miller @ 2012-04-20 3:56 UTC (permalink / raw)
To: yong.zhang0
Cc: sam, konrad, a.p.zijlstra, mingo, linux-kernel, sparclinux, daniel
From: Yong Zhang <yong.zhang0@gmail.com>
Date: Fri, 20 Apr 2012 11:36:34 +0800
> diff --git a/arch/sparc/kernel/leon_smp.c b/arch/sparc/kernel/leon_smp.c
> index 1210fde..bb017e7 100644
> --- a/arch/sparc/kernel/leon_smp.c
> +++ b/arch/sparc/kernel/leon_smp.c
> @@ -78,6 +78,8 @@ void __cpuinit leon_callin(void)
> local_flush_tlb_all();
> leon_configure_cache_smp();
>
> + notify_cpu_starting(cpuid);
> +
This is the most reasonable theory I've seen for this
problem :-)
^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH 1/1] sparc32,leon: add notify_cpu_starting()
2012-04-20 3:36 ` Yong Zhang
@ 2012-04-20 6:28 ` Konrad Eisele
-1 siblings, 0 replies; 20+ messages in thread
From: Konrad Eisele @ 2012-04-20 6:28 UTC (permalink / raw)
To: yong.zhang0
Cc: sam, a.p.zijlstra, mingo, linux-kernel, sparclinux, davem,
daniel, Yong Zhang
From: Yong Zhang <yong.zhang@windriver.com>
Otherwise cpu_active_mask will not set, which lead to other issue.
Signed-off-by: Yong Zhang <yong.zhang0@gmail.com>
Signed-off-by: Konrad Eisele <konrad@gaisler.com>
---
arch/sparc/kernel/leon_smp.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/arch/sparc/kernel/leon_smp.c b/arch/sparc/kernel/leon_smp.c
index 1210fde..160cac9 100644
--- a/arch/sparc/kernel/leon_smp.c
+++ b/arch/sparc/kernel/leon_smp.c
@@ -23,6 +23,7 @@
#include <linux/pm.h>
#include <linux/delay.h>
#include <linux/gfp.h>
+#include <linux/cpu.h>
#include <asm/cacheflush.h>
#include <asm/tlbflush.h>
@@ -78,6 +79,8 @@ void __cpuinit leon_callin(void)
local_flush_tlb_all();
leon_configure_cache_smp();
+ notify_cpu_starting(cpuid);
+
/* Get our local ticker going. */
smp_setup_percpu_timer();
--
1.6.1.3
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH 1/1] sparc32,leon: add notify_cpu_starting()
@ 2012-04-20 6:28 ` Konrad Eisele
0 siblings, 0 replies; 20+ messages in thread
From: Konrad Eisele @ 2012-04-20 6:28 UTC (permalink / raw)
To: yong.zhang0
Cc: sam, a.p.zijlstra, mingo, linux-kernel, sparclinux, davem,
daniel, Yong Zhang
From: Yong Zhang <yong.zhang@windriver.com>
Otherwise cpu_active_mask will not set, which lead to other issue.
Signed-off-by: Yong Zhang <yong.zhang0@gmail.com>
Signed-off-by: Konrad Eisele <konrad@gaisler.com>
---
arch/sparc/kernel/leon_smp.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/arch/sparc/kernel/leon_smp.c b/arch/sparc/kernel/leon_smp.c
index 1210fde..160cac9 100644
--- a/arch/sparc/kernel/leon_smp.c
+++ b/arch/sparc/kernel/leon_smp.c
@@ -23,6 +23,7 @@
#include <linux/pm.h>
#include <linux/delay.h>
#include <linux/gfp.h>
+#include <linux/cpu.h>
#include <asm/cacheflush.h>
#include <asm/tlbflush.h>
@@ -78,6 +79,8 @@ void __cpuinit leon_callin(void)
local_flush_tlb_all();
leon_configure_cache_smp();
+ notify_cpu_starting(cpuid);
+
/* Get our local ticker going. */
smp_setup_percpu_timer();
--
1.6.1.3
^ permalink raw reply related [flat|nested] 20+ messages in thread
* Re: [PATCH 1/1] sparc32,leon: add notify_cpu_starting()
2012-04-20 6:28 ` Konrad Eisele
@ 2012-04-20 6:32 ` Konrad Eisele
-1 siblings, 0 replies; 20+ messages in thread
From: Konrad Eisele @ 2012-04-20 6:32 UTC (permalink / raw)
To: yong.zhang0
Cc: sam, a.p.zijlstra, mingo, linux-kernel, sparclinux, davem,
daniel, Yong Zhang
Hello Yong,
Thank you for the patch, it works. The SMP is fully
functional again for sparc-leon. I just added a "#include<linux/cpu.h>"
to avoid compiler warning.
Please someone in the cc-list, apply.
-- Greetings Konrad
Konrad Eisele wrote:
> From: Yong Zhang<yong.zhang@windriver.com>
>
> Otherwise cpu_active_mask will not set, which lead to other issue.
>
> Signed-off-by: Yong Zhang<yong.zhang0@gmail.com>
> Signed-off-by: Konrad Eisele<konrad@gaisler.com>
> ---
> arch/sparc/kernel/leon_smp.c | 3 +++
> 1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/arch/sparc/kernel/leon_smp.c b/arch/sparc/kernel/leon_smp.c
> index 1210fde..160cac9 100644
> --- a/arch/sparc/kernel/leon_smp.c
> +++ b/arch/sparc/kernel/leon_smp.c
> @@ -23,6 +23,7 @@
> #include<linux/pm.h>
> #include<linux/delay.h>
> #include<linux/gfp.h>
> +#include<linux/cpu.h>
>
> #include<asm/cacheflush.h>
> #include<asm/tlbflush.h>
> @@ -78,6 +79,8 @@ void __cpuinit leon_callin(void)
> local_flush_tlb_all();
> leon_configure_cache_smp();
>
> + notify_cpu_starting(cpuid);
> +
> /* Get our local ticker going. */
> smp_setup_percpu_timer();
>
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 1/1] sparc32,leon: add notify_cpu_starting()
@ 2012-04-20 6:32 ` Konrad Eisele
0 siblings, 0 replies; 20+ messages in thread
From: Konrad Eisele @ 2012-04-20 6:32 UTC (permalink / raw)
To: yong.zhang0
Cc: sam, a.p.zijlstra, mingo, linux-kernel, sparclinux, davem,
daniel, Yong Zhang
Hello Yong,
Thank you for the patch, it works. The SMP is fully
functional again for sparc-leon. I just added a "#include<linux/cpu.h>"
to avoid compiler warning.
Please someone in the cc-list, apply.
-- Greetings Konrad
Konrad Eisele wrote:
> From: Yong Zhang<yong.zhang@windriver.com>
>
> Otherwise cpu_active_mask will not set, which lead to other issue.
>
> Signed-off-by: Yong Zhang<yong.zhang0@gmail.com>
> Signed-off-by: Konrad Eisele<konrad@gaisler.com>
> ---
> arch/sparc/kernel/leon_smp.c | 3 +++
> 1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/arch/sparc/kernel/leon_smp.c b/arch/sparc/kernel/leon_smp.c
> index 1210fde..160cac9 100644
> --- a/arch/sparc/kernel/leon_smp.c
> +++ b/arch/sparc/kernel/leon_smp.c
> @@ -23,6 +23,7 @@
> #include<linux/pm.h>
> #include<linux/delay.h>
> #include<linux/gfp.h>
> +#include<linux/cpu.h>
>
> #include<asm/cacheflush.h>
> #include<asm/tlbflush.h>
> @@ -78,6 +79,8 @@ void __cpuinit leon_callin(void)
> local_flush_tlb_all();
> leon_configure_cache_smp();
>
> + notify_cpu_starting(cpuid);
> +
> /* Get our local ticker going. */
> smp_setup_percpu_timer();
>
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 1/1] sparc32,leon: add notify_cpu_starting()
2012-04-20 6:32 ` Konrad Eisele
@ 2012-04-20 7:06 ` David Miller
-1 siblings, 0 replies; 20+ messages in thread
From: David Miller @ 2012-04-20 7:06 UTC (permalink / raw)
To: konrad
Cc: yong.zhang0, sam, a.p.zijlstra, mingo, linux-kernel, sparclinux,
daniel, yong.zhang
From: Konrad Eisele <konrad@gaisler.com>
Date: Fri, 20 Apr 2012 08:32:50 +0200
> Hello Yong,
> Thank you for the patch, it works. The SMP is fully
> functional again for sparc-leon. I just added a
> "#include<linux/cpu.h>"
> to avoid compiler warning.
> Please someone in the cc-list, apply.
I'll take care of it.
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH 1/1] sparc32,leon: add notify_cpu_starting()
@ 2012-04-20 7:06 ` David Miller
0 siblings, 0 replies; 20+ messages in thread
From: David Miller @ 2012-04-20 7:06 UTC (permalink / raw)
To: konrad
Cc: yong.zhang0, sam, a.p.zijlstra, mingo, linux-kernel, sparclinux,
daniel, yong.zhang
From: Konrad Eisele <konrad@gaisler.com>
Date: Fri, 20 Apr 2012 08:32:50 +0200
> Hello Yong,
> Thank you for the patch, it works. The SMP is fully
> functional again for sparc-leon. I just added a
> "#include<linux/cpu.h>"
> to avoid compiler warning.
> Please someone in the cc-list, apply.
I'll take care of it.
^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH] sparc32,leon: add notify_cpu_starting()
2012-04-20 7:06 ` David Miller
@ 2012-04-20 7:46 ` Konrad Eisele
-1 siblings, 0 replies; 20+ messages in thread
From: Konrad Eisele @ 2012-04-20 7:46 UTC (permalink / raw)
To: davem
Cc: konrad, yong.zhang0, sam, a.p.zijlstra, mingo, linux-kernel,
sparclinux, daniel
Otherwise cpu_active_mask will not set, which lead to other issue.
Signed-off-by: Yong Zhang <yong.zhang0@gmail.com>
Signed-off-by: Konrad Eisele <konrad@gaisler.com>
---
arch/sparc/kernel/leon_smp.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/arch/sparc/kernel/leon_smp.c b/arch/sparc/kernel/leon_smp.c
index 6173f4d..356dfc4 100644
--- a/arch/sparc/kernel/leon_smp.c
+++ b/arch/sparc/kernel/leon_smp.c
@@ -79,6 +79,8 @@ void __cpuinit leon_callin(void)
local_flush_tlb_all();
leon_configure_cache_smp();
+ notify_cpu_starting(cpuid);
+
/* Get our local ticker going. */
register_percpu_ce(cpuid);
--
1.6.1.3
^ permalink raw reply related [flat|nested] 20+ messages in thread
* [PATCH] sparc32,leon: add notify_cpu_starting()
@ 2012-04-20 7:46 ` Konrad Eisele
0 siblings, 0 replies; 20+ messages in thread
From: Konrad Eisele @ 2012-04-20 7:46 UTC (permalink / raw)
To: davem
Cc: konrad, yong.zhang0, sam, a.p.zijlstra, mingo, linux-kernel,
sparclinux, daniel
Otherwise cpu_active_mask will not set, which lead to other issue.
Signed-off-by: Yong Zhang <yong.zhang0@gmail.com>
Signed-off-by: Konrad Eisele <konrad@gaisler.com>
---
arch/sparc/kernel/leon_smp.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/arch/sparc/kernel/leon_smp.c b/arch/sparc/kernel/leon_smp.c
index 6173f4d..356dfc4 100644
--- a/arch/sparc/kernel/leon_smp.c
+++ b/arch/sparc/kernel/leon_smp.c
@@ -79,6 +79,8 @@ void __cpuinit leon_callin(void)
local_flush_tlb_all();
leon_configure_cache_smp();
+ notify_cpu_starting(cpuid);
+
/* Get our local ticker going. */
register_percpu_ce(cpuid);
--
1.6.1.3
^ permalink raw reply related [flat|nested] 20+ messages in thread
* Re: [PATCH] sparc32,leon: add notify_cpu_starting()
2012-04-20 7:46 ` Konrad Eisele
@ 2012-04-20 7:47 ` Konrad Eisele
-1 siblings, 0 replies; 20+ messages in thread
From: Konrad Eisele @ 2012-04-20 7:47 UTC (permalink / raw)
To: Konrad Eisele
Cc: davem, yong.zhang0, sam, a.p.zijlstra, mingo, linux-kernel,
sparclinux, daniel
This version is against linux/kernel/git/davem/sparc-next.git .
-- Konrad
Konrad Eisele wrote:
> Otherwise cpu_active_mask will not set, which lead to other issue.
>
> Signed-off-by: Yong Zhang<yong.zhang0@gmail.com>
> Signed-off-by: Konrad Eisele<konrad@gaisler.com>
> ---
> arch/sparc/kernel/leon_smp.c | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/arch/sparc/kernel/leon_smp.c b/arch/sparc/kernel/leon_smp.c
> index 6173f4d..356dfc4 100644
> --- a/arch/sparc/kernel/leon_smp.c
> +++ b/arch/sparc/kernel/leon_smp.c
> @@ -79,6 +79,8 @@ void __cpuinit leon_callin(void)
> local_flush_tlb_all();
> leon_configure_cache_smp();
>
> + notify_cpu_starting(cpuid);
> +
> /* Get our local ticker going. */
> register_percpu_ce(cpuid);
>
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH] sparc32,leon: add notify_cpu_starting()
@ 2012-04-20 7:47 ` Konrad Eisele
0 siblings, 0 replies; 20+ messages in thread
From: Konrad Eisele @ 2012-04-20 7:47 UTC (permalink / raw)
To: Konrad Eisele
Cc: davem, yong.zhang0, sam, a.p.zijlstra, mingo, linux-kernel,
sparclinux, daniel
This version is against linux/kernel/git/davem/sparc-next.git .
-- Konrad
Konrad Eisele wrote:
> Otherwise cpu_active_mask will not set, which lead to other issue.
>
> Signed-off-by: Yong Zhang<yong.zhang0@gmail.com>
> Signed-off-by: Konrad Eisele<konrad@gaisler.com>
> ---
> arch/sparc/kernel/leon_smp.c | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/arch/sparc/kernel/leon_smp.c b/arch/sparc/kernel/leon_smp.c
> index 6173f4d..356dfc4 100644
> --- a/arch/sparc/kernel/leon_smp.c
> +++ b/arch/sparc/kernel/leon_smp.c
> @@ -79,6 +79,8 @@ void __cpuinit leon_callin(void)
> local_flush_tlb_all();
> leon_configure_cache_smp();
>
> + notify_cpu_starting(cpuid);
> +
> /* Get our local ticker going. */
> register_percpu_ce(cpuid);
>
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH] sparc32,leon: add notify_cpu_starting()
2012-04-20 7:46 ` Konrad Eisele
@ 2012-04-20 8:13 ` Srivatsa S. Bhat
-1 siblings, 0 replies; 20+ messages in thread
From: Srivatsa S. Bhat @ 2012-04-20 8:01 UTC (permalink / raw)
To: Konrad Eisele
Cc: davem, yong.zhang0, sam, a.p.zijlstra, mingo, linux-kernel,
sparclinux, daniel
On 04/20/2012 01:16 PM, Konrad Eisele wrote:
> Otherwise cpu_active_mask will not set, which lead to other issue.
>
> Signed-off-by: Yong Zhang <yong.zhang0@gmail.com>
> Signed-off-by: Konrad Eisele <konrad@gaisler.com>
Reviewed-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
Looks like I missed sparc32 while fixing up the other architectures.
(https://lkml.org/lkml/2012/3/22/132)
Regards,
Srivatsa S. Bhat
> ---
> arch/sparc/kernel/leon_smp.c | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/arch/sparc/kernel/leon_smp.c b/arch/sparc/kernel/leon_smp.c
> index 6173f4d..356dfc4 100644
> --- a/arch/sparc/kernel/leon_smp.c
> +++ b/arch/sparc/kernel/leon_smp.c
> @@ -79,6 +79,8 @@ void __cpuinit leon_callin(void)
> local_flush_tlb_all();
> leon_configure_cache_smp();
>
> + notify_cpu_starting(cpuid);
> +
> /* Get our local ticker going. */
> register_percpu_ce(cpuid);
>
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH] sparc32,leon: add notify_cpu_starting()
@ 2012-04-20 8:13 ` Srivatsa S. Bhat
0 siblings, 0 replies; 20+ messages in thread
From: Srivatsa S. Bhat @ 2012-04-20 8:13 UTC (permalink / raw)
To: Konrad Eisele
Cc: davem, yong.zhang0, sam, a.p.zijlstra, mingo, linux-kernel,
sparclinux, daniel
On 04/20/2012 01:16 PM, Konrad Eisele wrote:
> Otherwise cpu_active_mask will not set, which lead to other issue.
>
> Signed-off-by: Yong Zhang <yong.zhang0@gmail.com>
> Signed-off-by: Konrad Eisele <konrad@gaisler.com>
Reviewed-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
Looks like I missed sparc32 while fixing up the other architectures.
(https://lkml.org/lkml/2012/3/22/132)
Regards,
Srivatsa S. Bhat
> ---
> arch/sparc/kernel/leon_smp.c | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/arch/sparc/kernel/leon_smp.c b/arch/sparc/kernel/leon_smp.c
> index 6173f4d..356dfc4 100644
> --- a/arch/sparc/kernel/leon_smp.c
> +++ b/arch/sparc/kernel/leon_smp.c
> @@ -79,6 +79,8 @@ void __cpuinit leon_callin(void)
> local_flush_tlb_all();
> leon_configure_cache_smp();
>
> + notify_cpu_starting(cpuid);
> +
> /* Get our local ticker going. */
> register_percpu_ce(cpuid);
>
^ permalink raw reply [flat|nested] 20+ messages in thread