Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:wait_on_page_bit_common

Proto:static inline int wait_on_page_bit_common(wait_queue_head_t *q, struct page *page, int bit_nr, int state, enum behavior behavior)

Type:int

Parameter:

TypeParameterName
wait_queue_head_t *q
struct page *page
intbit_nr
intstate
enum behaviorbehavior
1135  wait = wait
1137  bool thrashing = false
1138  bool delayacct = false
1140  ret = 0
1142  If bit_nr == PG_locked && Not PageUptodate(page) && PageWorkingset(page) Then
1144  If Not PageSwapBacked(page) Then
1146  delayacct = true
1148  psi_memstall_enter( & pflags)
1149  thrashing = true
1152  init_wait(wait)
1153  flags = If behavior == Hold ref to page and take the bit when woken, like* __lock_page() waiting on then setting PG_locked. Then wait_queue_entry::flags Else 0
1154  func = wake_page_function
1155  page = page
1156  bit_nr = bit_nr
1158  cycle
1159  spin_lock_irq( & lock)
1166  set_current_state(state)
1168  spin_unlock_irq( & lock)
1170  bit_is_set = st_bit - Determine whether a bit is set*@nr: bit number to test*@addr: Address to start counting from
1171  If behavior == Drop ref to page before wait, no check when woken,* like put_and_wait_on_page_locked() on PG_locked. Then put_page(page)
1174  If Value is more likely to compile time(bit_is_set) Then io_schedule()
1186  ret = -EINTR
1187  Break
1198  Break
1202  sh_wait - clean up after waiting in a queue*@wq_head: waitqueue waited on*@wq_entry: wait descriptor* Sets current thread back to running state and removes* the wait descriptor from the given waitqueue if still* queued.
1204  If thrashing Then
1205  If delayacct Then delayacct_thrashing_end()
1207  psi_memstall_leave( & pflags)
1218  Return ret
Caller
NameDescribe
wait_on_page_bit
wait_on_page_bit_killable
put_and_wait_on_page_lockedput_and_wait_on_page_locked - Drop a reference and wait for it to be unlocked*@page: The page to wait for
__lock_page__lock_page - get a lock on the page, assuming we need to sleep to get it*@__page: the page to lock
__lock_page_killable