From: Andrea Arcangeli <andrea@suse.de>
To: Peter Osterlund <peter.osterlund@mailbox.swipnet.se>
Cc: Linus Torvalds <torvalds@transmeta.com>,
Mark Hahn <hahn@coffee.psychology.mcmaster.ca>,
"Adam J. Richter" <adam@yggdrasil.com>,
linux-kernel@vger.kernel.org
Subject: Re: 2.4.4 sluggish under fork load
Date: Mon, 30 Apr 2001 19:51:49 +0200 [thread overview]
Message-ID: <20010430195149.F19620@athlon.random> (raw)
In-Reply-To: <Pine.LNX.4.21.0104281928080.10759-100000@penguin.transmeta.com> <Pine.LNX.4.33.0104291017370.2060-100000@ppro.localdomain>
In-Reply-To: <Pine.LNX.4.33.0104291017370.2060-100000@ppro.localdomain>; from peter.osterlund@mailbox.swipnet.se on Sun, Apr 29, 2001 at 10:26:57AM +0200
On Sun, Apr 29, 2001 at 10:26:57AM +0200, Peter Osterlund wrote:
> On Sat, 28 Apr 2001, Linus Torvalds wrote:
>
> > > could we leave it at half, but set the parent to SCHED_YIELD?
> >
> > Sounds like a good idea. Peter, how does that feel to you? I bet that I'v
> > enever seen it simply because all my machines are (a) much too powerful
> > for any reasonable use and (b) SMP.
>
> That seems to work. The scheduling delays are back to 20ms and the
> sluggishness feeling is gone. I wrote a simple test program to verify that
> the child is still scheduled before the parent, so the performance
> advantage should still be there. The only annoying thing is that it hides
> the bash bug ;)
>
> Patch below:
>
> --- linux-2.4.4.orig/kernel/fork.c Sat Apr 28 10:17:00 2001
> +++ linux-2.4.4/kernel/fork.c Sun Apr 29 10:06:42 2001
> @@ -666,16 +666,18 @@
> p->pdeath_signal = 0;
>
> /*
> - * Give the parent's dynamic priority entirely to the child. The
> - * total amount of dynamic priorities in the system doesn't change
> - * (more scheduling fairness), but the child will run first, which
> - * is especially useful in avoiding a lot of copy-on-write faults
> - * if the child for a fork() just wants to do a few simple things
> - * and then exec(). This is only important in the first timeslice.
> - * In the long run, the scheduling behavior is unchanged.
> + * "share" dynamic priority between parent and child, thus the
> + * total amount of dynamic priorities in the system doesn't change,
> + * more scheduling fairness. The parent yields to let the child run
> + * first, which is especially useful in avoiding a lot of
> + * copy-on-write faults if the child for a fork() just wants to do a
> + * few simple things and then exec(). This is only important in the
> + * first timeslice. In the long run, the scheduling behavior is
> + * unchanged.
> */
> - p->counter = current->counter;
> - current->counter = 0;
> + p->counter = (current->counter + 1) >> 1;
> + current->counter >>= 1;
> + current->policy |= SCHED_YIELD;
> current->need_resched = 1;
>
> /*
please try to reproduce the bad behaviour with 2.4.4aa2. There's a bug
in the parent-timeslice patch in 2.4 that I fixed while backporting it
to 2.2aa and that I now forward ported the fix to 2.4aa. The fact 2.4.4
gives the whole timeslice to the child just gives more light to such
bug. Unfortunately the fix doesn't apply cleanly to 2.4.4 (it's
incremental with the numa-scheduler patch) and I need to finish a few
more things before I can backport it myself.
Andrea
next prev parent reply other threads:[~2001-04-30 17:54 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <Pine.LNX.4.21.0104281928080.10759-100000@penguin.transmeta.com>
2001-04-29 8:26 ` 2.4.4 sluggish under fork load Peter Osterlund
2001-04-30 17:51 ` Andrea Arcangeli [this message]
2001-04-30 21:45 ` Peter Osterlund
2001-05-01 2:38 ` Rik van Riel
2001-05-01 5:18 ` Andrea Arcangeli
2001-05-01 16:55 ` Andrea Arcangeli
2001-05-01 17:33 ` J . A . Magallon
2001-05-01 20:34 ` Alan Cox
2001-05-03 14:02 Hubertus Franke
-- strict thread matches above, loose matches on Subject: below --
2001-05-01 4:18 Adam J. Richter
2001-04-29 8:04 Adam J. Richter
2001-04-29 7:14 Adam J. Richter
2001-04-28 11:52 Peter Osterlund
2001-04-28 14:16 ` J . A . Magallon
2001-04-28 14:26 ` Mohammad A. Haque
2001-04-28 15:07 ` Rene Puls
2001-04-28 17:10 ` John Kacur
2001-04-28 18:00 ` Peter Osterlund
2001-04-28 17:54 ` Linus Torvalds
2001-04-28 19:14 ` Peter Osterlund
2001-04-28 20:00 ` Harald Dunkel
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=20010430195149.F19620@athlon.random \
--to=andrea@suse.de \
--cc=adam@yggdrasil.com \
--cc=hahn@coffee.psychology.mcmaster.ca \
--cc=linux-kernel@vger.kernel.org \
--cc=peter.osterlund@mailbox.swipnet.se \
--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