Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\swap_slots.c Create Date:2022-07-28 15:21:01
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:get_swap_page

Proto:swp_entry_t get_swap_page(struct page *page)

Type:swp_entry_t

Parameter:

TypeParameterName
struct page *page
315  val = 0
317  If 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 Then
318  If IS_ENABLED(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y' or 'm',* 0 otherwise.(CONFIG_THP_SWAP) Then get_swap_pages(1, & entry, HPAGE_PMD_NR)
320  Go to out
332  cache = raw_cpu_ptr( & swp_slots)
334  If Value is more likely to compile time(check_cache_active() && slots) Then
335  mutex_lock( & protects slots, nr, cur )
336  If slots Then
337  repeat :
338  If nr Then
339  pentry = slots[cur++]
340  entry = pentry
341  val = 0
342  nr--
343  Else
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  If val Then Go to out
353  get_swap_pages(1, & entry, 1)
354  out :
355  If mem_cgroup_try_charge_swap(page, entry) Then
356  Called after dropping swapcache to decrease refcnt to swap entries.
357  val = 0
359  Return entry