Function report |
Source Code:kernel\locking\rtmutex.c |
Create Date:2022-07-28 09:52:08 |
Last Modify:2020-03-17 14:26:38 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:Adjust the priority chain
Proto:static int rt_mutex_adjust_prio_chain(struct task_struct *task, enum rtmutex_chainwalk chwalk, struct rt_mutex *orig_lock, struct rt_mutex *next_lock, struct rt_mutex_waiter *orig_waiter, struct task_struct *top_task)
Type:int
Parameter:
Type | Parameter | Name |
---|---|---|
struct task_struct * | task | |
enum rtmutex_chainwalk | chwalk | |
struct rt_mutex * | orig_lock | |
struct rt_mutex * | next_lock | |
struct rt_mutex_waiter * | orig_waiter | |
struct task_struct * | top_task |
456 | top_waiter = orig_waiter |
461 | bool requeue = true |
471 | again : |
475 | If ++depth > Max number of times we'll walk the boosting chain: Then |
482 | If prev_max != Max number of times we'll walk the boosting chain: Then |
484 | printk(warning conditions "Maximum lock depth %d reached task: %s (%d)\n", Max number of times we'll walk the boosting chain:, * executable name, excluding path. * - normally initialized setup_new_exec() * - access it with [gs]et_task_comm() * - lock it with task_lock(), task_pid_nr(top_task)) |
488 | put_task_struct(task) |
490 | Return -EDEADLK |
499 | retry : |
508 | waiter = pi_blocked_on |
519 | If Not waiter Then Go to out_unlock_pi |
526 | If orig_waiter && Not rt_mutex_owner(orig_lock) Then Go to out_unlock_pi |
538 | If next_lock != lock Then Go to out_unlock_pi |
546 | If top_waiter Then |
547 | If Not task_has_pi_waiters(task) Then Go to out_unlock_pi |
555 | If top_waiter != task_top_pi_waiter(task) Then |
556 | If Not detect_deadlock Then Go to out_unlock_pi |
558 | Else requeue = false |
571 | If Not detect_deadlock Then Go to out_unlock_pi |
573 | Else requeue = false |
601 | If lock == orig_lock || rt_mutex_owner(lock) == top_task Then |
603 | raw_spin_unlock( & wait_lock) |
605 | Go to out_unlock_pi |
614 | If Not requeue Then |
619 | put_task_struct(task) |
625 | If Not rt_mutex_owner(lock) Then |
626 | raw_spin_unlock_irq( & wait_lock) |
627 | Return 0 |
631 | task = get_task_struct(rt_mutex_owner(lock)) |
640 | next_lock = task_blocked_on_lock(task) |
644 | top_waiter = rt_mutex_top_waiter(lock) |
648 | raw_spin_unlock_irq( & wait_lock) |
651 | If Not next_lock Then Go to out_put_task |
653 | Go to again |
664 | rt_mutex_dequeue(lock, waiter) |
685 | rt_mutex_enqueue(lock, waiter) |
689 | put_task_struct(task) |
698 | If Not rt_mutex_owner(lock) Then |
706 | raw_spin_unlock_irq( & wait_lock) |
707 | Return 0 |
711 | task = get_task_struct(rt_mutex_owner(lock)) |
715 | If waiter == rt_mutex_top_waiter(lock) Then |
723 | rt_mutex_enqueue_pi(task, waiter) |
724 | rt_mutex_adjust_prio(task) |
726 | Else if prerequeue_top_waiter == waiter Then |
737 | rt_mutex_dequeue_pi(task, waiter) |
738 | waiter = rt_mutex_top_waiter(lock) |
739 | rt_mutex_enqueue_pi(task, waiter) |
740 | rt_mutex_adjust_prio(task) |
741 | Else next_lock = task_blocked_on_lock(task) |
763 | top_waiter = rt_mutex_top_waiter(lock) |
767 | raw_spin_unlock_irq( & wait_lock) |
776 | If Not next_lock Then Go to out_put_task |
784 | If Not detect_deadlock && waiter != top_waiter Then Go to out_put_task |
787 | Go to again |
789 | out_unlock_pi : |
791 | out_put_task : |
792 | put_task_struct(task) |
794 | Return ret |
Name | Describe |
---|---|
task_blocks_on_rt_mutex | Task blocks on lock.* Prepare waiter and propagate pi chain* This must be called with lock->wait_lock held and interrupts disabled |
remove_waiter | Remove a waiter from a lock and give up* Must be called with lock->wait_lock held and interrupts disabled. I must* have just failed to try_to_take_rt_mutex(). |
rt_mutex_adjust_pi | Recheck the pi chain, in case we got a priority setting* Called from sched_setscheduler |
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 |