Quote:> After noticing that bdflush is a kernel process, i killed my update.
> this worked great for a long time... yesterday, i had a cold boot
> in the middle of my work, all the files i made in the 15 minutes
> prior to the reset were gone. no sign of them. is this because i
> don't run update?
Now that I've figured this out (I think) let me share. There are two
daemons: bdflush and kflushd. kflushd takes care that pages are flushed
out when the kernel needs the space, bdflush takes care that dirty
buffers are eventually flushed even if the kernel doesn't need the space.
Obviously, if kflushd isn't running the system may run out of memory, so
it needs to run no matter what. In normal operation bdflush isn't really
necessary as shutdown will take care of syncing before the kernel stops,
however, it minimizes the loss should the system be stopped abnormally.
I could imagine situation where you might want to disable bdflush (to
avoid the disk spinning up in a portable running on battery, for
example), although bdflush seems to have plenty of parameters so you can
probably set it to suit your needs and still keep things safe.
Now the story of update. In older kernels (without kernel threads)
update used to start both kflushd and bdflush (the names might have been
different, I'm not sure). That's why pretty much all init scripts used
to fire up update as soon as possible. It then forked twice, one of the
children became kflushd and the other bdflush. In newer kernels kflushd
is started as a kernel thread almost immediately after init (it is I
believe process #3), much before update. Then comes update, forks, make
the system call that used to start kflushd. This call that used never to
return now returns immediately causing this child to exit immediately.
Then update forks again and starts bdflush as it always did.
The bottom line is, you still need update if you want to remain on the
safe side. You could make it marginally more efficient by eliminating
the unnecessary fork and syscall but you wouldn't gain much and got a
program that would no longer be good for older kernels.
I hope all of the above is correct; if not, feel free to correct me.
Apologies to those who have been following the 1.3 development process
and are probably tired of all this but people who are switching from 1.2
to 2.0 are probably not and it may help them.
Regards.
-,- - - -,- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -