mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andreas Mohr <andi@rhlx01.fht-esslingen.de>
To: Peter Williams <pwil3058@bigpond.net.au>
Cc: Con Kolivas <kernel@kolivas.org>, Andrew Morton <akpm@osdl.org>,
	Nick Piggin <nickpiggin@yahoo.com.au>,
	Linux Kernel <linux-kernel@vger.kernel.org>,
	Ingo Molnar <mingo@elte.hu>
Subject: Re: [PATCH] sched: Add SCHED_BGND (background) scheduling policy
Date: Wed, 5 Jul 2006 10:05:39 +0200	[thread overview]
Message-ID: <20060705080539.GA22099@rhlx01.fht-esslingen.de> (raw)
In-Reply-To: <44AB0CA2.5080908@bigpond.net.au>

On Wed, Jul 05, 2006 at 10:49:38AM +1000, Peter Williams wrote:
> Con Kolivas wrote:
> >On Wednesday 05 July 2006 09:35, Peter Williams wrote:
> >Could we just call it SCHED_IDLEPRIO since it's the same thing and there 
> >are tools out there that already use this name?

That makes quite some sense, seconded.

Plus, I like SCHED_IDLEPRIO more than SCHED_BGND, since it's more descriptive
when stuff happens and when not (but of course the SCHED_BGND name is shorter).

> I'm easy.  Which user space visible headers contain the definition? 
> That's the only place that it matters.  When I was writing a program to 
> use this feature, I couldn't find a header that defined any of the 
> scheduler policies that was visible in user space (of course, that 
> doesn't mean there isn't one - just that I couldn't find it).
> 
> Peter
> PS Any programs that use SCHED_IDLEPRIO should work as long as its value 
> is defined as 4.

OK, nice, but:

2.6.17-ck1:

/*
 * Scheduling policies
 */
#define SCHED_NORMAL            0
#define SCHED_FIFO              1
#define SCHED_RR                2
#define SCHED_BATCH             3
#define SCHED_ISO               4
#define SCHED_IDLEPRIO          5

#define SCHED_MIN               0
#define SCHED_MAX               5


Arggl.

So what does that tell us?

Does it tell us that the new policy should indeed be called SCHED_BGND
so that user-space programs that make use of a policy (e.g. schedtool
or any user-space app that wants to adjust its policy on its own) can figure
out which policy number to use (the 4 vs. 5 difference) by
#ifdef SCHED_IDLEPRIO elseif SCHED_BGND checks?

A less favourable solution would be to rename SCHED_BGND to SCHED_IDLEPRIO
but keep the current last policy number (4) for it, since that would
introduce a gross conflict (or do programs always go after the
policy name defines instead of the raw policy numbers?).
Given this issue, maybe best would be to add SCHED_IDLEPRIO *and* SCHED_ISO
to mainline at the same time, in order to keep the current
policy numbering extension as done in -ck.

Or maybe we should even introduce a more flexible way of dealing scheduling
policy registration and listing? A numbered solution that changes on a whim
whenever someone adds his own policy may be.... numbered ;) (in terms of days,
that is).

Semi-hard-coding scheduling numbers that get used by user-space sounds
somewhat hackish to me, maybe we should instead (or additionally?) have a
query API that returns a list of policy numbers for a given query input
(near-hard realtime features, non-root access, interactivity, cache usage
friendliness, batched operation, background processing).
What do other systems (*BSD, Solaris, ...) do in this case?

Andreas Mohr

  parent reply	other threads:[~2006-07-05  8:05 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-04 23:35 Peter Williams
2006-07-05  0:14 ` Con Kolivas
2006-07-05  0:49   ` Peter Williams
2006-07-05  0:52     ` Con Kolivas
2006-07-05  8:05     ` Andreas Mohr [this message]
2006-07-05 14:04       ` Jan Engelhardt
2006-07-05  0:44 ` Con Kolivas
2006-07-05  1:15   ` Peter Williams
2006-07-05  1:33     ` Con Kolivas
2006-07-05  4:20       ` Valdis.Kletnieks
2006-07-05  3:06   ` Peter Williams
2006-07-05  6:35 ` Ingo Molnar
2006-07-05  8:03   ` Peter Williams
2006-07-05  8:15     ` Arjan van de Ven
2006-07-05  8:19     ` Ingo Molnar
2006-07-05 17:40       ` Nick Piggin
2006-07-05 11:42 ` Mike Galbraith
2006-07-05 13:59   ` Peter Williams
2006-07-05 14:18     ` Peter Williams
2006-07-05 14:48     ` Mike Galbraith
2006-07-06 23:50       ` Peter Williams

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=20060705080539.GA22099@rhlx01.fht-esslingen.de \
    --to=andi@rhlx01.fht-esslingen.de \
    --cc=akpm@osdl.org \
    --cc=kernel@kolivas.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=nickpiggin@yahoo.com.au \
    --cc=pwil3058@bigpond.net.au \
    /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

all inboxes | Powered by JetHome®