Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\futex.c Create Date:2022-07-28 10:54:04
Last Modify:2020-03-17 15:28:32 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Wake up all waiters hashed on the physical page that is mapped* to this virtual address:

Proto:static int futex_wake_op(unsigned int __user *uaddr1, unsigned int flags, unsigned int __user *uaddr2, int nr_wake, int nr_wake2, int op)

Type:int

Parameter:

TypeParameterName
unsigned int __user *uaddr1
unsigned intflags
unsigned int __user *uaddr2
intnr_wake
intnr_wake2
intop
1759  key1 = FUTEX_KEY_INIT , key2 = FUTEX_KEY_INIT
1765  retry :
1766  ret = get_futex_key() - Get parameters which are the keys for a futex*@uaddr: virtual address of the futex*@fshared: 0 for a PROCESS_PRIVATE futex, 1 for PROCESS_SHARED*@key: address where result is stored
1767  If Value for the false possibility is greater at compile time(ret != 0) Then Go to out
1769  ret = get_futex_key() - Get parameters which are the keys for a futex*@uaddr: virtual address of the futex*@fshared: 0 for a PROCESS_PRIVATE futex, 1 for PROCESS_SHARED*@key: address where result is stored
1770  If Value for the false possibility is greater at compile time(ret != 0) Then Go to out_put_key1
1773  hb1 = hash_futex - Return the hash bucket in the global hash*@key: Pointer to the futex key for which the hash is calculated* We hash on the keys returned from get_futex_key (see below) and return the* corresponding hash bucket in the global hash.
1774  hb2 = hash_futex - Return the hash bucket in the global hash*@key: Pointer to the futex key for which the hash is calculated* We hash on the keys returned from get_futex_key (see below) and return the* corresponding hash bucket in the global hash.
1776  retry_private :
1777  Express the locking dependencies for lockdep:
1778  op_ret = futex_atomic_op_inuser(op, uaddr2)
1779  If Value for the false possibility is greater at compile time(op_ret < 0) Then
1780  double_unlock_hb(hb1, hb2)
1788  ret = op_ret
1789  Go to out_put_keys
1792  If op_ret == -EFAULT Then
1794  If ret Then Go to out_put_keys
1799  cond_resched()
1800  Go to retry_private
1803  put_futex_key( & key2)
1804  put_futex_key( & key1)
1805  cond_resched()
1806  Go to retry
1809  plist_for_each_entry_safe - iterate safely over list of given type*@pos: the type * to use as a loop counter*@n: another type * to use as temporary storage*@head: the head for your list*@m: the name of the list_head within the struct(this, next, & chain, list)
1811  If pi_state || rt_waiter Then
1812  ret = -EINVAL
1813  Go to out_unlock
1816  If ++ret >= nr_wake Then Break
1821  If op_ret > 0 Then
1822  op_ret = 0
1834  ret += op_ret
1837  out_unlock :
1838  double_unlock_hb(hb1, hb2)
1839  wake_up_q( & wake_q)
1840  out_put_keys :
1841  put_futex_key( & key2)
1842  out_put_key1 :
1843  put_futex_key( & key1)
1844  out :
1845  Return ret
Caller
NameDescribe
do_futex