内核的写入模块(Linux),用于保存从删除到交换的过程页面 [英] Write module of kernel (Linux), which to save the page of process from removing to the swap

查看:88
本文介绍了内核的写入模块(Linux),用于保存从删除到交换的过程页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

需要保存进程页面(用户部分!)以免将其删除到交换中.

Need to save the page of process (the user part!) from removing to the swap.

我只需要在内核中执行此操作. (我知道的语言C)

I need to do it in the kernel, only. (language C I know)

(也许在hook_page_list中插入钩子?)

(Maybe insert hook in shrink_page_list?)

我有进程ID,这些ID需要保存并限制系统中的物理内存量(我们填充,而未填充). ID和阈值写入/proc,/dev或/sys.

I have IDs of processes, which need to save and threshold amount of physical memory in the system (We fill, while it isn't filled). IDs and threshold write in /proc, /dev or /sys.

该如何处理?

要查看哪些文件?

要阅读哪些教程?

也许有些例子与此任务相关.

Maybe there are examples that are somehow are related with this task.

信息:我正在编译Debian Lenny的内核,使用Qemu在我的Ubuntu上启动它.

Info: I compilling kernel of Debian Lenny, use Qemu for start it on my Ubuntu.

推荐答案

请参阅get_user_pages. http://www.makelinux.net/ldd3/chp-15-sect-3 .

See get_user_pages. http://www.makelinux.net/ldd3/chp-15-sect-3.

使用get_user_pages,您可以获取所需的任何页面并将其锁定在内存中.

Use get_user_pages, you can get whatever page you want and keep it locked in memory.

更好的是,查看以下来源的评论 http://lxr.free-electrons.com/source/mm/gup .c#L637

Even better, look at the comments on the source at http://lxr.free-electrons.com/source/mm/gup.c#L637

这篇关于内核的写入模块(Linux),用于保存从删除到交换的过程页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