memblock_free_all释放page到buddy,前后nr_free的情况

https://www.cnblogs.com/tolimit/p/5287801.html

在zone_sizes_init 之后,各个node,zone'的page总数已知。但是此时的每个order的空闲链表是空的,也就是无法通过alloc_page这种接口来分配。此时page还在memblock管控,需要memblock释放。释放的函数是free_low_memory_core_early:

mm_init   //init/main.c
	mem_init(void)   //arch/arm64/mm/init.c
		memblock_free_all();
	
	
void __init memblock_free_all(void)
{
	unsigned long pages;

	free_unused_memmap();
	reset_all_zones_managed_pages();

	pages = free_low_memory_core_early();
	totalram_pages_add(pages);
}


free_low_memory_core_early
	for_each_free_mem_range
		 __free_memory_core(start, end);
			__free_pages_memory(start_pfn, end_pfn);
				memblock_free_pages(pfn_to_page(start), start, order);
					__free_pages_core
						__free_pages_ok
							__free_one_page
在memblock_free_all之前,各个NUMA的pglist_data的zone下面不同order的nr_free链表数为0:
[    0.000000] ===show_mem_info  after zone_sizes_init

[    0.000000] ===show_pgdata_info nodeid 0 
[    0.000000] ===show_zone_info :
                      name : DMA
                      managed_pages:7a000
                      spanned_pages:80000
                      present_pages:7c000
[    0.000000]  MAX_ORDER 10 of order :0 has nr_free 0
[    0.000000]  MAX_ORDER 10 of order :1 has nr_free 0
[    0.000000]  MAX_ORDER 10 of order :2 has nr_free 0
[    0.000000]  MAX_ORDER 10 of order :3 has nr_free 0
[    0.000000]  MAX_ORDER 10 of order :4 has nr_free 0
[    0.000000]  MAX_ORDER 10 of order :5 has nr_free 0
[    0.000000]  MAX_ORDER 10 of order :6 has nr_free 0
[    0.000000]  MAX_ORDER 10 of order :7 has nr_free 0
[    0.000000]  MAX_ORDER 10 of order :8 has nr_free 0
[    0.000000]  MAX_ORDER 10 of order :9 has nr_free 0
[    0.000000]  MAX_ORDER 10 of order :10 has nr_free 0
[    0.000000] ===show_zone_info :
                      name : DMA32
                      managed_pages:0
                      spanned_pages:0
                      present_pages:0
[    0.000000]  MAX_ORDER 10 of order :0 has nr_free 0
[    0.000000]  MAX_ORDER 10 of order :1 has nr_free 0
[    0.000000]  MAX_ORDER 10 of order :2 has nr_free 0
[    0.000000]  MAX_ORDER 10 of order :3 has nr_free 0
[    0.000000]  MAX_ORDER 10 of order :4 has nr_free 0
[    0.000000]  MAX_ORDER 10 of order :5 has nr_free 0
[    0.000000]  MAX_ORDER 10 of order :6 has nr_free 0
[    0.000000]  MAX_ORDER 10 of order :7 has nr_free 0
[    0.000000]  MAX_ORDER 10 of order :8 has nr_free 0
[    0.000000]  MAX_ORDER 10 of order :9 has nr_free 0
[    0.000000]  MAX_ORDER 10 of order :10 has nr_free 0
[    0.000000] ===show_zone_info :
                      name : Normal
                      managed_pages:762000
                      spanned_pages:2680000
                      present_pages:780000
[    0.000000]  MAX_ORDER 10 of order :0 has nr_free 0
[    0.000000]  MAX_ORDER 10 of order :1 has nr_free 0
[    0.000000]  MAX_ORDER 10 of order :2 has nr_free 0
[    0.000000]  MAX_ORDER 10 of order :3 has nr_free 0
[    0.000000]  MAX_ORDER 10 of order :4 has nr_free 0
[    0.000000]  MAX_ORDER 10 of order :5 has nr_free 0
[    0.000000]  MAX_ORDER 10 of order :6 has nr_free 0
[    0.000000]  MAX_ORDER 10 of order :7 has nr_free 0
[    0.000000]  MAX_ORDER 10 of order :8 has nr_free 0
[    0.000000]  MAX_ORDER 10 of order :9 has nr_free 0
[    0.000000]  MAX_ORDER 10 of order :10 has nr_free 0
[    0.000000] ===show_zone_info :
                      name : Movable
                      managed_pages:0
                      spanned_pages:0
                      present_pages:0
[    0.000000]  MAX_ORDER 10 of order :0 has nr_free 0
[    0.000000]  MAX_ORDER 10 of order :1 has nr_free 0
[    0.000000]  MAX_ORDER 10 of order :2 has nr_free 0
[    0.000000]  MAX_ORDER 10 of order :3 has nr_free 0
[    0.000000]  MAX_ORDER 10 of order :4 has nr_free 0
[    0.000000]  MAX_ORDER 10 of order :5 has nr_free 0
[    0.000000]  MAX_ORDER 10 of order :6 has nr_free 0
[    0.000000]  MAX_ORDER 10 of order :7 has nr_free 0
[    0.000000]  MAX_ORDER 10 of order :8 has nr_free 0
[    0.000000]  MAX_ORDER 10 of order :9 has nr_free 0
[    0.000000]  MAX_ORDER 10 of order :10 has nr_free 0

在memblock_free_all之后,才有,特别是order为10的情况最多,这是看空闲的组成大的buddy:
[    0.000000] ===free_low_mwmory_core_early return pages 7c4864
[    0.000000] ===show_mem_info  after memblock_free_all

[    0.000000] ===show_pgdata_info nodeid 0
[    0.000000] ===show_zone_info :
                      name : DMA
                      managed_pages:6b9f1
                      spanned_pages:80000
                      present_pages:7c000
[    0.000000]  MAX_ORDER 10 of order :0 has nr_free 5
[    0.000000]  MAX_ORDER 10 of order :1 has nr_free 4
[    0.000000]  MAX_ORDER 10 of order :2 has nr_free 5
[    0.000000]  MAX_ORDER 10 of order :3 has nr_free 4
[    0.000000]  MAX_ORDER 10 of order :4 has nr_free b
[    0.000000]  MAX_ORDER 10 of order :5 has nr_free 4
[    0.000000]  MAX_ORDER 10 of order :6 has nr_free 6
[    0.000000]  MAX_ORDER 10 of order :7 has nr_free 6
[    0.000000]  MAX_ORDER 10 of order :8 has nr_free 6
[    0.000000]  MAX_ORDER 10 of order :9 has nr_free 5
[    0.000000]  MAX_ORDER 10 of order :10 has nr_free 1a9
[    0.000000] ===show_zone_info :
                      name : DMA32
                      managed_pages:0
                      spanned_pages:0
                      present_pages:0
[    0.000000]  MAX_ORDER 10 of order :0 has nr_free 0
[    0.000000]  MAX_ORDER 10 of order :1 has nr_free 0
[    0.000000]  MAX_ORDER 10 of order :2 has nr_free 0
[    0.000000]  MAX_ORDER 10 of order :3 has nr_free 0
[    0.000000]  MAX_ORDER 10 of order :4 has nr_free 0
[    0.000000]  MAX_ORDER 10 of order :5 has nr_free 0
[    0.000000]  MAX_ORDER 10 of order :6 has nr_free 0
[    0.000000]  MAX_ORDER 10 of order :7 has nr_free 0
[    0.000000]  MAX_ORDER 10 of order :8 has nr_free 0
[    0.000000]  MAX_ORDER 10 of order :9 has nr_free 0
[    0.000000]  MAX_ORDER 10 of order :10 has nr_free 0
[    0.000000] ===show_zone_info :
                      name : Normal
                      managed_pages:758e73
                      spanned_pages:2680000
                      present_pages:780000
[    0.000000]  MAX_ORDER 10 of order :0 has nr_free 1
[    0.000000]  MAX_ORDER 10 of order :1 has nr_free 1
[    0.000000]  MAX_ORDER 10 of order :2 has nr_free 0
[    0.000000]  MAX_ORDER 10 of order :3 has nr_free 0
[    0.000000]  MAX_ORDER 10 of order :4 has nr_free 1
[    0.000000]  MAX_ORDER 10 of order :5 has nr_free 1
[    0.000000]  MAX_ORDER 10 of order :6 has nr_free 1
[    0.000000]  MAX_ORDER 10 of order :7 has nr_free 0
[    0.000000]  MAX_ORDER 10 of order :8 has nr_free 0
[    0.000000]  MAX_ORDER 10 of order :9 has nr_free 1
[    0.000000]  MAX_ORDER 10 of order :10 has nr_free 1d63
[    0.000000] ===show_zone_info :
                      name : Movable
                      managed_pages:0
                      spanned_pages:0
                      present_pages:0
