函数逻辑报告 |
Source Code:mm\swapfile.c |
Create Date:2022-07-27 16:47:27 |
Last Modify:2020-03-17 22:19:49 | Copyright©Brick |
首页 | 函数Tree |
注解内核,赢得工具 | 下载SCCT | English |
函数名称:scan_swap_map_slots
函数原型:static int scan_swap_map_slots(struct swap_info_struct *si, unsigned char usage, int nr, swp_entry_t slots[])
返回类型:int
参数:
类型 | 参数 | 名称 |
---|---|---|
struct swap_info_struct * | si | |
unsigned char | usage | |
int | nr | |
swp_entry_t | slots |
739 | last_in_cluster等于0 |
741 | n_ret等于0 |
743 | 如果nr大于SWAP_BATCH则nr等于SWAP_BATCH |
761 | 如果cluster info. Only for SSD 则 |
762 | 如果Try to get a swap entry from current cpu's swap entry pool (a cluster). This* might involve allocating a new cluster for current CPU too.则转到:checks |
764 | 否则转到:scan |
768 | 如果此条件成立可能性小(为编译器优化)(!countdown to next cluster search --)则 |
771 | 转到:checks |
774 | 自旋锁解锁 |
789 | 否则如果offset恒等于last_in_cluster则 |
796 | 如果此条件成立可能性小(为编译器优化)(--latency_ration < 0)则 |
797 | cond_resched() |
803 | 加自旋锁 |
807 | checks : |
808 | 如果cluster info. Only for SSD 则 |
818 | 如果非SWP_USED etc: see above 按位与SWP_WRITEOK的值则转到:no_page |
820 | 如果非dex of last free in swap_map 则转到:no_page |
825 | ci等于lock_cluster(si, offset) |
839 | 如果vmalloc'ed array of usage counts [offset]则 |
848 | unlock_cluster(ci) |
850 | swap_range_alloc(si, offset, 1) |
855 | 如果n_ret恒等于nr或offset大于等于dex of last free in swap_map 则转到:done |
861 | 如果此条件成立可能性小(为编译器优化)(--latency_ration < 0)则 |
871 | 如果cluster info. Only for SSD 则 |
872 | 如果Try to get a swap entry from current cpu's swap entry pool (a cluster). This* might involve allocating a new cluster for current CPU too.则转到:checks |
874 | 否则转到:done |
878 | offset先自加 |
882 | countdown to next cluster search 先自减 |
883 | 转到:checks |
886 | done : |
888 | 返回:n_ret |
890 | scan : |
891 | 自旋锁解锁 |
892 | 当offset先自加小于等于dex of last free in swap_map 循环 |
893 | 如果非vmalloc'ed array of usage counts [offset]则 |
901 | 如果此条件成立可能性小(为编译器优化)(--latency_ration < 0)则 |
902 | cond_resched() |
908 | 如果非vmalloc'ed array of usage counts [offset]则 |
916 | 如果此条件成立可能性小(为编译器优化)(--latency_ration < 0)则 |
917 | cond_resched() |
920 | offset自加 |
922 | 加自旋锁 |
924 | no_page : |
926 | 返回:n_ret |
名称 | 描述 |
---|---|
scan_swap_map | |
get_swap_pages |
源代码转换工具 开放的插件接口 | X |
---|---|
支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |