mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: William Lee Irwin III <wli@holomorphy.com>
To: Antonio Vargas <wind@cocodriloo.com>
Cc: Hubertus Franke <frankeh@watson.ibm.com>,
	linux-kernel@vger.kernel.org, Robert Love <rml@tech9.net>
Subject: Re: fairsched + O(1) process scheduler
Date: Thu, 3 Apr 2003 11:22:41 -0800	[thread overview]
Message-ID: <20030403192241.GB1828@holomorphy.com> (raw)
In-Reply-To: <20030403125355.GA12001@wind.cocodriloo.com>

On Thu, Apr 03, 2003 at 02:53:55PM +0200, Antonio Vargas wrote:
> Sorry for not answering sooner, but I had my mail pointing at
> the lkml instead of my personal email.
> Last night I continued coding up but I think I've it a deadlock:
> it seems the system stops calling schedule_tick() when there are
> no more tasks to run, and it's there where I use a workqueue so
> that I can update the user timeslices out of interrupt context.
> I think that because if I put printk's on my code, it continues to
> run OK, but if I remove them it freezes hard.

Use spin_lock_irq(&uidhash_lock) or you will deadlock if you hold it
while you take a timer tick, but it's wrong anyway. it's O(N) with
respect to number of users present. An O(1) algorithm could easily
make use of reference counts held by tasks.


On Thu, Apr 03, 2003 at 02:53:55PM +0200, Antonio Vargas wrote:
> About giving ticks to users, I've got an idea: assuming there are N
> total processes in the system and an user has got M processes, we should
> give N * max_timeslice ticks to each user every M * max_timeslice *
> num_users ticks. I've been thinking about it and it seems it would
> balance the ticks correctly.
> About the starvation for low-priority processes, I can get and
> example.. assume user A has process X Y and user B has process Z,
> and max_timeslice = 2:
> max_timeslice = 2 and 4 total processes ==>
> give 2 * 3 = 6 ticks to user A every 2 * 2 * 2 =  8 ticks
> give 2 * 3 = 6 ticks to user B every 1 * 2 * 2 =  4 ticks

This isn't right, when expiration happens needs to be tracked by both
user and task. Basically which tasks are penalized when the user
expiration happens? The prediction is the same set of tasks will always
be the target of the penalty.


-- wli

  reply	other threads:[~2003-04-03 19:14 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-01 12:51 Antonio Vargas
2003-04-01 16:41 ` William Lee Irwin III
2003-04-01 22:19   ` Antonio Vargas
2003-04-02 12:46     ` Antonio Vargas
2003-04-02 16:35       ` William Lee Irwin III
2003-04-02 21:36         ` Antonio Vargas
2003-04-02 21:35           ` Robert Love
2003-04-02 22:07             ` Antonio Vargas
2003-04-02 22:10               ` Robert Love
2003-04-02 22:35                 ` Antonio Vargas
2003-04-03 17:15                 ` Corey Minyard
2003-04-03 18:17                   ` Robert Love
     [not found]     ` <200304021144.21924.frankeh@watson.ibm.com>
2003-04-03 12:53       ` Antonio Vargas
2003-04-03 19:22         ` William Lee Irwin III [this message]
2003-04-04 11:27           ` Antonio Vargas
2003-04-04 14:04             ` William Lee Irwin III
2003-04-04 20:12               ` Antonio Vargas
2003-04-04 20:40                 ` William Lee Irwin III
     [not found]             ` <200304041453.16630.frankeh@watson.ibm.com>
2003-04-04 21:36               ` Antonio Vargas
     [not found]                 ` <200304081456.34367.frankeh@watson.ibm.com>
2003-04-08 20:19                   ` Antonio Vargas
2003-04-01 18:33 ` Robert Love

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=20030403192241.GB1828@holomorphy.com \
    --to=wli@holomorphy.com \
    --cc=frankeh@watson.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rml@tech9.net \
    --cc=wind@cocodriloo.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

all inboxes | Powered by JetHome®