Hacker News new | past | comments | ask | show | jobs | submit login

But data is transferred between the CPU and RAM in units of cache lines, not pages.



This is correct: the posts above referring to "page swaps" are a little misleading. The only reason I can think of to keep things within one page is to reduce the load on the TLB, which caches logical-to-physical addresses and which has the granularity of a page.

That being said if you're really looking to optimize for TLB misses you should be using huge pages if your OS and processor support them.


When you want to minimize transfers between disk and ram and your OS does paging, then it makes sense to put unfrequently used data (like error messages) together in a page with other unfrequently used data. It's mostly what you would do on a cache line level (instead of a page level) to minimize transfers between main memory and cache.




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

Search: