| Function report | 
| Source Code: kernel\locking\rwsem.c | Create Date:2022-07-28 09:48:08 | 
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick | 
| home page | Tree | 
| Annotation kernel can get tool activity | Download SCCT | Chinese | 
Name: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
Proto:static void rwsem_mark_wake(struct rw_semaphore *sem, enum rwsem_wake_type wake_type, struct wake_q_head *wake_q)
Type:void
Parameter:
| Type | Parameter | Name | 
|---|---|---|
| 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 | If type == RWSEM_WAITING_FOR_WRITE Then | 
| 418 | If wake_type == Wake whatever's at head of wait list Then | 
| 430 | Return | 
| 436 | If Value for the false possibility is greater at compile time(atomic_long_read( & count) < 0) Then Return | 
| 444 | If wake_type != RWSEM_WAKE_READ_OWNED Then | 
| 447 | adjustment = RWSEM_READER_BIAS | 
| 448 | oldcount = atomic_long_fetch_add(adjustment, & count) | 
| 471 | If last_rowner & RWSEM_RD_NONSPINNABLE Then | 
| 472 | owner = owner | RWSEM_RD_NONSPINNABLE | 
| 503 | If type == RWSEM_WAITING_FOR_WRITE Then Continue | 
| 506 | woken++ | 
| 516 | adjustment = woken * RWSEM_READER_BIAS - adjustment | 
| 520 | adjustment -= RWSEM_FLAG_WAITERS | 
| 527 | If woken && atomic_long_read( & count) & RWSEM_FLAG_HANDOFF Then adjustment -= RWSEM_FLAG_HANDOFF | 
| 530 | If adjustment Then atomic_long_add(adjustment, & count) | 
| 538 | get_task_struct(tsk) | 
| 546 | smp_store_release( & task, NULL) | 
| Name | Describe | 
|---|---|
| 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 | 
| 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 |