Function report |
Source Code:mm\madvise.c |
Create Date:2022-07-28 15:11:58 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:We can potentially split a vm area into separate* areas, each area with its own behavior.
Proto:static long madvise_behavior(struct vm_area_struct *vma, struct vm_area_struct **prev, unsigned long start, unsigned long end, int behavior)
Type:long
Parameter:
Type | Parameter | Name |
---|---|---|
struct vm_area_struct * | vma | |
struct vm_area_struct ** | prev | |
unsigned long | start | |
unsigned long | end | |
int | behavior |
70 | error = 0 |
75 | Case behavior == further special treatment |
76 | new_flags = new_flags & ~App will not benefit from clustered reads & ~App will access data sequentially |
77 | Break |
78 | Case behavior == xpect sequential page references |
79 | new_flags = new_flags & ~App will not benefit from clustered reads | App will access data sequentially |
80 | Break |
81 | Case behavior == xpect random page references |
82 | new_flags = new_flags & ~App will access data sequentially | App will not benefit from clustered reads |
83 | Break |
84 | Case behavior == don't inherit across fork |
86 | Break |
87 | Case behavior == do inherit across fork |
88 | If Flags, see mm.h. & Memory mapped I/O or similar Then |
93 | Break |
94 | Case behavior == Zero memory on fork, child only |
96 | If File we map to (can be NULL). || Flags, see mm.h. & VM_SHARED Then |
101 | Break |
102 | Case behavior == Undo MADV_WIPEONFORK |
103 | new_flags &= ~Wipe VMA contents in child. |
104 | Break |
107 | Break |
108 | Case behavior == Clear the MADV_DONTDUMP flag |
114 | Break |
115 | Case behavior == KSM may merge identical pages |
116 | Case behavior == KSM may not merge identical pages |
118 | If error Then Go to out_convert_errno |
120 | Break |
121 | Case behavior == Worth backing with hugepages |
122 | Case behavior == Not worth backing with hugepages |
123 | error = hugepage_madvise(vma, & new_flags, behavior) |
124 | If error Then Go to out_convert_errno |
126 | Break |
129 | If new_flags == Flags, see mm.h. Then |
134 | pgoff = Offset (within vm_file) in PAGE_SIZEunits + ( start - Our start address within vm_mm. >> PAGE_SHIFT determines the page size ) |
135 | prev = Given a mapping request (addr,end,vm_flags,file,pgoff), figure out* whether that can be merged with its predecessor or its successor |
138 | If prev Then |
145 | If start != Our start address within vm_mm. Then |
150 | error = __split_vma() bypasses sysctl_max_map_count checking. We use this where it* has already been checked or doesn't make sense to fail. |
151 | If error Then Go to out_convert_errno |
155 | If end != The first byte after our end addresswithin vm_mm. Then |
160 | error = __split_vma() bypasses sysctl_max_map_count checking. We use this where it* has already been checked or doesn't make sense to fail. |
161 | If error Then Go to out_convert_errno |
165 | success : |
169 | Flags, see mm.h. = new_flags |
171 | out_convert_errno : |
178 | out : |
179 | Return error |
Name | Describe |
---|---|
madvise_vma |
Source code conversion tool public plug-in interface | X |
---|---|
Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |