linux内存管理各文件简介

来源:互联网 发布:apache 用户认证 编辑:程序博客网 时间:2024/05/18 00:50

1、内存分配机制

page_alloc:伙伴分配系统

debug-pagealloc:伙伴分配系统辅助函数

slabslubslob:基于伙伴系统之上的内存分配算法

huge_memoryhugetlb:巨页模式的支持(分配和映射)

slob:用于嵌入式的简单内存分配器

slab_commonslabslub共用的功能函数

bootmem:启动期间的内存分配器

nobootmem A boot-time physical memory allocator and configurator

memblock:初始化期间物理内存块的管理,是对bootmem的改进替代

mmzonemanagement codes for pgdats, zones and page flags

mempool:内存池,内存资源极度紧张情况下使用,可保证无死锁、内存分配不会失败

percpu-km percpupercpu memory allocator

sparse:物理内存组织形式之一Sparse Memory,其他还有Discontiguous MemoryFlat Memory

page_isolation:内存页隔离

mlock:系统调用,锁定物理内存

mprotect:系统调用,设置内存访问权限

dmapool:符合DMA操作的内存池管理(创建、删除等操作)


2、内存资源管理

memcontrol:基于CGROUP的内存资源分配管理

page_cgroup:配合memcontrol实现内存CGROUP机制

hugetlb_cgroup:配合memcontrol实现内存CGROUP机制

vmpressure:配合memcontrol实现内存CGROUP机制


3、虚拟内存管理(分配释放)

memory:页表映射管理(MMU

huge_memory、hugetlb:巨页模式的支持(分配和映射)

rmap:physical to virtual reverse mappings

interval_tree:虚拟内存块操作(线段树)

mmap:虚拟空间内存管理(struct mm_struct / struct vm_area_struct)

mempolicy:内存映射策略

vmalloc:虚拟内存分配

vmstat:内存统计计数管理

nommu:对于没有mmu的支持

bounce:高端内存的临时映射访问机制

highmem:High memory handling common code and variables

pagewalk:页表遍历函数

pgtable-generic:页表帮助函数

mm_init:Memory initialisation verification and debugging

mmu_context:任务的内存地址空间切换

init-mm:初始化进程的内存地址空间

maccessAccess kernel memory without faulting函数

mremap:系统调用,扩大或者缩小内存映射地址空间,可能会同时移动映射地址

process_vm_access:系统调用,从特定进程中读取其内存内容,这允许特权进程访问另外一个程序的地址空间。

percpu-vm:Chunks are mapped into vmalloc areas and populated page by page. This is the default chunk allocator. 

mmu_notifier:由于Remote DMA (RDMA) engines、KVM虚拟机以及显卡都有自己的单独的内存管理系统,所以mmu_notifier专门用来通知这些模块主机内存页的变化。

mincore:系统调用,查询内存地址空间内的页是否被交换到硬盘

sparse-vmemmap:SPARSEMEM_VMEMMAP uses a virtually mapped memmap to optimise pfn_to_page and page_to_pfn 

operations. This is the most efficient option when sufficient kernel resources are available


4、内存回收机制

vmscan:内存回收算法

compaction:内存碎片整理(调用migrate

migrateMemory Migration functionality


5、内存交换机制

swapfile:内存页交换到硬盘空间

swap:对物理页换入换出的支持函数

swap_state:与页高速缓存交换有关

frontswapFrontswap允许Linuxswap子系统使用 transcendent memory,当有可用的内存的时候,会取代往一个swap设备发送数据或从一个swap设备获得数据。Frontswap本身并不是一个swap设备, 也因此它并不要求像swap设备那种的配置。


6、页高速缓存以及回写机制

filemap:固态存储设备文件映射到内存空间

ksmKernel Samepage Merging

page-writeback:内存页回写硬件设备管理

truncate:对页高速缓存的截断处理

backing-dev:页高速缓存对应的底层设备特性抽象

readahead:文件预读到页高速缓冲中

page_io:页高速缓存的I/O操作API接口

fremap:文件的重映射

fadvise:系统调用,建议内核未来以何种方式访问文件

msync:系统调用,把页高速缓存内容同步到磁盘

madvise:系统调用,应用程序建议内核如何进行页高速缓存的I/O操作

cleancache:允许 tmem 存储少数 rerault 时产生的清洁页缓存页面。

filemap_xip:当内核在flash中执行时的文件映射机制


7、异常管理机制

memory_hotplug:内存热插拔支持

memory-failure:内存硬件错误的处理机制(比如多比特ECC错误或者缓存错误)

oom_kill:内存耗尽的处理机制

kmemleak:内存泄漏检测机制

hwpoison-inject:在物理页帧注入硬件故障

kmemleak-test:内存泄漏测试模块

KmemcheckLinux 内核内存检测工具

failslabslab分配器故障注入


8、其他

shmem:基于内存的tmpfs文件系统实现

quicklist

balloon_compaction

util:通用函数


0 0
原创粉丝点击