Function report |
Source Code:mm\swapfile.c |
Create Date:2022-07-28 15:17:38 |
Last Modify:2020-03-17 22:19:49 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:Called after dropping swapcache to decrease refcnt to swap entries.
Proto:void put_swap_page(struct page *page, swp_entry_t entry)
Type:void
Parameter:
Type | Parameter | Name |
---|---|---|
struct page * | page | |
swp_entry_t | entry |
1327 | offset = Extract the `offset' field from a swp_entry_t. The swp_entry_t is in* arch-independent format |
1328 | idx = offset / SWAPFILE_CLUSTER |
1332 | free_entries = 0 |
1334 | size = Define swap_entry_size() as constant to let compiler to optimize* out some code if !CONFIG_THP_SWAP(hpage_nr_pages(page)) |
1336 | si = _swap_info_get(entry) |
1337 | If Not si Then Return |
1340 | ci = Determine the locking method in use for this device. Return* swap_cluster_info if SSD-style cluster-based locking is in place. |
1341 | If size == SWAPFILE_CLUSTER Then |
1342 | VM_BUG_ON(!cluster_is_huge(ci)) |
1343 | map = vmalloc'ed array of usage counts + offset |
1344 | When i < SWAPFILE_CLUSTER cycle |
1346 | VM_BUG_ON(!(val & Flag page is cached, in first swap_map )) |
1347 | If val == Flag page is cached, in first swap_map Then free_entries++ |
1350 | cluster_clear_huge(ci) |
1351 | If free_entries == SWAPFILE_CLUSTER Then |
1352 | unlock_cluster_or_swap_info(si, ci) |
1355 | swap_free_cluster(si, idx) |
1357 | Return |
1361 | If Not __swap_entry_free_locked(si, offset + i, Flag page is cached, in first swap_map ) Then |
1362 | unlock_cluster_or_swap_info(si, ci) |
1363 | free_swap_slot(entry) |
1369 | unlock_cluster_or_swap_info(si, ci) |
Name | Describe |
---|---|
add_to_swap | add_to_swap - allocate swap space for a page*@page: page we want to move to swap* Allocate swap space for the page and add the page to the* swap cache. Caller needs to hold the page lock. |
delete_from_swap_cache | This must be called only on pages that have* been verified to be in the swap cache and locked.* It will never put the page into the free list,* the caller has a reference on the page. |
__read_swap_cache_async | |
get_swap_page |
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 |