Skip to the content.

KSM

kernel doc1 中间说明了如何使用,首先阅读的内容。

TODO

scan_get_next_rmap_item 获取一个合适的匿名页面。

cmp_and_merge_page 让页面在 KSM 中稳定和不稳定的两颗红黑树中间查找是否存在合并的对象。

rmap_item 代表一个页面

notes

/*
 * cmp_and_merge_page - first see if page can be merged into the stable tree;
 * if not, compare checksum to previous and if it's the same, see if page can
 * be inserted into the unstable tree, or merged with a page already there and
 * both transferred to the stable tree.
 *
 * @page: the page that we are searching identical page to.
 * @rmap_item: the reverse mapping into the virtual address of this page
 */
static void cmp_and_merge_page(struct page *page, struct rmap_item *rmap_item)

读读代码

从 rmap 中看到的

  1. ksm 和 ksm 页反向映射
    • 相关数据结构体介绍
    • ksm 机制剖析(上)
    • ksm 机制剖析(下)
    • 反向映射查找 ksm 页 pte
    • ksm 实践

本站所有文章转发 CSDN 将按侵权追究法律责任,其它情况随意。

  1. kernel doc : Kernel Samepage Merging