Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Sat, 28 Apr 2001 14:02:00 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Sat, 28 Apr 2001 14:01:49 -0400 Received: from fep04.swip.net ([130.244.199.132]:6016 "EHLO fep04-svc.swip.net") by vger.kernel.org with ESMTP id ; Sat, 28 Apr 2001 14:01:36 -0400 To: John Kacur Cc: linux-kernel@vger.kernel.org Subject: Re: 2.4.4 sluggish under fork load In-Reply-To: <20010428170709.A410@kianga.local> <3AEAF969.58972FB4@home.com> From: Peter Osterlund Date: 28 Apr 2001 20:00:45 +0200 In-Reply-To: John Kacur's message of "Sat, 28 Apr 2001 13:10:01 -0400" Message-ID: Lines: 63 X-Mailer: Gnus v5.7/Emacs 20.7 Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org John Kacur 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 #include #include #include #include #include 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 - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/