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

> stuff gets evicted from the cache long before you hit the swap

No...?

I'm looking at a machine right now that has 3.7GB not swapped out and 1.2GB swapped out. Meanwhile the page cache has 26GB in it.

Swapping can happen regardless of how big your page cache is. And how much you want swap to be used depends on use case. Sometimes you want to tune it up or down. In general the system will be good about dropping cache first, but it's not a guarantee.

> measured by page swap-out/in rate and not by how much swap space is used

Eh? I mean, the data got there somewhere. The rate was nonzero at some point despite a huge page cache.

And usually when you want to specifically talk about the swap-out/in rate being too high, the term is "thrashing".



cached disk pages are not going to be swapped out, they're just freed (because these pages are already "out" in the same place swapland is)

if your cached disk pages keep getting hit and are "recent", they're going to stay in, and your old untouched working pages are going to be swapped out, to make room either for new working pages because you've just loaded new programs or data, or to make room for more disk pages to be cached because your page cache accesses are "busier" than some of your working pages.

you will swap out pages to make room for disk cache, but your cached disk pages will never be swapped out, they are just tossed (of course, after any dirty pages are written)




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

Search: