aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/rtmutex-debug.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/rtmutex-debug.c')
-rw-r--r--kernel/rtmutex-debug.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/kernel/rtmutex-debug.c b/kernel/rtmutex-debug.c
index 56d73cb8826d..5fcb4fe645e2 100644
--- a/kernel/rtmutex-debug.c
+++ b/kernel/rtmutex-debug.c
@@ -130,7 +130,7 @@ void debug_rt_mutex_deadlock(int detect, struct rt_mutex_waiter *act_waiter,
130 130
131 task = rt_mutex_owner(act_waiter->lock); 131 task = rt_mutex_owner(act_waiter->lock);
132 if (task && task != current) { 132 if (task && task != current) {
133 act_waiter->deadlock_task_pid = task->pid; 133 act_waiter->deadlock_task_pid = get_pid(task_pid(task));
134 act_waiter->deadlock_lock = lock; 134 act_waiter->deadlock_lock = lock;
135 } 135 }
136} 136}
@@ -142,9 +142,12 @@ void debug_rt_mutex_print_deadlock(struct rt_mutex_waiter *waiter)
142 if (!waiter->deadlock_lock || !rt_trace_on) 142 if (!waiter->deadlock_lock || !rt_trace_on)
143 return; 143 return;
144 144
145 task = find_task_by_pid(waiter->deadlock_task_pid); 145 rcu_read_lock();
146 if (!task) 146 task = pid_task(waiter->deadlock_task_pid, PIDTYPE_PID);
147 if (!task) {
148 rcu_read_unlock();
147 return; 149 return;
150 }
148 151
149 TRACE_OFF_NOLOCK(); 152 TRACE_OFF_NOLOCK();
150 153
@@ -173,6 +176,7 @@ void debug_rt_mutex_print_deadlock(struct rt_mutex_waiter *waiter)
173 current->comm, task_pid_nr(current)); 176 current->comm, task_pid_nr(current));
174 dump_stack(); 177 dump_stack();
175 debug_show_all_locks(); 178 debug_show_all_locks();
179 rcu_read_unlock();
176 180
177 printk("[ turning off deadlock detection." 181 printk("[ turning off deadlock detection."
178 "Please report this trace. ]\n\n"); 182 "Please report this trace. ]\n\n");
@@ -203,10 +207,12 @@ void debug_rt_mutex_init_waiter(struct rt_mutex_waiter *waiter)
203 memset(waiter, 0x11, sizeof(*waiter)); 207 memset(waiter, 0x11, sizeof(*waiter));
204 plist_node_init(&waiter->list_entry, MAX_PRIO); 208 plist_node_init(&waiter->list_entry, MAX_PRIO);
205 plist_node_init(&waiter->pi_list_entry, MAX_PRIO); 209 plist_node_init(&waiter->pi_list_entry, MAX_PRIO);
210 waiter->deadlock_task_pid = NULL;
206} 211}
207 212
208void debug_rt_mutex_free_waiter(struct rt_mutex_waiter *waiter) 213void debug_rt_mutex_free_waiter(struct rt_mutex_waiter *waiter)
209{ 214{
215 put_pid(waiter->deadlock_task_pid);
210 TRACE_WARN_ON(!plist_node_empty(&waiter->list_entry)); 216 TRACE_WARN_ON(!plist_node_empty(&waiter->list_entry));
211 TRACE_WARN_ON(!plist_node_empty(&waiter->pi_list_entry)); 217 TRACE_WARN_ON(!plist_node_empty(&waiter->pi_list_entry));
212 TRACE_WARN_ON(waiter->task); 218 TRACE_WARN_ON(waiter->task);