[    0.000000]  MAX_ORDER 10 of order :0 has nr_free 0
[    0.000000]  MAX_ORDER 10 of order :1 has nr_free 0
[    0.000000]  MAX_ORDER 10 of order :2 has nr_free 0
[    0.000000]  MAX_ORDER 10 of order :3 has nr_free 0
[    0.000000]  MAX_ORDER 10 of order :4 has nr_free 0
[    0.000000]  MAX_ORDER 10 of order :5 has nr_free 0
[    0.000000]  MAX_ORDER 10 of order :6 has nr_free 0
[    0.000000]  MAX_ORDER 10 of order :7 has nr_free 0
[    0.000000]  MAX_ORDER 10 of order :8 has nr_free 0
[    0.000000]  MAX_ORDER 10 of order :9 has nr_free 0
[    0.000000]  MAX_ORDER 10 of order :10 has nr_free 0

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:/a/659286.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

IT人的拖延——别让“对失败的担忧”吓跑了“幸福感”

除了完美主义情结外,拖延的另一大重要原因是“对于失败的担忧”,当我们尝试没有把握的事,或者是曾经做这件事失败过,再次需要尝试时,因为对自我有“成功”的期望,自然就会担忧失败的可能性。比如&#xff0…

前端Vue自定义个性化导航栏菜单组件的设计与实现

摘要: 随着前端技术的飞速发展和业务场景的日益复杂,组件化开发已成为提升开发效率和降低维护成本的关键手段。本文将以Vue uni-app平台为例,介绍如何通过自定义导航栏菜单组件,实现业务逻辑与界面展示的解耦,以及如何…

基于 Coze 从 0-1 搭建专属 小白的Bot 机器人

基于 Coze 从 0-1 搭建专属 小白的Bot 机器人 ​ 作为一个GIS从业人员,对于AI的使用是必不可少的,在过去的一两年里各种大模型频出,AI技术已经成为GIS领域的一项重要工具,为我们提供了许多强大的功能和解决方案。看到好文章都在介…

在PyCharm中,不希望新建Python文件自动打开Python控制台

很久没更新水一下 第一步编辑配置 第二步编辑配置模板 第三步取消勾选 第四步确定

【贪心算法题记录】376. 摆动序列

题目链接 题目描述 如果连续数字之间的差严格地在正数和负数之间交替,则数字序列称为 摆动序列 。第一个差(如果存在的话)可能是正数或负数。仅有一个元素或者含两个不等元素的序列也视作摆动序列。 例如, [1, 7, 4, 9, 2, 5] …

【Qt】Qt框架文件处理精要:API解析与应用实例:QFile

文章目录 前言:1. Qt 文件概述2. 输入输出设备类3. 文件读写类3.1. 打开open3.2. 读read / readline/ readAll3.3. 写write3.4. 关闭close 4. 读写文件示例5. 文件件和目录信息类总结: 前言: 在现代软件开发中,文件操作是应用程序…

好消息!DolphinScheduler官网集成LLM模型问答AI kapa.ai

不少小伙伴可能发现了,Apache DolphinScheduler官网最近默默上线了kapa.ai作为LLM的问答AI。 集成kapa.ai之后,社区用户可以点击Apache DolphinScheduler官网首页右下角的「Ask AI」模块,在接下来弹出的问答框输入自己的问题,即可…

uniapp通过Canvas绘制网格(心电图,坐标纸等可用)

本篇文档是Canvas绘制心电图的第一个部分&#xff0c;想了解详情的可以关注后学习交流。 心电图的最底层需要一个网状底层&#xff0c;来方便进行数据的测量。 一、白底分大、中、小三个区域的网格 1、首先是HTML部分 <!DOCTYPE html> <html lang"en">…

睿联技术对亚马逊既依赖又竞争:递表前大额分红,资金充裕又补流?

《港湾商业观察》施子夫 王璐 今年3月29日&#xff0c;冲刺创业板IPO的深圳市睿联技术股份有限公司&#xff08;以下简称&#xff0c;睿联技术&#xff09;提交了注册&#xff0c;不出意外的话&#xff0c;公司离挂牌上市已经近在咫尺。 然而&#xff0c;在目前资本市场尤其…

HNU-计算机体系结构-期末复习

前言 这是新开的课程&#xff0c;故历年考题有限。2024年期末考试的情况像大默写。期末试卷回忆在这里&#xff1a; 计算机体系结构-2024期末考试-CSDN博客 不知道结果怎么样&#xff0c;希望别太对不起付出吧。 资源推荐 本着不重复造轮子的原则&#xff0c;这里推荐学长以…

大模型培训 AUTOWEBGLM:自动网页导航智能体

大语言模型&#xff08;LLMs&#xff09;在智能代理任务中发挥着重要作用&#xff0c;尤其是在网络导航方面。然而&#xff0c;现有的代理在真实世界的网页上表现不佳&#xff0c;主要原因网络导航代理面临着三大挑战&#xff1a;网页上行动的多样性、HTML文本的处理限制以及开…

127.0.0.1 和 localhost 以及 0.0.0.0 区别

之前用 nginx 的时候&#xff0c;发现用这几个 IP&#xff0c;都能正常访问到 nginx 的欢迎网页。一度认为这几个 IP 都是一样的。 但本质上还是有些区别的。 首先 localhost 就不叫 IP&#xff0c;它是一个域名&#xff0c;就跟 "baidu.com",是一个形式的东西&…

开放式耳机推荐品牌:五款品质超凡机型必须选购

在这个快节奏的生活中&#xff0c;我们每个人都渴望在忙碌之余找到一片属于自己的宁静。音乐&#xff0c;作为连接心灵的桥梁&#xff0c;无疑是最为直接和有效的途径。而一款优秀的开放式耳机&#xff0c;不仅能让我们沉浸在美妙的旋律中&#xff0c;还能在保持对外界环境感知…

汇编原理(三)编程

源程序&#xff1a; 汇编指令&#xff1a;有对应的机器码与其对应 伪指令&#xff1a;无对应的机器码&#xff0c;是由编译器来执行的指令&#xff0c;编译器根据伪指令来进行相关的编译工作。 ex1:XXX segment、XXX ends这两个是一对成对使用的伪指令&#xff0c;且必须会被用…

HNU-计算机体系结构-实验3-缓存一致性

计算机体系结构 实验3 计科210X 甘晴void 202108010XXX 文章目录 计算机体系结构 实验31 实验目的2 实验过程2.0 预备知识2.0.1 多cache一致性算法——监听法2.0.1.1 MSI协议2.0.1.2 MESI协议2.0.1.3 本题讲解 2.0.2 多cache一致性算法——目录法2.0.2.1 有中心的目录法2.0.2…

摸鱼大数据——Hive表操作——复杂类型

1、hvie的SerDe机制 其中ROW FORMAT是语法关键字&#xff0c;DELIMITED和SERDE二选其一。本次我们主要学习DELIMITED关键字相关知识点 如果使用delimited: 表示底层默认使用的Serde类:LazySimpleSerDe类来处理数据。 如果使用serde:表示指定其他的Serde类来处理数据,支持用户自…

无需安装的在线PS:打开即用

为什么想用在线PS网页版&#xff1f;Photoshop常用于平面设计&#xff0c;是不少设计师接触过的第一款设计软件。作为一款平面设计工具&#xff0c;ps功能太多&#xff0c;并且没有在线版&#xff0c;这不仅需要设计师花费时间学习软件&#xff0c;还需要设计师具备一定的设计能…

Ant Design 动态增减form表单,第二三项根据第一项选中内容动态展示内容

效果图&#xff1a; 选中第一项下拉框&#xff0c;第二第三项展示 点击添加条件&#xff0c;第二条仍然只展示第一项select框 后端返回数据格式&#xff1a; ruleList:[{name:通话时长,key:TALK_TIME,type&#xff1a;’INT‘,unitName:秒,operaObj:[{name:>,value:>…

[JAVASE] String类 StringBuffer类 StringBuilder类

目录 一.String类 1.1 String字符串不可变的原因 1.2 字符串中的比较方法 1.2.1 equals 1.2.2 compareTo 与 compareToIgnoreCase 1.3 字符串中的查找方法 1.3.1 charAt 1.3.2 indexOf 与 lastIndexOf 1.4 字符串中的转换方法 1.4.1 valueOf 1.4.2 toUpperCase 与 to…

msi安装mysql8 启动失败,提示只有在任务处于完成状态(RanToCompletion、Faulted 或 Canceled)时才能释放它。

解决方案: 1.打开服务,找到安装的mysql 2. 右击&#xff0c;打开属性&#xff0c;进入【登录】选项卡&#xff0c;选择本地系统账户。 3. 点击确定-->应用 4.服务中选择开始服务 5.服务启动成功后,在安装步骤中继续点击执行