Linux SPI subsystem development
 help / color / mirror / Atom feed
* [PATCH 5/5] spi: Reduce kthread priority
       [not found] <20190801111348.530242235@infradead.org>
@ 2019-08-01 11:13 ` Peter Zijlstra
  2019-08-01 11:26   ` Mark Brown
                     ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Peter Zijlstra @ 2019-08-01 11:13 UTC (permalink / raw)
  To: mingo
  Cc: linux-kernel, peterz, Benson Leung, Enric Balletbo i Serra,
	Guenter Roeck, Mark Brown, linux-spi

The SPI thingies request FIFO-99 by default, reduce this to FIFO-50.

FIFO-99 is the very highest priority available to SCHED_FIFO and
it not a suitable default; it would indicate the SPI work is the
most important work on the machine.

Cc: Benson Leung <bleung@chromium.org>
Cc: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Cc: Guenter Roeck <groeck@chromium.org>
Cc: Mark Brown <broonie@kernel.org>
Cc: linux-spi@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
---
 drivers/platform/chrome/cros_ec_spi.c |    2 +-
 drivers/spi/spi.c                     |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/platform/chrome/cros_ec_spi.c
+++ b/drivers/platform/chrome/cros_ec_spi.c
@@ -706,7 +706,7 @@ static int cros_ec_spi_devm_high_pri_all
 					   struct cros_ec_spi *ec_spi)
 {
 	struct sched_param sched_priority = {
-		.sched_priority = MAX_RT_PRIO - 1,
+		.sched_priority = MAX_RT_PRIO / 2,
 	};
 	int err;
 
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -1434,7 +1434,7 @@ static void spi_pump_messages(struct kth
  */
 static void spi_set_thread_rt(struct spi_controller *ctlr)
 {
-	struct sched_param param = { .sched_priority = MAX_RT_PRIO - 1 };
+	struct sched_param param = { .sched_priority = MAX_RT_PRIO / 2 };
 
 	dev_info(&ctlr->dev,
 		"will run message pump with realtime priority\n");

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

* Re: [PATCH 5/5] spi: Reduce kthread priority
  2019-08-01 11:13 ` [PATCH 5/5] spi: Reduce kthread priority Peter Zijlstra
@ 2019-08-01 11:26   ` Mark Brown
  2019-08-01 12:07     ` Peter Zijlstra
  2019-08-01 11:27   ` Geert Uytterhoeven
                     ` (2 subsequent siblings)
  3 siblings, 1 reply; 11+ messages in thread
From: Mark Brown @ 2019-08-01 11:26 UTC (permalink / raw)
  To: Peter Zijlstra
  Cc: mingo, linux-kernel, Benson Leung, Enric Balletbo i Serra,
	Guenter Roeck, linux-spi

[-- Attachment #1: Type: text/plain, Size: 227 bytes --]

On Thu, Aug 01, 2019 at 01:13:53PM +0200, Peter Zijlstra wrote:

> The SPI thingies request FIFO-99 by default, reduce this to FIFO-50.

I don't have a cover letter or any other context, what's going on here
with dependencies?

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH 5/5] spi: Reduce kthread priority
  2019-08-01 11:13 ` [PATCH 5/5] spi: Reduce kthread priority Peter Zijlstra
  2019-08-01 11:26   ` Mark Brown
@ 2019-08-01 11:27   ` Geert Uytterhoeven
  2019-08-01 12:12     ` Peter Zijlstra
  2019-08-01 11:27   ` Enric Balletbo i Serra
  2019-08-02 11:22   ` Applied "spi: Reduce kthread priority" to the spi tree Mark Brown
  3 siblings, 1 reply; 11+ messages in thread
From: Geert Uytterhoeven @ 2019-08-01 11:27 UTC (permalink / raw)
  To: Peter Zijlstra
  Cc: Ingo Molnar, Linux Kernel Mailing List, Benson Leung,
	Enric Balletbo i Serra, Guenter Roeck, Mark Brown, linux-spi

Hi Peter,

On Thu, Aug 1, 2019 at 1:18 PM Peter Zijlstra <peterz@infradead.org> wrote:
> The SPI thingies request FIFO-99 by default, reduce this to FIFO-50.
>
> FIFO-99 is the very highest priority available to SCHED_FIFO and
> it not a suitable default; it would indicate the SPI work is the
> most important work on the machine.
>
> Cc: Benson Leung <bleung@chromium.org>
> Cc: Enric Balletbo i Serra <enric.balletbo@collabora.com>
> Cc: Guenter Roeck <groeck@chromium.org>
> Cc: Mark Brown <broonie@kernel.org>
> Cc: linux-spi@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org
> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
> ---
>  drivers/platform/chrome/cros_ec_spi.c |    2 +-
>  drivers/spi/spi.c                     |    2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> --- a/drivers/platform/chrome/cros_ec_spi.c
> +++ b/drivers/platform/chrome/cros_ec_spi.c
> @@ -706,7 +706,7 @@ static int cros_ec_spi_devm_high_pri_all
>                                            struct cros_ec_spi *ec_spi)
>  {
>         struct sched_param sched_priority = {
> -               .sched_priority = MAX_RT_PRIO - 1,
> +               .sched_priority = MAX_RT_PRIO / 2,

include/linux/sched/prio.h says:

 * Priority of a process goes from 0..MAX_PRIO-1, valid RT
 * priority is 0..MAX_RT_PRIO-1, and SCHED_NORMAL/SCHED_BATCH
 * tasks are in the range MAX_RT_PRIO..MAX_PRIO-1. Priority
 * values are inverted: lower p->prio value means higher priority.

So the new 50 is actually a higher priority than the old 99?

Given I'm far from an RT expert, I must be missing something?
Thanks!

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH 5/5] spi: Reduce kthread priority
  2019-08-01 11:13 ` [PATCH 5/5] spi: Reduce kthread priority Peter Zijlstra
  2019-08-01 11:26   ` Mark Brown
  2019-08-01 11:27   ` Geert Uytterhoeven
@ 2019-08-01 11:27   ` Enric Balletbo i Serra
  2019-08-01 12:17     ` Peter Zijlstra
  2019-08-02 11:22   ` Applied "spi: Reduce kthread priority" to the spi tree Mark Brown
  3 siblings, 1 reply; 11+ messages in thread
From: Enric Balletbo i Serra @ 2019-08-01 11:27 UTC (permalink / raw)
  To: Peter Zijlstra, mingo
  Cc: linux-kernel, Benson Leung, Guenter Roeck, Mark Brown, linux-spi,
	Doug Anderson


cc'ing Doug as he might be really interested on this patch

On 1/8/19 13:13, Peter Zijlstra wrote:
> The SPI thingies request FIFO-99 by default, reduce this to FIFO-50.
> 

You say below that is not a suitable default but there is any other reason? Did
you observed problems with this?

> FIFO-99 is the very highest priority available to SCHED_FIFO and
> it not a suitable default; it would indicate the SPI work is the
> most important work on the machine.
> 
> Cc: Benson Leung <bleung@chromium.org>
> Cc: Enric Balletbo i Serra <enric.balletbo@collabora.com>
> Cc: Guenter Roeck <groeck@chromium.org>
> Cc: Mark Brown <broonie@kernel.org>
> Cc: linux-spi@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org
> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
> ---
>  drivers/platform/chrome/cros_ec_spi.c |    2 +-
>  drivers/spi/spi.c                     |    2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> --- a/drivers/platform/chrome/cros_ec_spi.c
> +++ b/drivers/platform/chrome/cros_ec_spi.c
> @@ -706,7 +706,7 @@ static int cros_ec_spi_devm_high_pri_all
>  					   struct cros_ec_spi *ec_spi)
>  {
>  	struct sched_param sched_priority = {
> -		.sched_priority = MAX_RT_PRIO - 1,
> +		.sched_priority = MAX_RT_PRIO / 2,
>  	};
>  	int err;
>  
> --- a/drivers/spi/spi.c
> +++ b/drivers/spi/spi.c
> @@ -1434,7 +1434,7 @@ static void spi_pump_messages(struct kth
>   */
>  static void spi_set_thread_rt(struct spi_controller *ctlr)
>  {
> -	struct sched_param param = { .sched_priority = MAX_RT_PRIO - 1 };
> +	struct sched_param param = { .sched_priority = MAX_RT_PRIO / 2 };
>  
>  	dev_info(&ctlr->dev,
>  		"will run message pump with realtime priority\n");
> 
> 

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

* Re: [PATCH 5/5] spi: Reduce kthread priority
  2019-08-01 11:26   ` Mark Brown
@ 2019-08-01 12:07     ` Peter Zijlstra
  0 siblings, 0 replies; 11+ messages in thread
From: Peter Zijlstra @ 2019-08-01 12:07 UTC (permalink / raw)
  To: Mark Brown
  Cc: mingo, linux-kernel, Benson Leung, Enric Balletbo i Serra,
	Guenter Roeck, linux-spi

On Thu, Aug 01, 2019 at 12:26:55PM +0100, Mark Brown wrote:
> On Thu, Aug 01, 2019 at 01:13:53PM +0200, Peter Zijlstra wrote:
> 
> > The SPI thingies request FIFO-99 by default, reduce this to FIFO-50.
> 
> I don't have a cover letter or any other context, what's going on here
> with dependencies?

Patch stands on it own. I just went through the tree looking for FIFO
(ab)users.

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

* Re: [PATCH 5/5] spi: Reduce kthread priority
  2019-08-01 11:27   ` Geert Uytterhoeven
@ 2019-08-01 12:12     ` Peter Zijlstra
  2019-08-01 12:16       ` Geert Uytterhoeven
  0 siblings, 1 reply; 11+ messages in thread
From: Peter Zijlstra @ 2019-08-01 12:12 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Ingo Molnar, Linux Kernel Mailing List, Benson Leung,
	Enric Balletbo i Serra, Guenter Roeck, Mark Brown, linux-spi

On Thu, Aug 01, 2019 at 01:27:03PM +0200, Geert Uytterhoeven wrote:
> Hi Peter,
> 
> On Thu, Aug 1, 2019 at 1:18 PM Peter Zijlstra <peterz@infradead.org> wrote:
> > The SPI thingies request FIFO-99 by default, reduce this to FIFO-50.
> >
> > FIFO-99 is the very highest priority available to SCHED_FIFO and
> > it not a suitable default; it would indicate the SPI work is the
> > most important work on the machine.
> >
> > Cc: Benson Leung <bleung@chromium.org>
> > Cc: Enric Balletbo i Serra <enric.balletbo@collabora.com>
> > Cc: Guenter Roeck <groeck@chromium.org>
> > Cc: Mark Brown <broonie@kernel.org>
> > Cc: linux-spi@vger.kernel.org
> > Cc: linux-kernel@vger.kernel.org
> > Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
> > ---
> >  drivers/platform/chrome/cros_ec_spi.c |    2 +-
> >  drivers/spi/spi.c                     |    2 +-
> >  2 files changed, 2 insertions(+), 2 deletions(-)
> >
> > --- a/drivers/platform/chrome/cros_ec_spi.c
> > +++ b/drivers/platform/chrome/cros_ec_spi.c
> > @@ -706,7 +706,7 @@ static int cros_ec_spi_devm_high_pri_all
> >                                            struct cros_ec_spi *ec_spi)
> >  {
> >         struct sched_param sched_priority = {
> > -               .sched_priority = MAX_RT_PRIO - 1,
> > +               .sched_priority = MAX_RT_PRIO / 2,
> 
> include/linux/sched/prio.h says:
> 
>  * Priority of a process goes from 0..MAX_PRIO-1, valid RT
>  * priority is 0..MAX_RT_PRIO-1, and SCHED_NORMAL/SCHED_BATCH
>  * tasks are in the range MAX_RT_PRIO..MAX_PRIO-1. Priority
>  * values are inverted: lower p->prio value means higher priority.
> 
> So the new 50 is actually a higher priority than the old 99?
> 
> Given I'm far from an RT expert, I must be missing something?
> Thanks!

Ah; you found the confusion ;-)

https://lkml.kernel.org/20190617122448.GA3436@hirez.programming.kicks-ass.net

But basically, user-space prio is [1-99], while in-kernel prio is
[0-98]. The above is user prio (it basically uses the
sched_setscheduler() syscall).

So 50 really is lower than 99.

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

* Re: [PATCH 5/5] spi: Reduce kthread priority
  2019-08-01 12:12     ` Peter Zijlstra
@ 2019-08-01 12:16       ` Geert Uytterhoeven
  0 siblings, 0 replies; 11+ messages in thread
From: Geert Uytterhoeven @ 2019-08-01 12:16 UTC (permalink / raw)
  To: Peter Zijlstra
  Cc: Ingo Molnar, Linux Kernel Mailing List, Benson Leung,
	Enric Balletbo i Serra, Guenter Roeck, Mark Brown, linux-spi

Hi Peter,

On Thu, Aug 1, 2019 at 2:12 PM Peter Zijlstra <peterz@infradead.org> wrote:
> On Thu, Aug 01, 2019 at 01:27:03PM +0200, Geert Uytterhoeven wrote:
> > On Thu, Aug 1, 2019 at 1:18 PM Peter Zijlstra <peterz@infradead.org> wrote:
> > > The SPI thingies request FIFO-99 by default, reduce this to FIFO-50.
> > >
> > > FIFO-99 is the very highest priority available to SCHED_FIFO and
> > > it not a suitable default; it would indicate the SPI work is the
> > > most important work on the machine.
> > >
> > > Cc: Benson Leung <bleung@chromium.org>
> > > Cc: Enric Balletbo i Serra <enric.balletbo@collabora.com>
> > > Cc: Guenter Roeck <groeck@chromium.org>
> > > Cc: Mark Brown <broonie@kernel.org>
> > > Cc: linux-spi@vger.kernel.org
> > > Cc: linux-kernel@vger.kernel.org
> > > Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
> > > ---
> > >  drivers/platform/chrome/cros_ec_spi.c |    2 +-
> > >  drivers/spi/spi.c                     |    2 +-
> > >  2 files changed, 2 insertions(+), 2 deletions(-)
> > >
> > > --- a/drivers/platform/chrome/cros_ec_spi.c
> > > +++ b/drivers/platform/chrome/cros_ec_spi.c
> > > @@ -706,7 +706,7 @@ static int cros_ec_spi_devm_high_pri_all
> > >                                            struct cros_ec_spi *ec_spi)
> > >  {
> > >         struct sched_param sched_priority = {
> > > -               .sched_priority = MAX_RT_PRIO - 1,
> > > +               .sched_priority = MAX_RT_PRIO / 2,
> >
> > include/linux/sched/prio.h says:
> >
> >  * Priority of a process goes from 0..MAX_PRIO-1, valid RT
> >  * priority is 0..MAX_RT_PRIO-1, and SCHED_NORMAL/SCHED_BATCH
> >  * tasks are in the range MAX_RT_PRIO..MAX_PRIO-1. Priority
> >  * values are inverted: lower p->prio value means higher priority.
> >
> > So the new 50 is actually a higher priority than the old 99?
> >
> > Given I'm far from an RT expert, I must be missing something?
> > Thanks!
>
> Ah; you found the confusion ;-)
>
> https://lkml.kernel.org/20190617122448.GA3436@hirez.programming.kicks-ass.net

/me adds /r after org/
Thanks!

> But basically, user-space prio is [1-99], while in-kernel prio is
> [0-98]. The above is user prio (it basically uses the
> sched_setscheduler() syscall).
>
> So 50 really is lower than 99.

IC.

BTW, what about having a #define for MAX_RT_PRIO / 2?

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH 5/5] spi: Reduce kthread priority
  2019-08-01 11:27   ` Enric Balletbo i Serra
@ 2019-08-01 12:17     ` Peter Zijlstra
  2019-08-01 12:35       ` Mark Brown
  0 siblings, 1 reply; 11+ messages in thread
From: Peter Zijlstra @ 2019-08-01 12:17 UTC (permalink / raw)
  To: Enric Balletbo i Serra
  Cc: mingo, linux-kernel, Benson Leung, Guenter Roeck, Mark Brown,
	linux-spi, Doug Anderson

On Thu, Aug 01, 2019 at 01:27:04PM +0200, Enric Balletbo i Serra wrote:
> 
> cc'ing Doug as he might be really interested on this patch
> 
> On 1/8/19 13:13, Peter Zijlstra wrote:
> > The SPI thingies request FIFO-99 by default, reduce this to FIFO-50.
> > 
> 
> You say below that is not a suitable default but there is any other reason? Did
> you observed problems with this?

I didn't observe any problems with it personally. But imagine your
device is used to control something critical, like something leathal,
say a bandsaw. And just as you stick your hand through the laser
guarding it, your SPI device chirps and preempts the task that was about
to pull the emergency break and save your hand.

FIFO-99 is the highest possible prio (for SCHED_FIFO) and by using it
you say your task is the utmost imporant task on the system.

I'm thinking that isn't true 99% of the time, except of course when that
bandsaw emergency break is attached through SPI, but in that case the
admin can very well chrt the prio of this thread.

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

* Re: [PATCH 5/5] spi: Reduce kthread priority
  2019-08-01 12:17     ` Peter Zijlstra
@ 2019-08-01 12:35       ` Mark Brown
  2019-08-01 15:44         ` Doug Anderson
  0 siblings, 1 reply; 11+ messages in thread
From: Mark Brown @ 2019-08-01 12:35 UTC (permalink / raw)
  To: Peter Zijlstra
  Cc: Enric Balletbo i Serra, mingo, linux-kernel, Benson Leung,
	Guenter Roeck, linux-spi, Doug Anderson

[-- Attachment #1: Type: text/plain, Size: 867 bytes --]

On Thu, Aug 01, 2019 at 02:17:18PM +0200, Peter Zijlstra wrote:

> I'm thinking that isn't true 99% of the time, except of course when that
> bandsaw emergency break is attached through SPI, but in that case the
> admin can very well chrt the prio of this thread.

The SPI thread isn't usually RT, it's only made RT if something in the
system asks for it - the reason the ChromeOS people got CCed in is that
some of their embedded controllers are very fragile and need super tight
timing on some of the interactions over their control interface so
they're one of the users here.  Of course everyone is then going to
claim that their usage is the most critical usage in the system, and
they may well even be right, but I do tend to agree that just any old RT
priority is probably a sensible default since for most cases there will
be few if any other RT tasks anyway.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH 5/5] spi: Reduce kthread priority
  2019-08-01 12:35       ` Mark Brown
@ 2019-08-01 15:44         ` Doug Anderson
  0 siblings, 0 replies; 11+ messages in thread
From: Doug Anderson @ 2019-08-01 15:44 UTC (permalink / raw)
  To: Mark Brown
  Cc: Peter Zijlstra, Enric Balletbo i Serra, Ingo Molnar, LKML,
	Benson Leung, Guenter Roeck, linux-spi

Hi,

On Thu, Aug 1, 2019 at 5:35 AM Mark Brown <broonie@kernel.org> wrote:
>
> On Thu, Aug 01, 2019 at 02:17:18PM +0200, Peter Zijlstra wrote:
>
> > I'm thinking that isn't true 99% of the time, except of course when that
> > bandsaw emergency break is attached through SPI, but in that case the
> > admin can very well chrt the prio of this thread.
>
> The SPI thread isn't usually RT, it's only made RT if something in the
> system asks for it - the reason the ChromeOS people got CCed in is that
> some of their embedded controllers are very fragile and need super tight
> timing on some of the interactions over their control interface so
> they're one of the users here.  Of course everyone is then going to
> claim that their usage is the most critical usage in the system, and
> they may well even be right, but I do tend to agree that just any old RT
> priority is probably a sensible default since for most cases there will
> be few if any other RT tasks anyway.

For the Chrome OS case I believe that "MAX_RT_PRIO / 2" should be just
fine.  In fact in an earlier version of my work to make CrOS EC work
better at <https://crrev.com/c/1603464> I had said "We'll arbitrarily
pick a priority of "MAX_RT_PRIO / 4 - 1", AKA 24.  This seems to work
fine in practice."  I only switched to "MAX_RT_PRIO - 1" to match the
SPI code.

Mostly we just need to be a bit higher than things that request the
highest non-realtime priority, notably DM Crypt and loopback which
both schedule a bunch of work on the high priority system workqueue.
Those two things in particular seem to want high priority for
performance reasons but not for correctness reasons.  As mentioned
earlier our EC will actually fail transfers if there is too much
delay.

Thus:

Reviewed-by: Douglas Anderson <dianders@chromium.org>

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

* Applied "spi: Reduce kthread priority" to the spi tree
  2019-08-01 11:13 ` [PATCH 5/5] spi: Reduce kthread priority Peter Zijlstra
                     ` (2 preceding siblings ...)
  2019-08-01 11:27   ` Enric Balletbo i Serra
@ 2019-08-02 11:22   ` Mark Brown
  3 siblings, 0 replies; 11+ messages in thread
From: Mark Brown @ 2019-08-02 11:22 UTC (permalink / raw)
  To: Peter Zijlstra
  Cc: Benson Leung, Enric Balletbo i Serra, Guenter Roeck, linux-kernel,
	linux-spi, Mark Brown, mingo, Peter Zijlstra, peterz

The patch

   spi: Reduce kthread priority

has been applied to the spi tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-5.4

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From 4ff13d00ebd5533947b083c66d44da3243a2d559 Mon Sep 17 00:00:00 2001
From: Peter Zijlstra <peterz@infradead.org>
Date: Thu, 1 Aug 2019 13:13:53 +0200
Subject: [PATCH] spi: Reduce kthread priority

The SPI thingies request FIFO-99 by default, reduce this to FIFO-50.

FIFO-99 is the very highest priority available to SCHED_FIFO and
it not a suitable default; it would indicate the SPI work is the
most important work on the machine.

Cc: Benson Leung <bleung@chromium.org>
Cc: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Cc: Guenter Roeck <groeck@chromium.org>
Cc: Mark Brown <broonie@kernel.org>
Cc: linux-spi@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Link: https://lore.kernel.org/r/20190801111541.917256884@infradead.org
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 drivers/platform/chrome/cros_ec_spi.c | 2 +-
 drivers/spi/spi.c                     | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/platform/chrome/cros_ec_spi.c b/drivers/platform/chrome/cros_ec_spi.c
index 006a8ff64057..714306bc3f79 100644
--- a/drivers/platform/chrome/cros_ec_spi.c
+++ b/drivers/platform/chrome/cros_ec_spi.c
@@ -706,7 +706,7 @@ static int cros_ec_spi_devm_high_pri_alloc(struct device *dev,
 					   struct cros_ec_spi *ec_spi)
 {
 	struct sched_param sched_priority = {
-		.sched_priority = MAX_RT_PRIO - 1,
+		.sched_priority = MAX_RT_PRIO / 2,
 	};
 	int err;
 
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 9fd7926e80c0..8e83c9567353 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -1434,7 +1434,7 @@ static void spi_pump_messages(struct kthread_work *work)
  */
 static void spi_set_thread_rt(struct spi_controller *ctlr)
 {
-	struct sched_param param = { .sched_priority = MAX_RT_PRIO - 1 };
+	struct sched_param param = { .sched_priority = MAX_RT_PRIO / 2 };
 
 	dev_info(&ctlr->dev,
 		"will run message pump with realtime priority\n");
-- 
2.20.1

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

end of thread, other threads:[~2019-08-02 11:22 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20190801111348.530242235@infradead.org>
2019-08-01 11:13 ` [PATCH 5/5] spi: Reduce kthread priority Peter Zijlstra
2019-08-01 11:26   ` Mark Brown
2019-08-01 12:07     ` Peter Zijlstra
2019-08-01 11:27   ` Geert Uytterhoeven
2019-08-01 12:12     ` Peter Zijlstra
2019-08-01 12:16       ` Geert Uytterhoeven
2019-08-01 11:27   ` Enric Balletbo i Serra
2019-08-01 12:17     ` Peter Zijlstra
2019-08-01 12:35       ` Mark Brown
2019-08-01 15:44         ` Doug Anderson
2019-08-02 11:22   ` Applied "spi: Reduce kthread priority" to the spi tree Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox