All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Osterlund <peter.osterlund@mailbox.swipnet.se>
To: John Kacur <jkacur@home.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: 2.4.4 sluggish under fork load
Date: 28 Apr 2001 20:00:45 +0200	[thread overview]
Message-ID: <m2k8443nw2.fsf@ppro.localdomain> (raw)
In-Reply-To: <Pine.LNX.4.33.0104281322070.1159-100000@ppro.localdomain> <20010428170709.A410@kianga.local> <3AEAF969.58972FB4@home.com>
In-Reply-To: John Kacur's message of "Sat, 28 Apr 2001 13:10:01 -0400"

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1569 bytes --]

John Kacur <jkacur@home.com> writes:

> >Peter Osterlund wrote:
> >> 
> >> Another thing is that the bash loop "while true ; do /bin/true ; done" is
> >> not possible to interrupt with ctrl-c.
> 
> >        Same thing here.
> 
> I'm not having any problems. Just a quick question, is everyone who is
> having a problem running with more than one cpu?

A clarification. The bash loop above doesn't cause any sluggishness on
my single cpu system. The non-working ctrl-c is probably just a bash
bug. The child process must eat some cpu time to provoke the
sluggishness, like in the following test program where the child busy
waits 100ms and then exits:

#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <sys/time.h>

int main(int argc, char* argv[])
{
    double childTime = 0.10;
    if (argc > 1)
	childTime = atof(argv[1]);

    for (;;) {
	int child = fork();
	if (child == -1) {
	    printf("fork error\n");
	    exit(0);
	} else if (child > 0) {
	    while (waitpid(child, NULL, 0) != child)
		;
	    printf("."); fflush(stdout);
	} else {
	    struct timeval tv1, tv2;
	    double t;
	    gettimeofday(&tv1, NULL);
	    for (;;) {
		gettimeofday(&tv2, NULL);
		t = (tv2.tv_sec - tv1.tv_sec) +
		    (tv2.tv_usec - tv1.tv_usec) / 1000000.0;
		if (t > childTime)
		    break;
	    }
	    _exit(0);
	}
    }

    return 0;
}

-- 
Peter Österlund             peter.osterlund@mailbox.swipnet.se
Sköndalsvägen 35            http://home1.swipnet.se/~w-15919
S-128 66 Sköndal            +46 8 942647
Sweden


  reply	other threads:[~2001-04-28 18:02 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-04-28 11:52 2.4.4 sluggish under fork load 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 [this message]
2001-04-28 17:54 ` Linus Torvalds
2001-04-28 19:14   ` Peter Osterlund
2001-04-28 20:00 ` Harald Dunkel
  -- strict thread matches above, loose matches on Subject: below --
2001-04-29  7:14 Adam J. Richter
2001-04-29  8:04 Adam J. Richter
     [not found] <Pine.LNX.4.21.0104281928080.10759-100000@penguin.transmeta.com>
2001-04-29  8:26 ` Peter Osterlund
2001-04-30 17:51   ` Andrea Arcangeli
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-01  4:18 Adam J. Richter
2001-05-03 14:02 Hubertus Franke

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=m2k8443nw2.fsf@ppro.localdomain \
    --to=peter.osterlund@mailbox.swipnet.se \
    --cc=jkacur@home.com \
    --cc=linux-kernel@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.