sleep after sync? how to flush all caches?

Pavel Machek (pavel@bug.ucw.cz)
Tue, 23 Jun 1998 23:21:30 +0200


Hi!

>From man 2 sync:

BUGS
sync() only schedules the writes, so it may return before
the actual writing is
done.

Is it true these days?

>From man 8 sync:

From Linus: "Note that sync is only guaranteed to schedule the
dirty blocks for writing: it can actually take a short time before all
the blocks are finally written. If you are doing the sync with the
expectation of killing the machine soon after, please take this into
account and sleep for a few seconds. [The reboot(8) command takes
these precautions.]

SEE ALSO
sync(2), update(8), reboot(8), halt(8)

AUTHOR
Linus Torvalds (torvalds@cs.helsinki.fi)

Is this true these days?

And one final question: Is there way to force linux forget its disk
cache? I would like to play with ondemand loading a bit, and I would
appredicate being able to bring machine into state without cached data
without reboot.

Pavel

-- 
I'm really pavel@atrey.karlin.mff.cuni.cz. 	   Pavel
Look at http://atrey.karlin.mff.cuni.cz/~pavel/ ;-).

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu