函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\futex.c Create Date:2022-07-27 11:54:20
Last Modify:2020-03-17 15:28:32 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:ex_requeue() - Requeue waiters from uaddr1 to uaddr2*@uaddr1: source futex user address*@flags: futex flags (FLAGS_SHARED, etc

函数原型:static int futex_requeue(unsigned int __user *uaddr1, unsigned int flags, unsigned int __user *uaddr2, int nr_wake, int nr_requeue, unsigned int *cmpval, int requeue_pi)

返回类型:int

参数:

类型参数名称
unsigned int __user *uaddr1
unsigned intflags
unsigned int __user *uaddr2
intnr_wake
intnr_requeue
unsigned int *cmpval
intrequeue_pi
2003  key1等于FUTEX_KEY_INIT, key2等于FUTEX_KEY_INIT
2004  drop_count等于0, task_count等于0
2005  struct futex_pi_state * pi_state = NULL
2010  如果nr_wake小于0或nr_requeue小于0则返回:负EINVAL
2019  如果非IS_ENABLED(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y' or 'm',* 0 otherwise.(CONFIG_FUTEX_PI)且requeue_pi则返回:负ENOSYS
2022  如果requeue_pi
2027  如果uaddr1恒等于uaddr2则返回:负EINVAL
2034  如果PI code:则返回:负ENOMEM
2046  如果nr_wake不等于1则返回:负EINVAL
2050  retry :
2051  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
2052  如果此条件成立可能性小(为编译器优化)(ret != 0)则转到:out
2054  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
2056  如果此条件成立可能性小(为编译器优化)(ret != 0)则转到:out_put_key1
2063  如果requeue_pimatch_futex - Check whether two futex keys are equal*@key1: Pointer to key1*@key2: Pointer to key2* Return 1 if two futex_keys are equal, 0 otherwise.
2064  ret等于负EINVAL
2065  转到:out_put_keys
2068  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.
2069  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.
2071  retry_private :
2072  Reflects a new waiter being added to the waitqueue.
2073  Express the locking dependencies for lockdep:
2075  如果此条件成立可能性大(为编译器优化)(cmpval != NULL)则
2078  ret等于get_futex_value_locked( & curval, uaddr1)
2085  如果ret则转到:out_put_keys
2091  put_futex_key( & key2)
2092  put_futex_key( & key1)
2093  转到:retry
2095  如果curval不等于cmpval
2096  ret等于负EAGAIN
2097  转到:out_unlock
2101  如果requeue_pitask_countnr_wake小于nr_requeue
2102  struct task_struct * exiting = NULL
2110  ret等于ex_proxy_trylock_atomic() - Attempt an atomic lock for the top waiter*@pifutex: the user address of the to futex*@hb1: the from futex hash bucket, must be locked by the caller*@hb2: the to futex hash bucket, must be locked by the caller*@key1: the from
2123  如果ret大于0则
2124  WARN_ON(pi_state)
2125  drop_count自加
2126  task_count自加
2139  ret等于lookup_pi_state(uaddr2, ret, hb2, & key2, & pi_state, & exiting)
2144  :ret恒等于0
2146  退出
2149  :ret恒等于负EFAULT
2158  :ret恒等于负EBUSY
2159  :ret恒等于负EAGAIN
2178  默认
2179  转到:out_unlock
2184  如果task_countnr_wake大于等于nr_requeue退出
2197  如果requeue_pi且非rt_waiter或非requeue_pirt_waiterpi_state
2200  ret等于负EINVAL
2201  退出
2209  如果task_count先自加小于等于nr_wake且非requeue_pi
2216  ret等于负EINVAL
2217  退出
2224  如果requeue_pi
2266  drop_count自加
2274  Drops a reference to the pi_state object and frees or caches it* when the last reference is gone.
2276  out_unlock :
2277  double_unlock_hb(hb1, hb2)
2278  wake_up_q( & wake_q)
2279  Reflects a waiter being removed from the waitqueue by wakeup* paths.
2287 drop_count先自减大于等于0循环
2288  Drop a reference to the resource addressed by a key.* The hash bucket spinlock must not be held. This is* a no-op for private futexes, see comment in the get* counterpart.
2290  out_put_keys :
2291  put_futex_key( & key2)
2292  out_put_key1 :
2293  put_futex_key( & key1)
2294  out :
2295  返回:如果retret否则task_count
调用者
名称描述
do_futex