函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\ksm.c Create Date:2022-07-27 17:14:16
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:ry_to_merge_one_page - take two pages and merge them into one*@vma: the vma that holds the pte pointing to page*@page: the PageAnon page that we want to replace with kpage*@kpage: the PageKsm page that we want to map instead of page,

函数原型:static int try_to_merge_one_page(struct vm_area_struct *vma, struct page *page, struct page *kpage)

返回类型:int

参数:

类型参数名称
struct vm_area_struct *vma
struct page *page
struct page *kpage
1204  orig_pte等于__pte(0)
1205  err等于负EFAULT
1207  如果page恒等于kpage则返回:0
1210  如果非PageAnon(page)则转到:out
1220  如果非Return true if the page was successfully locked则转到:out
1223  如果PageTransCompound returns true for both transparent huge pages* and hugetlbfs pages, so it should only be called when it's known* that hugetlbfs pages aren't involved.
1224  如果split_huge_page(page)则转到:out_unlock
1234  如果write_protect_page(vma, page, & orig_pte)恒等于0则
1235  如果非kpage
1241  set_page_stable_node(page, NULL)
1247  如果非PageDirty(page)则SetPageDirty(page)
1249  err等于0
1250  否则如果pages_identical(page, kpage)则err等于place_page - replace page in vma by new ksm page*@vma: vma that holds the pte pointing to page*@page: the page we are replacing by kpage*@kpage: the ksm page we replace page by*@orig_pte: the original value of the pte
1254  如果Flags, see mm.h. 按位与VM_LOCKEDkpage且非err
1255  munlock_vma_page - munlock a vma page*@page: page to be unlocked, either a normal page or THP page head* returns the size of the page as a page mask (0 for normal page,* HPAGE_PMD_NR - 1 for THP head page)
1256  如果非PageMlocked(kpage)则
1260  page等于kpage
1264  out_unlock :
1265  lock_page - unlock a locked page*@page: the page* Unlocks the page and wakes up sleepers in ___wait_on_page_locked().* Also wakes sleepers in wait_on_page_writeback() because the wakeup* mechanism between PageLocked pages and PageWriteback pages is shared.
1266  out :
1267  返回:err
调用者
名称描述
try_to_merge_with_ksm_pagery_to_merge_with_ksm_page - like try_to_merge_two_pages,* but no new kernel page is allocated: kpage must already be a ksm page.* This function returns 0 if the pages were merged, -EFAULT otherwise.
cmp_and_merge_pagemp_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