我正在阅读:https://en.wikipedia.org/wiki/Page_cache
In computing, a page cache, sometimes also called disk cache,[1] is a transparent cache for the pages originating from a secondary storage device such as a hard disk drive (HDD) or a solid-state drive (SSD). The operating system keeps a page cache in otherwise unused portions of the main memory (RAM), resulting in quicker access to the contents of cached pages and overall performance improvements.
是否有类似的技术可以将经常访问的 RAM 部分保存在 L1、L2 和 L3 缓存中以提高性能?
我不知道那里保存了什么样的信息,什么缓存?
最佳答案
是的,这些被称为硬件/CPU 缓存。它们存储“高速缓存行”,通常为 64 字节,是从 RAM 中提取并存储的内存片段,以便 CPU 更近距离/更快地访问。这通常是在幕后进行的,因为它是在硬件中处理的,您通常无法修改它,操作系统也无法直接访问其内容。但是,您可以使用 flush_cache_
family 刷新内容。函数。
页面缓存的目的类似:通过存储可能很快使用的内存来加速 future 的访问。通常,它处理大小为 4KB 的内存页,并将内存从磁盘加载到 RAM 中。它是操作系统级缓存。 Linux 内核完全控制页面缓存的工作方式,您可以在源代码中自行修改。看看this discussion如果您想了解有关页面缓存中存储的内容的更多信息。
关于linux - 页缓存与 L1 缓存?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68491864/