From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,93db2bcd4637d4fc X-Google-Attributes: gid103376,public From: Andi Kleen Subject: Re: Runtime Error with gnat 3.10p Date: 1998/05/28 Message-ID: #1/1 X-Deja-AN: 357288578 Sender: andi@fred.muc.de References: <6kel87$ic7$1@polo.advicom.net> <356AF4B7.5EBF8617@cl.cam.ac.uk> <1998May27.203126.1@eisner> <356D33C7.42638D40@cl.cam.ac.uk> Distribution: world Organization: [posted via] Leibniz-Rechenzentrum, Muenchen (Germany) Newsgroups: comp.lang.ada Date: 1998-05-28T00:00:00+00:00 List-Id: Markus Kuhn 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