comp.lang.ada
 help / color / mirror / Atom feed
From: Andi Kleen <ak@muc.de>
Subject: Re: Runtime Error with gnat 3.10p
Date: 1998/05/28
Date: 1998-05-28T00:00:00+00:00	[thread overview]
Message-ID: <m367iq4kp2.fsf@fred.muc.de> (raw)
In-Reply-To: 356D33C7.42638D40@cl.cam.ac.uk


Markus Kuhn <Markus.Kuhn@cl.cam.ac.uk> writes:

> Andi Kleen wrote:
> > Of course it is possible to implement it under Linux without requiring
> > privileges too, just not with the standard, unmodified LinuxThreads
> > package. There are several userspace threads packages available (I
> > think the GNAT runtime has its own too) that work in a single process
> > context and don't need root for anything. Of course they all don't
> > scale to multiple CPUs on SMP machines.
> 
> This keeps me thinking: Can we extend the Linux kernel
> such that SCHED_FIFO and SCHED_RR are also available to non-root
> processes at static priority 0 such that SCHED_OTHER processes
> can still preempt SCHED_FIFO and system lockup is prevented?

Yes, with "process groups" (or something like the "gang scheduler"
used in several commercial Unixes) which allows to assign priorities
relative to a process group. For example the tree scheduling algorithm
used in Andy Valencia's VSTA OS would allow that [has anyone ported
Gnat to Vsta BTW?]. 

The problem is that it all adds overhead, one of the virtues of Linux 
is that it has very fast context switches and a low overhead scheduler.
 
> May be, we can extend the Linux scheduler easily to allow SCHED_RR
> and SCHED_FIFO policies also to be used at a static priority 0.
> The semantic would then be that with static priority 0, a
> SCHED_FIFO process will never be preempted by another SCHED_FIFO
> or SCHED_RR process, but it can very well still be preempted by a
> SCHED_OTHER (i.e., normal) process. This way, we preserve the
> execution order of threads that have only SCHED_FIFO and
> SCHED_RR policies within this thread community, but the execution
> of other SCHED_OTHER threads and processes will not be affected.
> Therefore, SCHED_RR and SCHED_FIFO can be made available at
> static priority 0 also to non-root users.

There is a patch floating around to implement the QNX scheduling
algorithm on Linux [see http://www.linuxhq.com/patch/20-p0768.html,
there is a equivalent patch for 2.1 somewhere too]. I think what you
propose would be rather easy to implement with that code.

> Is there any real application need for such a feature (beyond the
> ability to cheat around the Annex D formal requirements in
> conformance test suites)? If yes, then I'll have another look
> at the Linux scheduler whether there is an efficient extention
> possible.

I assume that other thread applications could benefit from it too. On the other
hand it'll be difficult to get it through Torvalds - the current scheduler
seems to have a very nice combination of low overhead and scalability, it
might be difficult to add features without destroying that balance.

-Andi




  reply	other threads:[~1998-05-28  0:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-05-26  0:00 Runtime Error with gnat 3.10p Andreas Jungmaier
1998-05-26  0:00 ` David C. Hoos, Sr.
1998-05-26  0:00   ` Markus Kuhn
1998-05-27  0:00     ` Robert Dewar
1998-05-28  0:00       ` Larry Kilgallen
1998-05-28  0:00         ` Andi Kleen
1998-05-28  0:00           ` Markus Kuhn
1998-05-28  0:00             ` Andi Kleen [this message]
1998-05-28  0:00       ` Markus Kuhn
1998-06-01  0:00         ` CHARLET Arnaud
1998-05-26  0:00   ` Simon Wright
replies disabled

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