博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
内存管理之bootmem管理之释放内存
阅读量:4154 次
发布时间:2019-05-25

本文共 1130 字,大约阅读时间需要 3 分钟。

主要还是两个函数free_bootmem_node和free_bootmem
这里主要是标记相应比特位为0,空闲。
/** * free_bootmem_node - mark a page range as usable * @pgdat: node the range resides on * @physaddr: starting address of the range * @size: size of the range in bytes * * Partial pages will be considered reserved and left as they are. * * The range must reside completely on the specified node. */void __init free_bootmem_node(pg_data_t *pgdat, unsigned long physaddr,			      unsigned long size){	unsigned long start, end;	kmemleak_free_part_phys(physaddr, size);	start = PFN_UP(physaddr);	end = PFN_DOWN(physaddr + size);	mark_bootmem_node(pgdat->bdata, start, end, 0, 0);}
 
/** * free_bootmem - mark a page range as usable * @addr: starting physical address of the range * @size: size of the range in bytes * * Partial pages will be considered reserved and left as they are. * * The range must be contiguous but may span node boundaries. */void __init free_bootmem(unsigned long physaddr, unsigned long size){	unsigned long start, end;	kmemleak_free_part_phys(physaddr, size);	start = PFN_UP(physaddr);	end = PFN_DOWN(physaddr + size);	mark_bootmem(start, end, 0, 0);}
 
 
 

转载地址:http://zqqti.baihongyu.com/

你可能感兴趣的文章
进程创建时共享内存处理
查看>>
idle进程创建
查看>>
内核线程创建
查看>>
linux elf tool readelf
查看>>
linux tool objdump
查看>>
linux tool nm
查看>>
字节对齐
查看>>
Python-发邮件
查看>>
python写入csv文件的两种方法
查看>>
pandas学习笔记—dataframe与list相互转化
查看>>
Keras和TensorFlow设置GPU及其使用率
查看>>
python常见异常处理方法
查看>>
pandas学习笔记—merge()函数详解
查看>>
pandas学习笔记—agg()函数详解
查看>>
Canny边缘检测算法原理及其OpenCV实现
查看>>
JupyterLab on JupyterHub(JupyterLab+JupyterHub)(JupyterLab JupyterHub)
查看>>
Ubuntu查找文件或文件夹
查看>>
DIGITS安装及服务部署
查看>>
利用Python脚本开发Hadoop的MapReduce大数据分析应用
查看>>
python连接SQL数据库
查看>>