* Re: [PATCH 1/1] sparc: task_cpu() for stopper thread on sparc32 returns 0 [not found] <1334827362-3434-1-git-send-email-konrad@gaisler.com> @ 2012-04-19 15:34 ` Sam Ravnborg 2012-04-20 3:36 ` Yong Zhang 0 siblings, 1 reply; 9+ messages in thread From: Sam Ravnborg @ 2012-04-19 15:34 UTC (permalink / raw) To: Konrad Eisele, Peter Zijlstra, Ingo Molnar, lkml Cc: sparclinux, davem, daniel 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. > > Signed-off-by: Konrad Eisele <konrad@gaisler.com> > --- > kernel/sched/stop_task.c | 9 ++++++++- > 1 files changed, 8 insertions(+), 1 deletions(-) > > diff --git a/kernel/sched/stop_task.c b/kernel/sched/stop_task.c > index 7b386e8..9201866 100644 > --- a/kernel/sched/stop_task.c > +++ b/kernel/sched/stop_task.c > @@ -13,7 +13,14 @@ > static int > select_task_rq_stop(struct task_struct *p, int sd_flag, int flags) > { > - return task_cpu(p); /* stop tasks as never migrate */ > + int ccpu, cpu , dcpu; > + ccpu = cpu = task_cpu(p); > + if (unlikely(!cpumask_test_cpu(cpu, tsk_cpus_allowed(p)))) { > + cpu = cpumask_first(tsk_cpus_allowed(p)); > + if (cpu >= nr_cpu_ids) > + cpu = ccpu; > + } > + return cpu; > } > #endif /* CONFIG_SMP */ > > -- > 1.6.1.3 > ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/1] sparc: task_cpu() for stopper thread on sparc32 returns 0 2012-04-19 15:34 ` [PATCH 1/1] sparc: task_cpu() for stopper thread on sparc32 returns 0 Sam Ravnborg @ 2012-04-20 3:36 ` Yong Zhang 2012-04-20 3:56 ` David Miller 2012-04-20 6:28 ` [PATCH 1/1] sparc32,leon: add notify_cpu_starting() Konrad Eisele 0 siblings, 2 replies; 9+ 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] 9+ 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 2012-04-20 6:28 ` [PATCH 1/1] sparc32,leon: add notify_cpu_starting() Konrad Eisele 1 sibling, 0 replies; 9+ 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] 9+ messages in thread
* [PATCH 1/1] sparc32,leon: add notify_cpu_starting() 2012-04-20 3:36 ` Yong Zhang 2012-04-20 3:56 ` David Miller @ 2012-04-20 6:28 ` Konrad Eisele 2012-04-20 6:32 ` Konrad Eisele 1 sibling, 1 reply; 9+ 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] 9+ messages in thread
* Re: [PATCH 1/1] sparc32,leon: add notify_cpu_starting() 2012-04-20 6:28 ` [PATCH 1/1] sparc32,leon: add notify_cpu_starting() Konrad Eisele @ 2012-04-20 6:32 ` Konrad Eisele 2012-04-20 7:06 ` David Miller 0 siblings, 1 reply; 9+ 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] 9+ 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 2012-04-20 7:46 ` [PATCH] " Konrad Eisele 0 siblings, 1 reply; 9+ 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] 9+ messages in thread
* [PATCH] sparc32,leon: add notify_cpu_starting() 2012-04-20 7:06 ` David Miller @ 2012-04-20 7:46 ` Konrad Eisele 2012-04-20 7:47 ` Konrad Eisele 2012-04-20 8:01 ` Srivatsa S. Bhat 0 siblings, 2 replies; 9+ 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] 9+ messages in thread
* Re: [PATCH] sparc32,leon: add notify_cpu_starting() 2012-04-20 7:46 ` [PATCH] " Konrad Eisele @ 2012-04-20 7:47 ` Konrad Eisele 2012-04-20 8:01 ` Srivatsa S. Bhat 1 sibling, 0 replies; 9+ 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] 9+ messages in thread
* Re: [PATCH] sparc32,leon: add notify_cpu_starting() 2012-04-20 7:46 ` [PATCH] " Konrad Eisele 2012-04-20 7:47 ` Konrad Eisele @ 2012-04-20 8:01 ` Srivatsa S. Bhat 1 sibling, 0 replies; 9+ 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] 9+ messages in thread
end of thread, other threads:[~2012-04-20 8:03 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1334827362-3434-1-git-send-email-konrad@gaisler.com>
2012-04-19 15:34 ` [PATCH 1/1] sparc: task_cpu() for stopper thread on sparc32 returns 0 Sam Ravnborg
2012-04-20 3:36 ` Yong Zhang
2012-04-20 3:56 ` David Miller
2012-04-20 6:28 ` [PATCH 1/1] sparc32,leon: add notify_cpu_starting() Konrad Eisele
2012-04-20 6:32 ` Konrad Eisele
2012-04-20 7:06 ` David Miller
2012-04-20 7:46 ` [PATCH] " Konrad Eisele
2012-04-20 7:47 ` Konrad Eisele
2012-04-20 8:01 ` Srivatsa S. Bhat
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox