From: Rusty Russell <rusty@rustcorp.com.au>
To: mingo@elte.hu
Cc: linux-kernel@vger.kernel.org
Subject: Re: [announce] [patch] ultra-scalable O(1) SMP and UP scheduler
Date: Mon, 07 Jan 2002 13:58:02 +1100 [thread overview]
Message-ID: <E16NPz8-0001t1-00@wagner.rustcorp.com.au> (raw)
In-Reply-To: Your message of "Fri, 04 Jan 2002 03:19:10 BST." <Pine.LNX.4.33.0201040050440.1363-100000@localhost.localdomain>
In message <Pine.LNX.4.33.0201040050440.1363-100000@localhost.localdomain> you
write:
>
> now that new-year's parties are over things are getting boring again. For
> those who want to see and perhaps even try something more complex, i'm
> announcing this patch that is a pretty radical rewrite of the Linux
> scheduler for 2.5.2-pre6:
Hi Ingo...
Reading through 2.5.2-C1, couple of comments/questions:
sched.c line 402:
/*
* Current runqueue is empty, try to find work on
* other runqueues.
*
* We call this with the current runqueue locked,
* irqs disabled.
*/
static void load_balance(runqueue_t *this_rq)
This first comment doesn't seem to be true: it also seems to be called
from idle_tick and expire task. Perhaps it'd be nicer too, to split
load_balance into "if (is_unbalanced(cpu())) pull_task(cpu())". (I
like "pull_" and "push_" nomenclature for the scheduler).
sched.c load_balance() line 435:
if ((load > max_load) && (load < prev_max_load) &&
(rq_tmp != this_rq)) {
Why are you ignoring a CPU with more than the previous maximum load
(prev_max_load is incremented earlier)?
sched.c expire_task line 552:
if (p->array != rq->active) {
p->need_resched = 1;
return;
}
I'm not clear how this can happen??
Finally, I gather you want to change smp_processor_id() to cpu()?
That's fine (smp_num_cpus => num_cpus() too please), but it'd be nice
to have that as a separate patch, rather than getting stuck with BOTH
cpu() and smp_processor_id().
Patch below (untested) corrects SMP_CACHE_BYTES alignment, minor
comment, and rebalance tick for HZ < 100 (ie. User Mode Linux).
Rusty.
PS. Awesome work.
--
Anyone who quotes me in their sig is an idiot. -- Rusty Russell.
diff -urN -I \$.*\$ --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal working-2.5.2-pre9-mingosched/kernel/sched.c working-2.5.2-pre9-mingoschedfix/kernel/sched.c
--- working-2.5.2-pre9-mingosched/kernel/sched.c Mon Jan 7 12:39:10 2002
+++ working-2.5.2-pre9-mingoschedfix/kernel/sched.c Mon Jan 7 13:51:39 2002
@@ -43,14 +43,14 @@
* if there is a RT task active in an SMP system but there is no
* RT scheduling activity otherwise.
*/
-static struct runqueue {
+struct runqueue {
int cpu;
spinlock_t lock;
unsigned long nr_running, nr_switches, last_rt_event;
task_t *curr, *idle;
prio_array_t *active, *expired, arrays[2];
- char __pad [SMP_CACHE_BYTES];
-} runqueues [NR_CPUS] __cacheline_aligned;
+} ____cacheline_aligned;
+static struct runqueue runqueues[NR_CPUS] __cacheline_aligned;
#define this_rq() (runqueues + cpu())
#define task_rq(p) (runqueues + (p)->cpu)
@@ -102,7 +102,7 @@
* This is the per-process load estimator. Processes that generate
* more load than the system can handle get a priority penalty.
*
- * The estimator uses a 4-entry load-history ringbuffer which is
+ * The estimator uses a SLEEP_HIST_SIZE-entry load-history ringbuffer which is
* updated whenever a task is moved to/from the runqueue. The load
* estimate is also updated from the timer tick to get an accurate
* estimation of currently executing tasks as well.
@@ -511,7 +511,7 @@
spin_unlock(&busiest->lock);
}
-#define REBALANCE_TICK (HZ/100)
+#define REBALANCE_TICK ((HZ/100) ?: 1)
void idle_tick(void)
{
next prev parent reply other threads:[~2002-01-07 5:00 UTC|newest]
Thread overview: 65+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-01-04 2:19 Ingo Molnar
2002-01-04 4:27 ` Oliver Xymoron
2002-01-04 5:34 ` Ian Morgan
2002-01-04 10:30 ` Anton Blanchard
2002-01-04 12:53 ` Ingo Molnar
2002-01-04 14:18 ` Thomas Cataldo
2002-01-04 14:46 ` dan kelley
2002-01-04 15:22 ` Nikita Danilov
2002-01-04 17:07 ` Ingo Molnar
2002-01-05 4:33 ` Davide Libenzi
2002-01-05 20:24 ` Ingo Molnar
2002-01-05 19:49 ` Mika Liljeberg
2002-01-05 22:00 ` Ingo Molnar
2002-01-05 21:04 ` Mika Liljeberg
2002-01-05 23:04 ` Davide Libenzi
2002-01-05 23:41 ` Alan Cox
2002-01-05 23:46 ` Davide Libenzi
2002-01-06 0:47 ` Linus Torvalds
2002-01-06 2:57 ` Ingo Molnar
2002-01-06 1:27 ` Linus Torvalds
2002-01-06 1:45 ` Davide Libenzi
2002-01-06 3:55 ` Ingo Molnar
2002-01-06 2:16 ` Davide Libenzi
2002-01-06 3:41 ` Ingo Molnar
2002-01-06 2:02 ` Davide Libenzi
2002-01-06 2:13 ` Alan Cox
2002-01-06 2:12 ` Davide Libenzi
2002-01-06 2:20 ` Alan Cox
2002-01-06 2:17 ` Davide Libenzi
2002-01-06 3:30 ` 2.4.17 kernel without modules...was " Vikram
2002-01-06 4:07 ` [announce] [patch] ultra-scalable O(1) " Ingo Molnar
2002-01-06 2:23 ` Davide Libenzi
2002-01-06 2:30 ` Alan Cox
2002-01-06 4:19 ` Ingo Molnar
2002-01-07 3:08 ` Richard Henderson
2002-01-07 3:16 ` Linus Torvalds
2002-01-07 3:31 ` Davide Libenzi
2002-01-07 3:34 ` Linus Torvalds
2002-01-07 3:49 ` Davide Libenzi
2002-01-06 4:01 ` Ingo Molnar
2002-01-06 4:08 ` Ingo Molnar
2002-01-06 4:16 ` Ingo Molnar
2002-01-06 3:55 ` Luc Van Oostenryck
2002-01-07 8:00 ` Jens Axboe
2002-01-06 2:49 ` Ingo Molnar
2002-01-07 2:58 ` Rusty Russell [this message]
2002-01-04 3:56 Ed Tomlinson
2002-01-04 7:42 Dieter Nützel
2002-01-04 8:02 ` David Lang
2002-01-04 11:44 ` Ingo Molnar
2002-01-04 11:33 ` David Lang
2002-01-04 13:39 ` Andrea Arcangeli
2002-01-04 14:04 ` Ingo Molnar
2002-01-04 13:36 ` Andrea Arcangeli
2002-01-04 15:44 ` Ingo Molnar
2002-01-04 14:45 ` Andrea Arcangeli
2002-01-04 11:16 rwhron
2002-01-04 13:20 ` Ingo Molnar
[not found] <20020104074239.94E016DAA6@mail.elte.hu>
2002-01-04 11:42 ` Ingo Molnar
2002-01-05 0:28 ` Roger Larsson
2002-01-05 7:53 ` george anzinger
2002-01-05 12:42 ` Ingo Molnar
2002-01-05 16:54 ` Robert Love
2002-01-07 17:34 Rene Rebe
[not found] <Pine.LNX.4.33.0201072124380.14212-100000@localhost.localdomain>
[not found] ` <20020107.191742.730580837.rene.rebe@gmx.net>
2002-01-07 19:53 ` Rene Rebe
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=E16NPz8-0001t1-00@wagner.rustcorp.com.au \
--to=rusty@rustcorp.com.au \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
/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®