linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Guenter Roeck <groeck@google.com>
To: Doug Anderson <dianders@chromium.org>
Cc: Mark Brown <broonie@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Steven Rostedt <rostedt@goodmis.org>,
	qais.yousef@arm.com, juri.lelli@redhat.com,
	Vincent Guittot <vincent.guittot@linaro.org>,
	dietmar.eggemann@arm.com, Benjamin Segall <bsegall@google.com>,
	mgorman@suse.de, Guenter Roeck <groeck@chromium.org>,
	Benson Leung <bleung@chromium.org>,
	Enric Balletbo i Serra <enric.balletbo@collabora.com>
Subject: Re: [PATCH 11/23] sched,spi: Convert to sched_set_fifo*()
Date: Wed, 22 Apr 2020 08:47:52 -0700	[thread overview]
Message-ID: <CABXOdTd-ze8=s8nXNvPSjBBQKX9N3e4v3xQfs_mbJfKaUrvZ0g@mail.gmail.com> (raw)
In-Reply-To: <CAD=FV=VcbXoxtzyvLsFZuCDXJwCv8Y3pUdYBKMUmJaNcueBrqQ@mail.gmail.com>

On Wed, Apr 22, 2020 at 7:35 AM Doug Anderson <dianders@chromium.org> wrote:
>
> Hi,
>
> On Wed, Apr 22, 2020 at 6:56 AM Mark Brown <broonie@kernel.org> wrote:
> >
> > On Wed, Apr 22, 2020 at 01:27:30PM +0200, Peter Zijlstra wrote:
> > > Because SCHED_FIFO is a broken scheduler model (see previous patches)
> > > take away the priority field, the kernel can't possibly make an
> > > informed decision.
> > >
> > > No effective change.
> >
> > Copying Doug who did this change and Guenter who reviewed it.  This
> > looks fine to me but I've no particular involvement with the code or
> > platforms that are affected here.
>
> Thanks!  Probably the maintainers of cros_ec_spi.c (Benson and Enric)
> should be aware of it, too.  CCing them.
>
> From my point of view, my response is pretty much identical to the one
> I wrote when the priority was reduced from "MAX_RT_PRIO - 1" to
> "MAX_RT_PRIO / 2" [1].  Basically, any priority that keeps us from
> being preempted by tasks that are only high priority for performance
> reasons (like dm crypt and loopback did when I last analyzed) is fine.
> Our priority needs to be high not for performance reasons but for
> correctness reasons (the other side will drop our data if we don't
> respond in time).
>
The crypto engine ends up running at the same priority level, so I am
a bit concerned that this patch series will re-introduce the problem
that Doug's initial patch tried to solve. Though I do notice that it
already _is_ running at the same priority, so maybe the problem has
already been re-introduced with the commit that set the priority to
MAX_RT_PRIO / 2, and we just haven't noticed yet. So I guess this
patch indeed doesn't make a difference.

Reviewed-by: Guenter Roeck <groeck@chromium.org>

