public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Bhavesh P. Davda" <bhavesh@avaya.com>
To: mingo@elte.hu
Cc: linux-kernel@vger.kernel.org, Linus Torvalds <torvalds@transmeta.com>
Subject: Re: [PATCH] SCHED_FIFO and SCHED_RR scheduler fix, kernel 2.4.18
Date: Thu, 13 Jun 2002 15:14:53 -0600	[thread overview]
Message-ID: <3D090B4D.4060104@avaya.com> (raw)
In-Reply-To: <Pine.LNX.4.44.0206132007010.8525-100000@elte.hu>

Ingo,

Ingo Molnar wrote:
> good catch, your observations are correct.

Thank you.

> btw., have you checked the 2.5 kernel's scheduler? It does all these
> things correctly: it queues freshly woken up tasks to the tail of the
> queue, it does not reschedule SCHED_FIFO tasks every timer tick and does
> not move RT tasks to the head of the queue in sys_setscheduler().

No I haven't. What prompted me to go with the kernel.org 2.4.18 kernel 
is the fact that the RedHat 7.3 2.4.18-3 kernel, with your O(1) 
scheduler patches besides hundreds of other patches any of which might 
also have changed the scheduler, doesn't honour SCHED_FIFO or SCHED_RR 
real-time priorities at all.

> in terms of 2.4.18, the timer and the setscheduler() change is OK, but i
> dont think we want the add_to_runqueue() change. It changes wakeup
> characteristics for non-RT tasks, it could affect any many-threads or
> many-processes application adversely. And we've been doing FIFO wakeups

I would think that the logical place to add any process to the runqueue 
would be the back of the runqueue. If all processes are ALWAYS added to 
the back of the runqueue, then every process is GUARANTEED to eventually 
be scheduled. No process will be starved indefinitely.

> like this for ages and nobody complained, so it's not that we are in a big
> hurry. Fundamental changes like this are fair game for the 2.5 kernel.
> [and we dont even know the full performance impact of this change even in
> 2.5, although it's been in since 2.5.3 or so. The full effect of things
> like this will show up during beta-testing of 2.6 i suspect.] Plus this
> change does not make *that* much of a difference - not many people use
> SCHED_FIFO tasks with the same priority, the typical usage is to sort the
> tasks by priority - this is one reason why there's a push to increase the
> number of RT priority levels to something like 1000 in the 2.5 kernel.  
> And if multiple SCHED_FIFO tasks have the same priority then exact
> scheduling is more like the matter of luck anyway.

The application that I am dealing with is a communications application 
with 86 SCHED_FIFO processes, crammed between priority levels 7-23, that 
depend on priority preemption using System V semaphores. The 2.2 kernel 
SCHED_FIFO behaviour was correct as far as a preempted SCHED_FIFO 
process being put in the back of the runqueue is concerned. But the 2.4 
kernel SCHED_FIFO behaviour was broken because of the add_to_runqueue() 
bug. That lead to our application grossly misbehaving under the 2.4.18 
scheduler.

As far as performance is concerned, putting the "if" test in 
update_process_times for SCHED_FIFO actually improved the performance of 
our application by 15%, as it would for any SCHED_FIFO centric 
application that relies on priority preemption where the average 
preemption time is > a timer tick.

Therefore, since my guess is that several applications out there depend 
on correct SCHED_FIFO and SCHED_RR behaviour as per the POSIX 
definition, I would like to request that my patch be applied to the 
2.4.19 kernel for people and companies who are reluctant to move to the 
2.5 series kernel for stability reasons.

Thank you.

- Bhavesh

-- 
Bhavesh P. Davda
Avaya Inc
Room B3-B03                     E-mail : bhavesh@avaya.com
1300 West 120th Avenue          Phone  : (303) 538-4438
Westminster, CO 80234           Fax    : (303) 538-3155


  reply	other threads:[~2002-06-13 21:15 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-12 16:19 [PATCH] SCHED_FIFO and SCHED_RR scheduler fix, kernel 2.4.18 Bhavesh P. Davda
2002-06-13 18:36 ` Ingo Molnar
2002-06-13 21:14   ` Bhavesh P. Davda [this message]
2002-06-13 21:24     ` Robert Love
2002-06-13 21:27       ` Ingo Molnar
2002-06-13 21:35     ` Ingo Molnar
2002-06-13 22:11     ` Richard Seaman, Jr.
2002-06-13 22:43       ` Bhavesh P. Davda

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=3D090B4D.4060104@avaya.com \
    --to=bhavesh@avaya.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=torvalds@transmeta.com \
    /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