函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:ksm_might_need_to_copy

函数原型:struct page *ksm_might_need_to_copy(struct page *page, struct vm_area_struct *vma, unsigned long address)

返回类型:struct page

参数:

类型参数名称
struct page *page
struct vm_area_struct *vma
unsigned longaddress
2563  anon_vma等于page_anon_vma(page)
2566  如果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 any
2567  如果page_stable_node(page)且非ksm_run按位与KSM_RUN_UNMERGE的值则返回:page
2570  否则如果非anon_vma
2571  返回:page
2572  否则如果Root of this anon_vma tree 恒等于root Our offset within mapping. 恒等于linear_page_index(vma, address)则
2574  返回:page
2576  如果非PageUptodate(page)则返回:page
2579  new_page等于alloc_page_vma(GFP_HIGHUSER_MOVABLE, vma, address)
2580  如果new_page
2581  copy_user_highpage(new_page, page, address, vma)
2583  SetPageDirty(new_page)
2584  __SetPageUptodate(new_page)
2585  __SetPageLocked(new_page)
2588  返回:new_page
调用者
名称描述
unuse_pteNo need to decide whether this PTE shares the swap entry with others,* just let do_wp_page work it out if a write is requested later - to* force COW, vm_page_prot omits write permission from any private vma.
do_swap_pageWe enter with non-exclusive mmap_sem (to exclude vma changes,* but allow concurrent faults), and pte mapped but not yet locked.* We return with pte unmapped and unlocked.* We return with the mmap_sem locked or unlocked in the same cases