All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Qais Yousef <qais.yousef@arm.com>
Cc: mingo@kernel.org, linux-kernel@vger.kernel.org,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH 0/5] Fix FIFO-99 abuse
Date: Fri, 2 Aug 2019 11:32:44 +0200	[thread overview]
Message-ID: <20190802093244.GF2332@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <20190801131707.5rpyydznnhz474la@e107158-lin.cambridge.arm.com>

On Thu, Aug 01, 2019 at 02:17:07PM +0100, Qais Yousef wrote:
> On 08/01/19 13:13, Peter Zijlstra wrote:
> > I noticed a bunch of kthreads defaulted to FIFO-99, fix them.
> > 
> > The generic default is FIFO-50, the admin will have to configure the system
> > anyway.
> > 
> > For some the purpose is to be above OTHER and then FIFO-1 really is sufficient.
> 
> I was looking in this area too and was thinking of a way to consolidate the
> creation of RT/DL tasks in the kernel and the way we set the priority.
> 
> Does it make sense to create a new header for RT priorities for kthreads
> created in the kernel so that we can easily track and rationale about the
> relative priorities of in-kernel RT tasks?
> 
> When working in the FW world such a header helped a lot in understanding what
> runs at each priority level and how to reason about what priority level makes
> sense for a new item. It could be a nice single point of reference; even for
> admins.

Well, SCHED_FIFO is a broken scheduler model; that is, it is
fundamentally incapable of resource management, which is the one thing
an OS really should be doing.

This is of course the reason it is limited to privileged users only.

Worse still; it is fundamentally impossible to compose static priority
workloads. You cannot take two correctly working static prio workloads
and smash them together and still expect them to work.

For this reason 'all' FIFO tasks the kernel creates are basically at:

  MAX_RT_PRIO / 2

The administrator _MUST_ configure the system, the kernel simply doesn't
know enough information to make a sensible choice.

Now, Geert suggested so make make a define for that, but how about we do
something like:

/*
 * ${the above explanation}
 */
int kernel_setscheduler_fifo(struct task_struct *p)
{
	struct sched_param sp = { .sched_priority = MAX_RT_PRIO / 2 };
	return sched_setscheduler_nocheck(p, SCHED_FIFO, &sp);
}

And then take away sched_setscheduler*().

  reply	other threads:[~2019-08-02  9:40 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-01 11:13 [PATCH 0/5] Fix FIFO-99 abuse Peter Zijlstra
2019-08-01 11:13 ` [PATCH 1/5] sched/pci: Reduce psimon FIFO priority Peter Zijlstra
2019-08-01 17:49   ` Johannes Weiner
2019-08-01 18:31     ` Suren Baghdasaryan
2019-08-01 21:03       ` Suren Baghdasaryan
2019-08-01 21:02     ` Peter Zijlstra
2019-08-01 11:13 ` [PATCH 2/5] rcu/tree: Fix SCHED_FIFO params Peter Zijlstra
2019-08-01 13:51   ` Paul E. McKenney
2019-08-01 14:43     ` Peter Zijlstra
2019-08-01 15:33       ` Paul E. McKenney
2019-08-01 11:13 ` [PATCH 3/5] crypto: Reduce default RT priority Peter Zijlstra
2019-08-09  6:19   ` Herbert Xu
2019-08-01 11:13 ` [PATCH 4/5] media/ivtv: Reduce default FIFO priority Peter Zijlstra
2019-08-01 12:24   ` Andy Walls
2019-08-01 12:38     ` Peter Zijlstra
2019-08-02  8:58       ` Peter Zijlstra
2019-08-07  9:26         ` Hans Verkuil
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
2019-08-02 11:22     ` Mark Brown
2019-08-01 13:17 ` [PATCH 0/5] Fix FIFO-99 abuse Qais Yousef
2019-08-02  9:32   ` Peter Zijlstra [this message]
2019-08-02  9:50     ` Thomas Gleixner
2019-08-02 10:26     ` Qais Yousef
2019-08-02 12:41       ` Peter Zijlstra
2019-08-02 14:08         ` Qais Yousef
2019-08-02 14:33           ` Peter Zijlstra
2019-08-02 15:21             ` Qais Yousef

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=20190802093244.GF2332@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=geert@linux-m68k.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=qais.yousef@arm.com \
    --cc=tglx@linutronix.de \
    /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 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.