函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:wait_on_page_bit_common

函数原型:static inline int wait_on_page_bit_common(wait_queue_head_t *q, struct page *page, int bit_nr, int state, enum behavior behavior)

返回类型:int

参数:

类型参数名称
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  如果bit_nr恒等于PG_locked且非PageUptodate(page)且PageWorkingset(page)则
1144  如果非PageSwapBacked(page)则
1146  delayacct = true
1148  psi_memstall_enter( & pflags)
1149  thrashing = true
1152  init_wait(wait)
1153  flags等于如果behavior恒等于Hold ref to page and take the bit when woken, like* __lock_page() waiting on then setting PG_locked.wait_queue_entry::flags 否则0
1154  func等于wake_page_function
1155  page等于page
1156  bit_nr等于bit_nr
1158  循环
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  如果behavior恒等于Drop ref to page before wait, no check when woken,* like put_and_wait_on_page_locked() on PG_locked.put_page(page)
1174  如果此条件成立可能性大(为编译器优化)(bit_is_set)则io_schedule()
1186  ret等于负EINTR
1187  退出
1198  退出
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  如果thrashing
1205  如果delayacctdelayacct_thrashing_end()
1207  psi_memstall_leave( & pflags)
1218  返回:ret
调用者
名称描述
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