All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] MIPS: Use common outgoing-CPU-notification code
@ 2017-04-07 10:12 ` Marcin Nowakowski
  0 siblings, 0 replies; 5+ messages in thread
From: Marcin Nowakowski @ 2017-04-07 10:12 UTC (permalink / raw)
  To: Ralf Baechle; +Cc: linux-mips, Marcin Nowakowski

This commit removes the open-coded CPU-offline notification with new
common code.  In particular, this change avoids calling scheduler code
using RCU from an offline CPU that RCU is ignoring.

Signed-off-by: Marcin Nowakowski <marcin.nowakowski@imgtec.com>
---
 arch/mips/kernel/smp-cps.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/arch/mips/kernel/smp-cps.c b/arch/mips/kernel/smp-cps.c
index 6183ad8..51a18e9 100644
--- a/arch/mips/kernel/smp-cps.c
+++ b/arch/mips/kernel/smp-cps.c
@@ -404,7 +404,6 @@ static int cps_cpu_disable(void)
 	return 0;
 }
 
-static DECLARE_COMPLETION(cpu_death_chosen);
 static unsigned cpu_death_sibling;
 static enum {
 	CPU_DEATH_HALT,
@@ -440,7 +439,7 @@ void play_dead(void)
 	}
 
 	/* This CPU has chosen its way out */
-	complete(&cpu_death_chosen);
+	(void)cpu_report_death();
 
 	if (cpu_death == CPU_DEATH_HALT) {
 		vpe_id = cpu_vpe_id(&cpu_data[cpu]);
@@ -489,8 +488,7 @@ static void cps_cpu_die(unsigned int cpu)
 	int err;
 
 	/* Wait for the cpu to choose its way out */
-	if (!wait_for_completion_timeout(&cpu_death_chosen,
-					 msecs_to_jiffies(5000))) {
+	if (!cpu_wait_death(cpu, 5)) {
 		pr_err("CPU%u: didn't offline\n", cpu);
 		return;
 	}
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH] MIPS: Use common outgoing-CPU-notification code
@ 2017-04-07 10:12 ` Marcin Nowakowski
  0 siblings, 0 replies; 5+ messages in thread
From: Marcin Nowakowski @ 2017-04-07 10:12 UTC (permalink / raw)
  To: Ralf Baechle; +Cc: linux-mips, Marcin Nowakowski

This commit removes the open-coded CPU-offline notification with new
common code.  In particular, this change avoids calling scheduler code
using RCU from an offline CPU that RCU is ignoring.

Signed-off-by: Marcin Nowakowski <marcin.nowakowski@imgtec.com>
---
 arch/mips/kernel/smp-cps.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/arch/mips/kernel/smp-cps.c b/arch/mips/kernel/smp-cps.c
index 6183ad8..51a18e9 100644
--- a/arch/mips/kernel/smp-cps.c
+++ b/arch/mips/kernel/smp-cps.c
@@ -404,7 +404,6 @@ static int cps_cpu_disable(void)
 	return 0;
 }
 
-static DECLARE_COMPLETION(cpu_death_chosen);
 static unsigned cpu_death_sibling;
 static enum {
 	CPU_DEATH_HALT,
@@ -440,7 +439,7 @@ void play_dead(void)
 	}
 
 	/* This CPU has chosen its way out */
-	complete(&cpu_death_chosen);
+	(void)cpu_report_death();
 
 	if (cpu_death == CPU_DEATH_HALT) {
 		vpe_id = cpu_vpe_id(&cpu_data[cpu]);
@@ -489,8 +488,7 @@ static void cps_cpu_die(unsigned int cpu)
 	int err;
 
 	/* Wait for the cpu to choose its way out */
-	if (!wait_for_completion_timeout(&cpu_death_chosen,
-					 msecs_to_jiffies(5000))) {
+	if (!cpu_wait_death(cpu, 5)) {
 		pr_err("CPU%u: didn't offline\n", cpu);
 		return;
 	}
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] MIPS: Use common outgoing-CPU-notification code
  2017-04-07 10:12 ` Marcin Nowakowski
  (?)
@ 2017-04-07 11:04 ` Sergei Shtylyov
  2017-04-07 11:32     ` Marcin Nowakowski
  -1 siblings, 1 reply; 5+ messages in thread
From: Sergei Shtylyov @ 2017-04-07 11:04 UTC (permalink / raw)
  To: Marcin Nowakowski, Ralf Baechle; +Cc: linux-mips

Hello!

On 4/7/2017 1:12 PM, Marcin Nowakowski wrote:

> This commit removes the open-coded CPU-offline notification with new

    Replaces, perhaps?

> common code.  In particular, this change avoids calling scheduler code
> using RCU from an offline CPU that RCU is ignoring.
>
> Signed-off-by: Marcin Nowakowski <marcin.nowakowski@imgtec.com>
[...]

MBR, Sergei

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] MIPS: Use common outgoing-CPU-notification code
@ 2017-04-07 11:32     ` Marcin Nowakowski
  0 siblings, 0 replies; 5+ messages in thread
From: Marcin Nowakowski @ 2017-04-07 11:32 UTC (permalink / raw)
  To: Sergei Shtylyov, Ralf Baechle; +Cc: linux-mips

Hi,

On 07.04.2017 13:04, Sergei Shtylyov wrote:
> Hello!
>
> On 4/7/2017 1:12 PM, Marcin Nowakowski wrote:
>
>> This commit removes the open-coded CPU-offline notification with new
>
>    Replaces, perhaps?
>

Yeah, that will be better. I'll send an updated version.

thanks
Marcin

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] MIPS: Use common outgoing-CPU-notification code
@ 2017-04-07 11:32     ` Marcin Nowakowski
  0 siblings, 0 replies; 5+ messages in thread
From: Marcin Nowakowski @ 2017-04-07 11:32 UTC (permalink / raw)
  To: Sergei Shtylyov, Ralf Baechle; +Cc: linux-mips

Hi,

On 07.04.2017 13:04, Sergei Shtylyov wrote:
> Hello!
>
> On 4/7/2017 1:12 PM, Marcin Nowakowski wrote:
>
>> This commit removes the open-coded CPU-offline notification with new
>
>    Replaces, perhaps?
>

Yeah, that will be better. I'll send an updated version.

thanks
Marcin

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-04-07 11:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-07 10:12 [PATCH] MIPS: Use common outgoing-CPU-notification code Marcin Nowakowski
2017-04-07 10:12 ` Marcin Nowakowski
2017-04-07 11:04 ` Sergei Shtylyov
2017-04-07 11:32   ` Marcin Nowakowski
2017-04-07 11:32     ` Marcin Nowakowski

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.