> Thus:
>
> Reviewed-by: Douglas Anderson <dianders@chromium.org>
>
>
> [1] https://lore.kernel.org/r/CAD=FV=UsYF1R6+XRfFFFm6PfmkTsEOfxxgCw2JxCnpyu1kGVLQ@mail.gmail.com
>
>
> > > Cc: broonie@kernel.org
> > > Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
> > > Reviewed-by: Ingo Molnar <mingo@kernel.org>
> > > ---
> > >  drivers/platform/chrome/cros_ec_spi.c |    6 +-----
> > >  1 file changed, 1 insertion(+), 5 deletions(-)
> > >
> > > --- a/drivers/platform/chrome/cros_ec_spi.c
> > > +++ b/drivers/platform/chrome/cros_ec_spi.c
> > > @@ -709,9 +709,6 @@ static void cros_ec_spi_high_pri_release
> > >  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 / 2,
> > > -     };
> > >       int err;
> > >
> > >       ec_spi->high_pri_worker =
> > > @@ -728,8 +725,7 @@ static int cros_ec_spi_devm_high_pri_all
> > >       if (err)
> > >               return err;
> > >
> > > -     err = sched_setscheduler_nocheck(ec_spi->high_pri_worker->task,
> > > -                                      SCHED_FIFO, &sched_priority);
> > > +     err = sched_set_fifo(ec_spi->high_pri_worker->task);
> > >       if (err)
> > >               dev_err(dev, "Can't set cros_ec high pri priority: %d\n", err);
> > >       return err;
> > > --- a/drivers/spi/spi.c
> > > +++ b/drivers/spi/spi.c
> > > @@ -1589,11 +1589,9 @@ EXPORT_SYMBOL_GPL(spi_take_timestamp_pos
> > >   */
> > >  static void spi_set_thread_rt(struct spi_controller *ctlr)
> > >  {
> > > -     struct sched_param param = { .sched_priority = MAX_RT_PRIO / 2 };
> > > -
> > >       dev_info(&ctlr->dev,
> > >               "will run message pump with realtime priority\n");
> > > -     sched_setscheduler(ctlr->kworker_task, SCHED_FIFO, &param);
> > > +     sched_set_fifo(ctlr->kworker_task);
> > >  }
> > >
> > >  static int spi_init_queue(struct spi_controller *ctlr)
> > >
> > >

  reply	other threads:[~2020-04-22 15:48 UTC|newest]

Thread overview: 71+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-22 11:27 [PATCH 00/23] sched: Remove FIFO priorities from modules Peter Zijlstra
2020-04-22 11:27 ` [PATCH 01/23] sched: Provide sched_set_fifo() Peter Zijlstra
2020-04-22 13:11   ` Paul E. McKenney
2020-04-22 13:26     ` Peter Zijlstra
2020-04-22 15:50       ` Paul E. McKenney
2020-04-22 16:33         ` Steven Rostedt
2020-04-22 16:40           ` Paul E. McKenney
2020-04-22 16:46             ` Steven Rostedt
2020-04-22 17:45               ` Paul E. McKenney
2020-04-22 15:50   ` Paul E. McKenney
2020-04-27 17:04   ` Qais Yousef
2020-04-22 11:27 ` [PATCH 02/23] sched,bL_switcher: Convert to sched_set_fifo*() Peter Zijlstra
2020-04-22 13:27   ` Nicolas Pitre
2020-04-22 11:27 ` [PATCH 03/23] sched,crypto: " Peter Zijlstra
2020-04-22 13:33   ` Herbert Xu
2020-04-22 11:27 ` [PATCH 04/23] sched,acpi_pad: " Peter Zijlstra
2020-04-22 16:45   ` Dietmar Eggemann
2020-04-23  8:46     ` Peter Zijlstra
2020-04-22 11:27 ` [PATCH 05/23] sched,drbd: " Peter Zijlstra
2020-04-23  8:57   ` Peter Zijlstra
2020-04-22 11:27 ` [PATCH 06/23] sched,psci: " Peter Zijlstra
2020-04-22 11:55   ` Valentin Schneider
2020-04-22 14:06   ` Sudeep Holla
2020-04-27 16:35   ` Qais Yousef
2020-04-27 16:58     ` Valentin Schneider
2020-04-22 11:27 ` [PATCH 07/23] sched,msm: " Peter Zijlstra
2020-04-22 11:27 ` [PATCH 08/23] sched,drm/scheduler: " Peter Zijlstra
2020-04-22 11:27 ` [PATCH 09/23] sched,ivtv: " Peter Zijlstra
2020-04-22 12:53   ` Steven Rostedt
2020-04-22 13:26     ` Peter Zijlstra
2020-04-24  9:58   ` Hans Verkuil
2020-04-22 11:27 ` [PATCH 10/23] sched,mmc: " Peter Zijlstra
2020-04-22 16:59   ` Ulf Hansson
2020-04-23  8:59     ` Peter Zijlstra
2020-04-23 12:01       ` Ulf Hansson
2020-04-22 11:27 ` [PATCH 11/23] sched,spi: " Peter Zijlstra
2020-04-22 13:56   ` Mark Brown
2020-04-22 14:35     ` Doug Anderson
2020-04-22 15:47       ` Guenter Roeck [this message]
2020-04-22 16:41         ` Doug Anderson
2020-04-22 20:16           ` Guenter Roeck
2020-04-22 11:27 ` [PATCH 12/23] sched,powercap: " Peter Zijlstra
2020-04-22 11:27 ` [PATCH 13/23] sched,ion: Convert to sched_set_normal() Peter Zijlstra
2020-04-22 13:21   ` Vincent Guittot
2020-04-22 13:29     ` Peter Zijlstra
2020-04-22 13:36       ` Vincent Guittot
2020-04-22 13:59         ` Peter Zijlstra
2020-04-22 15:09           ` Vincent Guittot
2020-04-22 15:39             ` Peter Zijlstra
2020-04-22 15:52               ` Vincent Guittot
2020-04-22 15:38           ` Juri Lelli
2020-04-22 15:42             ` Peter Zijlstra
2020-04-22 11:27 ` [PATCH 14/23] sched,powerclamp: Convert to sched_set_fifo() Peter Zijlstra
2020-04-22 11:27 ` [PATCH 15/23] sched,serial: " Peter Zijlstra
2020-04-22 11:27 ` [PATCH 16/23] sched,watchdog: " Peter Zijlstra
2020-04-22 12:51   ` Steven Rostedt
2020-04-22 13:24     ` Peter Zijlstra
2020-04-22 11:27 ` [PATCH 17/23] sched,irq: " Peter Zijlstra
2020-04-22 11:39   ` Peter Zijlstra
2020-04-22 11:27 ` [PATCH 18/23] sched,locktorture: " Peter Zijlstra
2020-04-22 15:51   ` Paul E. McKenney
2020-04-22 11:27 ` [PATCH 19/23] sched,rcuperf: Convert to sched_set_fifo_low() Peter Zijlstra
2020-04-22 15:51   ` Paul E. McKenney
2020-04-22 11:27 ` [PATCH 20/23] sched,rcutorture: " Peter Zijlstra
2020-04-22 15:51   ` Paul E. McKenney
2020-04-22 11:27 ` [PATCH 21/23] sched,psi: " Peter Zijlstra
2020-04-22 15:22   ` Johannes Weiner
2020-04-22 11:27 ` [PATCH 22/23] sched: Remove sched_setscheduler*() EXPORTs Peter Zijlstra
2020-04-22 11:27 ` [PATCH 23/23] sched: Remove sched_set_*() return value Peter Zijlstra
2020-04-22 14:25   ` Ingo Molnar
2020-04-22 16:16   ` Paul E. McKenney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CABXOdTd-ze8=s8nXNvPSjBBQKX9N3e4v3xQfs_mbJfKaUrvZ0g@mail.gmail.com' \
    --to=groeck@google.com \
    --cc=bleung@chromium.org \
    --cc=broonie@kernel.org \
    --cc=bsegall@google.com \
    --cc=dianders@chromium.org \
    --cc=dietmar.eggemann@arm.com \
    --cc=enric.balletbo@collabora.com \
    --cc=groeck@chromium.org \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=qais.yousef@arm.com \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    --cc=vincent.guittot@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).