函数逻辑报告 |
Source Code:mm\swapfile.c |
Create Date:2022-07-27 16:47:41 |
Last Modify:2020-03-17 22:19:49 | Copyright©Brick |
首页 | 函数Tree |
注解内核,赢得工具 | 下载SCCT | English |
函数名称:get_swap_pages
函数原型:int get_swap_pages(int n_goal, swp_entry_t swp_entries[], int entry_size)
返回类型:int
参数:
类型 | 参数 | 名称 |
---|---|---|
int | n_goal | |
swp_entry_t | swp_entries | |
int | entry_size |
994 | size等于Define swap_entry_size() as constant to let compiler to optimize* out some code if !CONFIG_THP_SWAP(entry_size) |
997 | n_ret等于0 |
1001 | WARN_ON_ONCE(n_goal > 1 && size == SWAPFILE_CLUSTER) |
1003 | avail_pgs等于atomic_long_read( & nr_swap_pages)除size |
1007 | 如果n_goal大于SWAP_BATCH则n_goal等于SWAP_BATCH |
1013 | atomic_long_sub(n_goal * size, & nr_swap_pages) |
1015 | 加自旋锁 |
1017 | start_over : |
1022 | 自旋锁解锁 |
1023 | 加自旋锁 |
1024 | 如果非dex of last free in swap_map 或非SWP_USED etc: see above 按位与SWP_WRITEOK的值则 |
1025 | 加自旋锁 |
1026 | 如果节点不在链表上则 |
1030 | WARN(!dex of last free in swap_map , "swap_info %d in list but !highest_bit\n", strange name for an index ) |
1033 | WARN(!(SWP_USED etc: see above & SWP_WRITEOK), "swap_info %d in list but !SWP_WRITEOK\n", strange name for an index ) |
1036 | __del_from_avail_list(si) |
1037 | 自旋锁解锁 |
1038 | 转到:nextsi |
1040 | 如果size恒等于SWAPFILE_CLUSTER则 |
1041 | 如果非SWP_USED etc: see above 按位与SWP_FS的值则n_ret等于swap_alloc_cluster(si, swp_entries) |
1046 | 自旋锁解锁 |
1047 | 如果n_ret或size恒等于SWAPFILE_CLUSTER则转到:check_out |
1049 | pr_debug("scan_swap_map of si %d failed to find offset\n", strange name for an index ) |
1052 | 加自旋锁 |
1053 | nextsi : |
1065 | 如果节点不在链表上则转到:start_over |
1069 | 自旋锁解锁 |
1071 | check_out : |
1072 | 如果n_ret小于n_goal则atomic_long_add((long)(n_goal - n_ret) * size, & nr_swap_pages) |
1075 | noswap : |
1076 | 返回:n_ret |
名称 | 描述 |
---|---|
refill_swap_slots_cache | alled with swap slot cache's alloc lock held |
get_swap_page |
源代码转换工具 开放的插件接口 | X |
---|---|
支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |