Function report |
Source Code:kernel\futex.c |
Create Date:2022-07-28 10:54:39 |
| Last Modify:2020-03-17 15:28:32 | Copyright©Brick |
| home page | Tree |
| Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:Userspace tried a 0 -> TID atomic transition of the futex value* and failed. The kernel side here does the whole locking operation:* if there are waiters then it will block as a consequence of relying* on rt-mutexes, it does PI, etc
Proto:static int futex_lock_pi(unsigned int __user *uaddr, unsigned int flags, ktime_t *time, int trylock)
Type:int
Parameter:
| Type | Parameter | Name |
|---|---|---|
| unsigned int __user * | uaddr | |
| unsigned int | flags | |
| ktime_t * | time | |
| int | trylock |
| 2881 | struct futex_pi_state * pi_state = NULL |
| 2882 | struct task_struct * exiting = NULL |
| 2885 | q = futex_q_init |
| 2888 | If Not IS_ENABLED(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y' or 'm',* 0 otherwise.(CONFIG_FUTEX_PI) Then Return -ENOSYS |
| 2896 | retry : |
| 2898 | If Value for the false possibility is greater at compile time(ret != 0) Then Go to out |
| 2901 | retry_private : |
| 2912 | Case ret == 1 |
| 2914 | ret = 0 |
| 2915 | Go to out_unlock_put_key |
| 2917 | Go to uaddr_faulted |
| 2936 | Default |
| 2937 | Go to out_unlock_put_key |
| 2946 | __queue_me( & q, hb) |
| 2948 | If trylock Then |
| 2951 | ret = If ret Then 0 Else -EWOULDBLOCK |
| 2952 | Go to no_block |
| 2955 | rt_mutex_init_waiter( & rt_waiter) |
| 2970 | raw_spin_lock_irq( & wait_lock) |
| 2971 | spin_unlock(lock_ptr) |
| 2978 | raw_spin_unlock_irq( & wait_lock) |
| 2980 | If ret Then |
| 2989 | ret = _mutex_wait_proxy_lock() - Wait for lock acquisition*@lock: the rt_mutex we were woken on*@to: the timeout, null if none |
| 2991 | cleanup : |
| 3005 | no_block : |
| 3022 | If ret && rt_mutex_owner( & The PI object:) == current process Then |
| 3024 | get_pi_state(pi_state) |
| 3030 | If pi_state Then |
| 3031 | rt_mutex_futex_unlock( & The PI object:) |
| 3035 | Go to out_put_key |
| 3037 | out_unlock_put_key : |
| 3038 | queue_unlock(hb) |
| 3040 | out_put_key : |
| 3041 | put_futex_key( & key) |
| 3042 | out : |
| 3043 | If to Then |
| 3045 | destroy_hrtimer_on_stack( & timer) |
| 3047 | Return If ret != -EINTR Then ret Else -ERESTARTNOINTR |
| 3049 | uaddr_faulted : |
| 3050 | queue_unlock(hb) |
| 3053 | If ret Then Go to out_put_key |
| 3056 | If Not (flags & Futex flags used to encode options to functions and preserve them across* restarts.) Then Go to retry_private |
| 3059 | put_futex_key( & key) |
| 3060 | Go to retry |
| Name | Describe |
|---|---|
| do_futex |
| Source code conversion tool public plug-in interface | X |
|---|---|
| Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |