2016-04-04 12:18:24

by Anna-Maria Behnsen

[permalink] [raw]
Subject: [PATCH] MIPS: Remove no longer needed work_on_cpu() call

Since commit 1cf4f629d9d2 ("cpu/hotplug: Move online calls to
hotplugged cpu") it is ensured that callbacks of CPU_ONLINE and
CPU_DOWN_PREPARE are processed on the hotplugged CPU. Due to this
work_on_cpu() calls are no longer required.

Replace work_on_cpu() with a direct call of mips_cdmm_bus_up() or
mips_cdmm_bus_down(). Description of those functions are adapted.

Cc: Ralf Baechle <[email protected]>
Cc: [email protected]
Signed-off-by: Anna-Maria Gleixner <[email protected]>
---
drivers/bus/mips_cdmm.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)

--- a/drivers/bus/mips_cdmm.c
+++ b/drivers/bus/mips_cdmm.c
@@ -599,8 +599,8 @@ BUILD_PERDEV_HELPER(cpu_up) /* i
* mips_cdmm_bus_down() - Tear down the CDMM bus.
* @data: Pointer to unsigned int CPU number.
*
- * This work_on_cpu callback function is executed on a given CPU to call the
- * CDMM driver cpu_down callback for all devices on that CPU.
+ * This function is executed on the hotplugged CPU and calls the CDMM
+ * driver cpu_down callback for all devices on that CPU.
*/
static long mips_cdmm_bus_down(void *data)
{
@@ -630,7 +630,9 @@ static long mips_cdmm_bus_down(void *dat
* CDMM devices on that CPU, or to call the CDMM driver cpu_up callback for all
* devices already discovered on that CPU.
*
- * It is used during initialisation and when CPUs are brought online.
+ * It is used as work_on_cpu callback function during
+ * initialisation. When CPUs are brought online the function is
+ * invoked directly on the hotplugged CPU.
*/
static long mips_cdmm_bus_up(void *data)
{
@@ -677,10 +679,10 @@ static int mips_cdmm_cpu_notify(struct n
switch (action & ~CPU_TASKS_FROZEN) {
case CPU_ONLINE:
case CPU_DOWN_FAILED:
- work_on_cpu(cpu, mips_cdmm_bus_up, &cpu);
+ mips_cdmm_bus_up(&cpu);
break;
case CPU_DOWN_PREPARE:
- work_on_cpu(cpu, mips_cdmm_bus_down, &cpu);
+ mips_cdmm_bus_down(&cpu);
break;
default:
return NOTIFY_DONE;


2016-04-04 15:03:40

by Ralf Baechle

[permalink] [raw]
Subject: Re: [PATCH] MIPS: Remove no longer needed work_on_cpu() call

On Mon, Apr 04, 2016 at 02:18:03PM +0200, Anna-Maria Gleixner wrote:

> Since commit 1cf4f629d9d2 ("cpu/hotplug: Move online calls to
> hotplugged cpu") it is ensured that callbacks of CPU_ONLINE and
> CPU_DOWN_PREPARE are processed on the hotplugged CPU. Due to this
> work_on_cpu() calls are no longer required.
>
> Replace work_on_cpu() with a direct call of mips_cdmm_bus_up() or
> mips_cdmm_bus_down(). Description of those functions are adapted.
>
> Cc: Ralf Baechle <[email protected]>
> Cc: [email protected]
> Signed-off-by: Anna-Maria Gleixner <[email protected]>
> ---
> drivers/bus/mips_cdmm.c | 12 +++++++-----
> 1 file changed, 7 insertions(+), 5 deletions(-)

Thanks, queued for 4.7.

Ralf

2016-04-05 13:26:17

by Anna-Maria Behnsen

[permalink] [raw]
Subject: Re: [PREEMPT-RT] [PATCH] MIPS: Remove no longer needed work_on_cpu() call

On Mon, 4 Apr 2016, Ralf Baechle wrote:

> On Mon, Apr 04, 2016 at 02:18:03PM +0200, Anna-Maria Gleixner wrote:
>
> > Since commit 1cf4f629d9d2 ("cpu/hotplug: Move online calls to
> > hotplugged cpu") it is ensured that callbacks of CPU_ONLINE and
> > CPU_DOWN_PREPARE are processed on the hotplugged CPU. Due to this
> > work_on_cpu() calls are no longer required.
> >
> > Replace work_on_cpu() with a direct call of mips_cdmm_bus_up() or
> > mips_cdmm_bus_down(). Description of those functions are adapted.
> >
> > Cc: Ralf Baechle <[email protected]>
> > Cc: [email protected]
> > Signed-off-by: Anna-Maria Gleixner <[email protected]>
> > ---
> > drivers/bus/mips_cdmm.c | 12 +++++++-----
> > 1 file changed, 7 insertions(+), 5 deletions(-)
>
> Thanks, queued for 4.7.
>

Please do not queue it. Heiko Carstens pointed out a problem: It isn't
ensured, that the callbacks of CPU_DOWN_FAILED are always processed on
the CPU that failed in CPU_DOWN_PREPARE (see
http://marc.info/?l=linux-s390&m=145985621421250&w=2 ). Once this
issue is fixed, I will resend the patch.

Anna-Maria

2016-04-06 12:29:35

by Ralf Baechle

[permalink] [raw]
Subject: Re: [PREEMPT-RT] [PATCH] MIPS: Remove no longer needed work_on_cpu() call

On Tue, Apr 05, 2016 at 03:26:11PM +0200, Anna-Maria Gleixner wrote:

> On Mon, 4 Apr 2016, Ralf Baechle wrote:
>
> > On Mon, Apr 04, 2016 at 02:18:03PM +0200, Anna-Maria Gleixner wrote:
> >
> > > Since commit 1cf4f629d9d2 ("cpu/hotplug: Move online calls to
> > > hotplugged cpu") it is ensured that callbacks of CPU_ONLINE and
> > > CPU_DOWN_PREPARE are processed on the hotplugged CPU. Due to this
> > > work_on_cpu() calls are no longer required.
> > >
> > > Replace work_on_cpu() with a direct call of mips_cdmm_bus_up() or
> > > mips_cdmm_bus_down(). Description of those functions are adapted.
> > >
> > > Cc: Ralf Baechle <[email protected]>
> > > Cc: [email protected]
> > > Signed-off-by: Anna-Maria Gleixner <[email protected]>
> > > ---
> > > drivers/bus/mips_cdmm.c | 12 +++++++-----
> > > 1 file changed, 7 insertions(+), 5 deletions(-)
> >
> > Thanks, queued for 4.7.
> >
>
> Please do not queue it. Heiko Carstens pointed out a problem: It isn't
> ensured, that the callbacks of CPU_DOWN_FAILED are always processed on
> the CPU that failed in CPU_DOWN_PREPARE (see
> http://marc.info/?l=linux-s390&m=145985621421250&w=2 ). Once this
> issue is fixed, I will resend the patch.

Thanks for letting me know, patch dropped.

Ralf