lkml.org 
[lkml]   [1997]   [Feb]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: wierd behaviour...
Date
> > main(){ fork();}      /* no while to do several fork(). so its safe */
> > /* no danger for your computer */
> >
> > so when i run it, my harddrive is running. Even if i run it several times
> > to be sure sure that the code is in buffers. i don't understand why my
> > hd need to write or read something during or after this little program.
>
> i studied vmstat's io bo ("bo: Blocks received from a block device (blocks/s)"
> from vmstat's manpage) and i see 4 new bo each time i run my source.
>
> that comes from fork(), and the following source makes me think something
> these 4 blocks is read when the child die.
> main(){ if( !fork()) sleep(4); else sleep(2); }
>
> any explaination ?

too complicated tests give wierd results and wrong conclutions... try

main(){ pause(); }
and you'll realize that these writes are ~5-10 secs after you start the image.
and

ls -l prog
ls -lc prog
ls -lu prog

will show the reason: every time you run, the "last access" timestamp
of the file is updated in the inode. and these changes are flushed to disk
a few seconds later by kflushd...


Harald
--
All SCSI disks will from now on ___ _____
be required to send an email notice 0--,| /OOOOOOO\
24 hours prior to complete hardware failure! <_/ / /OOOOOOOOOOO\
\ \/OOOOOOOOOOOOOOO\
\ OOOOOOOOOOOOOOOOO|//
Harald Koenig, \/\/\/\/\/\/\/\/\/
Inst.f.Theoret.Astrophysik // / \\ \
koenig@tat.physik.uni-tuebingen.de ^^^^^ ^^^^^
\
 
 \ /
  Last update: 2005-03-22 13:39    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site