函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:We use break_ksm to break COW on a ksm page: it's a stripped down* if (get_user_pages(addr, 1, 1, 1, &page, NULL) == 1)* put_page(page);* but taking great care only to touch a ksm page, in a VM_MERGEABLE vma,

函数原型:static int break_ksm(struct vm_area_struct *vma, unsigned long addr)

返回类型:int

参数:

类型参数名称
struct vm_area_struct *vma
unsigned longaddr
473  ret等于0
475  循环
476  cond_resched()
477  page等于follow_page(vma, addr, do get_page on page | wait for page to replace migration entry | we are working on non-current tsk/mm )
479  如果是错误或空退出
481  如果A KSM page is one of those write-protected "shared pages" or "merged pages"* which KSM maps into multiple mms, wherever identical anonymous page content* is found in VM_MERGEABLE vmas. It's a PageAnon page, pointing not to anyret等于By the time we get here, we already hold the mm semaphore* The mmap_sem may have been released depending on flags and our* return value. See filemap_fault() and __lock_page_or_retry().
484  否则ret等于VM_FAULT_WRITE
486  Perform a free_page(), also freeing any swap cache associated with* this page if it is the last user of the page.
487  当非ret按位与VM_FAULT_WRITE按位或VM_FAULT_SIGBUS按位或VM_FAULT_SIGSEGV按位或VM_FAULT_OOM的值的值循环
516  返回:如果ret按位与VM_FAULT_OOM则负ENOMEM否则0
调用者
名称描述
break_cow
unmerge_ksm_pagesThough it's very tempting to unmerge rmap_items from stable tree rather* than check every pte of a given vma, the locking doesn't quite work for* that - an rmap_item is assigned to the stable tree after inserting ksm* page and upping mmap_sem