402 Star 1.4K Fork 1.3K

GVPopenEuler / kernel

 / 详情

add memmap interface to reserved memory 特性同步: openEuler-1.0=LTS 到OLK-5.10

已完成
任务
创建于  
2021-12-24 14:18

add memmap interface to reserved memory 特性同步:openEuler-1.0=LTS 到OLK-5.10。
经分析,该特性仍有使用,需同步。考虑到预留内存的兼容性,对原始补丁需进行适当重构。

评论 (5)

pengliustd 创建了任务

Hi pengliustd, welcome to the openEuler Community.
I'm the Bot here serving you. You can find the instructions on how to interact with me at Here.
If you have any questions, please contact the SIG: Kernel, and any of the maintainers: @成坚 (CHENG Jian) , @Qiuuuuu , @zhengzengkai , @gogooo , @pi3orama , @Xie XiuQi , @YangYingliang

openeuler-ci-bot 添加了
 
sig/Kernel
标签

使用memblock_alloc(size, 0) 代替alloc_bootmem(size)
commit 2a5bda5a624d6471d25e953b9adba5182ab1b51f
Author: Mike Rapoport rppt@linux.vnet.ibm.com
Date: Tue Oct 30 15:09:09 2018 -0700

memblock: replace alloc_bootmem with memblock_alloc

The alloc_bootmem(size) is a shortcut for allocation of SMP_CACHE_BYTES
aligned memory. When the align parameter of memblock_alloc() is 0, the
alignment is implicitly set to SMP_CACHE_BYTES and thus alloc_bootmem(size)
and memblock_alloc(size, 0) are equivalent.

The conversion is done using the following semantic patch:

@@
expression size;
@@
- alloc_bootmem(size)
+ memblock_alloc(size, 0)

验证:
1.环境:
qemu 虚拟机,arm64,cmdline: memblock=debug memmap=1m$0x50000000
2.期望结果:
dmesg可以看到0x50000000处预留了1M内存。
3.实际结果:
输入图片说明
左侧未添加memmap=1m$0x50000000, 右侧添加了memmap=1m$0x50000000,表明添加memmap=1m$0x50000000后预留内存成功。
符合预期

增加功能
限制内核使用的内存区域
用法: memmap=exactmap memmap=1G@1G
含义:限制内核使用第2G的内存
下图中正好可以看到内核内存限制在第2G,符合预期。

输入图片说明

诚邀Issue的创建人,负责人,协作人以及评论人对此次Issue解决过程给予评价:

   0   1   2   3   4   5   6   7   8   9   10  

 不满意                        非常满意

登录 后才可以发表评论

状态
负责人
项目
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
预计工期 (小时)
参与者(3)
5329419 openeuler ci bot 1632792936 9968373 openeuler survey bot 1637036855
C
1
https://gitee.com/openeuler/kernel.git
git@gitee.com:openeuler/kernel.git
openeuler
kernel
kernel

搜索帮助