This is the mail archive of the
glibc-linux@ricardo.ecn.wfu.edu
mailing list for the glibc project.
Re: Slow pthread_create() under high load
- To: sasha at mysql dot com
- Subject: Re: Slow pthread_create() under high load
- From: "Stephen C. Tweedie" <sct at redhat dot com>
- Date: Mon, 27 Mar 2000 12:24:16 +0100
- Cc: Alan Cox <alan at lxorguk dot ukuu dot org dot uk>, drepper at cygnus dot com, Kaz Kylheku <kaz at ashi dot footprints dot net>, glibc-linux at ricardo dot ecn dot wfu dot edu, linux-kernel at vger dot rutgers dot edu, mysql at lists dot mysql dot com, monty at mysql dot com, Stephen Tweedie <sct at redhat dot com>
- References: <E12YyOa-0004CY-00@the-village.bc.nu> <38DCD6AA.14654E21@mysql.com>
- Reply-To: glibc-linux at ricardo dot ecn dot wfu dot edu
Hi,
On Sat, Mar 25, 2000 at 08:09:30AM -0700, sasha@mysql.com wrote:
> >
> Could somebody also elaborate on "the scheduler penalizes across forks" for
> those who are not as familiar with the kernel internals/jargon? Does that mean
> that a process that has called fork()/clone() automatically gets punished for
> this great sin by getting its priority lowered?
Correct. More specifically, the scheduling credits of the parent gets
shared amongst the child processes.
This is part of a kernel defence mechanism, and yes, it is important to
do something like this. If you don't, then a user can create a fork-
bomb task which continually forks off children, and if the children and
parent all keep the same credits, then it becomes essentially
impossible for any other process ever to get scheduled. It is a _nasty_
denial-of-service attack, and that's why the kernel has to share the
scheduling credits out when you fork.
--Stephen