Linux桌面环境下内存去重技术的研究与实现(中英文摘要)

Linux桌面环境下内存去重技术的研究与实现

在这里可以下载原稿 www.ykyi.net/upload/Research_and_Implementation_of_Memory_Deduplication_in_the_Linux_Desktop_Environment.pdf

论文题目: Linux桌面环境下内存去重技术的研究与实现

专业:软件工程

硕士生:周霄

指导教师:王常吉

摘  要

内存管理是操作系统中至关重要的部分。优秀的操作系统高效地管理有限的内存资源。Linux内核的内核同页合并(KSM)模块是在虚拟化兴起后为节省虚拟机使用的内存而发展的一种节约内存的技术。KSM通过合并相同内容页面的方式显著地降低了多个基于内核虚拟机(KVM)技术的虚拟机同时运行时系统使用的内存。实际上,KSM也能合并一般应用程序中的相同内容页面。但一般应用程序为了使用KSM技术合并内存,需要在源代码级别显式地调用相应的系统调用来告知KSM需要扫描的内存区域。对于一般用户来说,需要修改应用程序的源代码显然是一个太高的门槛。

本论文在认真研究了KSM模块的实现的基础上,增强了KSM的功能。新设计实现的KSM+使得用户可以不必修改应用程序的源代码就能利用KSM+合并相同内容的内存页面。另外原来的KSM算法依赖程序指定的内存区域有大量的重复内存页面,而实际上,一般应用程序并没有大量的重复内存。在重复内存非常少的情况下,对这些程序应用KSM技术非但不能降低内存使用,而且因为运行KSM本身所需内存而增加了内存开销。本论文针对这一点在KSM的算法上做了改进,减少了运行KSM+算法本身所消耗的内存。然后论文用Linux桌面下的常用应用程序验证了KSM+的实际效果,并构造了一个实验比较了KSM和KSM+。最后,为了了解应用程序的重复内存页面的特点,还编写了专门统计重复页面的内核模块,发现应用程序的重复页面的一些规律,为持续改进KSM+提供了依据。

 

关键词:KSM,重复内存合并 ,内存管理

 

 

Title: Research and Implementation of Memory Deduplication in The Linux Desktop Environment

Major: Software Engineering

Name: Zhou Xiao

Supervisor: Wang Changji

Abstract

Memory management is one of the most important parts of the operating system. KSM (Kernel Samepage Merging) in Linux kernel is a kind of memory saving technology developed after the emerging of virtual machine. KSM can dramatically decrease the memory usage of the hypervisor running several virtual machines. Actually, KSM can also be applied to normal applications. But in order to use the KSM, application must explicitly evoke a system call in source code level to tell KSM the memory area where the KSM will scan. To normal users, modifying the source code is impossible at most of the time.

Base on the full grasp of the implementation of KSM, a new implementation named KSM+ is created, which allows users to merge same-content pages on the specified applications without modifying corresponding source code. Moreover, the original KSM algorithm relies heavily on the specified area is rich in same-content pages, while normal applications have much less same-content pages compared to virtual machines. So, when KSM is applied to those applications, it is possible that memory usage will rise rather than decrease. To combat with this situation, KSM+ employs a new algorithm to decrease the memory usage for running itself. Several experiments prove that the KSM+ can be easily applied to specified applications and memory usage can be reduced. And a case is designed to compare the effect between KSM and KSM+, which shows KSM+ behaves better in deduplication when the same-content pages’ density is very low. At last, in order to inspect the characteristics of same-content pages from normal desktop applications, an ad-hoc kernel module is developed to do the statistics which supplies significant data for the further development of KSM+.

Key Words KSM, Deduplication, Memory Management

copyright ykyi.net