函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:get_swap_page

函数原型:swp_entry_t get_swap_page(struct page *page)

返回类型:swp_entry_t

参数:

类型参数名称
struct page *page
315  val等于0
317  如果PageHuge() only returns true for hugetlbfs pages, but not for* normal or transparent huge pages.* PageTransHuge() returns true for both transparent huge and* hugetlbfs pages, but not normal pages. PageTransHuge() can only be
318  如果IS_ENABLED(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y' or 'm',* 0 otherwise.(CONFIG_THP_SWAP)则get_swap_pages(1, & entry, HPAGE_PMD_NR)
320  转到:out
332  cache等于raw_cpu_ptr( & swp_slots)
334  如果此条件成立可能性大(为编译器优化)(check_cache_active() && slots)则
335  mutex_lock( & protects slots, nr, cur )
336  如果slots
337  repeat :
338  如果nr
339  pentry等于slots[cur++]
340  entry等于pentry
341  val等于0
342  nr自减
343  否则
348  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
349  如果val则转到:out
353  get_swap_pages(1, & entry, 1)
354  out :
355  如果mem_cgroup_try_charge_swap(page, entry)则
356  Called after dropping swapcache to decrease refcnt to swap entries.
357  val等于0
359  返回:entry