Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Disk caching makes the system much faster and more responsive! There are no downsides, except for confusing newbies. It does not take memory away from applications in any way, ever!

No downsides except for massive data loss when the system suddenly loses power/a drive crashes and the massive theft of memory from host OSes (e.g., when using Windows Subsystem for Linux).



There is no data loss from disk caching.


Does disk caching not include write caching?


the cache being talked about is for recently/frequently accesses things, not stuff pending write


Not in the context we're talking about


Are you sure? Dirty pages have to reside somewhere, so they are actually stuck in RAM until successfully written RAM. Linux will lie with straight face that dd to my 8gb pendrive finished successfully in a few seconds, so there may be non-trivial amounts of RAM involved here.

I don't know enough of Linux internals to know if the writeback cache and read cache are the same object in the kernel, but they feel similar.

Of course the real response is that without write cache (effectively adding fsync to every write) any modern linux system will grind to absolute halt and doing anything would be a challenge. So contray to GP's post, it's not reasonable to complain about it's existence.


It's written asap to disk unless you configure it otherwise. The disk (or flash disk, in your case) has its own ram before actually flushing to physical storage (fsync, unless it lies, in which case there is probably an article about it here cough macs cough). So the kernel isn't lying to you, but your disk probably is.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: