Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\ksm.c Create Date:2022-07-28 15:41:49
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:ksm_madvise

Proto:int ksm_madvise(struct vm_area_struct *vma, unsigned long start, unsigned long end, int advice, unsigned long *vm_flags)

Type:int

Parameter:

TypeParameterName
struct vm_area_struct *vma
unsigned longstart
unsigned longend
intadvice
unsigned long *vm_flags
2431  mm = The address space we belong to.
2435  Case advice == KSM may merge identical pages
2439  If vm_flags & ( KSM may merge identical pages | VM_SHARED | VM_MAYSHARE | Page-ranges managed without "struct page", just pure PFN | Memory mapped I/O or similar | Cannot expand with mremap() | Huge TLB Page VM | Can contain "struct page" and pure PFN pages ) Then Return 0
2444  If vma_is_dax(vma) Then Return 0
2457  err = __ksm_enter(mm)
2458  If err Then Return err
2462  vm_flags |= KSM may merge identical pages
2463  Break
2465  Case advice == KSM may not merge identical pages
2466  If Not (vm_flags & KSM may merge identical pages ) Then Return 0
2471  If err Then Return err
2475  vm_flags &= ~KSM may merge identical pages
2476  Break
2479  Return 0
Caller
NameDescribe
madvise_behaviorWe can potentially split a vm area into separate* areas, each area with its own behavior.