函数逻辑报告 |
Source Code:kernel\locking\rwsem.c |
Create Date:2022-07-27 10:48:29 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
首页 | 函数Tree |
注解内核,赢得工具 | 下载SCCT | English |
函数名称:handle the lock release when processes blocked on it that can now run* - if we come here from up_xxxx(), then the RWSEM_FLAG_WAITERS bit must* have been set
函数原型:static void rwsem_mark_wake(struct rw_semaphore *sem, enum rwsem_wake_type wake_type, struct wake_q_head *wake_q)
返回类型:void
参数:
类型 | 参数 | 名称 |
---|---|---|
struct rw_semaphore * | sem | |
enum rwsem_wake_type | wake_type | |
struct wake_q_head * | wake_q |
406 | woken等于0, adjustment等于0 |
409 | lockdep_assert_held( & wait_lock) |
415 | waiter等于rwsem_first_waiter(sem) |
417 | 如果type恒等于RWSEM_WAITING_FOR_WRITE则 |
418 | 如果wake_type恒等于 Wake whatever's at head of wait list 则 |
430 | 返回 |
436 | 如果此条件成立可能性小(为编译器优化)(atomic_long_read( & count) < 0)则返回 |
444 | 如果wake_type不等于RWSEM_WAKE_READ_OWNED则 |
448 | oldcount等于atomic_long_fetch_add(adjustment, & count) |
449 | 如果此条件成立可能性小(为编译器优化)(oldcount & RWSEM_WRITER_MASK)则 |
471 | 如果last_rowner按位与RWSEM_RD_NONSPINNABLE则 |
472 | owner等于owner按位或RWSEM_RD_NONSPINNABLE |
501 | 初始化链表头 |
503 | 如果type恒等于RWSEM_WAITING_FOR_WRITE则继续下一循环 |
506 | woken自加 |
507 | 链表项移动到尾部 |
518 | 如果链表为空则 |
520 | adjustment减等于RWSEM_FLAG_WAITERS |
527 | 如果woken且atomic_long_read( & count)按位与RWSEM_FLAG_HANDOFF则adjustment减等于RWSEM_FLAG_HANDOFF |
530 | 如果adjustment则atomic_long_add(adjustment, & count) |
538 | get_task_struct(tsk) |
546 | smp_store_release( & task, NULL) |
名称 | 描述 |
---|---|
rwsem_down_read_slowpath | Wait for the read lock to be granted |
rwsem_down_write_slowpath | Wait until we successfully acquire the write lock |
rwsem_wake | handle waking up a waiter on the semaphore* - up_read/up_write has decremented the active part of count if we come here |
rwsem_downgrade_wake | downgrade a write lock into a read lock* - caller incremented waiting part of count and discovered it still negative* - just wake up any readers at the front of the queue |
源代码转换工具 开放的插件接口 | X |
---|---|
支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |