From: Peter Zijlstra <peterz@infradead.org>
To: Christophe Leroy <christophe.leroy@csgroup.eu>
Cc: Steven Rostedt <rostedt@goodmis.org>,
mingo@kernel.org, linux-kernel@vger.kernel.org,
tglx@linutronix.de, qais.yousef@arm.com, juri.lelli@redhat.com,
vincent.guittot@linaro.org, dietmar.eggemann@arm.com,
bsegall@google.com, mgorman@suse.de, wim@linux-watchdog.org,
PRAT Maximilien <maximilien.prat@cs-soprasteria.com>,
CASAUBON Jean Michel <jean-michel.casaubon@cs-soprasteria.com>
Subject: Re: [PATCH 16/23] sched,watchdog: Convert to sched_set_fifo()
Date: Fri, 16 May 2025 14:42:50 +0200 [thread overview]
Message-ID: <20250516124250.GD16434@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <b506e413-f6ef-4f9c-8c15-5fc76f978235@csgroup.eu>
On Fri, May 16, 2025 at 10:42:47AM +0200, Christophe Leroy wrote:
> Hi Peter,
>
> Le 22/04/2020 à 15:24, Peter Zijlstra a écrit :
> > On Wed, Apr 22, 2020 at 08:51:55AM -0400, Steven Rostedt wrote:
> > > On Wed, 22 Apr 2020 13:27:35 +0200
> > > Peter Zijlstra <peterz@infradead.org> 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.
> > > >
> > > > Effectively changes prio from 99 to 50.
> > >
> > > Hmm, this being a watchdog, and looking at commit 38a1222ae4f364d
> > > ("watchdog: core: make sure the watchdog worker always works")
> > >
> > > I wonder if we should add a sched_set_high(), or have some other kind of
> > > watchdog handler that is guaranteed to trigger.
> >
> > It's FIFO, it'll never win from either a deadline or a stop-task. After
> > that it doesn't matter.
>
> It does matter. I didn't realise it when you sent out this patch five years
> ago, but today I'm facing an issue due to that patch. On powerpc 8xx the
> watchdog must be woken up every second, the HW is not able to take a higher
> timeout. I have process that is running at SCHED_FIFO prio 90. From time to
> time it keeps running for a bit more than one second, leading to a watchdog
> reset. This didn't happen before your patch.
>
> Why having arbitrary selected prio 50 and not kept it at the highest
> possible priority ?
Because if your random program of choice would have had a prio-90 task
that was super duper more important -- like stopping the saw from taking
off your fingers that had a runtime of mere milliseconds, then having
the watchdog thread delay that could be catastrophic, no?
> What would be the solution to fix this unexpected watchdog reset ?
>
> >
> > fifo_high() is most definitely a bad idea, because then we're back into
> > the whole 'fifo priority' has meaning -- it does not. At least, it
> > doesn't until you've got system design information.
>
> I don't understand why it has no meaning. When I have a user app at FIFO
> prio 90 and one at FIFO 89 I know the one at 90 will immediatly preempt the
> one at 89 when receiving data, and that's the behaviour I expect. What am I
> missing here ?
The 'until you've got system design information' bit. Not until you have
the domain expertise of all possible runnable tasks on your system, can
you determine FIFO priorities.
The thing is; you cannot design two programs that use FIFO in isolation
and blindly smash them together and expect it to work. FIFO is
fundamentally non-composable.
Someone has to go and set the priority of every FIFO task on the system,
otherwise things will not work. This very much includes the watchdog
thread.
So the solution is to know your setup and do your setup, including
the watchdog thread priority.
next prev parent reply other threads:[~2025-05-16 12:43 UTC|newest]
Thread overview: 73+ 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
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
2025-05-16 8:42 ` Christophe Leroy
2025-05-16 12:42 ` Peter Zijlstra [this message]
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=20250516124250.GD16434@noisy.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=bsegall@google.com \
--cc=christophe.leroy@csgroup.eu \
--cc=dietmar.eggemann@arm.com \
--cc=jean-michel.casaubon@cs-soprasteria.com \
--cc=juri.lelli@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=maximilien.prat@cs-soprasteria.com \
--cc=mgorman@suse.de \
--cc=mingo@kernel.org \
--cc=qais.yousef@arm.com \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
--cc=vincent.guittot@linaro.org \
--cc=wim@linux-watchdog.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
Powered by JetHome