[lkml]   [1997]   [Feb]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: wierd behaviour...
> > 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.

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...

All SCSI disks will from now on ___ _____
be required to send an email notice 0--,| /OOOOOOO\
24 hours prior to complete hardware failure! <_/ / /OOOOOOOOOOO\
Harald Koenig, \/\/\/\/\/\/\/\/\/
Inst.f.Theoret.Astrophysik // / \\ \ ^^^^^ ^^^^^

 \ /
  Last update: 2005-03-22 13:39    [W:0.037 / U:0.056 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site