函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Wake up waiters matching bitset queued on this futex (uaddr).

函数原型:static int futex_wake(unsigned int __user *uaddr, unsigned int flags, int nr_wake, unsigned int bitset)

返回类型:int

参数:

类型参数名称
unsigned int __user *uaddr
unsigned intflags
intnr_wake
unsigned intbitset
1660  key等于FUTEX_KEY_INIT
1664  如果非bitset则返回:负EINVAL
1667  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
1668  如果此条件成立可能性小(为编译器优化)(ret != 0)则转到:out
1671  hb等于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.
1674  如果非hb_waiters_pending(hb)则转到:out_put_key
1677  加自旋锁
1679  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)
1681  如果pi_statert_waiter
1682  ret等于负EINVAL
1683  退出
1687  如果非bitset按位与bitset的值则继续下一循环
1691  如果ret先自加大于等于nr_wake退出
1696  自旋锁解锁
1697  wake_up_q( & wake_q)
1698  out_put_key :
1699  put_futex_key( & key)
1700  out :
1701  返回:ret
调用者
名称描述
handle_futex_deathProcess a futex-list entry, check whether it's owned by the* dying task, and do notification if so:
do_futex