函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\ksm.c Create Date:2022-07-27 17:15:13
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:scan_get_next_rmap_item

函数原型:static struct rmap_item *scan_get_next_rmap_item(struct page **page)

返回类型:struct rmap_item

参数:

类型参数名称
struct page **page
2224  如果链表为空则返回:NULL
2227  slot等于mm_slot
2228  如果slot恒等于ksm_mm_head
2239  lru_add_drain_all()
2257  cond_resched()
2261 nid小于ksm_nr_node_ids循环root_unstable_tree[nid] =
2264  加自旋锁
2265  slot等于list_entry - get the struct for this entry*@ptr: the &struct list_head pointer.*@type: the type of the struct this is embedded in.*@member: the name of the list_head within the struct.(链表后项, structmm_slot, mm_list)
2266  mm_slot等于slot
2267  自旋锁解锁
2272  如果slot恒等于ksm_mm_head则返回:NULL
2274  next_mm :
2275  address等于0
2276  rmap_list等于rmap_list
2279  mm等于mm
2280  lock for reading
2281  如果ksmd, and unmerge_and_remove_all_rmap_items(), must not touch an mm's* page tables after it has passed through ksm_exit() - which, if necessary,* takes mmap_sem briefly to serialize against them. ksm_exit() does not setvma = NULL
2283  否则vma等于Look up the first VMA which satisfies addr < vm_end, NULL if none.
2286 vma循环
2287  如果非Flags, see mm.h. 按位与KSM may merge identical pages 的值则继续下一循环
2289  如果address小于Our start address within vm_mm. address等于Our start address within vm_mm.
2291  如果非Serialized by page_table_lock address等于The first byte after our end addresswithin vm_mm.
2298  如果是错误或空
2299  address加等于PAGE_SIZE
2300  cond_resched()
2301  继续下一循环
2303  如果PageAnon( * page)则
2318  address加等于PAGE_SIZE
2319  cond_resched()
2323  如果ksmd, and unmerge_and_remove_all_rmap_items(), must not touch an mm's* page tables after it has passed through ksm_exit() - which, if necessary,* takes mmap_sem briefly to serialize against them. ksm_exit() does not set
2324  address等于0
2325  rmap_list等于rmap_list
2331  remove_trailing_rmap_items(slot, rmap_list)
2333  加自旋锁
2334  mm_slot等于list_entry - get the struct for this entry*@ptr: the &struct list_head pointer.*@type: the type of the struct this is embedded in.*@member: the name of the list_head within the struct.(链表后项, structmm_slot, mm_list)
2336  如果address恒等于0则
2346  从哈希表移除对象
2347  删除链表项
2348  自旋锁解锁
2350  free_mm_slot(slot)
2351  lear_bit - Clears a bit in memory*@nr: Bit to clear*@addr: Address to start counting from* This is a relaxed atomic operation (no implied memory barriers).
2352  lease a read lock
2353  mmdrop(mm)
2354  否则
2355  lease a read lock
2363  自旋锁解锁
2367  slot等于mm_slot
2368  如果slot不等于ksm_mm_head则转到:next_mm
2371  seqnr自加
2372  返回:NULL
调用者
名称描述
ksm_do_scanksm_do_scan - the ksm scanner main worker function.*@scan_npages: number of pages we want to scan before we return.