加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Linux > 正文

Linux – 识别拥有物理内存中特定地址的进程

发布时间:2020-12-14 01:24:37 所属栏目:Linux 来源:网络整理
导读:在 Linux下,如何判断具体进程拥有/正在使用物理内存中的给定地址? 我知道这可能需要编写一个内核模块来访问一些内核数据结构并将结果返回给用户 – 我需要知道它是如何完成的,无论它有多复杂. 解决方法 进程使用的页面及其在物理内存中的位置不是静态信息.
在 Linux下,如何判断具体进程拥有/正在使用物理内存中的给定地址?

我知道这可能需要编写一个内核模块来访问一些内核数据结构并将结果返回给用户 – 我需要知道它是如何完成的,无论它有多复杂.

解决方法

进程使用的页面及其在物理内存中的位置不是静态信息.但是,您寻找的信息应该在 page tables.一个 change进入内核,可能几乎正是您正在寻找的内容:

author  Arjan van de Ven <arjan@linux.intel.com>    2008-04-17 15:40:45 (GMT) 
committer   Ingo Molnar <mingo@elte.hu>                 2008-04-17 15:40:45 (GMT)
commit  926e5392ba8a388ae32ca0d2714cc2c73945c609 (patch)
tree    2718b50b8b66a3614f47d3246b080ee8511b299e
parent  2596e0fae094be9354b29ddb17e6326a18012e8c (diff) 

x86: add code to dump the (kernel) page tables for visual inspection by kernel developers 

This patch adds code to the kernel to have an (optional)
/proc/kernel_page_tables debug file that basically dumps the kernel
pagetables; this allows us kernel developers to verify that nothing
fishy is going on and that the various mappings are set up correctly.
This was quite useful in finding various change_page_attr() bugs,and
is very likely to be useful in the future as well. 

Signed-off-by:Arjan van de Ven <arjan@linux.intel.com> 
Cc: mingo@elte.hu 
Cc: tglx@tglx.de 
Cc: hpa@zytor.com 
Signed-off-by: Ingo Molnar <mingo@elte.hu> 
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

添加的功能由新的配置选项(X86_PTDUMP)启用.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读