dentries和inodes

#Linux #内存 #系统 在释放linux内存时,遇到了三个名词pagecache/dentries/inodes。不是太懂,在网上找了一个解释说明

It appears you are working with memory caching of directory structures. 当我们正在使用内存缓存目录结构时,
An inode in your context is a data structure that represents a file. A dentries is a data structure that represents a directory. 在这个上下文中的inode是表示文件的数据结构,而dentries是表示目录的数据结构。
These structures could be used to build a memory cache that represents the file structure on a disk. To get a directly listing, the OS could go to the dentries–if the directory is there–list its contents (a series of inodes). If not there, go to the disk and read it into memory so that it can be used again. 这些结构可用于构建表示磁盘上的文件结构的内存高速缓存。为了直接获得列表,操作系统可以去dentries那里(如果目录在那里的话)列出其内容(一系列inode)。如果没有,则会去磁盘上将其读入内存,以便它可以再次使用。
The page cache could contain any memory mappings to blocks on disk. That could conceivably be buffered I/O, memory mapped files, paged areas of executables–anything that the OS could hold in memory from a file. 页面缓存(page cache)可以包含磁盘块的任何内存映射。这可以是缓冲I/O,内存映射文件,可执行文件的分页区域——操作系统可以从文件保存在内存中的任何内容。

简单的说

  • pagecache 可以包含的任何内存映射

  • dentries 是表示目录的数据结构

  • inodes 是表示文件的数据结构

如何释放内存[[常用易忘记命令#Linux 手动释放内存]]

最后更新于