Re: wierd behaviour...

Luis Colorado (luis@grea1.ts.es)
Fri, 28 Feb 1997 10:00:17 +0100 (MET)


On Wed, 26 Feb 1997, Marc Lehmann wrote:

> Date: Wed, 26 Feb 1997 20:57:46 +0100 (MET)
> From: Marc Lehmann <mlehmann@hildesheim.sgh-net.de>
> To: koenig@tat.physik.uni-tuebingen.de
> Cc: linux-kernel@vger.rutgers.edu
> Subject: Re: wierd behaviour...
>
>
> >too complicated tests give wierd results and wrong conclutions... try
>
> You should have tried it..
>
> >and you'll realize that these writes are ~5-10 secs after you start the image.
>
> You SHOULD have tried it.. the writes are instant. run it in a shell-loop,
> and your drive light keeps going all the time!
>
> I didn't believe it at first, but:
>
> main(){ pause(); }

I think, to identify it actually as a fork related problem, you can try this
code (I'm sure you won't get disk light flashin in this case):

main () {
while ()
if (!fork ())
exit (0);
else sleep (1);
}

If you don't get hd lights flashing in this case, you are identifying
incorrectly the problem.

>
> compiled, started, and interrupted does nothing (well, after
> some time, the atime is updated).. as one would expect.
>
> main(){ fork(); }
>
> on the other hand DOES write to my harddisk, quite loudly, BTW..
> this has NOTHING to do with the atime update.
>
> after killing syslogd (maybe some log-file gets written), I still
> get the disk-activity...
>
> checked under 2.1.14 (the last one that did compile so far :-)
>
> btw:
> void main(void) { if(fork()) sleep(2); else sleep(1);}
>
> shows this behavious, while
>
> void main(void) { if(fork()) sleep(1); else sleep(2);}
>
> does not... (except for the atime update, which is much later..)
> i.e. if the child dies BEFORE the parent we get the behaviour,
> not otherwise round.. (hmm.. I thought it would be
> an interatcion with init or the shell, but...)
>
> ---------------------------------------------------------------------
>
> for a pentium-optimizing gcc, look at http://www.goof.com/pcg
>
> -----==-
> ----==-- _
> ---==---(_)__ __ ____ __ Marc Lehmann
> --==---/ / _ \/ // /\ \/ / mlehmann@hildesheim.sgh-net.de
> -=====/_/_//_/\_,_/ /_/\_\ pcg@goof.com
> The choice of a GNU generation
>

Luis Colorado <luis.colorado@ts.es>
Telefonica Sistemas, S.A.
C/Ramirez de Arellano 19 / 28043 MADRID (SPAIN)
Tel: 34.1.337.5830 / Fax: 34.1.337.5709