Function report |
Source Code:mm\swapfile.c |
Create Date:2022-07-28 15:18:36 |
Last Modify:2020-03-17 22:19:49 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:If the boolean frontswap is true, only unuse pages_to_unuse pages;* pages_to_unuse==0 means all pages; ignored if frontswap is false
Proto:int try_to_unuse(unsigned int type, bool frontswap, unsigned long pages_to_unuse)
Type:int
Parameter:
Type | Parameter | Name |
---|---|---|
unsigned int | type | |
bool | frontswap | |
unsigned long | pages_to_unuse |
2129 | retval = 0 |
2135 | If Not umber of those currently in use Then Return 0 |
2138 | If Not frontswap Then pages_to_unuse = 0 |
2141 | retry : |
2142 | retval = shmem_unuse(type, frontswap, & pages_to_unuse) |
2146 | prev_mm = For dynamically allocated mm_structs, there is a dynamically sized cpumask* at the end of the structure, the size of which depends on the maximum CPU* number the system can see |
2149 | spin_lock( & mmlist_lock) |
2150 | p = List of maybe swapped mm's. These * are globally strung together off * init_mm.mmlist, and are protected * by mmlist_lock |
2156 | If Not mmget_not_zero(mm) Then Continue |
2158 | spin_unlock( & mmlist_lock) |
2163 | If retval Then |
2165 | Go to out |
2172 | cond_resched() |
2173 | spin_lock( & mmlist_lock) |
2175 | spin_unlock( & mmlist_lock) |
2179 | i = 0 |
2186 | If Not page Then Continue |
2206 | If pages_to_unuse && --pages_to_unuse == 0 Then Go to out |
2222 | If umber of those currently in use Then |
2223 | If Not signal_pending(current process) Then Go to retry |
2227 | out : |
2228 | Return If retval == Return code to denote that requested number of* frontswap pages are unused(moved to page cache).* Used in in shmem_unuse and try_to_unuse. Then 0 Else retval |
Name | Describe |
---|---|
SYSCALL_DEFINE1 | |
frontswap_shrink | Frontswap, like a true swap device, may unnecessarily retain pages* under certain circumstances; "shrink" frontswap is essentially a* "partial swapoff" and works by calling try_to_unuse to attempt to* unuse enough frontswap pages to attempt to -- subject |
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 |